当前位置: 首页 > news >正文

懒人一键搭建符号执行环境V5K3

0.背景

在写完上一篇文章后发现,其实V5k3的组合也可以使用。Verilator v5.x 系列版本完全支持本项目的编译与仿真。 不同于 v3 版本,Verilator v5 引入了更严格的访问控制机制:要从 Verilator 生成的 C++ 仿真模型中访问内部信号或变量,必须在 Verilog 源码中显式声明为 public。

在 Verilator v5 中,这种声明需使用如下语法:

(* verilator public_flat_rw *) reg [127:0] Drg;
(* verilator public_flat_rw *) wire [127:0] Dnext_debug;

这将使信号可以通过 Verilator 生成的 C++ 模型中的 rootp->AES_ENC__DOT__Drg 等方式访问,从而配合 KLEE 等符号执行引擎进行断言验证与调试。

如果未显式声明,Verilator 将不会导出对应变量的访问接口,导致编译或链接阶段出现 undefined reference 或访问失败的情况。

搭建

在经过大量测试之后,编写了一个懒人安装v5k3组合的脚本,可以将代码复制保存为.sh,赋予可执行权限后运行即可。

#!/bin/bash
set -estep() {echo -e "\n\033[1;36m🔷 Step $1: $2\033[0m"sleep 0.5
}
run() {echo -e "   \033[90m$@\033[0m"sleep 0.2eval "$@"
}INSTALL_SCRIPT=install_verilator.shstep "0" "生成容器内 Verilator 安装脚本 ${INSTALL_SCRIPT}"
cat << EOF > ${INSTALL_SCRIPT}
#!/bin/bash
set -estep() {echo -e "\n\033[1;36m🔷 Step \$1: \$2\033[0m"sleep 0.5
}
run() {echo -e "   \033[90m\$@\033[0m"sleep 0.2eval "\$@"
}step "1" "导入 Kitware GPG 公钥(解决 NO_PUBKEY 报错)"
if command -v apt-key &>/dev/null; thenrun "apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 16FAAD7AF99A65E2 || true"
elserun "curl -fsSL https://apt.kitware.com/keys/kitware-archive-latest.asc | gpg --dearmor -o /usr/share/keyrings/kitware-archive-keyring.gpg"
fistep "2" "更新软件包索引"
run "apt update"step "3" "安装构建工具与依赖库"
run "apt-get install -y git help2man perl python3 make g++ flex bison ccache autoconf automake libtool"
run "apt-get install -y libgoogle-perftools-dev numactl perl-doc"
run "apt-get install -y libfl2 libfl-dev zlib1g zlib1g-dev"step "4" "克隆并切换到 verilator v5.032"
run "rm -rf verilator"
run "git clone https://github.com/verilator/verilator"
run "cd verilator"
run "git fetch --all --tags"
run "git checkout v5.032"step "5" "构建并安装 Verilator"
run "autoconf"
run "./configure"
run "make -j\$(nproc)"
run "make install"step "6" "验证 Verilator 安装"
run "verilator --version"
echo -e "\n\033[1;32m✅ Verilator v5.032 安装成功!\033[0m"
EOFchmod +x ${INSTALL_SCRIPT}step "1" "检查是否已存在 klee/klee 镜像"
if sudo docker images | grep -q '^klee/klee'; thenecho -e "   ✅ 已存在 klee/klee 镜像,跳过拉取"
elsestep "1.1" "拉取 KLEE 官方镜像"run "sudo docker pull klee/klee"
fistep "2" "检查是否已存在容器 v5k3"
if sudo docker ps -a --format '{{.Names}}' | grep -q '^v5k3$'; thenecho -e "   ✅ 容器 v5k3 已存在,跳过创建"
elsestep "2.1" "启动后台容器 v5k3"run "sudo docker run -itd --name v5k3 klee/klee tail -f /dev/null"
fistep "3" "复制安装脚本到容器 /root/"
run "sudo docker cp ${INSTALL_SCRIPT} v5k3:/root/"step "4" "赋权并执行安装脚本(以 root 用户)"
run "sudo docker exec --user root -it v5k3 chmod +x /root/${INSTALL_SCRIPT}"
run "sudo docker exec --user root -it v5k3 bash /root/${INSTALL_SCRIPT}"step "5" "验证 Verilator 与 KLEE 版本"
run "sudo docker exec --user root -it v5k3 verilator --version"
run "sudo docker exec -it v5k3 klee --version"
step "6" "自动进入容器 v5k3 交互终端"
run "sudo docker exec -it v5k3 /bin/bash"
┌──(hx㉿orz)-[~]
└─$ ./installv5k3.sh

2.安装日志

┌──(hx㉿orz)-[~]
└─$ ./installv5k3.shStep 0: 生成容器内 Verilator 安装脚本 install_verilator.shStep 1: 检查是否已存在 klee/klee 镜像✅ 已存在 klee/klee 镜像,跳过拉取Step 2: 检查是否已存在容器 v5k3Step 2.1: 启动后台容器 v5k3sudo docker run -itd --name v5k3 klee/klee tail -f /dev/null
20df274bfc6432687b7ca526bed56b066e5c404460d9dce3fea090d48f17e6e4Step 3: 复制安装脚本到容器 /root/sudo docker cp install_verilator.sh v5k3:/root/
Successfully copied 3.07kB to v5k3:/root/Step 4: 赋权并执行安装脚本(以 root 用户)sudo docker exec --user root -it v5k3 chmod +x /root/install_verilator.shsudo docker exec --user root -it v5k3 bash /root/install_verilator.shStep 1: 导入 Kitware GPG 公钥(解决 NO_PUBKEY 报错)apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 16FAAD7AF99A65E2 || true
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
Executing: /tmp/apt-key-gpghome.3MhklnngfX/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys 16FAAD7AF99A65E2
gpg: key A65337CCA8A748B8: public key "Kitware Apt Archive Automatic Signing Key (2025) <debian@kitware.com>" imported
gpg: Total number processed: 1
gpg:               imported: 1Step 2: 更新软件包索引apt update
Get:1 http://archive.ubuntu.com/ubuntu jammy InRelease [270 kB]                             
Get:2 http://security.ubuntu.com/ubuntu jammy-security InRelease [129 kB]                            
Get:3 https://apt.kitware.com/ubuntu jammy InRelease [15.5 kB]                                                
Get:4 http://archive.ubuntu.com/ubuntu jammy-updates InRelease [128 kB]                             
Get:5 http://archive.ubuntu.com/ubuntu jammy-backports InRelease [127 kB]
Get:6 https://apt.kitware.com/ubuntu jammy/main amd64 Packages [68.7 kB]     
Get:7 http://security.ubuntu.com/ubuntu jammy-security/main amd64 Packages [2788 kB]   
Get:8 http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages [17.5 MB]            
Get:9 http://security.ubuntu.com/ubuntu jammy-security/universe amd64 Packages [1243 kB]          
Get:10 http://security.ubuntu.com/ubuntu jammy-security/multiverse amd64 Packages [47.7 kB]                                            
Get:11 http://security.ubuntu.com/ubuntu jammy-security/restricted amd64 Packages [4000 kB]                                            
Get:12 http://archive.ubuntu.com/ubuntu jammy/restricted amd64 Packages [164 kB]                                                       
Get:13 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages [1792 kB]                                                            
Get:14 http://archive.ubuntu.com/ubuntu jammy/multiverse amd64 Packages [266 kB]                                                       
Get:15 http://archive.ubuntu.com/ubuntu jammy-updates/multiverse amd64 Packages [55.7 kB]                                              
Get:16 http://archive.ubuntu.com/ubuntu jammy-updates/restricted amd64 Packages [4246 kB]                                              
Get:17 http://archive.ubuntu.com/ubuntu jammy-updates/universe amd64 Packages [1542 kB]                                                
Get:18 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages [3140 kB]                                                    
Get:19 http://archive.ubuntu.com/ubuntu jammy-backports/main amd64 Packages [82.7 kB]                                                  
Get:20 http://archive.ubuntu.com/ubuntu jammy-backports/universe amd64 Packages [35.2 kB]                                              
Fetched 37.6 MB in 22s (1733 kB/s)                                                                                                     
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
140 packages can be upgraded. Run 'apt list --upgradable' to see them.
W: https://apt.kitware.com/ubuntu/dists/jammy/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.Step 3: 安装构建工具与依赖库apt-get install -y git help2man perl python3 make g++ flex bison ccache autoconf automake libtool
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
g++ is already the newest version (4:11.2.0-1ubuntu1).
g++ set to manually installed.
make is already the newest version (4.3-4.1build1).
make set to manually installed.
The following additional packages will be installed:autotools-dev git-man less libcbor0.8 liberror-perl libfido2-1 libfl-dev libfl2 libhiredis0.14 liblocale-gettext-perl libltdl-devlibperl5.34 libpython3-stdlib libsigsegv2 libxmuu1 m4 openssh-client perl-base perl-modules-5.34 python3-minimal xauth
Suggested packages:autoconf-archive gnu-standards autoconf-doc gettext bison-doc distcc | icecc flex-doc gettext-base git-daemon-run| git-daemon-sysvinit git-doc git-email git-gui gitk gitweb git-cvs git-mediawiki git-svn libtool-doc gfortran | fortran95-compilergcj-jdk m4-doc keychain libpam-ssh monkeysphere ssh-askpass perl-doc libterm-readline-gnu-perl | libterm-readline-perl-perllibtap-harness-archive-perl python3-doc python3-tk python3-venv
Recommended packages:netbase
The following NEW packages will be installed:autoconf automake autotools-dev bison ccache flex git git-man help2man less libcbor0.8 liberror-perl libfido2-1 libfl-dev libfl2libhiredis0.14 liblocale-gettext-perl libltdl-dev libsigsegv2 libtool libxmuu1 m4 openssh-client xauth
The following packages will be upgraded:libperl5.34 libpython3-stdlib perl perl-base perl-modules-5.34 python3 python3-minimal
7 upgraded, 24 newly installed, 0 to remove and 133 not upgraded.
Need to get 18.5 MB of archives.Step 4: 克隆并切换到 verilator v5.032rm -rf verilatorgit clone https://github.com/verilator/verilator
Cloning into 'verilator'...
remote: Enumerating objects: 93530, done.
remote: Counting objects: 100% (759/759), done.
remote: Compressing objects: 100% (260/260), done.
remote: Total 93530 (delta 592), reused 499 (delta 499), pack-reused 92771 (from 4)
Receiving objects: 100% (93530/93530), 63.24 MiB | 1.52 MiB/s, done.
Resolving deltas: 100% (78462/78462), done.cd verilatorgit fetch --all --tags
Fetching origingit checkout v5.032
Note: switching to 'v5.032'.You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:git switch -c <new-branch-name>Or undo this operation with:git switch -Turn off this advice by setting config variable advice.detachedHead to falseHEAD is now at 8ff77e9d4 Version bumpStep 5: 构建并安装 Verilatorautoconf./configure
configuring for Verilator 5.032 2025-01-01
checking whether to perform partial static linking of Verilator binary... yes
checking whether to use tcmalloc... check
checking whether to build for coverage collection... no
checking whether to use hardcoded paths... yes
checking whether to show and stop on compilation warnings... no
checking whether to run long tests... no
checking for z3... no
checking for cvc5... no
checking for cvc4... no
checking for SMT solver... no
compiler CXX inbound is set to... 
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether gcc accepts -g... yes
checking for gcc option to enable C11 features... none needed
checking for g++... g++
checking whether the compiler supports GNU C++... yes
checking whether g++ accepts -g... yes
checking for g++ option to enable C++11 features... none needed
checking for a BSD-compatible install... /usr/bin/install -c
compiler g++ --version = g++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
checking that C++ compiler can compile simple program... yes
checking for ar... ar
checking for perl... perl
checking for python3... python3
python3 --version = Python 3.10.12
checking for flex... flex
flex --version = flex 2.6.4
checking for bison... bison
bison --version = bison (GNU Bison) 3.8.2
checking for ccache... ccache
objcache is ccache --version = ccache version 4.5.1
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for size_t... yes
checking for size_t... (cached) yes
checking for inline... inline
checking whether g++ accepts -pg... yes
checking whether g++ accepts -std=gnu++17... yes
checking whether g++ accepts -Wextra... yes
checking whether g++ accepts -Wfloat-conversion... yes
checking whether g++ accepts -Wlogical-op... yes
checking whether g++ accepts -Wthread-safety... no
checking whether coroutines are supported by g++... no
checking whether coroutines are supported by g++ with -fcoroutines-ts... no
checking whether coroutines are supported by g++ with -fcoroutines... yes
checking whether g++ accepts -Qunused-arguments... no
checking whether g++ accepts -faligned-new... yes
checking whether g++ accepts -Wno-unused-parameter... yes
checking whether g++ accepts -Wno-shadow... yes
checking whether g++ accepts -Wno-char-subscripts... yes
checking whether g++ accepts -Wno-null-conversion... no
checking whether g++ accepts -Wno-parentheses-equality... no
checking whether g++ accepts -Wno-unused... yes
checking whether g++ accepts -Og... yes
checking whether g++ accepts -ggdb... yes
checking whether g++ accepts -gz... yes
checking whether g++ linker accepts -gz... yes
checking whether g++ accepts -faligned-new... yes
checking whether g++ accepts -fbracket-depth=4096... no
checking whether g++ accepts -fcf-protection=none... yes
checking whether g++ accepts -mno-cet... no
checking whether g++ accepts -Qunused-arguments... no
checking whether g++ accepts -Wno-bool-operation... yes
checking whether g++ accepts -Wno-c++11-narrowing... no
checking whether g++ accepts -Wno-constant-logical-operand... no
checking whether g++ accepts -Wno-non-pod-varargs... no
checking whether g++ accepts -Wno-parentheses-equality... no
checking whether g++ accepts -Wno-shadow... yes
checking whether g++ accepts -Wno-sign-compare... yes
checking whether g++ accepts -Wno-tautological-bitwise-compare... no
checking whether g++ accepts -Wno-tautological-compare... yes
checking whether g++ accepts -Wno-uninitialized... yes
checking whether g++ accepts -Wno-unused-but-set-parameter... yes
checking whether g++ accepts -Wno-unused-but-set-variable... yes
checking whether g++ accepts -Wno-unused-parameter... yes
checking whether g++ accepts -Wno-unused-variable... yes
checking whether g++ linker accepts -mt... no
checking whether g++ linker accepts -pthread... yes
checking whether g++ linker accepts -lpthread... yes
checking whether g++ linker accepts -latomic... yes
checking whether g++ linker accepts -fuse-ld=mold... no
checking whether g++ linker accepts -fuse-ld=mold... no
checking whether g++ linker accepts -static-libgcc... yes
checking whether g++ linker accepts -static-libstdc++... yes
checking whether g++ linker accepts -Xlinker -gc-sections... yes
checking whether g++ linker accepts -lpthread... yes
checking whether g++ linker accepts -latomic... yes
checking whether g++ linker accepts -lbcrypt... no
checking whether g++ linker accepts -lpsapi... no
checking whether g++ linker accepts -l:libtcmalloc_minimal.a... yes
checking whether g++ accepts -fno-builtin-malloc... yes
checking whether g++ accepts -fno-builtin-calloc... yes
checking whether g++ accepts -fno-builtin-realloc... yes
checking whether g++ accepts -fno-builtin-free... yes
checking whether g++ supports C++14... yes
checking for g++ precompile header include option... -include
checking for struct stat.st_mtim.tv_nsec... yes
checking whether SystemC is found (in system path)... no
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating src/Makefile_obj
config.status: creating include/verilated.mk
config.status: creating include/verilated_config.h
config.status: creating verilator.pc
config.status: creating verilator-config.cmake
config.status: creating verilator-config-version.cmake
config.status: creating src/config_package.hNow type 'make' (or sometimes 'gmake') to build Verilator.make -j8make install
------------------------------------------------------------
making verilator in src
make -C src 
make[1]: Entering directory '/home/klee/verilator/src'
make -C obj_dbg -j 1  TGT=../../bin/verilator_bin_dbg VL_DEBUG=1 -f ../Makefile_obj serial
make[2]: Entering directory '/home/klee/verilator/src/obj_dbg'
make[2]: Nothing to be done for 'serial'.
make[2]: Leaving directory '/home/klee/verilator/src/obj_dbg'
make -C obj_dbg       TGT=../../bin/verilator_bin_dbg VL_DEBUG=1 -f ../Makefile_obj
make[2]: Entering directory '/home/klee/verilator/src/obj_dbg'Step 6: 验证 Verilator 安装verilator --version
Verilator 5.032 2025-01-01 rev v5.032✅ Verilator v5.032 安装成功!Step 5: 验证 Verilator 与 KLEE 版本sudo docker exec --user root -it v5k3 verilator --version
Verilator 5.032 2025-01-01 rev v5.032sudo docker exec -it v5k3 klee --version
KLEE 3.1 (https://klee.github.io)Build mode: RelWithDebInfo (Asserts: TRUE)Build revision: fe22b90764887ab69c20b1eccd773d47a8378b95LLVM (http://llvm.org/):LLVM version 13.0.1Optimized build with assertions.Default target: x86_64-unknown-linux-gnuHost CPU: skylakeStep 6: 自动进入容器 v5k3 交互终端sudo docker exec -it v5k3 /bin/bash
klee@20df274bfc64:~$ verilator --version
Verilator 5.032 2025-01-01 rev v5.032
klee@20df274bfc64:~$ klee --version
KLEE 3.1 (https://klee.github.io)Build mode: RelWithDebInfo (Asserts: TRUE)Build revision: fe22b90764887ab69c20b1eccd773d47a8378b95LLVM (http://llvm.org/):LLVM version 13.0.1Optimized build with assertions.Default target: x86_64-unknown-linux-gnuHost CPU: skylake
klee@20df274bfc64:~$ 

相关文章:

懒人一键搭建符号执行环境V5K3

0.背景 在写完上一篇文章后发现&#xff0c;其实V5k3的组合也可以使用。Verilator v5.x 系列版本完全支持本项目的编译与仿真。 不同于 v3 版本&#xff0c;Verilator v5 引入了更严格的访问控制机制&#xff1a;要从 Verilator 生成的 C 仿真模型中访问内部信号或变量&#x…...

Java队列(Queue)核心操作与最佳实践:深入解析与面试指南

文章目录 概述一、Java队列核心实现类对比1. LinkedList2. ArrayDeque3. PriorityQueue 二、核心操作API与时间复杂度三、经典使用场景与最佳实践场景1&#xff1a;BFS层序遍历&#xff08;树/图&#xff09;场景2&#xff1a;滑动窗口最大值&#xff08;单调队列&#xff09; …...

Android 中实现图片翻转动画(卡片翻转效果)

1、简述 通过 ObjectAnimator 和 AnimatorSet 可以实现图片的翻转动画,并在翻转过程中切换图片,同时避免图片被镜像。 ObjectAnimator 是 Android 动画框架中的一个类,用于对对象的属性进行动画效果处理。它通过改变对象的属性值来实现动画效果,非常适合实现复杂的动画,如…...

智能电网第1期 | 工业交换机在变电站自动化系统中的作用

随着智能电网建设的加速推进&#xff0c;变电站自动化系统对通信网络的实时性、可靠性和安全性提出了更高要求。在变电站智能化改造过程中&#xff0c;传统网络架构面临诸多挑战&#xff1a; 多协议兼容难题&#xff1a;继电保护、测控装置等设备通信协议多样&#xff0c;难以统…...

01.浏览器自动化webdriver源码分析之启动函数

日后&#xff0c;网络爬虫也好&#xff0c;数据采集也好&#xff0c;自动化必然是主流。因此&#xff0c;笔者未雨绸缪&#xff0c;在此研究各类自动化源码&#xff0c;希望能够赶上时代&#xff0c;做出一套实用的自动化框架。 这里先研究传统的webdriver中转来进行浏览器自动…...

day35图像处理OpenCV

文章目录 一、图像预处理17 直方图均衡化17.1绘制直方图17.2直方图均衡化1. 自适应直方图均衡化2. 对比度受限的自适应直方图均衡化3. 示例 19 模板匹配 一、图像预处理 17 直方图均衡化 直方图&#xff1a;反映图像像素分布的统计图&#xff0c;横坐标就是图像像素的取值&…...

精益数据分析(15/126):解锁数据分析关键方法,驱动业务增长

精益数据分析&#xff08;15/126&#xff09;&#xff1a;解锁数据分析关键方法&#xff0c;驱动业务增长 在创业与数据分析的征程中&#xff0c;我们都在努力探寻成功的密码。今天&#xff0c;我依旧带着和大家共同进步的初衷&#xff0c;深入解读《精益数据分析》的相关内容…...

JETBRAINS USER AGREEMENT【2025.4.16】更新用户许可协议

JETBRAIN旗下的各产品更新用户许可协议&#xff1a; 大致跟漂亮国出口管制政策有关&#xff0c;以下是详细内容&#xff1a; JETBRAINS USER AGREEMENT Version 2.0, effective as of April 16, 2025 THIS IS A LEGAL AGREEMENT. BY CLICKING ON THE "I AGREE" (OR…...

【数字图像处理】立体视觉基础(1)

成像 成像过程&#xff1a;三维空间坐标到二维图像坐标的变换 相机矩阵&#xff1a;建立三维到二维的投影关系 相机的使用步骤&#xff08;模型-视图变换&#xff09;&#xff1a; &#xff08;1&#xff09;视图变换 &#xff08;2&#xff09;模型变换 &#xff08;3&…...

通过AI工具或模型创建PPT的不同方式详解,结合 Assistants API、DALL·E 3 等工具的功能对比及表格总结

以下是通过AI工具或模型创建PPT的不同方式详解&#xff0c;结合 Assistants API、DALLE 3 等工具的功能对比及表格总结&#xff1a; 1. 主要实现方式详解 1.1 基于文本生成PPT 工具示例&#xff1a;Microsoft PowerPoint Copilot、Google Workspace&#xff08;AI-powered D…...

weibo_har鸿蒙微博分享,单例二次封装,鸿蒙微博,微博登录

weibo_har鸿蒙微博分享&#xff0c;单例二次封装&#xff0c;鸿蒙微博 HarmonyOS 5.0.3 Beta2 SDK&#xff0c;原样包含OpenHarmony SDK Ohos_sdk_public 5.0.3.131 (API Version 15 Beta2) &#x1f3c6;简介 zyl/weibo_har是微博封装使用&#xff0c;支持原生core使用 &a…...

C++ Lambda表达式复习

C Lambda表达式 (C Lambda Expressions: Beginner to Advanced) Lambda表达式是C11引入的一种轻量级匿名函数语法&#xff0c;支持闭包捕获&#xff0c;可以简化代码逻辑&#xff0c;特别是在函数式编程、回调函数和STL算法场景中尤为常用。本文将从基础语法到高级应用&#x…...

鸿蒙NEXT开发权限工具类(申请授权相关)(ArkTs)

import abilityAccessCtrl, { Permissions } from ohos.abilityAccessCtrl; import { bundleManager, common, PermissionRequestResult } from kit.AbilityKit; import { BusinessError } from ohos.base; import { ToastUtil } from ./ToastUtil;/*** 权限工具类&#xff08;…...

1000 QPS 下 MySQL 性能瓶颈解决方案

当 MySQL 在 1000 QPS 时出现性能瓶颈&#xff0c;需从‌索引优化‌、‌查询逻辑调整‌、‌服务器配置调优‌、‌架构扩展‌等多维度综合解决&#xff0c;具体策略如下&#xff1a; 一、索引优化 补充缺失索引‌ 通过慢查询日志定位高频低效 SQL&#xff0c;使用 EXPLAIN 分…...

【MySQL】MySQL 表的增删改查(CRUD)—— 下篇(内含聚合查询、group by和having子句、联合查询、插入查询结果)

目录 1. 插入查询结果 2 聚合查询 &#xff08;行与行之间运算&#xff09; count 计算查询结果的行数 sum 求和 avg 求平均值 max 最大值 min 最小值 【小结】 3. group by 子句 分组 where 条件 having 条件 4. 联合查询&#xff08;多表查询&#xff09; 内连接…...

简化K8S部署流程:通过Apisix实现蓝绿发布策略详解(上)

本次主题主要目的是为大家讲解蓝绿发布&#xff0c;但是发现文档和内容太长了&#xff0c;对此将文档拆分成了两部分&#xff0c;视频拆分成了好几部分&#xff0c;这样大家刷起来没疲劳感。 第一部分《apisix argorollout 实现蓝绿发布I-使用apisix发布应用》&#xff0c;主要…...

FLV 与 MP4 格式深度剖析:结构、原理

1 FLV格式分析 1.1 定义 FLV(Flash Video)是Adobe公司推出的⼀种流媒体格式&#xff0c;由于其封装后的⾳视频⽂件体积⼩、封装简单等特点&#xff0c;⾮常适合于互联⽹上使⽤。⽬前主流的视频⽹站基本都⽀持FLV。采⽤FLV格式封装的⽂件后缀为.flv FLV封装格式是由⼀个**⽂件…...

k8s的yaml文件里的volume跟volumeMount的区别

volume 是 Pod 级别的资源&#xff0c;用于定义存储卷。它是一个独立于容器的存储资源&#xff0c;可以被一个或多个容器共享使用。volume 的定义位于 Pod 的 spec.volumes 部分。 特点 独立性&#xff1a;volume 是 Pod 的一部分&#xff0c;而不是容器的一部分。它独立于容…...

Git常用操作命令

配置 Git git config --global user.name "Your Name": 设置用户名。git config --global user.email "your_emailexample.com": 设置用户邮箱。 初始化和克隆仓库 git init: 初始化一个新的 Git 仓库。git clone [URL]: 克隆一个远程仓库到本地。 git cl…...

09.传输层协议 ——— TCP协议

文章目录 TCP协议 谈谈可靠性TCP协议格式 序号与确认序号窗口大小六个标志位 确认应答机制&#xff08;ACK&#xff09;超时重传机制连接管理机制 三次握手四次挥手 流量控制滑动窗口拥塞控制延迟应答捎带应答面向字节流粘包问题TCP异常情况TCP小结基于TCP的应用层协议 TCP协…...

NineData 与飞书深度集成,企业级数据管理审批流程全面自动化

NineData 正式推出与飞书审批系统的深度集成功能&#xff0c;企业用户在 NineData 平台发起的审批工单&#xff0c;将自动推送至审批人的飞书中&#xff0c;审批人可以直接在飞书进行审批并通过/拒绝。该功能实现跨系统协作&#xff0c;带来巨大的审批效率提升&#xff0c;为各…...

WebRTC服务器Coturn服务器中的通信协议

1、概述 作为WebRTC服务器&#xff0c;coturn通信协议主要是STUN和TURN协议 STUN&TURN协议头部都是20个字节,用 Message Type来区分不同的协议 |------2------|------2------|------------4------------|------------------------12-------------------------|-----------…...

4.19除自身以外数组的乘积

我自己的思路&#xff0c;想用双指针&#xff0c; 一个从左边left开始乘&#xff0c;一个从右边right开始乘&#xff0c;如果left,或者right遇到了目标索引i(也就是我们要跨过去的当前元素)&#xff0c;那么直接让对应的指针加一&#xff0c;当前元素不参与累积的计算&#xff…...

Anaconda3使用conda进行包管理

一、基础包管理操作 ‌安装包‌ 使用 conda install <包名> 安装指定包&#xff0c;支持多包批量安装和版本指定&#xff1a; conda install numpy # 安装单个包 conda install numpy scipy pandas # 批量安装多个包 conda install numpy1.21 # 指定版本 conda instal…...

媒体关注:联易融聚焦AI+业务,重塑供应链金融生态

近日&#xff0c;供应链金融科技龙头企业联易融科技集团&#xff08;以下简称“联易融”&#xff09;发布的公告显示&#xff0c;截至2024年末&#xff0c;公司现金储备达51亿元&#xff0c;同比上一年增加2亿元。公司称&#xff0c;公司经营性现金流保持健康&#xff0c;现金储…...

安装 Conda 环境

安装 Conda 环境&#xff1a;快速指南 什么是 Conda&#xff1f; Conda 是一个开源的跨平台包管理器和环境管理系统&#xff0c;支持 Python、R、Julia 等语言。它广泛用于数据科学和机器学习领域&#xff0c;能够轻松创建、管理和切换开发环境。 安装步骤 1. 安装 Anaconda…...

Qt Creator 创建 Qt Quick Application一些问题

一、Qt Creator 创建 Qt Quick Application 时无法选择 MSVC 编译器(即使已安装 Qt 5.15.2 和 MSVC2019) 1、打开 Qt Creator 的编译器设置 工具 (Tools) → 选项 (Options) → Kits → 编译器 (Compilers) 检查是否存在 Microsoft Visual C++ Compiler (x86_amd64) 或类似条…...

Spark-Streaming核心编程

以下是今天所学的知识点与代码测试&#xff1a; Spark-Streaming DStream实操 案例一&#xff1a;WordCount案例 需求&#xff1a;使用 netcat 工具向 9999 端口不断的发送数据&#xff0c;通过 SparkStreaming 读取端口数据并统计不同单词出现的次数 实验步骤&#xff1a;…...

深度剖析神经网络:从基础原理到面试要点(二)

引言 在人工智能蓬勃发展的今天&#xff0c;神经网络作为其核心技术之一&#xff0c;广泛应用于图像识别、自然语言处理、语音识别等众多领域。深入理解神经网络的数学模型和结构&#xff0c;对于掌握人工智能技术至关重要。本文将对神经网络的关键知识点进行详细解析&#xf…...

c#操作excel

说明 vs2022开发&#xff0c;调用excel 代码 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using Sy…...

MQTTX + MCP:MQTT 客户端秒变物联网 Agent

引言&#xff1a;MQTTX 与 MCP 的融合 作为最受欢迎的 MQTT 客户端工具&#xff0c;MQTTX 在 1.12.0 beta 版本中集成了模型上下文协议&#xff08;MCP&#xff09;到 Copilot AI 功能中&#xff0c;显著提升了服务能力。这一融合让 MQTTX 转变为 MCP Host&#xff08;也就是发…...

GSAP 动画引擎实战:打造丝滑动效交互组件库

目录 一、前言二、项目初始化三、核心动效组件实战1. 元素淡入组件&#xff1a;FadeIn.vue2. 列表级联动画&#xff1a;SlideList.vue3. 滚动触发 Reveal 动画&#xff1a;ScrollReveal.vue4. 拖拽盒子组件&#xff1a;DraggableBox.vue5. 打字机效果组件&#xff1a;Typewrite…...

[OpenGL] Lambertian材质漫反射BRDF方程的解释与推导

一、简介 本文简单的介绍了 Physical Based Rendering, PBR 中的 Lambertian 材质漫反射BRDF公式 f r l a m b e r t i a n c d i f f π fr_{lambertian}\frac{c_{diff}}{\pi} frlambertian​πcdiff​​的推导。 二、漫反射项 根据 渲染方程&#xff1a; L o ( v ) ∫ …...

网易云音乐如何修改缓存地址到D盘

你可以通过创建 符号链接&#xff08;Symbolic Link&#xff09; 将网易云音乐的缓存目录转移到D盘&#xff0c;无需修改软件设置。以下是具体步骤&#xff1a; 操作步骤 关闭网易云音乐 确保程序完全退出&#xff08;任务栏右下角无残留进程&#xff09;。 备份并移动原缓存文…...

react使用01

React.cloneElement(element,props,…children) 这个是React的官方API&#xff0c;&#xff0c;主要用于克隆并修改React元素&#xff0c;&#xff0c; 本质&#xff1a; 复制一个已有的React元素&#xff0c;并允许你修改他的props element : 必须是一个有效的element元素p…...

yooAsset打包后材质丢失

以安卓为目标平台打出的AssetBundle包&#xff08;尤其是YooAsset打出的&#xff09;&#xff0c;在Window下Unity编辑器以HostPlayMode运行&#xff0c;有时显示会丢失部分材质。 这是因为安卓目标的AssetBundle包适合OpenglES&#xff0c;而window下Unity编辑器模式是Dx11&a…...

Codeforces Round 1019 (Div. 2)

A. Common Multiple 找不同的数字 #include<iostream> #include<vector> #include<algorithm> using namespace std; int main() {int t; cin >> t;while (t--) {int n;cin >> n;vector<int> a(n);for (int i 0; i < n; i)cin >&…...

【Spring Boot】MyBatis多表查询的操作:注解和XML实现SQL语句

1.准备工作 1.1创建数据库 &#xff08;1&#xff09;创建数据库&#xff1a; CREATE DATABASE mybatis_test DEFAULT CHARACTER SET utf8mb4;&#xff08;2&#xff09;使用数据库 -- 使⽤数据数据 USE mybatis_test;1.2 创建用户表和实体类 创建用户表 -- 创建表[⽤⼾表…...

Docker离线安装与配置指南

Docker离线安装与配置指南 离线安装步骤 1. 下载离线安装包 官方下载地址&#xff1a; https://download.docker.com/linux/static/stable/x86_64/注意&#xff1a;国内用户若无法访问&#xff0c;可能需要使用科学上网工具。本文档以Docker 20.10.23版本为例。 2. 安装与部…...

N8N 官方 MCP 节点实战指南:AI 驱动下的多工具协同应用场景全解析

在低代码自动化领域&#xff0c;N8N 凭借其强大的节点扩展能力和灵活的工作流编排&#xff0c;成为企业构建复杂自动化流程的首选工具。随着 AI Agent 技术的兴起&#xff0c;通过 MCP&#xff08;Multi-Tool Coordination Protocol&#xff09;实现 AI 与外部工具的协同调用&a…...

v-html 显示富文本内容

返回数据格式&#xff1a; 只有图片名称 显示不出完整路径 解决方法&#xff1a;在接收数据后手动给img格式的拼接vite.config中的服务器地址 页面&#xff1a; <el-button click"">获取信息<el-button><!-- 弹出层 --> <el-dialog v-model&…...

UWB与GPS技术融合的室内外无缝定位方案

‌ 一、技术原理与互补性‌ ‌双模定位机制‌ ‌室外场景‌&#xff1a;GPS/北斗提供‌10-30厘米级定位精度‌&#xff08;RTK技术辅助&#xff09;&#xff0c;覆盖露天区域。‌室内场景‌&#xff1a;UWB通过‌TOF/TDOA算法‌实现‌10-50厘米级定位精度‌&#xff0c;穿透金…...

AiEditor v1.3.8 发布

2025 年 4 月 22 日&#xff0c;AI 富文本编辑器 AiEditor 发布了 v1.3.8 版本。 AiEditor 是一个面向 AI 的下一代富文本编辑器&#xff0c;基于 Web Component 开发&#xff0c;支持 Layui、Vue、React、Angular 等几乎任何前端框架&#xff0c;适配 PC Web 端和手机端&#…...

从零学会epoll的使用和原理

从零学会epoll的使用和原理 第一步&#xff1a;理解 select / poll 的缺陷 一、select 和 poll 是什么&#xff1f; 它们是 Linux 提供的 I/O 多路复用机制&#xff0c;可以让我们同时监听多个文件描述符&#xff08;fd&#xff09;&#xff0c;比如 socket&#xff0c;来等…...

XHTMLConverter把docx转换html报java.lang.NullPointerException异常

一.报错 1.报错信息 org.apache.poi.xwpf.converter.core.XWPFConverterException: java.lang.NullPointerExceptionat org.apache.poi.xwpf.converter.xhtml.XHTMLConverter.convert(XHTMLConverter.java:77)at org.apache.poi.xwpf.converter.xhtml.XHTMLConverter.doConve…...

教育科技质检的三重挑战 质检LIMS系统在教育技术研发的应用

在教育技术研发领域&#xff0c;实验室作为产品验证的核心环节&#xff0c;其质检效率与数据安全性直接关乎企业的创新竞争力。LIMS&#xff08;实验室信息管理系统&#xff09;作为贯穿检测全流程的数字化中枢&#xff0c;正在成为教育科技企业的"质量守护者"。本文…...

MySQL最左前缀原则深度解析:优化索引设计的核心法则

一、什么是最左前缀原则&#xff1f; 最左前缀原则&#xff08;Leftmost Prefix Principle&#xff09; 指在使用复合索引&#xff08;Composite Index&#xff09;时&#xff0c;MySQL会按照索引定义的列顺序&#xff0c;从左到右匹配查询条件。只有连续且从最左侧开始的列组…...

多模态大语言模型arxiv论文略读(三十五)

On the Out-Of-Distribution Generalization of Multimodal Large Language Models ➡️ 论文标题&#xff1a;On the Out-Of-Distribution Generalization of Multimodal Large Language Models ➡️ 论文作者&#xff1a;Xingxuan Zhang, Jiansheng Li, Wenjing Chu, Junjia…...

Linux 安装pm2并全局可用

前言 本文基于&#xff1a;操作系统 CentOS Stream 8 使用工具&#xff1a;Xshell8、Xftp8 服务器基础环境&#xff1a; node - 请查看 Linux安装node并全局可用 所需服务器基础环境&#xff0c;请根据提示进行下载、安装。 1.安装依赖 npm install pm2 -g2.配置全局软链…...

39.剖析无处不在的数据结构

数据结构是计算机中组织和存储数据的特定方式&#xff0c;它的目的是方便且高效地对数据进行访问和修改。数据结构表述了数据之间的关系&#xff0c;以及操作数据的一系列方法。数据又是程序的基本单元&#xff0c;因此无论是哪种语言、哪种领域&#xff0c;都离不开数据结构&a…...