迁移临时数据脚本

news2026/4/14 22:50:35
打开PowerShell 输入命令powershell -ExecutionPolicy Bypass -File xxx.ps1这句 PowerShell 命令的作用是临时允许执行脚本文件并且运行指定的 .ps1 脚本。1. 每个部分是什么意思powershell启动 PowerShell 环境-ExecutionPolicy Bypass临时关闭执行策略限制Windows 默认禁止直接运行陌生 .ps1 脚本加这句就是“这次先不管安全限制允许运行脚本”-File 文件名.ps1指定要运行的PowerShell 脚本文件2. 常见正常用途# 基础使用默认路径自动备份检查进程 .\migrate_temp_data.ps1 # 指定根路径 .\migrate_temp_data.ps1 -RootPath D:\your-app-root # 跳过备份 跳过进程检查 .\migrate_temp_data.ps1 -SkipBackup -SkipProcessCheckpowershell启动 PowerShell 环境-ExecutionPolicy Bypass临时关闭执行策略限制Windows 默认禁止直接运行陌生 .ps1 脚本加这句就是“这次先不管安全限制允许运行脚本”-File 文件名.ps1指定要运行的PowerShell 脚本文件以绕过系统安全策略的方式直接运行 xxx.ps1 这个 PowerShell 脚本。.安全提醒非常重要这是高权限操作可以绕过系统对脚本的安全拦截如果你不知道这个脚本是干嘛的不要随便运行很多病毒、木马、流氓软件也会用这种方式偷偷执行恶意脚本运行自己写的批量自动化脚本安装 / 配置软件、部署环境系统维护、批量修改设置迁移临时数据脚本[CmdletBinding()] param( [Parameter(Mandatory $false)] [string]$RootPath $PSScriptRoot, [switch]$SkipBackup, [switch]$SkipProcessCheck ) Set-StrictMode -Version Latest $ErrorActionPreference Stop if ([string]::IsNullOrWhiteSpace($RootPath)) { $RootPath (Get-Location).Path } function Write-Log { param( [Parameter(Mandatory $true)][string]$Message, [ValidateSet(INFO, WARN, ERROR)] [string]$Level INFO ) $line [{0}] {1,-5} {2} -f (Get-Date -Format yyyy-MM-dd HH:mm:ss), $Level, $Message Write-Host $line } function Resolve-FullPath { param( [Parameter(Mandatory $true)][string]$PathValue, [switch]$AllowMissing ) $resolved Resolve-Path -LiteralPath $PathValue -ErrorAction SilentlyContinue if ($resolved) { return $resolved.Path } if ($AllowMissing) { return [System.IO.Path]::GetFullPath($PathValue) } throw Path not found: $PathValue } function Get-PythonCommand { $candidates ( { Exe py; Args (-3) }, { Exe python; Args () }, { Exe python3; Args () } ) foreach ($candidate in $candidates) { $cmd Get-Command $candidate.Exe -ErrorAction SilentlyContinue if (-not $cmd) { continue } try { $candidate.Exe ($candidate.Args (--version)) * $null if ($LASTEXITCODE -eq 0) { return $candidate } } catch { continue } } return $null } function Test-FileLocked { param([Parameter(Mandatory $true)][string]$PathValue) if (-not (Test-Path -LiteralPath $PathValue)) { return $false } try { $stream [System.IO.File]::Open( $PathValue, [System.IO.FileMode]::Open, [System.IO.FileAccess]::ReadWrite, [System.IO.FileShare]::None ) $stream.Close() return $false } catch { return $true } } function Invoke-RobocopyMerge { param( [Parameter(Mandatory $true)][string]$Source, [Parameter(Mandatory $true)][string]$Destination ) New-Item -ItemType Directory -Path $Destination -Force | Out-Null # /E copy all subdirs including empty; merge into destination without deleting extras. robocopy $Source $Destination /E /COPY:DAT /R:2 /W:1 /NFL /NDL /NJH /NJS /NP | Out-Null $code $LASTEXITCODE if ($code -gt 7) { throw robocopy failed with exit code $code while copying $Source - $Destination } } function Apply-BackendImageHotfix { param([Parameter(Mandatory $true)][string]$RootPathValue) $routeFile Join-Path $RootPathValue resources\backend\src\automation\yingdao_routes_ops_task.py if (-not (Test-Path -LiteralPath $routeFile)) { Write-Log Backend route file not found, skip image hotfix: $routeFile WARN return } $content Get-Content -LiteralPath $routeFile -Raw -Encoding UTF8 $updated $content $mimeFallbackPattern if not mimetype:r?n\s*mimetype application/octet-stream $mimeFallbackReplacement if not mimetype: suffix file_path.suffix.lower() if suffix .webp: mimetype image/webp elif suffix in {.jpg, .jpeg}: mimetype image/jpeg elif suffix .png: mimetype image/png elif suffix .gif: mimetype image/gif else: mimetype application/octet-stream $updated [System.Text.RegularExpressions.Regex]::Replace( $updated, $mimeFallbackPattern, $mimeFallbackReplacement ) $updated [System.Text.RegularExpressions.Regex]::Replace( $updated, response\.headers\[Connection\]\s*\s*keep-alive, response.headers.pop(Connection, None) ) if ($updated -ne $content) { Set-Content -LiteralPath $routeFile -Value $updated -Encoding UTF8 Write-Log Applied backend image hotfix: $routeFile } else { Write-Log Backend image hotfix already present: $routeFile } } $root Resolve-FullPath -PathValue $RootPath $sourceData Join-Path $root temp\data $sourceConfig Join-Path $root temp\config $sourceImages Join-Path $root temp\images $targetData Join-Path $root data $targetConfig Join-Path $root config $targetImages Join-Path $root images $targetDb Join-Path $targetData database\app.db Write-Log Root path: $root Write-Log Source data: $sourceData Write-Log Source config: $sourceConfig Write-Log Source images: $sourceImages if (-not (Test-Path -LiteralPath $sourceData)) { throw Missing source directory: $sourceData } if (-not (Test-Path -LiteralPath $sourceConfig)) { throw Missing source directory: $sourceConfig } if (-not $SkipProcessCheck) { $running Get-Process -ErrorAction SilentlyContinue | Where-Object { $_.ProcessName -eq 1688-OZON Automation } if ($running) { throw Detected running process 1688-OZON Automation. Please close app before migration. } } if (Test-FileLocked -PathValue $targetDb) { throw Target database is locked: $targetDb } if (-not $SkipBackup) { $stamp Get-Date -Format yyyyMMdd_HHmmss $backupRoot Join-Path $root (migration_backup_$stamp) New-Item -ItemType Directory -Path $backupRoot -Force | Out-Null if (Test-Path -LiteralPath $targetConfig) { Copy-Item -LiteralPath $targetConfig -Destination (Join-Path $backupRoot config) -Recurse -Force } if (Test-Path -LiteralPath $targetData) { Copy-Item -LiteralPath $targetData -Destination (Join-Path $backupRoot data) -Recurse -Force } Write-Log Backup created: $backupRoot } else { Write-Log Skip backup requested WARN } Write-Log Copying config files from temp/config - config ... Invoke-RobocopyMerge -Source $sourceConfig -Destination $targetConfig Write-Log Copying data files from temp/data - data ... Invoke-RobocopyMerge -Source $sourceData -Destination $targetData if (Test-Path -LiteralPath $sourceImages) { Write-Log Copying image files from temp/images - images ... Invoke-RobocopyMerge -Source $sourceImages -Destination $targetImages } else { Write-Log temp/images not found, skip image copy. Existing images directory will be kept. WARN } if (-not (Test-Path -LiteralPath $targetDb)) { throw Database not found after copy: $targetDb } # Avoid stale SQLite sidecar files from previous runs. foreach ($sidecar in ($targetDb-wal, $targetDb-shm)) { if (Test-Path -LiteralPath $sidecar) { Remove-Item -LiteralPath $sidecar -Force -ErrorAction SilentlyContinue Write-Log Removed SQLite sidecar: $sidecar } } $python Get-PythonCommand if (-not $python) { throw Python runtime not found. Install Python 3 or ensure py/python is in PATH. } $pythonScript import json import shutil import sqlite3 import sys from datetime import datetime from pathlib import Path db_path Path(sys.argv[1]) images_root Path(sys.argv[2]) if len(sys.argv) 2 else None if not db_path.exists(): raise SystemExit(fDatabase not found: {db_path}) obsolete_tables [ collection_tasks, upload_tasks, system_logs, customer_service_tasks, category_update_tasks, ] def table_exists(cursor, table_name): cursor.execute( SELECT 1 FROM sqlite_master WHERE typetable AND name? LIMIT 1, (table_name,), ) return cursor.fetchone() is not None def columns(cursor, table_name): cursor.execute(fPRAGMA table_info({table_name})) return [row[1] for row in cursor.fetchall()] def read_integrity(connection): _cur connection.cursor() _cur.execute(PRAGMA integrity_check) return _cur.fetchone()[0] def sql_quote_path(path_obj: Path) - str: return str(path_obj).replace(, ) def parse_json_list(value): if value is None: return [] if isinstance(value, str): text value.strip() if not text: return [] try: decoded json.loads(text) except Exception: return [text] else: decoded value if isinstance(decoded, list): return decoded if isinstance(decoded, str): return [decoded] return [] def normalize_image_ref(value): raw str(value or ).strip() if not raw: return None if raw.startswith((http://, https://)): return raw normalized raw.replace(\\, /) normalized normalized.split(?, 1)[0].split(#, 1)[0] lower_text normalized.lower() marker /images/ marker_index lower_text.find(marker) if marker_index 0: relative normalized[marker_index len(marker):] elif lower_text.startswith(images/): relative normalized[len(images/):] else: path_obj Path(normalized) if path_obj.is_absolute(): parts [part for part in path_obj.parts if part not in (path_obj.anchor, \\, /)] lower_parts [part.lower() for part in parts] if images in lower_parts: idx lower_parts.index(images) relative /.join(parts[idx 1 :]) else: relative /.join(parts) else: relative normalized relative relative.lstrip(/).replace(\\, /) if not relative: return None return f/images/{relative} def normalize_image_list(values): result [] for item in values: normalized normalize_image_ref(item) if not normalized: continue if normalized not in result: result.append(normalized) return result def image_exists(image_url): if not isinstance(image_url, str) or not image_url.startswith(/images/): return True if images_root is None: return True relative image_url[len(/images/):] return (images_root / relative).exists() def repair_database_in_place(path_obj: Path) - str: stamp datetime.now().strftime(%Y%m%d_%H%M%S) backup_path path_obj.with_name(f{path_obj.name}.before_auto_repair_{stamp}) repaired_path path_obj.with_name(f{path_obj.stem}.auto_repaired_{stamp}{path_obj.suffix}) shutil.copy2(path_obj, backup_path) source_conn sqlite3.connect(str(path_obj)) source_conn.execute(fVACUUM INTO {sql_quote_path(repaired_path)}) source_conn.close() verify_conn sqlite3.connect(str(repaired_path)) repaired_integrity read_integrity(verify_conn) verify_conn.close() if repaired_integrity ! ok: repaired_path.unlink(missing_okTrue) raise RuntimeError(fauto repair failed, rebuilt db integrity is: {repaired_integrity}) path_obj.unlink(missing_okTrue) repaired_path.replace(path_obj) return str(backup_path) conn sqlite3.connect(str(db_path)) conn.execute(PRAGMA busy_timeout 5000) cur conn.cursor() added [] skipped [] dropped [] not_found [] normalized_image_rows 0 normalized_image_fields {images: 0, images_ru: 0} image_refs_total 0 image_refs_missing 0 image_refs_missing_samples [] auto_repair_performed False repair_backup integrity_before read_integrity(conn) if integrity_before ! ok: conn.close() repair_backup repair_database_in_place(db_path) auto_repair_performed True conn sqlite3.connect(str(db_path)) conn.execute(PRAGMA busy_timeout 5000) cur conn.cursor() integrity_after_repair read_integrity(conn) if integrity_after_repair ! ok: raise RuntimeError(fdb integrity remains invalid after repair attempt: {integrity_after_repair}) if table_exists(cur, task_progress): existing set(columns(cur, task_progress)) if is_file not in existing: cur.execute(ALTER TABLE task_progress ADD COLUMN is_file BOOLEAN DEFAULT 0) added.append(task_progress.is_file) else: skipped.append(task_progress.is_file) else: raise RuntimeError(Missing required table: task_progress) for name in obsolete_tables: if table_exists(cur, name): cur.execute(fDROP TABLE {name}) dropped.append(name) else: not_found.append(name) if table_exists(cur, products): cur.execute(SELECT id, images, images_ru FROM products) for product_id, images_raw, images_ru_raw in cur.fetchall(): row_changed False for field_name, field_value in ((images, images_raw), (images_ru, images_ru_raw)): old_values parse_json_list(field_value) new_values normalize_image_list(old_values) if new_values ! old_values: cur.execute( fUPDATE products SET {field_name} ? WHERE id ?, (json.dumps(new_values, ensure_asciiFalse), product_id), ) normalized_image_fields[field_name] 1 row_changed True for image_url in new_values: if not isinstance(image_url, str) or not image_url.startswith(/images/): continue image_refs_total 1 if not image_exists(image_url): image_refs_missing 1 if len(image_refs_missing_samples) 20: image_refs_missing_samples.append({ product_id: product_id, field: field_name, image: image_url, }) if row_changed: normalized_image_rows 1 conn.commit() integrity_final read_integrity(conn) result { db_path: str(db_path), added: added, skipped: skipped, dropped: dropped, not_found: not_found, auto_repair_performed: auto_repair_performed, repair_backup: repair_backup, integrity_before: integrity_before, integrity_after_repair: integrity_after_repair, integrity_final: integrity_final, task_progress_columns: columns(cur, task_progress), normalized_image_rows: normalized_image_rows, normalized_image_fields: normalized_image_fields, image_refs_total: image_refs_total, image_refs_missing: image_refs_missing, image_refs_missing_samples: image_refs_missing_samples, } conn.close() print(json.dumps(result, ensure_asciiFalse)) $tempPy Join-Path $env:TEMP (ozon_migrate_ [Guid]::NewGuid().ToString(N) .py) Set-Content -LiteralPath $tempPy -Value $pythonScript -Encoding UTF8 try { $raw $python.Exe ($python.Args ($tempPy, $targetDb, $targetImages)) 21 if ($LASTEXITCODE -ne 0) { throw (Database migration failed:n ($raw | Out-String)) } } finally { Remove-Item -LiteralPath $tempPy -Force -ErrorAction SilentlyContinue } $result (($raw | Out-String).Trim()) | ConvertFrom-Json if ($result.integrity_final -ne ok) { throw SQLite integrity_check failed: $($result.integrity_final) } Write-Log Database migrated: $($result.db_path) Write-Log Added fields: $(($result.added) -join , ) Write-Log Dropped obsolete tables: $(($result.dropped) -join , ) Write-Log Integrity: before$($result.integrity_before), after_repair$($result.integrity_after_repair), final$($result.integrity_final) if ($result.auto_repair_performed) { Write-Log Auto-repaired SQLite before migration. Backup: $($result.repair_backup) WARN } Write-Log task_progress columns: $(($result.task_progress_columns) -join , ) Write-Log Normalized product image paths: rows$($result.normalized_image_rows), images$($result.normalized_image_fields.images), images_ru$($result.normalized_image_fields.images_ru) Write-Log Image reference check: total$($result.image_refs_total), missing$($result.image_refs_missing) if ($result.image_refs_missing -gt 0) { Write-Log (Missing image samples: ((($result.image_refs_missing_samples) | ConvertTo-Json -Compress))) WARN } Apply-BackendImageHotfix -RootPathValue $root Write-Log Migration completed successfully. Write-Log Image migration: if temp/images exists it has been merged into images/.运行命令powershell -ExecutionPolicy Bypass -File migrate_temp_data.ps1一、脚本核心功能参数配置可指定根路径默认脚本所在目录支持跳过备份、跳过进程检查严格模式执行错误立即终止ErrorActionPreference Stop基础工具函数Write-Log带时间戳、日志级别的日志输出Resolve-FullPath解析绝对路径支持允许路径不存在的场景Get-PythonCommand自动检测系统中的 Pythonpy/python/python3Test-FileLocked检测文件是否被锁定用于检查数据库是否被占用Invoke-RobocopyMerge调用 robocopy 合并目录保留目标目录原有文件前置检查校验源目录temp/data、temp/config是否存在检查目标数据库data/database/app.db是否被锁定可选检查 “1688-OZON Automation” 进程是否运行避免文件占用数据备份默认对目标 config、data 目录备份命名格式migration_backup_时间戳支持通过-SkipBackup参数跳过备份数据迁移用 robocopy 将 temp/config → config、temp/data → data、temp/images → images目录合并不删除目标原有文件清理 SQLite 临时文件app.db-wal、app.db-shm数据库处理核心 Python 脚本自动修复检测数据库完整性若损坏则自动修复并备份原文件字段调整给 task_progress 表添加 is_file 字段不存在时清理废弃表删除 collection_tasks、upload_tasks 等废弃表图片路径标准化统一 products 表的 images、images_ru 字段路径格式转为/images/相对路径检查图片文件是否存在输出缺失的图片引用完整性校验迁移后再次校验数据库完整性后端代码热修复修正yingdao_routes_ops_task.py中的 MIME 类型处理支持 webp/jpg/png/gif移除 Connection: keep-alive 响应头二、关键使用场景powershell# 基础使用默认路径自动备份检查进程 .\migrate_temp_data.ps1 # 指定根路径 .\migrate_temp_data.ps1 -RootPath D:\your-app-root # 跳过备份 跳过进程检查 .\migrate_temp_data.ps1 -SkipBackup -SkipProcessCheck三、核心注意事项四、常见问题排查如果需要对脚本进行修改比如新增废弃表、调整图片 MIME 类型、修改备份规则等可以针对性调整对应函数或 Python 脚本片段。依赖 Python脚本依赖 Python 3 环境需确保 py/python/python3 在系统 PATH 中文件锁定目标数据库被占用时会终止执行需关闭相关进程日志输出所有操作有详细日志可通过控制台查看执行状态图片迁移仅当 temp/images 存在时才会合并目标 images 目录原有文件会保留数据库修复若数据库损坏会自动修复并备份原文件修复失败会抛出异常Python 未找到安装 Python 并添加到 PATH或手动指定 Python 路径数据库锁定关闭 “1688-OZON Automation” 进程或用-SkipProcessCheck跳过检查不推荐robocopy 报错检查源 / 目标目录权限确保 robocopy 可执行Windows 自带图片缺失警告日志中显示的缺失图片需手动核对文件是否存在于 images 目录

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2517905.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

SpringBoot-17-MyBatis动态SQL标签之常用标签

文章目录 1 代码1.1 实体User.java1.2 接口UserMapper.java1.3 映射UserMapper.xml1.3.1 标签if1.3.2 标签if和where1.3.3 标签choose和when和otherwise1.4 UserController.java2 常用动态SQL标签2.1 标签set2.1.1 UserMapper.java2.1.2 UserMapper.xml2.1.3 UserController.ja…

wordpress后台更新后 前端没变化的解决方法

使用siteground主机的wordpress网站,会出现更新了网站内容和修改了php模板文件、js文件、css文件、图片文件后,网站没有变化的情况。 不熟悉siteground主机的新手,遇到这个问题,就很抓狂,明明是哪都没操作错误&#x…

网络编程(Modbus进阶)

思维导图 Modbus RTU(先学一点理论) 概念 Modbus RTU 是工业自动化领域 最广泛应用的串行通信协议,由 Modicon 公司(现施耐德电气)于 1979 年推出。它以 高效率、强健性、易实现的特点成为工业控制系统的通信标准。 包…

UE5 学习系列(二)用户操作界面及介绍

这篇博客是 UE5 学习系列博客的第二篇,在第一篇的基础上展开这篇内容。博客参考的 B 站视频资料和第一篇的链接如下: 【Note】:如果你已经完成安装等操作,可以只执行第一篇博客中 2. 新建一个空白游戏项目 章节操作,重…

IDEA运行Tomcat出现乱码问题解决汇总

最近正值期末周,有很多同学在写期末Java web作业时,运行tomcat出现乱码问题,经过多次解决与研究,我做了如下整理: 原因: IDEA本身编码与tomcat的编码与Windows编码不同导致,Windows 系统控制台…

利用最小二乘法找圆心和半径

#include <iostream> #include <vector> #include <cmath> #include <Eigen/Dense> // 需安装Eigen库用于矩阵运算 // 定义点结构 struct Point { double x, y; Point(double x_, double y_) : x(x_), y(y_) {} }; // 最小二乘法求圆心和半径 …

使用docker在3台服务器上搭建基于redis 6.x的一主两从三台均是哨兵模式

一、环境及版本说明 如果服务器已经安装了docker,则忽略此步骤,如果没有安装,则可以按照一下方式安装: 1. 在线安装(有互联网环境): 请看我这篇文章 传送阵>> 点我查看 2. 离线安装(内网环境):请看我这篇文章 传送阵>> 点我查看 说明&#xff1a;假设每台服务器已…

XML Group端口详解

在XML数据映射过程中&#xff0c;经常需要对数据进行分组聚合操作。例如&#xff0c;当处理包含多个物料明细的XML文件时&#xff0c;可能需要将相同物料号的明细归为一组&#xff0c;或对相同物料号的数量进行求和计算。传统实现方式通常需要编写脚本代码&#xff0c;增加了开…

LBE-LEX系列工业语音播放器|预警播报器|喇叭蜂鸣器的上位机配置操作说明

LBE-LEX系列工业语音播放器|预警播报器|喇叭蜂鸣器专为工业环境精心打造&#xff0c;完美适配AGV和无人叉车。同时&#xff0c;集成以太网与语音合成技术&#xff0c;为各类高级系统&#xff08;如MES、调度系统、库位管理、立库等&#xff09;提供高效便捷的语音交互体验。 L…

(LeetCode 每日一题) 3442. 奇偶频次间的最大差值 I (哈希、字符串)

题目&#xff1a;3442. 奇偶频次间的最大差值 I 思路 &#xff1a;哈希&#xff0c;时间复杂度0(n)。 用哈希表来记录每个字符串中字符的分布情况&#xff0c;哈希表这里用数组即可实现。 C版本&#xff1a; class Solution { public:int maxDifference(string s) {int a[26]…

【大模型RAG】拍照搜题技术架构速览:三层管道、两级检索、兜底大模型

摘要 拍照搜题系统采用“三层管道&#xff08;多模态 OCR → 语义检索 → 答案渲染&#xff09;、两级检索&#xff08;倒排 BM25 向量 HNSW&#xff09;并以大语言模型兜底”的整体框架&#xff1a; 多模态 OCR 层 将题目图片经过超分、去噪、倾斜校正后&#xff0c;分别用…

【Axure高保真原型】引导弹窗

今天和大家中分享引导弹窗的原型模板&#xff0c;载入页面后&#xff0c;会显示引导弹窗&#xff0c;适用于引导用户使用页面&#xff0c;点击完成后&#xff0c;会显示下一个引导弹窗&#xff0c;直至最后一个引导弹窗完成后进入首页。具体效果可以点击下方视频观看或打开下方…

接口测试中缓存处理策略

在接口测试中&#xff0c;缓存处理策略是一个关键环节&#xff0c;直接影响测试结果的准确性和可靠性。合理的缓存处理策略能够确保测试环境的一致性&#xff0c;避免因缓存数据导致的测试偏差。以下是接口测试中常见的缓存处理策略及其详细说明&#xff1a; 一、缓存处理的核…

龙虎榜——20250610

上证指数放量收阴线&#xff0c;个股多数下跌&#xff0c;盘中受消息影响大幅波动。 深证指数放量收阴线形成顶分型&#xff0c;指数短线有调整的需求&#xff0c;大概需要一两天。 2025年6月10日龙虎榜行业方向分析 1. 金融科技 代表标的&#xff1a;御银股份、雄帝科技 驱动…

观成科技:隐蔽隧道工具Ligolo-ng加密流量分析

1.工具介绍 Ligolo-ng是一款由go编写的高效隧道工具&#xff0c;该工具基于TUN接口实现其功能&#xff0c;利用反向TCP/TLS连接建立一条隐蔽的通信信道&#xff0c;支持使用Let’s Encrypt自动生成证书。Ligolo-ng的通信隐蔽性体现在其支持多种连接方式&#xff0c;适应复杂网…

铭豹扩展坞 USB转网口 突然无法识别解决方法

当 USB 转网口扩展坞在一台笔记本上无法识别,但在其他电脑上正常工作时,问题通常出在笔记本自身或其与扩展坞的兼容性上。以下是系统化的定位思路和排查步骤,帮助你快速找到故障原因: 背景: 一个M-pard(铭豹)扩展坞的网卡突然无法识别了,扩展出来的三个USB接口正常。…

未来机器人的大脑:如何用神经网络模拟器实现更智能的决策?

编辑&#xff1a;陈萍萍的公主一点人工一点智能 未来机器人的大脑&#xff1a;如何用神经网络模拟器实现更智能的决策&#xff1f;RWM通过双自回归机制有效解决了复合误差、部分可观测性和随机动力学等关键挑战&#xff0c;在不依赖领域特定归纳偏见的条件下实现了卓越的预测准…

Linux应用开发之网络套接字编程(实例篇)

服务端与客户端单连接 服务端代码 #include <sys/socket.h> #include <sys/types.h> #include <netinet/in.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <arpa/inet.h> #include <pthread.h> …

华为云AI开发平台ModelArts

华为云ModelArts&#xff1a;重塑AI开发流程的“智能引擎”与“创新加速器”&#xff01; 在人工智能浪潮席卷全球的2025年&#xff0c;企业拥抱AI的意愿空前高涨&#xff0c;但技术门槛高、流程复杂、资源投入巨大的现实&#xff0c;却让许多创新构想止步于实验室。数据科学家…

深度学习在微纳光子学中的应用

深度学习在微纳光子学中的主要应用方向 深度学习与微纳光子学的结合主要集中在以下几个方向&#xff1a; 逆向设计 通过神经网络快速预测微纳结构的光学响应&#xff0c;替代传统耗时的数值模拟方法。例如设计超表面、光子晶体等结构。 特征提取与优化 从复杂的光学数据中自…