【开源工具】深度解析:基于PyQt6的Windows时间校时同步工具开发全攻略

🕒 【开源工具】深度解析:基于PyQt6的Windows时间校时同步工具开发全攻略

请添加图片描述

🌈 个人主页:创客白泽 - CSDN博客
🔥 系列专栏:🐍《Python开源项目实战》
💡 热爱不止于代码,热情源自每一个灵感闪现的夜晚。愿以开源之火,点亮前行之路。
👍 如果觉得这篇文章有帮助,欢迎您一键三连,分享给更多人哦

请添加图片描述

在这里插入图片描述

一、概述:时间同步的重要性与工具价值

在现代计算机应用中,准确的时间同步至关重要。无论是金融交易、日志记录还是分布式系统协同,毫秒级的时间误差都可能导致严重问题。Windows系统虽然内置了时间同步功能,但存在以下痛点:

  1. 同步频率不可控(默认每周一次)
  2. 服务器选择有限
  3. 缺乏可视化操作界面
  4. 无法实时查看同步状态

本文介绍的Windows智能校时工具通过PyQt6实现了以下突破:

  • 多NTP服务器智能选择
  • 可配置的自动同步周期
  • 直观的图形化界面
  • 实时状态监控
  • 服务器连通性测试

二、功能全景图

2.1 核心功能矩阵

功能模块实现方式技术亮点
时间显示QTimer实时刷新多线程避免UI阻塞
NTP同步ntplib+win32api双保险机制(NTP+HTTP备用)
自动同步QTimer定时触发智能间隔配置(1-1440分钟)
服务器测试多线程并行测试延迟毫秒级统计

2.2 特色功能详解

  1. 智能降级策略:当NTP协议同步失败时,自动切换HTTP API备用方案
  2. 跨线程通信:通过PyQt信号槽机制实现线程安全的状态更新
  3. 系统级集成:调用win32api直接修改系统时间(需管理员权限)

三、效果展示

3.1 主界面布局

在这里插入图片描述

  • 顶部:大字号时间日期显示
  • 中部:NTP服务器配置区
  • 底部:操作按钮与状态栏

3.2 服务器测试对话框

在这里插入图片描述

  • 可视化服务器响应延迟
  • 成功/失败状态直观标识

四、实现步骤详解

4.1 环境准备

pip install pyqt6 ntplib requests pywin32

4.2 核心类结构

在这里插入图片描述

4.3 关键实现步骤

  1. 时间获取双保险机制
def do_sync(self):try:# 首选NTP协议response = self.ntp_client.request(ntp_server, version=3, timeout=5)...except ntplib.NTPException:# 备用HTTP方案ntp_time = self.get_time_from_http()
  1. 线程安全的UI更新
class TimeSyncSignals(QObject):update_status = pyqtSignal(str)  # 状态更新信号sync_complete = pyqtSignal(bool, str, str)  # 完成信号# 子线程通过信号触发主线程UI更新
self.signals.update_status.emit("正在同步...")

五、代码深度解析

5.1 NTP时间转换关键代码

# 获取NTP响应并转换时区
response = self.ntp_client.request(server, version=3, timeout=5)
ntp_time = datetime.datetime.fromtimestamp(response.tx_time)  # 本地时间
utc_time = datetime.datetime.utcfromtimestamp(response.tx_time)  # UTC时间# 设置系统时间(必须使用UTC)
win32api.SetSystemTime(utc_time.year, utc_time.month, utc_time.isoweekday() % 7,utc_time.day, utc_time.hour, utc_time.minute,utc_time.second, int(utc_time.microsecond / 1000)
)

5.2 自定义事件处理

class ServerTestEvent(QEvent):def __init__(self, text):super().__init__(QEvent.Type.User)self.text = text# 在子线程中安全更新UI
def add_result(self, text):QApplication.instance().postEvent(self, ServerTestEvent(text))def customEvent(self, event):if isinstance(event, ServerTestEvent):self.result_list.addItem(event.text)

5.3 样式美化技巧

/* 按钮渐变效果 */
QPushButton {background: qlineargradient(x1:0, y1:0, x2:1, y2:1,stop:0 #4CAF50, stop:1 #45a049);border-radius: 4px;color: white;
}/* 列表项悬停效果 */
QListWidget::item:hover {background: #e0e0e0;
}

六、源码下载与使用说明

6.1 完整源码

import sys
import datetime
import threading
import requests
import ntplib
import win32api
from PyQt6.QtWidgets import (QApplication, QMainWindow, QWidget, QVBoxLayout, QHBoxLayout, QLabel, QComboBox, QPushButton, QSpinBox, QCheckBox, QListWidget, QMessageBox, QGroupBox, QScrollArea, QDialog)
from PyQt6.QtCore import Qt, QTimer, QDateTime, QObject, pyqtSignal, QEvent
from PyQt6.QtGui import QFont, QIconclass TimeSyncSignals(QObject):update_status = pyqtSignal(str)sync_complete = pyqtSignal(bool, str, str)class TimeSyncApp(QMainWindow):def __init__(self):super().__init__()self.setWindowTitle("🕒 Windows 自动校时工具")self.setGeometry(100, 100, 650, 500)# 初始化变量self.sync_in_progress = Falseself.auto_sync_timer = QTimer()self.auto_sync_timer.timeout.connect(self.sync_time)self.signals = TimeSyncSignals()# 连接信号槽self.signals.update_status.connect(self.update_status_bar)self.signals.sync_complete.connect(self.handle_sync_result)# 创建主界面self.init_ui()# 启动时间更新定时器self.time_update_timer = QTimer()self.time_update_timer.timeout.connect(self.update_current_time)self.time_update_timer.start(1000)# 初始化NTP客户端self.ntp_client = ntplib.NTPClient()def init_ui(self):# 主窗口布局central_widget = QWidget()self.setCentralWidget(central_widget)main_layout = QVBoxLayout(central_widget)main_layout.setSpacing(15)main_layout.setContentsMargins(20, 20, 20, 20)# 标题title_label = QLabel("🕒 Windows 自动校时工具")title_font = QFont("Segoe UI", 18, QFont.Weight.Bold)title_label.setFont(title_font)title_label.setStyleSheet("color: #4CAF50;")title_label.setAlignment(Qt.AlignmentFlag.AlignCenter)main_layout.addWidget(title_label)# 当前时间显示time_group = QGroupBox("🕰️ 当前系统时间")time_group.setStyleSheet("QGroupBox { font-weight: bold; }")time_layout = QVBoxLayout(time_group)self.current_time_label = QLabel()time_font = QFont("Segoe UI", 24)self.current_time_label.setFont(time_font)self.current_time_label.setStyleSheet("color: #2196F3;")self.current_time_label.setAlignment(Qt.AlignmentFlag.AlignCenter)time_layout.addWidget(self.current_time_label)self.current_date_label = QLabel()date_font = QFont("Segoe UI", 12)self.current_date_label.setFont(date_font)self.current_date_label.setAlignment(Qt.AlignmentFlag.AlignCenter)time_layout.addWidget(self.current_date_label)main_layout.addWidget(time_group)# 同步选项sync_group = QGroupBox("⚙️ 同步选项")sync_group.setStyleSheet("QGroupBox { font-weight: bold; }")sync_layout = QVBoxLayout(sync_group)# NTP服务器选择ntp_layout = QHBoxLayout()ntp_label = QLabel("NTP 服务器:")ntp_label.setFont(QFont("Segoe UI", 10))self.ntp_combo = QComboBox()self.ntp_combo.addItems(["time.windows.com","time.nist.gov","pool.ntp.org","time.google.com","time.apple.com","ntp.aliyun.com","ntp.tencent.com"])self.ntp_combo.setCurrentIndex(0)self.ntp_combo.setFont(QFont("Segoe UI", 10))ntp_layout.addWidget(ntp_label)ntp_layout.addWidget(self.ntp_combo)sync_layout.addLayout(ntp_layout)# 同步间隔interval_layout = QHBoxLayout()interval_label = QLabel("自动同步间隔 (分钟):")interval_label.setFont(QFont("Segoe UI", 10))self.interval_spin = QSpinBox()self.interval_spin.setRange(1, 1440)self.interval_spin.setValue(60)self.interval_spin.setFont(QFont("Segoe UI", 10))interval_layout.addWidget(interval_label)interval_layout.addWidget(self.interval_spin)sync_layout.addLayout(interval_layout)# 自动同步开关self.auto_sync_check = QCheckBox("启用自动同步 🔄")self.auto_sync_check.setFont(QFont("Segoe UI", 10))self.auto_sync_check.stateChanged.connect(self.toggle_auto_sync)sync_layout.addWidget(self.auto_sync_check)main_layout.addWidget(sync_group)# 按钮区域button_layout = QHBoxLayout()self.sync_button = QPushButton("立即同步时间 ⚡")self.sync_button.setFont(QFont("Segoe UI", 10, QFont.Weight.Bold))self.sync_button.setStyleSheet("background-color: #4CAF50; color: white;")self.sync_button.clicked.connect(self.sync_time)button_layout.addWidget(self.sync_button)self.server_test_button = QPushButton("测试服务器 🛠️")self.server_test_button.setFont(QFont("Segoe UI", 10))self.server_test_button.clicked.connect(self.show_server_test_dialog)button_layout.addWidget(self.server_test_button)main_layout.addLayout(button_layout)# 状态栏self.status_bar = self.statusBar()self.status_bar.setFont(QFont("Segoe UI", 9))self.status_bar.showMessage("🟢 就绪")# 初始化当前时间显示self.update_current_time()def update_current_time(self):now = QDateTime.currentDateTime()self.current_time_label.setText(now.toString("HH:mm:ss"))self.current_date_label.setText(now.toString("yyyy-MM-dd dddd"))def toggle_auto_sync(self, state):if state == Qt.CheckState.Checked.value:minutes = self.interval_spin.value()self.auto_sync_timer.start(minutes * 60000)  # 转换为毫秒self.status_bar.showMessage(f"🔄 自动同步已启用,每 {minutes} 分钟同步一次")else:self.auto_sync_timer.stop()self.status_bar.showMessage("⏸️ 自动同步已禁用")def sync_time(self):if self.sync_in_progress:returnself.sync_in_progress = Trueself.sync_button.setEnabled(False)self.signals.update_status.emit("🔄 正在同步时间...")# 在新线程中执行同步操作sync_thread = threading.Thread(target=self.do_sync, daemon=True)sync_thread.start()def do_sync(self):ntp_server = self.ntp_combo.currentText()try:# 使用NTP协议获取时间response = self.ntp_client.request(ntp_server, version=3, timeout=5)# 将NTP时间转换为本地时间ntp_time = datetime.datetime.fromtimestamp(response.tx_time)utc_time = datetime.datetime.utcfromtimestamp(response.tx_time)print(f"从NTP服务器获取的时间 (UTC): {utc_time}")print(f"转换为本地时间: {ntp_time}")# 设置系统时间 (需要UTC时间)win32api.SetSystemTime(utc_time.year, utc_time.month, utc_time.isoweekday() % 7,utc_time.day, utc_time.hour, utc_time.minute, utc_time.second, int(utc_time.microsecond / 1000))# 获取设置后的系统时间new_time = datetime.datetime.now()print(f"设置后的系统时间: {new_time}")# 通过信号发送结果self.signals.sync_complete.emit(True, f"✅ 时间同步成功! 服务器: {ntp_server}",f"时间已成功同步到 {ntp_server}\nNTP时间 (UTC): {utc_time}\n本地时间: {ntp_time}\n设置后系统时间: {new_time}")except ntplib.NTPException as e:# NTP失败,尝试备用方法try:self.signals.update_status.emit("⚠️ NTP同步失败,尝试备用方法...")ntp_time = self.get_time_from_http()if ntp_time:utc_time = ntp_time.astimezone(datetime.timezone.utc).replace(tzinfo=None)print(f"从HTTP获取的时间 (本地): {ntp_time}")print(f"转换为UTC时间: {utc_time}")win32api.SetSystemTime(utc_time.year, utc_time.month, utc_time.isoweekday() % 7,utc_time.day, utc_time.hour, utc_time.minute, utc_time.second, int(utc_time.microsecond / 1000))new_time = datetime.datetime.now()print(f"设置后的系统时间: {new_time}")self.signals.sync_complete.emit(True,"✅ 时间同步成功! (备用方法)",f"时间已通过备用方法同步\nHTTP时间: {ntp_time}\nUTC时间: {utc_time}\n设置后系统时间: {new_time}")else:raise Exception("所有同步方法均失败")except Exception as e:error_msg = f"❌ 同步失败: {str(e)}"print(error_msg)self.signals.sync_complete.emit(False,error_msg,f"时间同步失败:\n{str(e)}")finally:self.sync_in_progress = Falseself.sync_button.setEnabled(True)def get_time_from_http(self):try:# 尝试使用世界时间APIresponse = requests.get("http://worldtimeapi.org/api/timezone/Etc/UTC", timeout=5)data = response.json()utc_time = datetime.datetime.fromisoformat(data["datetime"])return utc_time.astimezone()  # 转换为本地时区except:try:# 尝试使用阿里云APIresponse = requests.get("http://api.m.taobao.com/rest/api3.do?api=mtop.common.getTimestamp", timeout=5)data = response.json()timestamp = int(data["data"]["t"]) / 1000return datetime.datetime.fromtimestamp(timestamp)except:return Nonedef update_status_bar(self, message):self.status_bar.showMessage(message)def handle_sync_result(self, success, status_msg, detail_msg):self.status_bar.showMessage(status_msg)if success:QMessageBox.information(self, "成功", detail_msg)else:QMessageBox.critical(self, "错误", detail_msg)def show_server_test_dialog(self):self.test_dialog = ServerTestDialog(self)self.test_dialog.show()class ServerTestDialog(QDialog):def __init__(self, parent=None):super().__init__(parent)self.setWindowTitle("🛠️ NTP服务器测试工具")self.setWindowModality(Qt.WindowModality.NonModal)self.setMinimumSize(600, 400)self.ntp_client = ntplib.NTPClient()self.test_in_progress = Falseself.init_ui()def init_ui(self):layout = QVBoxLayout(self)layout.setContentsMargins(15, 15, 15, 15)layout.setSpacing(10)# 标题title_label = QLabel("NTP服务器连通性测试")title_label.setFont(QFont("Segoe UI", 14, QFont.Weight.Bold))title_label.setAlignment(Qt.AlignmentFlag.AlignCenter)layout.addWidget(title_label)# 说明info_label = QLabel("测试各NTP服务器的响应时间和可用性,结果将显示在下方列表中:")info_label.setFont(QFont("Segoe UI", 10))info_label.setWordWrap(True)layout.addWidget(info_label)# 结果列表self.result_list = QListWidget()self.result_list.setFont(QFont("Consolas", 9))self.result_list.setStyleSheet("""QListWidget {background-color: #f8f8f8;border: 1px solid #ddd;border-radius: 4px;}""")scroll_area = QScrollArea()scroll_area.setWidgetResizable(True)scroll_area.setWidget(self.result_list)layout.addWidget(scroll_area, 1)# 进度标签self.progress_label = QLabel("准备开始测试...")self.progress_label.setFont(QFont("Segoe UI", 9))self.progress_label.setAlignment(Qt.AlignmentFlag.AlignCenter)layout.addWidget(self.progress_label)# 按钮区域button_layout = QHBoxLayout()button_layout.setSpacing(15)self.test_button = QPushButton("开始测试")self.test_button.setFont(QFont("Segoe UI", 10))self.test_button.setStyleSheet("""QPushButton {background-color: #4CAF50;color: white;padding: 5px 15px;border: none;border-radius: 4px;}QPushButton:disabled {background-color: #cccccc;}""")self.test_button.clicked.connect(self.start_test)close_button = QPushButton("关闭")close_button.setFont(QFont("Segoe UI", 10))close_button.setStyleSheet("""QPushButton {background-color: #f44336;color: white;padding: 5px 15px;border: none;border-radius: 4px;}""")close_button.clicked.connect(self.close)button_layout.addStretch(1)button_layout.addWidget(self.test_button)button_layout.addWidget(close_button)button_layout.addStretch(1)layout.addLayout(button_layout)def start_test(self):if self.test_in_progress:returnself.test_in_progress = Trueself.test_button.setEnabled(False)self.result_list.clear()self.progress_label.setText("测试进行中...")servers = ["time.windows.com","time.nist.gov","pool.ntp.org","time.google.com","time.apple.com","ntp.aliyun.com","ntp.tencent.com"]print("\n" + "="*50)print("Starting NTP server connectivity test...")print("="*50)test_thread = threading.Thread(target=self.run_server_tests, args=(servers,), daemon=True)test_thread.start()def run_server_tests(self, servers):for server in servers:self.add_result(f"正在测试 {server}...")print(f"\nTesting server: {server}")try:start_time = datetime.datetime.now()response = self.ntp_client.request(server, version=3, timeout=5)end_time = datetime.datetime.now()latency = (end_time - start_time).total_seconds() * 1000  # 毫秒ntp_time = datetime.datetime.fromtimestamp(response.tx_time)result_text = (f"✅ {server} - 延迟: {latency:.2f}ms - "f"时间: {ntp_time.strftime('%Y-%m-%d %H:%M:%S')}")print(f"Server {server} test successful")print(f"  Latency: {latency:.2f}ms")print(f"  NTP Time: {ntp_time}")self.add_result(result_text)except ntplib.NTPException as e:error_text = f"❌ {server} - NTP错误: {str(e)}"print(f"Server {server} test failed (NTP error): {str(e)}")self.add_result(error_text)except Exception as e:error_text = f"❌ {server} - 错误: {str(e)}"print(f"Server {server} test failed (General error): {str(e)}")self.add_result(error_text)print("\n" + "="*50)print("NTP server testing completed")print("="*50 + "\n")self.test_complete()def add_result(self, text):# 使用QMetaObject.invokeMethod确保线程安全QApplication.instance().postEvent(self, ServerTestEvent(text))def test_complete(self):QApplication.instance().postEvent(self, ServerTestCompleteEvent())def customEvent(self, event):if isinstance(event, ServerTestEvent):self.result_list.addItem(event.text)self.result_list.scrollToBottom()elif isinstance(event, ServerTestCompleteEvent):self.test_in_progress = Falseself.test_button.setEnabled(True)self.progress_label.setText("测试完成")print("All server tests completed")class ServerTestEvent(QEvent):def __init__(self, text):super().__init__(QEvent.Type.User)self.text = textclass ServerTestCompleteEvent(QEvent):def __init__(self):super().__init__(QEvent.Type.User + 1)if __name__ == "__main__":app = QApplication(sys.argv)# 设置应用程序样式app.setStyle("Fusion")# 设置全局字体font = QFont("Segoe UI", 10)app.setFont(font)window = TimeSyncApp()window.show()sys.exit(app.exec())

6.2 运行要求

  • Windows 7及以上系统
  • Python 3.8+
  • 管理员权限(修改系统时间需要)

6.3 编译为EXE

pyinstaller --onefile --windowed --icon=time.ico timesync.py

七、总结与拓展方向

7.1 项目亮点

  1. 采用PyQt6现代GUI框架,界面美观
  2. 双时间源冗余设计,可靠性高
  3. 完整的异常处理机制
  4. 符合Windows系统规范的时间设置

7.2 优化建议

  1. 增加本地时间服务器配置
  2. 实现时间偏差历史记录
  3. 添加UTC/GMT时区切换
  4. 支持Linux/MacOS跨平台

时间同步看似简单,实则涉及操作系统底层、网络协议、多线程编程等多个技术领域。本项目的价值不仅在于实用工具开发,更是PyQt6高级应用的典型案例。建议读者在此基础上深入探索Windows系统API和NTP协议的高级用法。

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

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

相关文章

大模型项目:普通蓝牙音响接入DeepSeek,解锁语音交互新玩法

本文附带视频讲解 【代码宇宙019】技术方案:蓝牙音响接入DeepSeek,解锁语音交互新玩法_哔哩哔哩_bilibili 目录 效果演示 核心逻辑 技术实现 大模型对话(技术: LangChain4j 接入 DeepSeek) 语音识别(…

qt命名空间演示

#ifndef CIR_H #define CIR_Hnamespace cir {double PI3.141592653;//获取圆行周长double getLenthOfCircle(double radius){return 2*PI*radius;}//获取圆形面积double getAreaOfCircle(double radius){return PI*radius*radius;}} #endif // CIR_H#include <iostream> …

使用 Java 反射动态加载和操作类

Java 的反射机制(Reflection)是 Java 语言的一大特色,它允许程序在运行时检查、加载和操作类、方法、字段等元信息。通过 java.lang.Class 和 java.lang.reflect 包,开发者可以动态加载类、创建实例、调用方法,甚至在运行时构造新类。反射是 Java 灵活性的核心,广泛应用于…

《 C++ 点滴漫谈: 三十七 》左值?右值?完美转发?C++ 引用的真相超乎你想象!

摘要 本文全面系统地讲解了 C 中的引用机制&#xff0c;涵盖左值引用、右值引用、引用折叠、完美转发等核心概念&#xff0c;并深入探讨其底层实现原理及工程实践应用。通过详细的示例与对比&#xff0c;读者不仅能掌握引用的语法规则和使用技巧&#xff0c;还能理解引用在性能…

【AutoGen深度解析】下一代AI代理编程框架实战指南

目录 &#x1f31f; 前言&#x1f3d7;️ 技术背景与价值&#x1f6a7; 当前技术痛点&#x1f6e0;️ 解决方案概述&#x1f465; 目标读者说明 &#x1f50d; 一、技术原理剖析&#x1f5bc;️ 核心概念图解&#x1f4a1; 核心作用讲解⚙️ 关键技术模块说明&#x1f504; 技术…

Python-AI调用大模型 给出大模型人格案例

Python调用通义千问模拟原神雷电将军口吻 最近在用AI编辑器写AI对话 尝试给AI对话增加人格 以下是使用阿里通义千问大模型模拟《原神》中雷电将军(雷电影)口吻的代码案例&#xff0c;包含典型的高傲威严、略带古风的说话风格。 完整后端代码示例 import dashscope from dash…

csdn博客打赏功能

CSDN_专业开发者社区_已接入DeepSeekR1满血版 官网: 最右下角 耳机 就是客服 可以转人工 开启打赏功能如下: 1.因为博主本人不可以对本人账号文章进行打赏&#xff0c;因此本人账号打开文章详情页不显示打赏按钮。为了验证账号设置的打赏功能是否生效所以让您使用无痕模式模…

【深度学习】目标检测算法大全

目录 一、R-CNN 1、R-CNN概述 2、R-CNN 模型总体流程 3、核心模块详解 &#xff08;1&#xff09;候选框生成&#xff08;Selective Search&#xff09; &#xff08;2&#xff09;深度特征提取与微调 2.1 特征提取 2.2 网络微调&#xff08;Fine-tuning&#xff09; …

26考研——中央处理器_指令流水线_指令流水线的基本概念 流水线的基本实现(5)

408答疑 文章目录 六、指令流水线指令流水线的基本概念流水线的基本实现流水线设计的原则流水线的逻辑结构流水线的时空图表示 八、参考资料鲍鱼科技课件26王道考研书 六、指令流水线 前面介绍的指令都是在单周期处理机中采用串行方法执行的&#xff0c;同一时刻 CPU 中只有一…

配置集群(yarn)

在配置 YARN 集群前&#xff0c;要先完成以下准备工作&#xff1a; 集群环境规划&#xff1a;明确各节点的角色&#xff0c;如 ResourceManager、NodeManager 等。网络环境搭建&#xff1a;保证各个节点之间能够通过网络互通。时间同步设置&#xff1a;安装 NTP 服务&#xff0…

vue实现与后台springboot传递数据【传值/取值 Axios 】

vue实现与后台springboot传递数据【传值/取值】 提示&#xff1a;帮帮志会陆续更新非常多的IT技术知识&#xff0c;希望分享的内容对您有用。本章分享的是node.js和vue的使用。前后每一小节的内容是存在的有&#xff1a;学习and理解的关联性。【帮帮志系列文章】&#xff1a;每…

二叉树路径总和

一、给你二叉树的根节点 root 和一个表示目标和的整数 targetSum 。判断该树中是否存在根节点到叶子节点的路径&#xff0c;这条路径上所有节点值相加等于目标和 targetSum 。如果存在&#xff0c;返回 true &#xff1b;否则&#xff0c;返回 false 。 112. 路径总和 - 力扣&…

Matlab 模糊控制平行侧边自动泊车

1、内容简介 Matlab 233-模糊控制平行侧边自动泊车 可以交流、咨询、答疑 2、内容说明 略 3、仿真分析 略 4、参考论文 略

M0G3507完美移植江科大软件IIC MPU6050

经过两天两夜的查阅文献资料、整理学习&#xff0c;成功的把江科大的软件IIC读写MPU6050移植到MSPM0G3507&#xff0c;亲测有效&#xff01;&#xff01;包的&#xff0c;为了让大家直观地感受下&#xff0c;先上图。记得点个赞哦&#xff01; 学过江科大的STM32的小伙伴是不是…

CI/CD与DevOps流程流程简述(提供思路)

一 CI/CD流程详解&#xff1a;代码集成、测试与发布部署 引言 在软件开发的世界里&#xff0c;CI/CD&#xff08;持续集成/持续交付&#xff09;就像是一套精密的流水线&#xff0c;确保代码从开发到上线的整个过程高效、稳定。我作为一名资深的软件工程师&#xff0c;接下来…

大数据基础——Ubuntu 安装

文章目录 Ubuntu 安装一、配置电脑二、安装系统 Ubuntu 安装 一、配置电脑 1、进入VMware 2、选择配置类型 3、选择硬件兼容性版本 4、当前虚拟机的操作系统 选择“稍后安装操作系统”&#xff08;修改&#xff09; 5、选择虚拟机将来需要安装的系统 选中“Linux”和选择…

LeetCode百题刷003(449周赛一二题)

遇到的问题都有解决的方案&#xff0c;希望我的博客可以为你提供一些帮助 一、不同字符数量最多为 K 时的最少删除数 &#xff08;哈希表空间换时间&#xff09; 不同字符数量最多为 K 时的最少删除数 - 力扣 (LeetCode) 竞赛https://leetcode.cn/contest/weekly-contest-449/…

【网安等保】OpenEuler 24.03系统主机安全加固及配置优化实践指南

[ 知识是人生的灯塔&#xff0c;只有不断学习&#xff0c;才能照亮前行的道路 ] &#x1f4e2; 大家好&#xff0c;我是 WeiyiGeek&#xff0c;一个正在向全栈工程师(SecDevOps)前进的计算机技术爱好者&#xff0c;欢迎各位道友一起学习交流、一起进步 &#x1f680;&#xff0…

大模型赋能:2D 写实数字人开启实时交互新时代

在数字化浪潮席卷全球的当下&#xff0c;人工智能技术不断突破创新&#xff0c;其中大模型驱动的 2D 写实数字人正成为实时交互领域的一颗新星&#xff0c;引领着行业变革&#xff0c;为人们带来前所未有的交互体验。 一、2D 写实数字人概述 2D 写实数字人是通过计算机图形学…

Dockers部署oscarfonts/geoserver镜像的Geoserver

Dockers部署oscarfonts/geoserver镜像的Geoserver 说实话&#xff0c;最后发现要选择合适的Geoserver镜像才是关键&#xff0c;所以所以所以…&#x1f437; 推荐oscarfonts/geoserver的镜像&#xff01; 一开始用kartoza/geoserver镜像一直提示内存不足&#xff0c;不过还好…