DPVS-1:编译安装DPVS (ubuntu22.04)
操作系统
root@ubuntu22:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.3 LTS
Release: 22.04
Codename: jammy
root@ubuntu22:~#
前置软件准备
apt install git
apt install meson
apt install gcc
apt install pkg-config
apt install libnuma-dev
apt install libssl-devapt install automake autoconf
apt install libtool
apt install libpopt-dev
DPDK编译安装
下载DPVS
git clone https://github.com/iqiyi/dpvs.git
cd dpvs
下载DPDK20.11
在dpvs目录下下载dpdk,方便后续操作
root@ubuntu22:~/dpvs# wget https://fast.dpdk.org/rel/dpdk-20.11.10.tar.xz
--2025-02-20 15:16:23-- https://fast.dpdk.org/rel/dpdk-20.11.10.tar.xz
Resolving fast.dpdk.org (fast.dpdk.org)... 151.101.130.49, 151.101.66.49, 151.101.2.49, ...
Connecting to fast.dpdk.org (fast.dpdk.org)|151.101.130.49|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 14047916 (13M) [application/octet-stream]
Saving to: ‘dpdk-20.11.10.tar.xz’dpdk-20.11.10.tar.xz 100%[============================================================>] 13.40M 6.96MB/s in 1.9s 2025-02-20 15:16:26 (6.96 MB/s) - ‘dpdk-20.11.10.tar.xz’ saved [14047916/14047916]root@ubuntu22:~/dpvs#
root@ubuntu22:~/dpvs# tar xf dpdk-20.11.10.tar.xz
打PATCH
root@ubuntu22:~/dpvs# cp patch/dpdk-stable-20.11.10/* dpdk-stable-20.11.10/
root@ubuntu22:~/dpvs/dpdk-stable-20.11.10# patch -p1 < 0001-kni-use-netlink-event-for-multicast-driver-part.patch
patching file kernel/linux/kni/kni_net.c
root@ubuntu22:~/dpvs/dpdk-stable-20.11.10# patch -p1 < 0002-pdump-change-dpdk-pdump-tool-for-dpvs.patch
patching file app/pdump/main.c
patching file lib/librte_pdump/rte_pdump.c
patching file lib/librte_pdump/rte_pdump.h
root@ubuntu22:~/dpvs/dpdk-stable-20.11.10# patch -p1 < 0003-debug-enable-dpdk-eal-memory-debug.patch
patching file lib/librte_eal/common/rte_malloc.c
patching file lib/librte_eal/include/rte_malloc.h
root@ubuntu22:~/dpvs/dpdk-stable-20.11.10# patch -p1 < 0004-ixgbe_flow-patch-ixgbe-fdir-rte_flow-for-dpvs.patch
patching file drivers/net/ixgbe/ixgbe_flow.c
root@ubuntu22:~/dpvs/dpdk-stable-20.11.10# patch -p1 < 0005
-bash: 0005: No such file or directory
root@ubuntu22:~/dpvs/dpdk-stable-20.11.10# patch -p1 < 0005-bonding-allow-slaves-from-different-numa-nodes.patch
patching file drivers/net/bonding/rte_eth_bond_pmd.c
root@ubuntu22:~/dpvs/dpdk-stable-20.11.10# patch -p1 < 0006-bonding-fix-problem-in-mode-4-dropping-multicast-pac.patch
patching file drivers/net/bonding/rte_eth_bond_pmd.c
root@ubuntu22:~/dpvs/dpdk-stable-20.11.10# patch -p1 < 0007-bonding-device-sends-packets-with-user-specified-sal.patch
patching file drivers/net/bonding/rte_eth_bond_pmd.c
patching file lib/librte_mbuf/rte_mbuf.h
编译
在dpdkbuild中编译,安装在dpdklib中,后续指定 pkg-config目录到
root@ubuntu22:~/dpvs/dpdk-stable-20.11.10# mkdir dpdklib
root@ubuntu22:~/dpvs/dpdk-stable-20.11.10# mkdir dpdkbuild
root@ubuntu22:~/dpvs/dpdk-stable-20.11.10# meson -Denable_kmods=true -Dprefix=/root/dpvs/dpdk-stable-20.11.10/dpdklib dpdkbuildroot@ubuntu22:~/dpvs/dpdk-stable-20.11.10# ninja -C dpdkbuild/
ninja: Entering directory `dpdkbuild/'
[2419/2421] Generating kernel/linux/kni/rte_kni with a custom command
make: Entering directory '/usr/src/linux-headers-6.2.0-26-generic'
warning: the compiler differs from the one used to build the kernelThe kernel was built by: x86_64-linux-gnu-gcc-11 (Ubuntu 11.3.0-1ubuntu1~22.04.1) 11.3.0You are using: gcc-11 (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0CC [M] /root/dpvs/dpdk-stable-20.11.10/dpdkbuild/kernel/linux/kni/kni_misc.oCC [M] /root/dpvs/dpdk-stable-20.11.10/dpdkbuild/kernel/linux/kni/kni_net.oLD [M] /root/dpvs/dpdk-stable-20.11.10/dpdkbuild/kernel/linux/kni/rte_kni.oMODPOST /root/dpvs/dpdk-stable-20.11.10/dpdkbuild/kernel/linux/kni/Module.symversCC [M] /root/dpvs/dpdk-stable-20.11.10/dpdkbuild/kernel/linux/kni/rte_kni.mod.oLD [M] /root/dpvs/dpdk-stable-20.11.10/dpdkbuild/kernel/linux/kni/rte_kni.koBTF [M] /root/dpvs/dpdk-stable-20.11.10/dpdkbuild/kernel/linux/kni/rte_kni.ko
Skipping BTF generation for /root/dpvs/dpdk-stable-20.11.10/dpdkbuild/kernel/linux/kni/rte_kni.ko due to unavailability of vmlinux
make: Leaving directory '/usr/src/linux-headers-6.2.0-26-generic'
[2421/2421] Linking target app/test/dpdk-testroot@ubuntu22:~/dpvs/dpdk-stable-20.11.10# cd dpdkbuild
root@ubuntu22:~/dpvs/dpdk-stable-20.11.10/dpdkbuild# ninja install
root@ubuntu22:~/dpvs/dpdk-stable-20.11.10#
设置pkg-cofnig
这里的pkgconfig目录与centos(/lib64/pkgconfig)不同,需要根据实际路径设定
root@ubuntu22:~/dpvs/dpdk-stable-20.11.10/dpdklib# export PKG_CONFIG_PATH=/root/dpvs/dpdk-stable-20.11.10/dpdklib/lib/x86_64-linux-gnu/pkgconfig
root@ubuntu22:~/dpvs/dpdk-stable-20.11.10/dpdklib#
验证libdpdk
root@ubuntu22:~/dpvs/dpdk-stable-20.11.10/dpdklib# pkg-config --libs libdpdk
-L/root/dpvs/dpdk-stable-20.11.10/dpdklib/lib/x86_64-linux-gnu -Wl,--as-needed -lrte_node -lrte_graph -lrte_bpf -lrte_flow_classify -lrte_pipeline -lrte_table -lrte_port -lrte_fib -lrte_ipsec -lrte_vhost -lrte_stack -lrte_security -lrte_sched -lrte_reorder -lrte_rib -lrte_regexdev -lrte_rawdev -lrte_pdump -lrte_power -lrte_member -lrte_lpm -lrte_latencystats -lrte_kni -lrte_jobstats -lrte_ip_frag -lrte_gso -lrte_gro -lrte_eventdev -lrte_efd -lrte_distributor -lrte_cryptodev -lrte_compressdev -lrte_cfgfile -lrte_bitratestats -lrte_bbdev -lrte_acl -lrte_timer -lrte_hash -lrte_metrics -lrte_cmdline -lrte_pci -lrte_ethdev -lrte_meter -lrte_net -lrte_mbuf -lrte_mempool -lrte_rcu -lrte_ring -lrte_eal -lrte_telemetry -lrte_kvargs
设置大页
echo "vm.nr_hugepages=1024" >> /etc/sysctl.conf
sysctl -proot@ubuntu22:/etc/apt# cat /proc/meminfo | grep Huge
AnonHugePages: 0 kB
ShmemHugePages: 0 kB
FileHugePages: 0 kB
HugePages_Total: 1024
HugePages_Free: 1024
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 2048 kB
Hugetlb: 2097152 kB
安装golang
heathcheck dpvs-agent 需要golang 1.20版本
wget https://golang.google.cn/dl/go1.20.linux-amd64.tar.gz
rm -rf /usr/local/go && tar -C /usr/local -xzf go1.20.linux-amd64.tar.gz
export PATH=$PATH:/usr/local/go/bingo env -w GOPROXY=https://goproxy.cn,direct
编译DPVS
修改编译选项
开启编译healthcheck ipvs-agent,config.mk中修改,
export CONFIG_DPVS_AGENT=y

编译安装
root@ubuntu22:~# make
root@ubuntu22:~# make install
root@ubuntu22:~# cd dpvs
root@ubuntu22:~/dpvs# ls bin
dpip dpvs dpvs-agent healthcheck ipvsadm keepalived
报错处理
报错
/root/dpvs/src/ipvs/ip_vs_synproxy.c: In function ‘cookie_hash’:
/root/dpvs/src/ipvs/ip_vs_synproxy.c:216:5: error: ‘MD5’ is deprecated: Since OpenSSL 3.0 [-Werror=deprecated-declarations]216 | MD5((unsigned char *)data, sizeof(data), hash);| ^~~
libssl3.0对 MD5有一个废弃告警,这里会把告警变成报错。
src/Makefile中,去掉-Werror
50 #CFLAGS += -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -mcmodel=medium51 CFLAGS += -Wall -Wstrict-prototypes -Wmissing-prototypes -mcmodel=medium52
报错
lldp.c: In function ‘lldp_do_cmd’:
lldp.c:101:27: error: format not a string literal and no format arguments [-Werror=format-security]101 | printf(message->message);
tools/dpip/lldp.c中修改101行
//printf(message->message);
printf("%s", message->message);
运行DPVS
加载驱动
insmod ./dpdk-stable-20.11.10/dpdkbuild/kernel/linux/kni/rte_kni.ko
modprobe uio_pci_generic
修改网卡驱动
root@ubuntu22:~# lspci | grep Eth
03:00.0 Ethernet controller: Intel Corporation 82574L Gigabit Network Connection
0b:00.0 Ethernet controller: VMware VMXNET3 Ethernet Controller (rev 01)
13:00.0 Ethernet controller: VMware VMXNET3 Ethernet Controller (rev 01)dpdk-devbind.py -u 0000:0b:00.0
dpdk-devbind.py -b uio_pci_generic 0000:0b:00.0
修改配置文件
cp conf/dpvs.conf.single-nic.sample /etc/dpvs.confcat /etc/dpvs.confnetif_defs {<init> pktpool_size 524287<init> pktpool_cache 256<init> device dpdk0 {rx {queue_number 1 # 虚拟机网卡,改为1个RX队列descriptor_number 1024rss all}tx {queue_number 1 # 虚拟机网卡,改为1个TX队列descriptor_number 1024}! mtu 1500! promisc_mode! allmulticastkni_name dpdk0.kni}
}对应的worker写改为1个rx worker 1个tx worker
worker_defs {<init> worker cpu0 {type mastercpu_id 0}<init> worker cpu1 {type slavecpu_id 1port dpdk0 {rx_queue_ids 0tx_queue_ids 0! isol_rx_cpu_ids 9! isol_rxq_ring_sz 1048576}}<init> worker cpu2 {type slavecpu_id 2port dpdk0 {rx_queue_ids 1tx_queue_ids 1! isol_rx_cpu_ids 10! isol_rxq_ring_sz 1048576}}
}
...sa_pool {pool_hash_size 16flow_enable off # 虚拟机VMXNET3网卡不支持flow, 所以off掉
}
运行报错
dpvs – -a 0000:0b:00.0 -l 0-2 , 0 master 1 ,2 worker
root@ubuntu22:~/dpvs/bin# dpvs -- -a 0000:0b:00.0 -l 0-2
Command 'dpvs' not found, did you mean:command 'pvs' from deb lvm2 (2.03.11-2.1ubuntu4)
Try: apt install <deb name>
root@ubuntu22:~/dpvs/bin# ./dpvs -- -a 0000:0b:00.0 -l 0-2
current thread affinity is set to 3F
EAL: Detected 6 lcore(s)
EAL: Detected 1 NUMA nodes
EAL: Detected static linkage of DPDK
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: Selected IOVA mode 'PA'
EAL: No available hugepages reported in hugepages-1048576kB
EAL: Probing VFIO support...
EAL: Probe PCI driver: net_vmxnet3 (15ad:07b0) device: 0000:0b:00.0 (socket 0)
EAL: No legacy callbacks, legacy socket not created
DPVS: dpvs version: 1.9-8, build on 2025.02.21.01:02:16
DPVS: dpvs-conf-file: /etc/dpvs.conf
DPVS: dpvs-pid-file: /var/run/dpvs.pid
DPVS: dpvs-ipc-file: /var/run/dpvs.ipc
CFG_FILE: Opening configuration file '/etc/dpvs.conf'.
CFG_FILE: log_level = WARNING
NETIF: dpdk0:rx_queue_number = 1
NETIF: worker cpu1:dpdk0 rx_queue_id += 0
NETIF: worker cpu1:dpdk0 tx_queue_id += 0
NETIF: worker cpu2:dpdk0 rx_queue_id += 1
NETIF: worker cpu2:dpdk0 tx_queue_id += 1
NETIF: dpdk0: rte_eth_dev_set_mc_addr_list failed -- Operation not supported,enable all multicast
Segmentation fault (core dumped)
直接段错误,重新以DEBUG模式编译DPDK 和 DPVS ,GDB跟踪
Thread 1 "dpvs" received signal SIGSEGV, Segmentation fault.
0x000055555601d5f4 in vmxnet3_dev_set_rxmode (set=1, feature=8, hw=0x1003ad940) at ../drivers/net/vmxnet3/vmxnet3_ethdev.c:1293
1293 rxConf->rxMode = rxConf->rxMode | feature;
(gdb) bt
#0 0x000055555601d5f4 in vmxnet3_dev_set_rxmode (set=1, feature=8, hw=0x1003ad940) at ../drivers/net/vmxnet3/vmxnet3_ethdev.c:1293
#1 vmxnet3_dev_allmulticast_enable (dev=0x555556b6c980 <rte_eth_devices>) at ../drivers/net/vmxnet3/vmxnet3_ethdev.c:1341
#2 0x000055555626f3e2 in rte_eth_allmulticast_enable (port_id=0) at ../lib/librte_ethdev/rte_ethdev.c:2595
#3 0x0000555555c51033 in dpdk_set_mc_list (dev=0x10af20ec0) at /root/dpvs/src/netif.c:3356
#4 0x0000555555c1bc8c in __netif_set_mc_list (dev=0x10af20ec0) at /root/dpvs/src/netif_addr.c:189
#5 0x0000555555c1bd3b in netif_mc_add (dev=0x10af20ec0, addr=0x5555562d3500 <LLDP_ETHER_ADDR_DST>) at /root/dpvs/src/netif_addr.c:210
#6 0x0000555555be0150 in lldp_ether_addr_filter (add=true) at /root/dpvs/src/lldp.c:1512
#7 0x0000555555be0241 in lldp_xmit_start () at /root/dpvs/src/lldp.c:1530
#8 0x0000555555be2198 in dpvs_lldp_init () at /root/dpvs/src/lldp.c:1857
#9 0x0000555555aa0e8e in inet_init () at /root/dpvs/src/inet.c:103
#10 0x0000555555bef475 in modules_init () at /root/dpvs/src/main.c:138
#11 0x0000555555befe07 in main (argc=5, argv=0x7fffffffe2f0) at /root/dpvs/src/main.c:339
(gdb) f 0
#0 0x000055555601d5f4 in vmxnet3_dev_set_rxmode (set=1, feature=8, hw=0x1003ad940) at ../drivers/net/vmxnet3/vmxnet3_ethdev.c:1293
1293 rxConf->rxMode = rxConf->rxMode | feature;
(gdb) p rxConf
$1 = (struct Vmxnet3_RxFilterConf *) 0x78
(gdb) p hw->shared->devRead
Cannot access memory at address 0x8
(gdb) p hw->shared
$2 = (Vmxnet3_DriverShared *) 0x0
(gdb) p *hw
$3 = {hw_addr0 = 0x1100800000 "", hw_addr1 = 0x1100801000 "", back = 0x0, device_id = 1968, vendor_id = 5549, subsystem_device_id = 0, subsystem_vendor_id = 0, adapter_stopped = false, perm_addr = "\000\f)\264\277<", num_tx_queues = 1 '\001', num_rx_queues = 1 '\001', bufs_per_pkt = 1 '\001', version = 1 '\001', txdata_desc_size = 128, rxdata_desc_size = 0, num_intrs = 0 '\000', tqd_start = 0x0, rqd_start = 0x0, shared = 0x0, sharedPA = 0
参考代码
static int
vmxnet3_dev_allmulticast_enable(struct rte_eth_dev *dev)
{struct vmxnet3_hw *hw = dev->data->dev_private;vmxnet3_dev_set_rxmode(hw, VMXNET3_RXM_ALL_MULTI, 1);return 0;
}/* Updating rxmode through Vmxnet3_DriverShared structure in adapter */
static void
vmxnet3_dev_set_rxmode(struct vmxnet3_hw *hw, uint32_t feature, int set)
{struct Vmxnet3_RxFilterConf *rxConf = &hw->shared->devRead.rxFilterConf;if (set)rxConf->rxMode = rxConf->rxMode | feature;elserxConf->rxMode = rxConf->rxMode & (~feature);VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_CMD, VMXNET3_CMD_UPDATE_RX_MODE);
}
hw下shared为0 ,rxConf则更是一个野指针,导致coredump.
猜测当前VMware虚拟机的vmxnet3网卡或驱动的问题
物理机测试
将上述编译安装流程都走一遍,配置文件不变, 运行成功
root@r750-132:~/dpvs/bin# ./dpvs -- -a 98:00.0 -l 0-9
current thread affinity is set to FFFFFFFF
EAL: Detected 32 lcore(s)
EAL: Detected 2 NUMA nodes
EAL: Detected static linkage of DPDK
EAL: Multi-process socket /var/run/dpdk/rte/mp_socket
EAL: Selected IOVA mode 'PA'
EAL: No available hugepages reported in hugepages-1048576kB
EAL: Probing VFIO support...
EAL: VFIO support initialized
EAL: Probe PCI driver: mlx5_pci (15b3:1017) device: 0000:98:00.0 (socket 1)
EAL: No legacy callbacks, legacy socket not created
DPVS: dpvs version: 1.9-8, build on 2025.02.20.15:37:58
DPVS: dpvs-conf-file: /etc/dpvs.conf
DPVS: dpvs-pid-file: /var/run/dpvs.pid
DPVS: dpvs-ipc-file: /var/run/dpvs.ipc
CFG_FILE: Opening configuration file '/etc/dpvs.conf'.
CFG_FILE: log_level = WARNING
NETIF: dpdk0:rx_queue_number = 8
NETIF: worker cpu1:dpdk0 rx_queue_id += 0
NETIF: worker cpu1:dpdk0 tx_queue_id += 0
NETIF: worker cpu2:dpdk0 rx_queue_id += 1
NETIF: worker cpu2:dpdk0 tx_queue_id += 1
NETIF: worker cpu3:dpdk0 rx_queue_id += 2
NETIF: worker cpu3:dpdk0 tx_queue_id += 2
NETIF: worker cpu4:dpdk0 rx_queue_id += 3
NETIF: worker cpu4:dpdk0 tx_queue_id += 3
NETIF: worker cpu5:dpdk0 rx_queue_id += 4
NETIF: worker cpu5:dpdk0 tx_queue_id += 4
NETIF: worker cpu6:dpdk0 rx_queue_id += 5
NETIF: worker cpu6:dpdk0 tx_queue_id += 5
NETIF: worker cpu7:dpdk0 rx_queue_id += 6
NETIF: worker cpu7:dpdk0 tx_queue_id += 6
NETIF: worker cpu8:dpdk0 rx_queue_id += 7
NETIF: worker cpu8:dpdk0 tx_queue_id += 7
SAPOOL: sapool_filter_enable = on
IPVS: dp_vs_conn_init: lcore 9: nothing to do.
NETIF: Ethdev port_id=0 invalid tx_offload: 0x1000e, valid value: 0xc96af
配置接口/查看接口
root@r750-132:~/dpvs/bin# ./dpip link show
1: dpdk0: socket 1 mtu 1500 rx-queue 8 tx-queue 8UP 100000 Mbps full-duplex auto-nego lldp addr E8:EB:D3:A3:83:76 OF_RX_IP_CSUM OF_TX_IP_CSUM OF_TX_TCP_CSUM OF_TX_UDP_CSUM
root@r750-132:~/dpvs/bin# ./dpip addr show
inet 10.1.1.132/24 scope global dpdk0valid_lft forever preferred_lft forever
inet6 fe80::eaeb:d3ff:fea3:8376/64 scope link dpdk0valid_lft forever preferred_lft forever
相关文章:
DPVS-1:编译安装DPVS (ubuntu22.04)
操作系统 rootubuntu22:~# lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 22.04.3 LTS Release: 22.04 Codename: jammy rootubuntu22:~# 前置软件准备 apt install git apt install meson apt install gcc ap…...
即将发布书籍 - Yocto项目实战教程:高效定制嵌入式Linux系统
以下这本书《Yocto项目实战教程:高效定制嵌入式Linux系统》即将发布,现在请哪位大佬出山写一个序或者推荐,有兴趣的大佬,请联系我! Git仓库地址: https://github.com/jerrysundev/Yocto-Project-Book.git …...
Git 常用指令及其说明
配置相关 # 配置全局用户名 git config --global user.name "YourUsername"# 配置全局邮箱 git config --global user.email "your.emailexample.com"说明:这两条命令用于设置 Git 全局的用户名和邮箱,在提交代码时,这些…...
nginx代理后502
直接访问 https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions正常 使用nginx代理后访问出现502 server {listen 9999;server_name 172.21.3.78;location ^~ /compatible-mode {proxy_pass https://dashscope.aliyuncs.com;}location / {proxy_pass…...
大模型WebUI:Gradio全解12——LangChain原理及其agent构建Gradio(1)
大模型WebUI:Gradio全解12——LangChain原理及其agent构建Gradio(1) 前言本篇摘要12. LangChain原理及其agent构建Gradio12.1 LangChain概念及优势分析12.1.1 概念12.1.2 标准化组件接口1. 示例:聊天模型2. 示例:检索器12.1.3 编排组件12.1.4 便于部署12.1.5 可观测性和评…...
【Unity】鱼群效果模拟
鱼群效果模拟 文章目录 鱼群效果模拟Boid算法实现方式version1_CPUversion2_GPUversion3_Multilaterationversion4_Bitonic_Sorting (GPU友好)version5_Skinning (TODO) 细节项优化项参考链接 Boid算法 Boid算法是一种模拟群体行…...
PHP入门基础学习五(函数1)
函数 一、概念 1、什么是函数? 函数:封装一段用于完成特定功能的代码 当使用一个函数时,只需关心函数的参数和返回值,就可以完成一个特定的功能 2、php中的函数 PHP 的真正威力源自于它的函数,PHP 中提供了超过 1000 个内建的函数。 php函数分为: 系统内部函数和自…...
微信小程序 - 页面跳转(wx.navigateTo、wx.redirectTo、wx.switchTab、wx.reLaunch)
API 跳转 1、wx.navigateTo (1)基本介绍 功能:保留当前页面,跳转到应用内的某个页面,使用该方法跳转后可以通过返回按钮返回到原页面 使用场景:适用于需要保留当前页面状态,后续还需返回的情…...
Typora的Github主题美化
[!note] Typora的Github主题进行一些自己喜欢的修改,主要包括:字体、代码块、表格样式 美化前: 美化后: 一、字体更换 之前便看上了「中文网字计划」的「朱雀仿宋」字体,于是一直想更换字体,奈何自己拖延症…...
2.3 变量
版权声明:本文为博主原创文章,转载请在显著位置标明本文出处以及作者网名,未经作者允许不得用于商业目的。 变量是用来存放某个值的数据,它可以表示一个数字、一个字符串、一个结构、一个类等。变量包含名称、类型和值。在代码中…...
Docker:Docker从入门到精通(一)- Docker简介
一、前言 通过本专栏的学习,我们将了解 1. 掌握Docker基础知识,能够理解Docker镜像与容器的概念 2. 完成Docker安装与启动 3. 掌握Docker镜像与容器相关命令 4. 掌握Tomcat Nginx 等软件的常用应用的安装 5. 掌握docker迁移与备份相…...
【复习】Redis
数据结构 Redis常见的数据结构 String:缓存对象Hash:缓存对象、购物车List:消息队列Set:点赞、共同关注ZSet:排序 Zset底层? Zset底层的数据结构是由压缩链表或跳表实现的 如果有序集合的元素 < 12…...
在Spring Boot+Vue前后端分离的项目中使用JWT实现基本的权限校验
说明 在 Spring Boot + Vue 前后端分离的项目中,如果不使用第三方服务(如 Spring Security、Shiro 等),可以通过自定义实现基本的权限校验。 使用JWT实现步骤 以下是实现步骤: 1. 设计权限模型 通常权限模型包括: 用户(User):系统的使用者。角色(Role):用户的权…...
蓝桥杯单片机组第十二届省赛第二批次
前言 第十二届省赛涉及知识点:NE555频率数据读取,NE555频率转换周期,PCF8591同时测量光敏电阻和电位器的电压、按键长短按判断。 本试题涉及模块较少,题目不难,基本上准备充分的都能完整的实现每一个功能,并…...
伪404兼容huawei生效显示404
根据上述思考,以下是详细的中文分步说明: --- **步骤 1:获取目标设备的User-Agent信息** 首先,我们需要收集目标设备的User-Agent字符串,包括: 1. **iPhone设备的User-Agent**: Mozi…...
UIAutomation开发常用方法的参考文档
简介 由于UIAutomation的官方文档只有一个github中的readme文件,只是简单的使用示例,具体使用还需要在代码中查找,非常不方便。经过我多年使用UIAutomation开发的经验和整理,把常用的功能梳理成本文档,作为我的开发参考使用,这样就不用每次都翻代码了,同时也可以使用AI…...
数据库面试题(基础常考!!!)
在数据库领域,无论是日常开发还是面试场景,都有一些高频且重要的问题需要我们深入理解和掌握。本文将对这些常见面试题进行详细阐述,帮助大家更好地应对面试和实际工作中的挑战。 面试题一:三范式详解 什么是三范式 三范式是关…...
ASP.NET Core Clean Architecture
文章目录 项目地址一、项目主体1. CQRS1.1 Repository数据库接口1.2 GetEventDetail 完整的Query流程1.3 创建CreateEventCommand并使用validation 2. EFcore层2.1 BaseRepository2.2 CategoryRepository2.3 OrderRepository 3. Email/Excel导出3.1 Email1. IEmail接口层2. Ema…...
蓝桥杯备赛-精卫填海-DP
精卫终于快把东海填平了!只剩下了最后的一小片区域了。同时,西山上的木石也已经不多了。精卫能把东海填平吗? 事实上,东海未填平的区域还需要至少体积为 v 的木石才可以填平,而西山上的木石还剩下 n 块,每块…...
Windows10配置C++版本的Kafka,并进行发布和订阅测试
配置的环境为:Release x64下的环境 完整项目:https://gitee.com/jiajingong/kafka-publisher 1、首先下载相应的库文件(.lib,.dll) 参考链接: GitHub - eStreamSoftware/delphi-kafka GitHub - cloade…...
挑战杯推荐项目
“人工智能”创意赛 - 智能艺术创作助手:借助大模型技术,开发能根据用户输入的主题、风格等要求,生成绘画、音乐、文学作品等多种形式艺术创作灵感或初稿的应用,帮助艺术家和创意爱好者激发创意、提高创作效率。 - 个性化梦境…...
树莓派超全系列教程文档--(62)使用rpicam-app通过网络流式传输视频
使用rpicam-app通过网络流式传输视频 使用 rpicam-app 通过网络流式传输视频UDPTCPRTSPlibavGStreamerRTPlibcamerasrc GStreamer 元素 文章来源: http://raspberry.dns8844.cn/documentation 原文网址 使用 rpicam-app 通过网络流式传输视频 本节介绍来自 rpica…...
【SpringBoot】100、SpringBoot中使用自定义注解+AOP实现参数自动解密
在实际项目中,用户注册、登录、修改密码等操作,都涉及到参数传输安全问题。所以我们需要在前端对账户、密码等敏感信息加密传输,在后端接收到数据后能自动解密。 1、引入依赖 <dependency><groupId>org.springframework.boot</groupId><artifactId...
Opencv中的addweighted函数
一.addweighted函数作用 addweighted()是OpenCV库中用于图像处理的函数,主要功能是将两个输入图像(尺寸和类型相同)按照指定的权重进行加权叠加(图像融合),并添加一个标量值&#x…...
【单片机期末】单片机系统设计
主要内容:系统状态机,系统时基,系统需求分析,系统构建,系统状态流图 一、题目要求 二、绘制系统状态流图 题目:根据上述描述绘制系统状态流图,注明状态转移条件及方向。 三、利用定时器产生时…...
使用 Streamlit 构建支持主流大模型与 Ollama 的轻量级统一平台
🎯 使用 Streamlit 构建支持主流大模型与 Ollama 的轻量级统一平台 📌 项目背景 随着大语言模型(LLM)的广泛应用,开发者常面临多个挑战: 各大模型(OpenAI、Claude、Gemini、Ollama)接口风格不统一;缺乏一个统一平台进行模型调用与测试;本地模型 Ollama 的集成与前…...
嵌入式学习笔记DAY33(网络编程——TCP)
一、网络架构 C/S (client/server 客户端/服务器):由客户端和服务器端两个部分组成。客户端通常是用户使用的应用程序,负责提供用户界面和交互逻辑 ,接收用户输入,向服务器发送请求,并展示服务…...
【电力电子】基于STM32F103C8T6单片机双极性SPWM逆变(硬件篇)
本项目是基于 STM32F103C8T6 微控制器的 SPWM(正弦脉宽调制)电源模块,能够生成可调频率和幅值的正弦波交流电源输出。该项目适用于逆变器、UPS电源、变频器等应用场景。 供电电源 输入电压采集 上图为本设计的电源电路,图中 D1 为二极管, 其目的是防止正负极电源反接, …...
CSS | transition 和 transform的用处和区别
省流总结: transform用于变换/变形,transition是动画控制器 transform 用来对元素进行变形,常见的操作如下,它是立即生效的样式变形属性。 旋转 rotate(角度deg)、平移 translateX(像素px)、缩放 scale(倍数)、倾斜 skewX(角度…...
BLEU评分:机器翻译质量评估的黄金标准
BLEU评分:机器翻译质量评估的黄金标准 1. 引言 在自然语言处理(NLP)领域,衡量一个机器翻译模型的性能至关重要。BLEU (Bilingual Evaluation Understudy) 作为一种自动化评估指标,自2002年由IBM的Kishore Papineni等人提出以来,…...
