Z-Ant开源程序是简化了微处理器上神经网络的部署和优化
一、软件介绍
文末提供程序和源码下载
Z-Ant (Zig-Ant) 是一个全面的开源神经网络框架,专门用于在微控制器和边缘设备上部署优化的 AI 模型。Z-Ant 使用 Zig 构建,为资源受限的硬件上的模型优化、代码生成和实时推理提供端到端工具。
二、全面的模型部署
- ONNX Model Support: Full compatibility with ONNX format models
ONNX 模型支持:与 ONNX 格式模型完全兼容 - Cross-platform Compilation: ARM Cortex-M, RISC-V, x86, and more
跨平台编译:ARM Cortex-M、RISC-V、x86 等 - Static Library Generation: Generate optimized static libraries for any target architecture
静态库生成:为任何目标架构生成优化的静态库 - Real-time Inference: Microsecond-level prediction times on microcontrollers
实时推理:微控制器上的微秒级预测时间
三、高级优化引擎
- Quantization: Automatic model quantization with dynamic and static options
量化:具有动态和静态选项的自动模型量化 - Pruning: Neural network pruning for reduced model size
修剪:用于减小模型大小的神经网络修剪 - Buffer Optimization: Memory-efficient tensor operations
缓冲区优化:节省内存的张量运算 - Flash vs RAM Execution: Configurable execution strategies
Flash 与 RAM 执行:可配置的执行策略
四、GUI Interface 🖥 GUI 界面
Z-Ant includes an experimental cross-platform GUI built with SDL for basic model selection and code generation. Note that the GUI is currently unstable and under active development - we recommend using the command-line interface for production workflows.
Z-Ant 包括一个使用 SDL 构建的实验性跨平台 GUI,用于基本模型选择和代码生成。请注意,GUI 当前不稳定,正在积极开发中 - 我们建议对生产工作流使用命令行界面。
📷 ImageToTensor Processing
📷 ImageToTensor 处理
- JPEG Decoding: Complete JPEG image processing pipeline
JPEG 解码:完整的 JPEG 图像处理管道 - Multiple Color Spaces: RGB, YUV, Grayscale support
多个色彩空间:支持 RGB、YUV、灰度 - Hardware Optimization: SIMD and platform-specific optimizations
硬件优化:SIMD 和特定于平台的优化 - Preprocessing Pipeline: Normalization, resizing, and format conversion
预处理管道:规范化、调整大小和格式转换
🔧 Extensive ONNX Support
🔧 广泛的 ONNX 支持
- 30+ Operators: Comprehensive coverage of neural network operations
30+ 算子:神经网络作全面覆盖 - Multiple Data Types: Float32, Int64, Bool, and more
多种数据类型:Float32、Int64、Bool 等 - Dynamic Shapes: Support for variable input dimensions
动态形状:支持可变输入尺寸 - Custom Operators: Extensible operator framework
自定义运算符:可扩展的运算符框架
Why Z-Ant? 为什么选择 Z-Ant?
- 🚫 Lack of DL Support: Devices like TI Sitara, Raspberry Pi Pico, or ARM Cortex-M lack comprehensive DL libraries
🚫 缺乏 DL 支持:TI Sitara、Raspberry Pi Pico 或 ARM Cortex-M 等设备缺乏全面的 DL 库 - 🌍 Open-source: Complete end-to-end NN deployment and optimization solution
🌍 开源:完整的端到端 NN 部署和优化解决方案 - 🎓 Research-Inspired: Implements cutting-edge optimization techniques inspired by MIT's Han Lab research
🎓 受研究启发:实施受麻省理工学院 Han 实验室研究启发的尖端优化技术 - 🏛 Academic Collaboration: Developed in collaboration with institutions like Politecnico di Milano
🏛 学术合作: 与米兰理工大学等机构合作开发 - ⚡ Performance First: Designed for real-time inference with minimal resource usage
⚡ 性能优先:专为实时推理而设计,资源使用量最少 - 🔧 Developer Friendly: Clear APIs, extensive documentation, and practical examples
🔧 开发人员友好:清晰的 API、广泛的文档和实际示例
Use Cases 使用案例
- 🏭 Edge AI: Real-time anomaly detection, predictive maintenance
🏭 Edge AI:实时异常检测,预测性维护 - 🤖 IoT & Autonomous Systems: Lightweight AI models for drones, robots, vehicles, IoT devices
🤖 物联网和自主系统:用于无人机、机器人、车辆、物联网设备的轻量级人工智能模型 - 📱 Mobile Applications: On-device inference for privacy-preserving AI
📱 移动应用程序:用于隐私保护 AI 的设备端推理 - 🏥 Medical Devices: Real-time health monitoring and diagnostics
🏥 医疗设备:实时健康监测和诊断 - 🎮 Gaming: AI-powered gameplay enhancement on embedded systems
🎮 游戏:嵌入式系统上 AI 驱动的游戏增强功能
同类最佳 TinyML 引擎路线图
To establish Z-Ant as the premier tinyML inference engine, we are pursuing several key improvements:
为了将 Z-Ant 确立为首屈一指的 tinyML 推理引擎,我们正在寻求几项关键改进:
🔥 Performance Optimizations
🔥 性能优化
Ultra-Low Latency Inference
超低延迟推理
- Custom Memory Allocators: Zero-allocation inference with pre-allocated memory pools
自定义内存分配器:使用预分配的内存池进行零分配推理 - In-Place Operations: Minimize memory copies through tensor operation fusion
就地作:通过张量运算融合最大限度地减少内存副本 - SIMD Vectorization: ARM NEON, RISC-V Vector extensions, and x86 AVX optimizations
SIMD 矢量化:ARM NEON、RISC-V 矢量扩展和 x86 AVX 优化 - Assembly Kernels: Hand-optimized assembly for critical operations (matrix multiplication, convolution)
汇编内核:针对关键运算(矩阵乘法、卷积)的手动优化汇编 - Cache-Aware Algorithms: Memory access patterns optimized for L1/L2 cache efficiency
高速缓存感知算法:针对 L1/L2 高速缓存效率优化的内存访问模式
Advanced Model Optimization
高级模型优化
- Dynamic Quantization: Runtime precision adjustment based on input characteristics
动态量化:根据输入特性进行运行时精度调整 - Structured Pruning: Channel and block-level pruning for hardware-friendly sparsity
结构化修剪:通道和块级修剪,实现硬件友好的稀疏性 - Knowledge Distillation: Automatic teacher-student model compression pipeline
知识蒸馏:自动师生模型压缩管道 - Neural Architecture Search (NAS): Hardware-aware model architecture optimization
神经架构搜索 (NAS):硬件感知模型架构优化 - Binary/Ternary Networks: Extreme quantization for ultra-low power inference
二进制/三元网络:用于超低功耗推理的极端量化
⚡ Hardware Acceleration ⚡ 硬件加速
Microcontroller-Specific Optimizations
微控制器特定的优化
- DSP Instruction Utilization: Leverage ARM Cortex-M DSP instructions and RISC-V packed SIMD
DSP 指令利用:利用 ARM Cortex-M DSP 指令和 RISC-V 封装的 SIMD - DMA-Accelerated Operations: Offload data movement to DMA controllers
DMA 加速作:将数据移动卸载到 DMA 控制器 - Flash Execution Strategies: XIP (Execute-in-Place) optimization for flash-resident models
Flash 执行策略:针对 Flash 驻留模型的 XIP(就地执行)优化 - Low-Power Modes: Dynamic frequency scaling and sleep mode integration
低功耗模式:动态频率调节和休眠模式集成 - Hardware Security Modules: Secure model storage and execution
硬件安全模块:安全的模型存储和执行
Emerging Hardware Support
新兴硬件支持
- NPU Integration: Support for dedicated neural processing units (e.g., Arm Ethos, Intel Movidius)
NPU 集成:支持专用神经处理单元(例如 Arm Ethos、Intel Movidius) - FPGA Acceleration: Custom hardware generation for ultra-performance inference
FPGA 加速:用于超高性能推理的定制硬件生成 - GPU Compute: OpenCL/CUDA kernels for edge GPU acceleration
GPU 计算:用于边缘 GPU 加速的 OpenCL/CUDA 内核 - Neuromorphic Computing: Spike-based neural network execution
Neuromorphic Computing:基于尖峰的神经网络执行
🧠 Advanced AI Capabilities
🧠 高级 AI 功能
Model Compression & Acceleration
模型压缩和加速
- Lottery Ticket Hypothesis: Sparse subnetwork discovery and training
彩票假说:稀疏子网络发现和训练 - Progressive Quantization: Gradual precision reduction during training/deployment
渐进式量化:训练/部署期间逐渐降低精度 - Magnitude-Based Pruning: Automatic weight importance analysis
基于量级的修剪:自动权重重要性分析 - Channel Shuffling: Network reorganization for efficient inference
通道改组:网络重组以实现高效推理 - Tensor Decomposition: Low-rank approximation for parameter reduction
张量分解:用于参数缩减的低秩近似
Adaptive Inference 自适应推理
- Early Exit Networks: Conditional computation based on input complexity
Early Exit Networks:基于输入复杂度的条件计算 - Dynamic Model Selection: Runtime model switching based on resource availability
动态模型选择:基于资源可用性的运行时模型切换 - Cascaded Inference: Multi-stage models with progressive complexity
级联推理:具有渐进复杂性的多阶段模型 - Attention Mechanism Optimization: Efficient transformer and attention implementations
注意力机制优化:高效的 transformer 和 attention 实现
🔧 Developer Experience & Tooling
🔧 开发者体验和工具
Advanced Profiling & Analysis
高级分析和分析
- Hardware Performance Counters: Cycle-accurate performance measurement
硬件性能计数器:周期精确的性能测量 - Energy Profiling: Power consumption analysis per operation
能量分析:每个作的功耗分析 - Memory Footprint Analysis: Detailed RAM/Flash usage breakdown
内存占用分析:详细的 RAM/Flash 使用情况明细 - Thermal Analysis: Temperature impact on inference performance
热分析:温度对推理性能的影响 - Real-Time Visualization: Live performance monitoring dashboards
实时可视化:实时性能监控仪表板
Automated Optimization Pipeline
自动优化管道
- AutoML Integration: Automated hyperparameter tuning for target hardware
AutoML 集成:目标硬件的自动超参数调整 - Benchmark-Driven Optimization: Continuous performance regression testing
基准测试驱动优化:持续性能回归测试 - Hardware-in-the-Loop Testing: Automated testing on real hardware platforms
硬件在环测试:在真实硬件平台上进行自动化测试 - Model Validation: Accuracy preservation verification throughout optimization
模型验证:在整个优化过程中保持精度验证 - Deploy-to-Production Pipeline: One-click deployment to embedded systems
部署到生产管道:一键部署到嵌入式系统
🌐 Ecosystem & Integration
🌐 生态系统与集成
Framework Interoperability
框架互作性
- TensorFlow Lite Compatibility: Seamless migration from TFLite models
TensorFlow Lite 兼容性:从 TFLite 模型无缝迁移 - PyTorch Mobile Integration: Direct PyTorch model deployment pipeline
PyTorch 移动集成:直接 PyTorch 模型部署管道 - ONNX Runtime Parity: Feature-complete ONNX runtime alternative
ONNX 运行时奇偶校验:功能齐全的 ONNX 运行时替代方案 - MLflow Integration: Model versioning and experiment tracking
MLflow 集成:模型版本控制和实验跟踪 - Edge Impulse Compatibility: Integration with popular edge ML platforms
Edge Impulse 兼容性:与流行的边缘 ML 平台集成
Production Deployment 生产部署
- OTA Model Updates: Over-the-air model deployment and versioning
OTA 模型更新:无线模型部署和版本控制 - A/B Testing Framework: Safe model rollout with performance comparison
A/B 测试框架:安全推出模型并进行性能比较 - Federated Learning Support: Distributed training on edge devices
联邦学习支持:边缘设备上的分布式训练 - Model Encryption: Secure model storage and execution
模型加密:安全的模型存储和执行 - Compliance Tools: GDPR, HIPAA, and safety-critical certifications
合规性工具:GDPR、HIPAA 和安全关键认证
📊 Benchmarking & Validation
📊 基准测试和验证
Industry-Standard Benchmarks
行业标准基准
- MLPerf Tiny: Competitive performance on standard benchmarks
MLPerf Tiny:在标准基准测试中具有竞争力的性能 - EEMBC MLMark: Energy efficiency measurements
EEMBC MLMark:能效测量 - Custom TinyML Benchmarks: Domain-specific performance evaluation
自定义 TinyML 基准测试:特定领域的性能评估 - Real-World Workload Testing: Production-representative model validation
真实工作负载测试:具有生产代表性的模型验证 - Cross-Platform Consistency: Identical results across all supported hardware
跨平台一致性:在所有支持的硬件上获得相同的结果
Quality Assurance 质量保证
- Fuzzing Infrastructure: Automated testing with random inputs
模糊测试基础设施:使用随机输入进行自动化测试 - Formal Verification: Mathematical proof of correctness for critical operations
形式化验证:关键作正确性的数学证明 - Hardware Stress Testing: Extended operation under extreme conditions
硬件压力测试:在极端条件下延长作时间 - Regression Test Suite: Comprehensive backward compatibility testing
回归测试套件:全面的向后兼容性测试 - Performance Monitoring: Continuous integration with performance tracking
性能监控:与性能跟踪持续集成
🚀 Getting Started for Contributors
🚀 投稿人入门
Prerequisites 先决条件
- Zig Compiler: Install the latest Zig compiler
Zig 编译器:安装最新的 Zig 编译器 - Git: For version control and collaboration
Git:用于版本控制和协作 - Basic Zig Knowledge: Improve Zig proficiency via Ziglings
Zig 基础知识:通过 Ziglings 提高 Zig 熟练度
Quick Setup 快速设置
-
Clone the repository: 克隆存储库:
git clone https://github.com/ZIGTinyBook/Z-Ant.git cd Z-Ant
-
Run tests to verify setup:
运行测试以验证设置:zig build test --summary all
-
Generate code for a model:
为模型生成代码:zig build codegen -Dmodel=mnist-1
First Time Contributors 首次贡献者
Start here if you're new to Z-Ant:
如果您是 Z-Ant 的新用户,请从这里开始:
- Run existing tests: Use
zig build test --summary all
to understand the codebase
运行现有测试:用于zig build test --summary all
了解代码库 - Try code generation: Use
zig build codegen -Dmodel=mnist-1
to see the workflow
尝试代码生成:用于zig build codegen -Dmodel=mnist-1
查看工作流程 - Read the documentation: Check
/docs/
folder for detailed guides
阅读文档:检查/docs/
文件夹以获取详细指南 - Review the Hackathon Guide: For specific guidance on the rendering and lowering pipeline, refer to the HackathonGuide.md.
查看 Hackathon 指南:有关渲染和降低管道的具体指导,请参阅 HackathonGuide.md。
Project Architecture 项目架构
<span style="background-color:var(--bgColor-muted, var(--color-canvas-subtle))"><span style="color:#1f2328"><span style="color:var(--fgColor-default, var(--color-fg-default))"><span style="background-color:var(--bgColor-muted, var(--color-canvas-subtle))"><code>Z-Ant/
├── src/ # Core source code
│ ├── Core/ # Neural network core functionality
│ ├── CodeGen/ # Code generation engine
│ ├── ImageToTensor/ # Image preprocessing pipeline
│ ├── onnx/ # ONNX model parsing
│ └── Utils/ # Utilities and helpers
├── tests/ # Comprehensive test suite
├── datasets/ # Sample models and test data
├── generated/ # Generated code output
├── examples/ # Arduino and microcontroller examples
└── docs/ # Documentation and guides
</code></span></span></span></span>
🛠️ Development Workflow 🛠️ 开发工作流程
Quick Start Commands 快速启动命令
# Run comprehensive tests
zig build test --summary all# Generate code for a specific model
zig build codegen -Dmodel=mnist-1# Test generated code
zig build test-codegen -Dmodel=mnist-1# Compile static library for deployment
zig build lib -Dmodel=mnist-1 -Dtarget=thumb-freestanding -Dcpu=cortex_m33
Git Branching Strategy Git 分支策略
We follow a structured branching strategy to ensure code quality and smooth collaboration:
我们遵循结构化的分支策略来确保代码质量和顺利协作:
Branch Types 分支类型
main
: Stable, production-ready code for releases
main
:用于发布的稳定、生产就绪代码feature/<feature-name>
: New features under development
feature/<feature-name>
:正在开发的新功能fix/<issue-description>
: Bug fixes and patches
fix/<issue-description>
:错误修复和补丁docs/<documentation-topic>
: Documentation improvements
docs/<documentation-topic>
: 文档改进test/<test-improvements>
: Test suite enhancements
test/<test-improvements>
:测试套件增强功能
Best Practices for Contributors
贡献者的最佳实践
- Test Before Committing: Run
zig build test --summary all
before every commit
Test Before Committing:在每次提交之前运行zig build test --summary all
- Document Your Code: Follow Zig's doc-comments standard
记录您的代码:遵循 Zig 的文档注释标准 - Small, Focused PRs: Keep pull requests small and focused on a single feature/fix
小型、专注的 PR:保持拉取请求较小并专注于单个功能/修复 - Use Conventional Commits: Follow commit message conventions (feat:, fix:, docs:, etc.)
使用常规提交:遵循提交消息约定(feat:、fix:、docs: 等)
Using Z-Ant 🔧 使用 Z-Ant
Development Requirements 开发要求
- Install the latest Zig compiler
安装最新的 Zig 编译器 - Improve Zig proficiency via Ziglings
通过 Ziglings 提高 Zig 熟练度
Running Tests 运行测试
Add tests to build.zig/test_list
.
将测试添加到 build.zig/test_list
。
- Regular tests: 定期测试:
zig build test --summary all
- Heavy computational tests:
繁重的计算测试:zig build test -Dheavy --summary all
Generating Code for Models
为模型生成代码
zig build codegen -Dmodel=model_name [-Dlog -Duser_tests=user_tests.json]
Generated code will be placed in:
生成的代码将被放置在:
<span style="background-color:var(--bgColor-muted, var(--color-canvas-subtle))"><span style="color:#1f2328"><span style="color:var(--fgColor-default, var(--color-fg-default))"><span style="background-color:var(--bgColor-muted, var(--color-canvas-subtle))"><code>generated/model_name/
├── lib_{model_name}.zig
├── test_{model_name}.zig
└── user_tests.json
</code></span></span></span></span>
Testing Generated Models 测试生成的模型
zig build test-codegen -Dmodel=model_name
Integrating into Your Project
集成到您的项目中
Build the static library:
构建静态库:
zig build lib -Dmodel=model_name -Dtarget={arch} -Dcpu={cpu}
Linking with CMake: 与 CMake 链接:
target_link_libraries(your_project PUBLIC path/to/libzant.a)
Logging (Optional) 日志记录(可选)
To set a custom log function from your C code:
要从 C 代码设置自定义日志函数:
extern void setLogFunction(void (*log_function)(uint8_t *string));
🏗️ Build System (build.zig
)
🏗️ 构建系统 ( build.zig
)
Available Build Commands 可用的构建命令
Core Commands 核心命令
-
Standard build: 标准版本:
zig build # Build all targets
-
Run unit tests: 运行单元测试:
zig build test --summary all # Run all unit tests
-
Code generation: 代码生成:
zig build codegen -Dmodel=model_name # Generate code for specified model
-
Static library compilation:
静态库编译:zig build lib -Dmodel=model_name # Compile static library for deployment
Testing Commands 测试命令
-
Test generated library: 测试生成的库:
zig build test-generated-lib -Dmodel=model_name # Test specific generated model library
-
OneOp model testing: OneOp 模型测试:
zig build test-codegen-gen # Generate oneOperation test models zig build test-codegen # Test all generated oneOperation models
-
ONNX parser testing: ONNX 解析器测试:
zig build onnx-parser # Test ONNX parser functionality
Profiling & Performance 分析和性能
- Build main executable for profiling:
构建用于性能分析的主可执行文件:zig build build-main -Dmodel=model_name # Build profiling target executable
Command-Line Options 命令行选项
Target & Architecture Options
目标和架构选项
-Dtarget=<arch>
: Target architecture (e.g.,thumb-freestanding
,native
)
-Dtarget=<arch>
:目标架构(例如、thumb-freestanding
native
、 )-Dcpu=<cpu>
: CPU model (e.g.,cortex_m33
,cortex_m4
)
-Dcpu=<cpu>
:CPU 型号(例如、cortex_m33
、)cortex_m4
Model & Path Options 模型和路径选项
-Dmodel=<name>
: Model name (default:mnist-8
)
-Dmodel=<name>
:模型名称(默认值:mnist-8
)-Dmodel_path=<path>
: Custom ONNX model path
-Dmodel_path=<path>
:自定义 ONNX 模型路径-Dgenerated_path=<path>
: Output directory for generated code
-Dgenerated_path=<path>
:生成代码的输出目录-Doutput_path=<path>
: Output directory for compiled library
-Doutput_path=<path>
:编译库的输出目录
Code Generation Options 代码生成选项
-Dlog=true|false
: Enable detailed logging during code generation
-Dlog=true|false
:在代码生成期间启用详细日志记录-Duser_tests=<path>
: Specify custom user tests JSON file
-Duser_tests=<path>
:指定自定义用户测试 JSON 文件-Dshape=<shape>
: Input tensor shape
-Dshape=<shape>
:输入张量形状-Dtype=<type>
: Input data type (default:f32
)
-Dtype=<type>
:输入数据类型(默认值:f32
)-Dcomm=true|false
: Generate code with comments
-Dcomm=true|false
:生成带注释的代码-Ddynamic=true|false
: Enable dynamic memory allocation
-Ddynamic=true|false
:启用动态内存分配
Testing Options 测试选项
-Dheavy=true|false
: Run heavy computational tests
-Dheavy=true|false
:运行繁重的计算测试-Dtest_name=<name>
: Run specific test by name
-Dtest_name=<name>
:按名称运行特定测试
Debug & Profiling Options
调试和分析选项
-Dtrace_allocator=true|false
: Use tracing allocator for debugging (default:true
)
-Dtrace_allocator=true|false
:使用跟踪分配器进行调试(默认值:true
)-Dallocator=<type>
: Allocator type to use (default:raw_c_allocator
)
-Dallocator=<type>
:要使用的分配器类型(默认值:raw_c_allocator
)
Common Usage Examples 常见使用示例
# Generate code for MNIST model with logging
zig build codegen -Dmodel=mnist-1 -Dlog=true# Build static library for ARM Cortex-M33
zig build lib -Dmodel=mnist-1 -Dtarget=thumb-freestanding -Dcpu=cortex_m33# Test with heavy computational tests enabled
zig build test -Dheavy=true --summary all# Generate code with custom paths and comments
zig build codegen -Dmodel=custom_model -Dmodel_path=my_models/custom.onnx -Dgenerated_path=output/ -Dcomm=true# Build library with custom output location
zig build lib -Dmodel=mnist-1 -Doutput_path=/path/to/deployment/# Run specific test
zig build test -Dtest_name=tensor_math_test# Build profiling executable for performance analysis
zig build build-main -Dmodel=mnist-1 -Dtarget=native
五、软件下载
迅雷云盘
本文信息来源于GitHub作者地址:https://github.com/ZantFoundation/Z-Ant
相关文章:
Z-Ant开源程序是简化了微处理器上神经网络的部署和优化
一、软件介绍 文末提供程序和源码下载 Z-Ant (Zig-Ant) 是一个全面的开源神经网络框架,专门用于在微控制器和边缘设备上部署优化的 AI 模型。Z-Ant 使用 Zig 构建,为资源受限的硬件上的模型优化、代码生成和实时推理提供端到端…...
面试题-在ts中类型转换的方法
在 TypeScript 中,类型转换主要分为 类型断言(Type Assertion)、类型守卫(Type Guard) 和 类型兼容转换 三种方式。以下是详细分类和示例: 一、类型断言(Type Assertion) 强制编译…...
【论文笔记】【强化微调】T-GRPO:对视频数据进行强化微调
tulerfeng/Video-R1: Video-R1: Reinforcing Video Reasoning in MLLMs [🔥the first paper to explore R1 for video] 1. 引述 在强化微调中,像 GRPO、DAPO 这样的方法都是对文本或者图片进行微调思考,所以这类微调方法不对时序信息做处理&…...
`shallowReactive` 与 `shallowRef`:浅层响应式 API
🤍 前端开发工程师、技术日更博主、已过CET6 🍨 阿珊和她的猫_CSDN博客专家、23年度博客之星前端领域TOP1 🕠 牛客高级专题作者、打造专栏《前端面试必备》 、《2024面试高频手撕题》、《前端求职突破计划》 🍚 蓝桥云课签约作者、…...
使用Node.js开发服务端接口
Node.js是一个基于JavaScript的运行时环境,非常适合开发高性能的服务端接口。以下是开发服务端接口的主要方法和步骤。 选择合适的框架 Express、Koa或Fastify是Node.js中常用的框架。Express是最流行的选择,适合快速开发。Koa更轻量,适合需…...
`teleport` 传送 API 的使用:在 Vue 3 中的最佳实践
🤍 前端开发工程师、技术日更博主、已过CET6 🍨 阿珊和她的猫_CSDN博客专家、23年度博客之星前端领域TOP1 🕠 牛客高级专题作者、打造专栏《前端面试必备》 、《2024面试高频手撕题》、《前端求职突破计划》 🍚 蓝桥云课签约作者、…...
Linux 多种方式实现行转列
目录 一. 前提二. xargs 实现行转列三. paste 实现行转列四. sed 实现行转列 一. 前提 ⏹之前在这下面篇文章中使用sed命令实现了行专列,本篇文章再介绍几种更加简单的方式。 Linux sed案例 👉 20231126-2.log 110120 SPLREQUEST 内容1 AAA memberID1…...
AI与SEO关键词协同进化
内容概要 人工智能(AI)与搜索引擎优化(SEO)的结合,正深刻变革着关键词策略的制定与执行方式。本文旨在探讨AI技术如何驱动SEO关键词领域的智能化进化,核心在于利用AI强大的数据处理与模式识别能力…...
C# 网络编程-关于HTTP/HTTPS的基础(一)
一、HTTP基础概念 1. 请求-响应模型 HTTP是基于客户端-服务器的无状态协议,流程如下: 客户端(如浏览器)发起请求。服务器接收请求并处理。服务器返回响应,包含状态码、Header和响应体。连接关闭,后续请求…...
题解:P11501 [ROIR 2019] 探险队(Day 2)
前言:这道题 dp 做法找环的部分还没有用拓扑做的,补充一下。 这道题其实很像“上司的舞会”,就是求树上最大独立集。 这里我们把每个人向他讨厌的那个人连边(发现所有点出度均为 1 1 1,所以这是一个基环树࿰…...
读者写者问题与读写锁自旋锁
一、读者写者问题 读者写者问题具有以下特点: 一个交易场所---写者写入数据,读者读数据两种角色---读者,写者三种关系 读者和读者---并发写者和写者---互斥读者和写者---互斥 && 同步 二、读者写者VS生产消费 生产者消费者模型中…...
Sublime text启用vim
打开:首选项 > 设置,在打开的输入框中把 "ignored_packages": ["Vintage"] 修改为 "ignored_packages": [],不忽略Vintage,即为启用Vintage,它是Sublime的内置vim插件。 然后再添加&…...
蚂蚁百宝箱快速创建智能体AI小程序
蚂蚁百宝箱官网https://tbox.alipay.com/community?operationSource1006/ 以下是一篇关于蚂蚁百宝箱快速创建智能体 AI 小程序的图文并茂的博客: 标题:蚂蚁百宝箱快速创建智能体 AI 小程序,开启智能应用新体验 引言 在数字化飞速发展的当…...
【Anconda安装教程】安装到环境配置全流程
目录 前言 一、进入官网下载 二、下载Anconda编辑 三、安装Anconda 四、配置环境变量 五、验证是否安装成功 六、anaconda的使用 情况一:电脑现在没有装python或者现在装的可以卸载掉 情况二:电脑目前装了python,但想保留它 6.1 进…...
Linux系统编程 | IPC对象---信号量
在前面两篇博客文章中,对Linux系统编程部分IPC三大对象中的消息队列和共享内存的知识体系做了一个大致的梳理,在本篇文章中,将对三大IPC对象中的最后一个信号量做一个总结。如果有需要的博客朋友,可以参考我的Linux系统编程专栏参…...
当数据自己会说话:聚类与分类算法全景解析
从金融风控到医疗诊断,两种机器学习技术如何重塑决策逻辑 在人工智能与数据驱动的时代,聚类和分类作为机器学习的两大核心技术,已成为从海量数据中提取价值的必备工具。它们看似相似——都是将数据划分到不同的组中——但内在逻辑和应用场景却…...
哈佛结构(Harvard Architecture)与冯·诺依曼架构(Von Neumann Architecture)
一、基础概念与历史溯源 哈佛结构 起源:1940年代由哈佛大学开发的Mark I计算机首次采用,专为弹道计算优化。核心特征: 物理分离的存储器:程序指令存储在ROM/Flash,数据存储在RAM,两者独立编址。独立总线系统…...
Python内存使用分析工具深度解析与实践指南(下篇)
文章目录 引言6. guppy3 / Heapy功能安装程序示例适用场景注意事项 7. objgraph功能安装程序示例适用场景注意事项 8. memory_profiler功能安装程序示例适用场景注意事项 9. profile(标准库)功能程序示例适用场景注意事项 总结对比表 引言 在Python编程…...
经典控制理论:线性化笔记
一、弹簧阻尼系统 求B点的位置X0,与弹簧形变后的位置X1的关系 ---- 解: 二、直流电动机模型 求输出转速与输入电压的关系 解:...
【StarRocks系列】查询优化
步骤参考官网 分析查询 | StarRocks StarRocks-Profile分析及优化指南 StarRocks-Profile分析及优化指南 - 经验教程 - StarRocks中文社区论坛...
【STM32】STM32的中断系统寄存器NVIC、EXTI
文章目录 中断概述中断的概念为什么需要中断STM32的中断 STM32的中断体系架构NVICNVIC的介绍中断优先级优先级寄存器优先级组 EXTI 中断概述 中断的概念 在主程序运行过程中,出现了特定事件,使得CPU暂停当前正在运行的程序,转而去处理这个事…...
LLM-201: OpenHands与LLM交互链路分析
一、核心交互链路架构 #mermaid-svg-ZBqCSQk1PPDkIXNx {font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}#mermaid-svg-ZBqCSQk1PPDkIXNx .error-icon{fill:#552222;}#mermaid-svg-ZBqCSQk1PPDkIXNx .error-text{fill:#552222;strok…...
税务 VR 虚拟体验,带来全新办税感受
在过去,企业办税难题诸多。申报纳税高峰期,办税服务厅人满为患,财务人员需早起取号排队,耗费大量时间。传统办税流程复杂,涉及多环节和部门,资料繁多,若准备不全或有误就得重新准备,…...
【Linux 驱动中断】
Linux 驱动中断 一、GIC 控制器:硬件中断的枢纽二、GPIO 中断:设备交互的常见入口三、Tasklet 与软中断:高效的异步处理机制3.1 Tasklet3.2 软中断 四、工作队列:灵活的任务处理框架4.1 共享工作队列4.2 自定义工作队列4.3 延迟工…...
ali 轻量服务器安装nginx
# Ubuntu sudo apt install nginx-light # 精简版 # CentOS sudo yum install nginx #启动并设置开机自启 sudo systemctl daemon-reload sudo systemctl start nginx sudo systemctl enable nginx #验证安装 nginx -v curl -I 127.0.0.1 #常用命令: # 重新加载配…...
2025年- H83-Lc191--139.单词拆分(动态规划)--Java版
1.题目描述 2.思路 字符串s是一个容器(一个背包),wordDict词典是物品,这里面的每个物品我们可以使用多次。 动归五部曲 (1)字符串的长度为i,dp[i]true。 dp[s.size] dp[0]代表空字符串 &#x…...
【好用但慎用】Windows 系统中将所有 WSL 发行版从 C 盘迁移到 非系统 盘的完整笔记(附 异常处理)
🚀 将所有 WSL 发行版从 C 盘迁移到 I 盘的完整教程(含 Podman / NVIDIA Workbench / Ubuntu 等) 【无标题】使用 Chocolatey 安装 WSL 管理工具 LxRunOffline-CSDN博客 免责声明 重要提示 在执行 WSL 迁移操作前,请务必仔细阅读…...
贪心算法思路详解
文章目录 一、贪心算法是什么?二、贪心算法原理三、再谈背包问题四、活动选择问题五、拟阵理论总结 一、贪心算法是什么? 贪心算法与动态规划算法一样是用于求解最优化类问题的算法,其本质上是基于动态规划算法的改进算法,其所求…...
Keil 安装 CMSIS-FreeRTOS 失败解决方案
一、问题现象 在 Keil 中安装 CMSIS-FreeRTOS 时出现以下错误: (1) 通过内置工具安装: (2)通过官网安装: 二、核心原因 Keil 版本过低,与 CMSIS-FreeRTOS 包不兼容: …...
Python打卡DAY33
DAY33:MLP神经网络的训练 恩师浙大疏锦行 知识点: PyTorch和cuda的安装查看显卡信息的命令行命令(cmd中使用)cuda的检查简单神经网络的流程 数据预处理(归一化、转换成张量)模型的定义 继承nn.Module类定义…...
RJ45 网口实现千兆传输速率(1Gbps)的原理,涉及物理层传输技术、线缆标准、信号调制及网络协议等多方面的协同设计。以下从技术维度展开详细解析:
一、千兆以太网的标准与物理层基础 1. 标准规范 千兆以太网遵循 IEEE 802.3ab(针对双绞线)和 IEEE 802.3z(针对光纤)标准,其中 RJ45 接口对应双绞线场景,核心是通过四对双绞线(CAT5e/CAT6 线缆…...
leetcode hot 100之:二叉树的层序遍历
层序遍历和前中后序遍历不一样,大家可以想象的是:前中后序遍历可以用递归,因为他是以子树为标准来选择的;那层序怎么办呢?怎么才能一层层地遍历呢? void First(TreeNode* root) {printf("%d",ro…...
深入解析BERT:语言分类任务的革命性引擎
“BERT的出现,如同在自然语言处理领域投下了一颗认知炸弹——它让机器真正学会了’联系上下文’。” ——自然语言处理研究者普遍共识 在自然语言处理(NLP)领域,2018年诞生的BERT(Bidirectional Encoder Representatio…...
Pycharm中Jupyter Notebook 插件常用快捷键
bg:Jupyter跟LINQPad很像,都是方便写的时候看数据用 快捷键功能Shift Enter执行当前单元格,并跳转到下一个单元格Ctrl Enter执行当前单元格,不跳转(留在当前单元格)Alt Enter执行当前单元格,…...
【Python】Excel表格操作:ISBN转条形码
一、效果 原始文件: 输出文件: 二、代码 import os import logging from openpyxl import load_workbook from openpyxl.drawing.image import Image as ExcelImage from barcode import EAN13 from barcode.writer import ImageWriterlogging.basicCo…...
大数据Hadoop集群搭建
文章目录 大数据Hadoop集群搭建一、VMware准备Linux虚拟机二、VMware虚拟机系统设置1、主机名、IP、SSH免密登录2、JDK环境部署3、防火墙、SELinux、时间同步 三、VMware虚拟机集群上部署HDFS集群1、集群规划2、上传&解压3、Hadoop安装包目录结构4、修改配置文件࿰…...
饼图:数据可视化的“切蛋糕”艺术
饼图,作为数据可视化家族中最经典、最易识别的成员之一,其核心功能如同其名——像切分蛋糕一样,直观展示一个整体(100%)被划分为若干组成部分的比例关系。 往期文章推荐: 20.用Mermaid代码画ER图:AI时代的…...
mysql server层做了什么
服务器处理客户端请求 服务器程序在处理来自客户端的查询请求时,大致需要分为3部分:连接管理、解析与优化、存储引擎。 连接管理 每当有一个客户端进程连接到服务器进程时,服务器进程都会创建一个线程专门处理与这个客户端的交互ÿ…...
3.5.1_1 信道划分介质访问控制(上)
在这个视频中我们要介绍信道划分、介质访问控制,这是两个词,我们先介绍一下什么叫做介质访问控制。 通过之前的学习,我们知道在计算机网络当中,有的信道它在逻辑上属于总线型,我们也可以把这种信道称为广播信道&#x…...
RPC常见问题回答
项目流程和架构设计 1.服务端的功能: 1.提供rpc调用对应的函数 2.完成服务注册 服务发现 上线/下线通知 3.提供主题的操作 (创建/删除/订阅/取消订阅) 消息的发布 2.服务的模块划分 1.网络通信模块 net 底层套用的moude库 2.应用层通信协议模块 1.序列化 反序列化数…...
数据分析和可视化:Py爬虫-XPath解析章节要点总结
重要知识点 XPath 概述:XPath 是一门可以在 XML 文件中查找信息的语言,也可用于 HTML 文件。它功能强大,提供简洁明了的路径表达式和多个函数,用于字符串、数值、时间比较等。1999 年成为 W3C 标准,常用于爬虫中抓取网…...
WIFI原因造成ESP8266不断重启的解决办法
一、报错 报错信息如下: 21:37:21.799 -> ets Jan 8 2013,rst cause:2, boot mode:(3,7) 21:37:21.799 -> 21:37:21.799 -> load 0x4010f000, len 3424, room 16 21:37:21.799 -> tail 0 21:37:21.799 -> chksum 0x2e 21:37:21.799 -> loa…...
OSI网络通信模型详解
OSI 模型就是把这整个过程拆解成了 7 个明确分工的步骤,每一层只负责自己那一摊事儿,这样整个系统才能顺畅运转,出了问题也容易找到“锅”在谁那。 核心比喻:寄快递 📦 想象你要把一份重要的礼物(你的数据…...
第五章 中央处理器
5.1 CPU的功能和基本构造 5.1.1 CPU的基本功能 5.1.2 CPU的基本结构 1.运算器 算术逻辑单元ALU 累加寄存器ACC 程序字状态寄存器PSW 计数器CT 暂存寄存器 通用寄存器组 移位器 通用寄存器供用户自由编程,可以存放数据和地址。而指令寄存器是专门用于存放指令的专用寄存器,…...
大模型学习入门——Day3:注意力机制
本系列笔记的教材:快乐学习大模型-DataWhale团队 注意力机制 注意力机制最先源于计算机视觉领域,其核心思想为当我们关注一张图片,我们往往无需看清楚全部内容而仅将注意力集中在重点部分即可。而在自然语言处理领域,我们往往也…...
C++ 学习笔记精要(二)
第一节 特殊类的设计 1. 一个类: 只能在堆上创建对象 关键点:自己控制析构 1.1 方法一: 使用delete禁掉默认析构函数 #include <iostream> using namespace std;class HeapOnly { public:HeapOnly(){_str new char[10];}~HeapOnly() delete;void Destroy(){delete[…...
博士,超28岁,出局!
近日,长沙市望城区《2025年事业引才博士公开引进公告》引发轩然大波——博士岗位年龄要求28周岁及以下,特别优秀者也仅放宽至30周岁。 图源:网络 这份规定让众多"高龄"博士生直呼不合理,并在社交平台掀起激烈讨论。 图源…...
macOS - 根据序列号查看机型、保障信息
文章目录 最近在看 MacBook 二手机,有个咸鱼卖家放个截图 说不清参数,于是想根据 序列号 查看机型。苹果提供了这样的网页: https://checkcoverage.apple.com/ (无需登录) 结果 2025-06-20(五)…...
C/C++ 高频八股文面试题1000题(一)
原作者:Linux教程,原文地址:C/C 高频八股文面试题1000题(一) 在准备技术岗位的求职过程中,C/C始终是绕不开的核心考察点。无论是互联网大厂的笔试面试,还是嵌入式、后台开发、系统编程等方向的岗位,C/C 都…...
C++ map 和 unordered_map 的区别和联系
C map 和 unordered_map 的区别和联系 map 和 unordered_map 都是 C 标准库中关联容器,用于存储键值对。它们的主要区别在于底层实现和性能特性,联系在于它们都提供了键值对的存储和访问功能。 区别: 特性mapunordered_map底层实现红黑树 …...