字符串压缩(一)之ZSTD

news2025/1/18 16:56:17

一、zstd压缩与解压

  ZSTD_compress属于ZSTD的Simple API范畴,只有压缩级别可以设置。

  ZSTD_compress函数原型如下:

  size_t ZSTD_compress(void* dst, size_t dstCapacity, const void* src, size_t srcSize, int compressionLevel)

  ZSTD_decompress函数原型如下:
  size_t ZSTD_decompress( void* dst, size_t dstCapacity, const void* src, size_t compressedSize);

  我们先来看看zstd的压缩与解压缩示例。

 1 #include <stdio.h>
 2 #include <string.h>
 3 #include <sys/time.h>
 4 #include <malloc.h>
 5 #include <zstd.h>
 6 #include <iostream>
 7 
 8 using namespace std;
 9 
10 int main()
11 {
12     // compress
13     size_t com_space_size;
14     size_t peppa_pig_text_size;
15 
16     char *com_ptr = NULL;
17     char peppa_pig_buf[2048] = "Narrator: It is raining today. So, Peppa and George cannot play outside.Peppa: Daddy, it's stopped raining. Can we go out to play?Daddy: Alright, run along you two.Narrator: Peppa loves jumping in muddy puddles.Peppa: I love muddy puddles.Mummy: Peppa. If you jumping in muddy puddles, you must wear your boots.Peppa: Sorry, Mummy.Narrator: George likes to jump in muddy puddles, too.Peppa: George. If you jump in muddy puddles, you must wear your boots.Narrator: Peppa likes to look after her little brother, George.Peppa: George, let's find some more pud dles.Narrator: Peppa and George are having a lot of fun. Peppa has found a lttle puddle. George hasfound a big puddle.Peppa: Look, George. There's a really big puddle.Narrator: George wants to jump into the big puddle first.Peppa: Stop, George. | must check if it's safe for you. Good. It is safe for you. Sorry, George. It'sonly mud.Narrator: Peppa and George love jumping in muddy puddles.Peppa: Come on, George. Let's go and show Daddy.Daddy: Goodness me.Peppa: Daddy. Daddy. Guess what we' ve been doing.Daddy: Let me think... Have you been wa tching television?Peppa: No. No. Daddy.Daddy: Have you just had a bath?Peppa: No. No.Daddy: | know. You've been jumping in muddy puddles.Peppa: Yes. Yes. Daddy. We've been jumping in muddy puddles.Daddy: Ho. Ho. And look at the mess you're in.Peppa: Oooh....Daddy: Oh, well, it's only mud. Let's clean up quickly before Mummy sees the mess.Peppa: Daddy, when we've cleaned up, will you and Mummy Come and play, too?Daddy: Yes, we can all play in the garden.Narrator: Peppa and George are wearing their boots. Mummy and Daddy are wearing their boots.Peppa loves jumping up and down in muddy puddles. Everyone loves jumping up and down inmuddy puddles.Mummy: Oh, Daddy pig, look at the mess you're in. .Peppa: It's only mud.";
18     
19     peppa_pig_text_size = strlen(peppa_pig_buf);
20     com_space_size= ZSTD_compressBound(peppa_pig_text_size);
21     com_ptr = (char *)malloc(com_space_size);
22     if(NULL == com_ptr) {
23         cout << "compress malloc failed" << endl;
24         return -1;
25     }
26 
27     size_t com_size;
28     com_size = ZSTD_compress(com_ptr, com_space_size, peppa_pig_buf, peppa_pig_text_size, ZSTD_fast);
29     cout << "peppa pig text size:" << peppa_pig_text_size << endl;
30     cout << "compress text size:" << com_size << endl;
31     cout << "compress ratio:" << (float)peppa_pig_text_size / (float)com_size << endl << endl;
32 
33 
34     // decompress
35     char* decom_ptr = NULL;
36     unsigned long long decom_buf_size;
37     decom_buf_size = ZSTD_getFrameContentSize(com_ptr, com_size);
38     
39     decom_ptr = (char *)malloc((size_t)decom_buf_size);
40     if(NULL == decom_ptr) {
41         cout << "decompress malloc failed" << endl;
42         return -1;
43     }
44 
45     size_t decom_size;
46     decom_size = ZSTD_decompress(decom_ptr, decom_buf_size, com_ptr, com_size);
47     cout << "decompress text size:" << decom_size << endl;
48 
49     if(strncmp(peppa_pig_buf, decom_ptr, peppa_pig_text_size)) {
50         cout << "decompress text is not equal peppa pig text" << endl;
51     }
52     
53     free(com_ptr);
54     free(decom_ptr);
55     return 0;
56 }

执行结果:

  从结果可以发现,压缩之前的peppa pig文本长度为1827,压缩后的文本长度为759,压缩率为2.4,解压后的长度与压缩前相等。

  另外,上文提到可以调整ZSTD_compress函数的压缩级别,zstd的默认级别为ZSTD_CLEVEL_DEFAULT = 3,最小值为0,最大值为ZSTD_MAX_CLEVEL = 22。另外也提供一些策略设置,例如 ZSTD_fast, ZSTD_greedy, ZSTD_lazy, ZSTD_lazy2, ZSTD_btlazy2。压缩级别越高,压缩率越高,但是压缩速率越低。

二、ZSTD压缩与解压性能探索

  上面探索了zstd的基础压缩与解压方法,接下来再摸索一下zstd的压缩与解压缩性能。

  测试方法是,使用ZSTD_compress连续压缩同一段文本并持续10秒,最后得到每一秒的平均压缩速率。测试压缩性能的代码示例如下:

 1 #include <stdio.h>
 2 #include <string.h>
 3 #include <sys/time.h>
 4 #include <malloc.h>
 5 #include <zstd.h>
 6 #include <iostream>
 7 
 8 using namespace std;
 9 
10 int main()
11 {
12     int cnt = 0;
13 
14     size_t com_size;
15     size_t com_space_size;
16     size_t peppa_pig_text_size;
17     
18     char *com_ptr = NULL;
19     char peppa_pig_buf[2048] = "Narrator: It is raining today. So, Peppa and George cannot play outside.Peppa: Daddy, it's stopped raining. Can we go out to play?Daddy: Alright, run along you two.Narrator: Peppa loves jumping in muddy puddles.Peppa: I love muddy puddles.Mummy: Peppa. If you jumping in muddy puddles, you must wear your boots.Peppa: Sorry, Mummy.Narrator: George likes to jump in muddy puddles, too.Peppa: George. If you jump in muddy puddles, you must wear your boots.Narrator: Peppa likes to look after her little brother, George.Peppa: George, let's find some more pud dles.Narrator: Peppa and George are having a lot of fun. Peppa has found a lttle puddle. George hasfound a big puddle.Peppa: Look, George. There's a really big puddle.Narrator: George wants to jump into the big puddle first.Peppa: Stop, George. | must check if it's safe for you. Good. It is safe for you. Sorry, George. It'sonly mud.Narrator: Peppa and George love jumping in muddy puddles.Peppa: Come on, George. Let's go and show Daddy.Daddy: Goodness me.Peppa: Daddy. Daddy. Guess what we' ve been doing.Daddy: Let me think... Have you been wa tching television?Peppa: No. No. Daddy.Daddy: Have you just had a bath?Peppa: No. No.Daddy: | know. You've been jumping in muddy puddles.Peppa: Yes. Yes. Daddy. We've been jumping in muddy puddles.Daddy: Ho. Ho. And look at the mess you're in.Peppa: Oooh....Daddy: Oh, well, it's only mud. Let's clean up quickly before Mummy sees the mess.Peppa: Daddy, when we've cleaned up, will you and Mummy Come and play, too?Daddy: Yes, we can all play in the garden.Narrator: Peppa and George are wearing their boots. Mummy and Daddy are wearing their boots.Peppa loves jumping up and down in muddy puddles. Everyone loves jumping up and down inmuddy puddles.Mummy: Oh, Daddy pig, look at the mess you're in. .Peppa: It's only mud.";
20 
21     timeval st, et;
22 
23     peppa_pig_text_size = strlen(peppa_pig_buf);
24     com_space_size= ZSTD_compressBound(peppa_pig_text_size);
25 
26     gettimeofday(&st, NULL);
27     while(1) {
28         
29         com_ptr = (char *)malloc(com_space_size);
30         com_size = ZSTD_compress(com_ptr, com_space_size, peppa_pig_buf, peppa_pig_text_size, ZSTD_fast);
31         
32         free(com_ptr);
33         cnt++;
34         
35         gettimeofday(&et, NULL);
36         if(et.tv_sec - st.tv_sec >= 10) {
37             break;
38         }
39     }
40 
41     cout << "compress per second:" << cnt/10 << " times" << endl;
42     return 0;
43 }

执行结果:

  结果显示ZSTD的压缩性能大概在每秒6-7万次左右,这个结果其实并不是太理想。需要说明的是压缩性能与待压缩文本的长度、字符内容也是有关系的。

  我们再来探索一下ZSTD的解压缩性能。与上面的测试方法类似,先对本文进行压缩,然后连续解压同一段被压缩过的数据并持续10秒,最后得到每一秒的平均解压速率。测试解压性能的代码示例如下:

 1 #include <stdio.h>
 2 #include <string.h>
 3 #include <sys/time.h>
 4 #include <malloc.h>
 5 #include <zstd.h>
 6 #include <iostream>
 7 
 8 using namespace std;
 9 
10 int main()
11 {
12     int cnt = 0;
13 
14     size_t com_size;
15     size_t com_space_size;
16     size_t peppa_pig_text_size;
17 
18     timeval st, et;
19     
20     char *com_ptr = NULL;
21     char peppa_pig_buf[2048] = "Narrator: It is raining today. So, Peppa and George cannot play outside.Peppa: Daddy, it's stopped raining. Can we go out to play?Daddy: Alright, run along you two.Narrator: Peppa loves jumping in muddy puddles.Peppa: I love muddy puddles.Mummy: Peppa. If you jumping in muddy puddles, you must wear your boots.Peppa: Sorry, Mummy.Narrator: George likes to jump in muddy puddles, too.Peppa: George. If you jump in muddy puddles, you must wear your boots.Narrator: Peppa likes to look after her little brother, George.Peppa: George, let's find some more pud dles.Narrator: Peppa and George are having a lot of fun. Peppa has found a lttle puddle. George hasfound a big puddle.Peppa: Look, George. There's a really big puddle.Narrator: George wants to jump into the big puddle first.Peppa: Stop, George. | must check if it's safe for you. Good. It is safe for you. Sorry, George. It'sonly mud.Narrator: Peppa and George love jumping in muddy puddles.Peppa: Come on, George. Let's go and show Daddy.Daddy: Goodness me.Peppa: Daddy. Daddy. Guess what we' ve been doing.Daddy: Let me think... Have you been wa tching television?Peppa: No. No. Daddy.Daddy: Have you just had a bath?Peppa: No. No.Daddy: | know. You've been jumping in muddy puddles.Peppa: Yes. Yes. Daddy. We've been jumping in muddy puddles.Daddy: Ho. Ho. And look at the mess you're in.Peppa: Oooh....Daddy: Oh, well, it's only mud. Let's clean up quickly before Mummy sees the mess.Peppa: Daddy, when we've cleaned up, will you and Mummy Come and play, too?Daddy: Yes, we can all play in the garden.Narrator: Peppa and George are wearing their boots. Mummy and Daddy are wearing their boots.Peppa loves jumping up and down in muddy puddles. Everyone loves jumping up and down inmuddy puddles.Mummy: Oh, Daddy pig, look at the mess you're in. .Peppa: It's only mud.";
22 
23     size_t decom_size;
24     char* decom_ptr = NULL;
25     unsigned long long decom_buf_size;
26 
27     peppa_pig_text_size = strlen(peppa_pig_buf);
28     com_space_size= ZSTD_compressBound(peppa_pig_text_size);
29     com_ptr = (char *)malloc(com_space_size);
30     
31     com_size = ZSTD_compress(com_ptr, com_space_size, peppa_pig_buf, peppa_pig_text_size, 1);
32 
33     gettimeofday(&st, NULL);
34     decom_buf_size = ZSTD_getFrameContentSize(com_ptr, com_size);
35     
36     while(1) {
37     
38         decom_ptr = (char *)malloc((size_t)decom_buf_size);
39         
40         decom_size = ZSTD_decompress(decom_ptr, decom_buf_size, com_ptr, com_size);
41         if(decom_size != peppa_pig_text_size) {
42         
43             cout << "decompress error" << endl;
44             break;
45         }
46         
47         free(decom_ptr);
48         
49         cnt++;
50         gettimeofday(&et, NULL);
51         if(et.tv_sec - st.tv_sec >= 10) {
52             break;
53         }
54     }
55 
56     cout << "decompress per second:" << cnt/10 << " times" << endl;
57     
58     free(com_ptr);
59     return 0;
60 }

执行结果:

   结果显示ZSTD的解压缩性能大概在每秒12万次左右,解压性能比压缩性能高。

三、zstd的高级用法

  zstd提供了一个名为PZSTD的压缩和解压工具。PZSTD(parallel zstd),并行压缩的zstd,是一个使用多线程对待压缩文本进行切片分段,且进行并行压缩的命令行工具。

  其实高版本(v1.4.0及以上)的zstd也提供了指定多线程对文本进行并行压缩的相关API接口,也就是本小节要介绍的zstd高级API用法。下面我们再来探索一下zstd的多线程压缩使用方法。

  多线程并行压缩的两个关键API,一个是参数设置API,另一个是压缩API。

  参数设置API的原型是:

  size_t ZSTD_CCtx_setParameter(ZSTD_CCtx* cctx, ZSTD_cParameter param, int value)

  压缩API的原型是:

  size_t ZSTD_compress2(ZSTD_CCtx* cctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize)

  下面给出zstd并行压缩的示例demo,通过ZSTD_CCtx_setParameter设置线程数为3,即指定宏ZSTD_c_nbWorkers为3,通过ZSTD_compress2压缩相关文本。另外,为了展示zstd确实使用了多线程,需要先读取一个非常大的文件,作为zstd的压缩文本源,尽量使zstd运行较长时间。

 1 #include <stdio.h>
 2 #include <string.h>
 3 #include <sys/time.h>
 4 #include <malloc.h>
 5 #include <zstd.h>
 6 #include <iostream>
 7 
 8 using namespace std;
 9 
10 int main()
11 {
12     size_t com_size;
13     size_t com_space_size;
14 
15     FILE *fp = NULL;
16     unsigned int file_len;
17     
18     char *com_ptr = NULL;
19     char *file_text_ptr = NULL;
20 
21     fp = fopen("xxxxxx", "r");
22     if(NULL == fp){
23          cout << "file open failed" << endl;
24          return -1;
25     }
26 
27     fseek(fp, 0, SEEK_END);
28     file_len = ftell(fp);
29     fseek(fp, 0, SEEK_SET);
30     cout << "file length:" << file_len << endl;
31 
32     // malloc space for file content
33     file_text_ptr = (char *)malloc(file_len);
34     if(NULL == file_text_ptr) {
35         cout << "malloc failed" << endl;
36         return -1;
37     }
38 
39     // malloc space for compress space
40     com_space_size = ZSTD_compressBound(file_len);
41     com_ptr = (char *)malloc(com_space_size);
42     if(NULL == com_ptr) {
43         cout << "malloc failed" << endl;
44         return -1;
45     }
46 
47     // read text from source file
48     fread(file_text_ptr, 1, file_len, fp);
49     fclose(fp);
50 
51     ZSTD_CCtx* cctx;
52     cctx = ZSTD_createCCtx();
53 
54     // set multi-thread parameter
55     ZSTD_CCtx_setParameter(cctx, ZSTD_c_nbWorkers, 3);
56     ZSTD_CCtx_setParameter(cctx, ZSTD_c_compressionLevel, ZSTD_btlazy2);
57 
58     com_size = ZSTD_compress2(cctx, com_ptr, com_space_size, file_text_ptr, file_len);
59     
60     free(com_ptr);
61     free(file_text_ptr);
62     return 0;
63 }

  运行上述demo,可见zstd确实启动了3个线程对文本进行了并行压缩。且设置的线程数越多,压缩时间越短,这里就不详细展示了,读者可以自行实验。

  需要说明的是,zstd当前默认编译单线程的库文件,要实现多线程的API调用,需要在make的时候指定编译参数ZSTD_MULTITHREAD。

  

  另外,zstd还支持线程池的方式,线程池的函数原型:

  POOL_ctx* ZSTD_createThreadPool(size_t numThreads)

  线程池可以避免在多次、连续压缩场景时频繁的去创建线程、撤销线程产生的非必要开销,使得算力主要开销在文本压缩方面。

四、总结

   本篇分享了zstd压缩与解压缩使用的基本方法,对压缩与解压的性能进行了摸底,最后探索了zstd多线程压缩的使用方法。

  从压缩测试来看,zstd的压缩比其实已经比较好了,比原文所占用空间缩小了一半以上,当然压缩比也跟待压缩文本的内容有关。

  从性能执行结果来看,zstd的压缩与解压性能表现比较勉强,我认为zstd在鱼(性能)和熊掌(压缩比)之间更偏向熊掌一些,不过对一些性能要求不太高的,但是要高压缩比的场景是比较符合的。

  多线程并行压缩,在有大文本需要连续多次压缩的场景下,结合线程池可以很好的提升压缩速率。

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

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

相关文章

Mysql replace into

CREATE TABLE t (id int(11) NOT NULL AUTO_INCREMENT,age int(11) DEFAULT NULL,msg varchar(10) DEFAULT NULL,PRIMARY KEY (id),UNIQUE KEY uniq_age (age) ) ENGINEInnoDB DEFAULT CHARSETutf8;insert into t (age, msg) values (1,aaa),(2,bbb),(3,ccc);id 为自增主键、ag…

「重学JS」你真的懂数据类型吗?

前言 学习了这么久前端&#xff0c;发现自己对于基础知识的掌握并没有那么通透&#xff0c;于是打算重新学一遍JS&#xff0c;引用经济学的一句话&#xff1a;JS基础决定能力高度&#x1f926;&#x1f3fb; 基础很重要&#xff0c;只有基础好才会很少出 bug&#xff0c;大多数…

aws cloudformation 理解常见资源的部署和使用

参考 cfn101-workshopaws cli cloudformation cloudformation是aws的iac工具&#xff0c;以下简称cfn 环境搭建——cfn命令行工具 创建堆栈 aws cloudformation create-stack --stack-name testtemp \--template-body file://testtemp.yaml# --parameters ParameterKeyKey…

二叉树的循环问题

目录 一、二叉树的完全性检验 二、前序遍历的非递归写法 三、中序遍历的非递归写法 四、后序遍历的非递归写法 一、二叉树的完全性检验 给定一个二叉树的 root &#xff0c;确定它是否是一个 完全二叉树 。 在一个 完全二叉树 中&#xff0c;除了最后一个关卡外&#xff0c…

Vue脚手架

脚手架 安装步骤 全局安装vue/cli npm install -g vue/cli 安装之后使用不了vue的命令&#xff0c;查看nodejs文件发现我把vue装在了node_globalnpm这个文件夹中。 解决方法&#xff1a;新增一条path指向该文件夹 切换到你要创建的目录创建脚手架 vue create 项目名称 根据…

[附源码]Python计算机毕业设计Django保护濒危动物公益网站

项目运行 环境配置&#xff1a; Pychram社区版 python3.7.7 Mysql5.7 HBuilderXlist pipNavicat11Djangonodejs。 项目技术&#xff1a; django python Vue 等等组成&#xff0c;B/S模式 pychram管理等等。 环境需要 1.运行环境&#xff1a;最好是python3.7.7&#xff0c;…

【Hack The Box】linux练习-- Talkative

HTB 学习笔记 【Hack The Box】linux练习-- Talkative &#x1f525;系列专栏&#xff1a;Hack The Box &#x1f389;欢迎关注&#x1f50e;点赞&#x1f44d;收藏⭐️留言&#x1f4dd; &#x1f4c6;首发时间&#xff1a;&#x1f334;2022年11月27日&#x1f334; &#x…

初始数据结构

目录 1. 集合的框架 集合框架的重要性 数据结构的介绍 算法的介绍 容器背后对应的数据结构 2. 时间复杂度和空间复杂度 算法效率 时间复杂度 时间复杂度的概念 大O的渐进表示法 常见的时间复杂度的计算 空间复杂度 空间复杂度的概念 从本章开始又要开始新的篇章&a…

[附源码]Python计算机毕业设计Django班级事务管理论文2022

项目运行 环境配置&#xff1a; Pychram社区版 python3.7.7 Mysql5.7 HBuilderXlist pipNavicat11Djangonodejs。 项目技术&#xff1a; django python Vue 等等组成&#xff0c;B/S模式 pychram管理等等。 环境需要 1.运行环境&#xff1a;最好是python3.7.7&#xff0c;…

k8s上部署Harbor通过Nginx-Ingress域名访问

目录 1、k8s集群环境&#xff0c;通过kubesphere安装部署。 1.1 集群基本信息 1.2 集群节点信息 2、安装Harbor 2.1、使用Helm添加Harbor仓库 2.2 、通过openssl生成证书 2.3、 创建secret 2.4、 创建nfs存储目录 2.5、 创建pv 2.6、创建pvc 2.7、values.yaml配置文件 2.…

3-UI自动化-八大元素定位,xpath定位方式和相关的常问面试题

3-UI自动化-八大元素定位&#xff0c;xpath定位方式和相关的常问面试题八大元素定位八大元素定位的使用通过xpath定位xpath语法1. xpath逻辑运算定位2. 层级条件定位3. 索引定位4. 文本定位text()WebElement对象WebElement对象常用属性WebElement对象常用方法find_element()和 …

【Mybatis编程:插入和根据id删除相册数据】

目录 1. Mybatis编程&#xff1a;插入相册数据 2. Mybatis编程&#xff1a;根据id删除相册数据 1. Mybatis编程&#xff1a;插入相册数据 当某个数据表中的id被设计为“自动编号”的&#xff08;auto_increment&#xff09;&#xff0c;在配置<insert>标签时&#xff0…

开心公寓房屋出租管理系统的设计与实现(系统源码+技术文档+论文)

项目描述 临近学期结束&#xff0c;还是毕业设计&#xff0c;你还在做java程序网络编程&#xff0c;期末作业&#xff0c;老师的作业要求觉得大了吗?不知道毕业设计该怎么办?网页功能的数量是否太多?没有合适的类型或系统?等等。这里根据疫情当下&#xff0c;你想解决的问…

基于51单片机病房呼叫系统(64位病床)

资料编号&#xff1a;189 下面是仿真演示&#xff1a; 189-基于51单片机病房呼叫系统&#xff08;64位病床&#xff09;&#xff08;仿真源程序原理图全套资料&#xff09;功能介绍&#xff1a; 设计一个可容64张床位的比那个房呼叫系统。 1、每个床位都有一个按钮&#xf…

InnoDB存储引擎简介

InnoDB存储引擎是一种兼顾高可靠性和高性能的通用存储引擎&#xff0c;在MySQL5.5之后&#xff0c;被选为MySQL的默认存储引擎 InnoDB的特点 1 DML操作循环ACID模型&#xff0c;支持事务 这里就印出了我们之前的知识点 DML操作就是我们对数据进行 增删除查改操作 ACID分别代表…

HTML小游戏14 —— H5横版冒险游戏《无限生机》(附完整源码)

&#x1f482; 网站推荐:【神级源码资源网】【摸鱼小游戏】&#x1f91f; 前端学习课程&#xff1a;&#x1f449;【28个案例趣学前端】【400个JS面试题】&#x1f485; 想寻找共同学习交流、摸鱼划水的小伙伴&#xff0c;请点击【摸鱼学习交流群】&#x1f4ac; 免费且实用的计…

[ 渗透测试面试篇 ] 渗透测试面试题大集合(详解)(三)CSRF相关面试题

​ &#x1f36c; 博主介绍 &#x1f468;‍&#x1f393; 博主介绍&#xff1a;大家好&#xff0c;我是 _PowerShell &#xff0c;很高兴认识大家~ ✨主攻领域&#xff1a;【渗透领域】【数据通信】 【通讯安全】 【web安全】【面试分析】 &#x1f389;点赞➕评论➕收藏 养成…

Azure CDN

Azure CDN Azure CDN 是服务器的分发网络&#xff0c;可以将网页内容更高效地分发给终端用户。 CDN在POP点的边缘服务器缓存内容&#xff0c;这样更临近终端用户&#xff0c;延迟低。 Azure CDN 给开发者提供全球解决方案&#xff0c;能够将内容放在全球各个节点&#xff0c;提…

MotoSimEG-VRC软件:龙门架外部设备添加以及示教编程与仿真运行

目录 概述 龙门架添加与属性配置 龙门架软限位设定 龙门架示教编程 仿真运行 概述 龙门架是工业生产中十分常见的自动化设备&#xff0c;由于其具备三维空间内的多自由度运动特性&#xff0c;通常被作为堆垛机&#xff0c;广泛应用在仓储物流领域。也可以作为直角坐标机器…

如何通过 Hardhat 来验证智能合约

在很大程度上&#xff0c;由于部署到通用区块链的智能合约的不变性&#xff0c;安全始终是用户和企业的首要任务。因此&#xff0c;在以太坊上开发智能合约的关键步骤之一是初始部署后的 Etherscan 验证。Etherscan 使任何人&#xff0c;从用户到经验丰富的开发人员和 bug hunt…