[go: up one dir, main page]

CN116828068A - A new type of heterogeneous equipment networking system and method - Google Patents

A new type of heterogeneous equipment networking system and method Download PDF

Info

Publication number
CN116828068A
CN116828068A CN202211652776.2A CN202211652776A CN116828068A CN 116828068 A CN116828068 A CN 116828068A CN 202211652776 A CN202211652776 A CN 202211652776A CN 116828068 A CN116828068 A CN 116828068A
Authority
CN
China
Prior art keywords
json
text
file
preset
transmission
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211652776.2A
Other languages
Chinese (zh)
Inventor
余丹
兰雨晴
孙中杰
邢智涣
王丹星
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Standard Intelligent Security Technology Co Ltd
Original Assignee
China Standard Intelligent Security Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Standard Intelligent Security Technology Co Ltd filed Critical China Standard Intelligent Security Technology Co Ltd
Priority to CN202211652776.2A priority Critical patent/CN116828068A/en
Publication of CN116828068A publication Critical patent/CN116828068A/en
Pending legal-status Critical Current

Links

Landscapes

  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

The invention provides a file transmission compression system based on JSON, which comprises: the JSON text module is used for acquiring the JSON text; the text processing module is used for processing and compressing the JSON text through a preset Huffman coding and LZ77 algorithm to determine a processed text; and the transmission module is used for transmitting the processing text to a preset control terminal based on a preset MQTT protocol. Aiming at the problems of too many attributes or too long attributes in JSON data, the method aims to provide a more efficient and quick dynamic lossless compression method for JSON data packets.

Description

一种新型异构设备组网系统和方法A new type of heterogeneous equipment networking system and method

技术领域Technical field

本发明涉及异构设备组网技术领域,特别涉及一种新型异构设备组网系统和方法。The present invention relates to the technical field of heterogeneous equipment networking, and in particular to a new heterogeneous equipment networking system and method.

背景技术Background technique

JSON是一种轻量级的数据交换格式,是基于ECMAScript的子集,采用完全独立于编程语言的文本格式来存储和表示数据。常取代XML用来在服务器和客户端之前传输数据。但当传输的数据量过大时,JSON在移动互联网应用容易导致消耗流量、带宽等网络资源过大。JSON is a lightweight data exchange format based on a subset of ECMAScript that uses a text format that is completely independent of programming languages to store and represent data. Often used instead of XML to transfer data between server and client. However, when the amount of data transmitted is too large, the application of JSON on the mobile Internet can easily lead to excessive consumption of network resources such as traffic and bandwidth.

所以亟需一种JSON数据的压缩,对JSON数据中重复的key或者value进行处理,减少多余的格式描述字符,提高mqtt传输的性能。Therefore, there is an urgent need for a kind of JSON data compression to process repeated keys or values in JSON data, reduce redundant format description characters, and improve the performance of mqtt transmission.

发明内容Contents of the invention

为了克服上述背景技术中出现的问题,本发明提供一种基于JSON的文件传输压缩系统,用以解决上述背景技术中出现的问题。In order to overcome the problems in the above background technology, the present invention provides a JSON-based file transmission compression system to solve the problems in the above background technology.

本发明提供一种基于JSON的文件传输压缩系统,包括:The present invention provides a JSON-based file transmission compression system, including:

JSON文本模块,用于获取JSON文本;JSON text module, used to obtain JSON text;

处理文本模块,用于通过预设的霍夫曼编码和LZ77算法,对所述JSON文本进行处理和压缩,确定处理文本;The text processing module is used to process and compress the JSON text through the preset Huffman coding and LZ77 algorithm, and determine the processing text;

传输模块,用于基于预设的MQTT协议,将所述处理文本传输至预设的控制终端。The transmission module is used to transmit the processed text to the preset control terminal based on the preset MQTT protocol.

作为本技术方案的一种实施例,所述JSON文本模块,包括:As an embodiment of this technical solution, the JSON text module includes:

传输文件获取单元,用于通过预设的MQTT协议,获取传输文件;The transmission file acquisition unit is used to obtain transmission files through the preset MQTT protocol;

识别单元,用于识别所述传输文件的文件格式;An identification unit, used to identify the file format of the transmission file;

JSON文本单元,用于获取对文件格式为JSON的JSON文本。JSON text unit, used to obtain JSON text in the file format JSON.

作为本技术方案的一种实施例,所述处理文本模块,包括:As an embodiment of this technical solution, the text processing module includes:

最优传输路径单元,用于通过预设的霍夫曼编码,计算所述JSON文本的最优传输路径;The optimal transmission path unit is used to calculate the optimal transmission path of the JSON text through preset Huffman coding;

压缩文件单元,用于通过预设的LZ77算法,删除JSON文本的格式描述符,并对所述JSON文本进行无损压缩,确定压缩文件;The compressed file unit is used to delete the format descriptor of the JSON text through the preset LZ77 algorithm, perform lossless compression on the JSON text, and determine the compressed file;

处理文件单元,用于将所述压缩文件和对应的最优传输路径进行打包,生成处理文件。A processing file unit is used to package the compressed file and the corresponding optimal transmission path to generate a processing file.

作为本技术方案的一种实施例,所述最优传输路径单元,包括:As an embodiment of this technical solution, the optimal transmission path unit includes:

传输节点子单元,用于通过预设的霍夫曼编码,确定JSON文本的传输节点;The transmission node subunit is used to determine the transmission node of the JSON text through the preset Huffman encoding;

路径权值子单元,用于对所述传输节点赋予路径权值;Path weight subunit, used to assign path weight to the transmission node;

最优传输路径子单元,用于通过所述路径权值,计算所述JSON文本的最优传输路径。The optimal transmission path subunit is used to calculate the optimal transmission path of the JSON text based on the path weight.

作为本技术方案的一种实施例,所述压缩文件单元,包括:As an embodiment of this technical solution, the compressed file unit includes:

滑动窗口的大小子单元,用于通过预设的LZ77算法,获取滑动窗口,并确定滑动窗口的大小;The size subunit of the sliding window is used to obtain the sliding window through the preset LZ77 algorithm and determine the size of the sliding window;

编码子单元,用于基于所述滑动窗口的大小,对删除JSON文本的格式描述符,同时,对所述JSON文本进行编码,生成对应的三元组;An encoding subunit, used to delete the format descriptor of the JSON text based on the size of the sliding window, and at the same time, encode the JSON text to generate corresponding triples;

解析子单元,用于接收终端设备的命令,通过所述命令,在预设的空间成本和时间成本内将所述三元组解析,确定对应的压缩文件。The parsing subunit is used to receive a command from the terminal device, and use the command to parse the triplet within a preset space cost and time cost to determine the corresponding compressed file.

本发明提供一种一种基于JSON的文件传输压缩方法,包括:The present invention provides a JSON-based file transmission compression method, which includes:

获取JSON文本;Get JSON text;

通过预设的霍夫曼编码和LZ77算法,对所述JSON文本进行处理和压缩,确定处理文本;Process and compress the JSON text through the preset Huffman coding and LZ77 algorithm to determine the text to be processed;

基于预设的MQTT协议,将所述处理文本传输至预设的控制终端。Based on the preset MQTT protocol, the processing text is transmitted to the preset control terminal.

作为本技术方案的一种实施例,所述获取JSON文本,包括:As an embodiment of this technical solution, obtaining JSON text includes:

通过预设的MQTT协议,获取传输文件;Obtain transmission files through the preset MQTT protocol;

识别所述传输文件的文件格式;Identify the file format of the transmission file;

获取对文件格式为JSON的JSON文本。Get the JSON text of the file in JSON format.

作为本技术方案的一种实施例,所述通过预设的霍夫曼编码和LZ77算法,对所述JSON文本进行处理和压缩,确定处理文本,包括:As an embodiment of this technical solution, the JSON text is processed and compressed through preset Huffman coding and LZ77 algorithm, and the processing text is determined to include:

最优传输路径单元,用于通过预设的霍夫曼编码,计算所述JSON文本的最优传输路径;The optimal transmission path unit is used to calculate the optimal transmission path of the JSON text through preset Huffman coding;

通过预设的LZ77算法,删除JSON文本的格式描述符,并对所述JSON文本进行无损压缩,确定压缩文件;Use the preset LZ77 algorithm to delete the format descriptor of the JSON text, perform lossless compression on the JSON text, and determine the compressed file;

将所述压缩文件和对应的最优传输路径进行打包,生成处理文件。Pack the compressed file and the corresponding optimal transmission path to generate a processing file.

作为本技术方案的一种实施例,所述通过预设的霍夫曼编码,计算所述JSON文本的最优传输路径,包括:As an embodiment of this technical solution, calculating the optimal transmission path of the JSON text through preset Huffman coding includes:

通过预设的霍夫曼编码,确定JSON文本的传输节点;Determine the transmission node of JSON text through the preset Huffman encoding;

对所述传输节点赋予路径权值;Assign path weights to the transmission nodes;

通过所述路径权值,计算所述JSON文本的最优传输路径。Based on the path weight, the optimal transmission path of the JSON text is calculated.

作为本技术方案的一种实施例,所述通过预设的LZ77算法,删除JSON文本的格式描述符,并对所述JSON文本进行无损压缩,确定压缩文件,包括:As an embodiment of this technical solution, the format descriptor of the JSON text is deleted through the preset LZ77 algorithm, and the JSON text is losslessly compressed to determine the compressed file, including:

通过预设的LZ77算法,获取滑动窗口,并确定滑动窗口的大小;Through the preset LZ77 algorithm, obtain the sliding window and determine the size of the sliding window;

基于所述滑动窗口的大小,对删除JSON文本的格式描述符,同时,对所述JSON文本进行编码,生成对应的三元组;Based on the size of the sliding window, delete the format descriptor of the JSON text, and at the same time, encode the JSON text to generate the corresponding triple;

接收终端设备的命令,通过所述命令,在预设的空间成本和时间成本内将所述三元组解析,确定对应的压缩文件。Receive a command from the terminal device, and use the command to parse the triplet within a preset space cost and time cost to determine the corresponding compressed file.

本发明的其它特征和优点将在随后的说明书中阐述,并且,部分地从说明书中变得显而易见,或者通过实施本发明而了解。本发明的目的和其他优点可通过在所写的说明书、权利要求书、以及附图中所特别指出的结构来实现和获得。Additional features and advantages of the invention will be set forth in the description which follows, and in part will be apparent from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention may be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.

下面通过附图和实施例,对本发明的技术方案做进一步的详细描述。The technical solution of the present invention will be further described in detail below through the accompanying drawings and examples.

附图说明Description of the drawings

附图用来提供对本发明的进一步理解,并且构成说明书的一部分,与本发明的实施例一起用于解释本发明,并不构成对本发明的限制。在附图中:The drawings are used to provide a further understanding of the present invention and constitute a part of the specification. They are used to explain the present invention together with the embodiments of the present invention and do not constitute a limitation of the present invention. In the attached picture:

图1为本发明实施例中一种基于JSON的文件传输压缩系统模块图;Figure 1 is a module diagram of a JSON-based file transmission compression system in an embodiment of the present invention;

图2为本发明实施例中一种基于JSON的文件传输压缩系统模块图;Figure 2 is a module diagram of a JSON-based file transmission compression system in an embodiment of the present invention;

图3为本发明实施例中一种基于JSON的文件传输压缩系统模块图。Figure 3 is a module diagram of a JSON-based file transmission compression system in an embodiment of the present invention.

具体实施方式Detailed ways

以下结合附图对本发明的优选实施例进行说明,应当理解,此处所描述的优选实施例仅用于说明和解释本发明,并不用于限定本发明。The preferred embodiments of the present invention will be described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described here are only used to illustrate and explain the present invention, and are not intended to limit the present invention.

实施例1:Example 1:

根据图1所述,本技术方案提供了一种基于JSON的文件传输压缩系统,包括:According to Figure 1, this technical solution provides a JSON-based file transmission compression system, including:

JSON文本模块,用于获取JSON文本;JSON text module, used to obtain JSON text;

处理文本模块,用于通过预设的霍夫曼编码和LZ77算法,对所述JSON文本进行处理和压缩,确定处理文本;The text processing module is used to process and compress the JSON text through the preset Huffman coding and LZ77 algorithm, and determine the processing text;

传输模块,用于基于预设的MQTT协议,将所述处理文本传输至预设的控制终端。The transmission module is used to transmit the processed text to the preset control terminal based on the preset MQTT protocol.

上述技术方案的工作原理和有益效果在于:The working principle and beneficial effects of the above technical solution are:

本技术方案提供了一种基于JSON的文件传输压缩系统,包括:JSON文本模块,用于获取JSON文本;JSON因为简洁和清晰的层次结构,是理想的数据交换语言,易于人阅读和编写,也易于机器解析和生成,处理文本模块,用于通过预设的霍夫曼编码和LZ77算法,对JSON文本进行处理和压缩,确定处理文本;对JSON数据中属性太多或者属性过长的问题进行处理,传输模块,用于基于预设的MQTT协议,将处理文本传输至预设的控制终端,提供一种更高效快捷的JSON数据包的动态无损压缩方法。This technical solution provides a file transmission compression system based on JSON, including: JSON text module, used to obtain JSON text; JSON is an ideal data exchange language because of its concise and clear hierarchical structure, which is easy for people to read and write. Easy to parse and generate by machine, the text processing module is used to process and compress JSON text through the preset Huffman encoding and LZ77 algorithm, and determine the text to be processed; it also solves the problem of too many attributes or too long attributes in JSON data. The processing and transmission module is used to transmit the processed text to the preset control terminal based on the preset MQTT protocol, providing a more efficient and faster dynamic lossless compression method for JSON data packets.

实施例2:Example 2:

根据图2所述,本技术方案提供了一种实施例,所述JSON文本模块,包括:According to Figure 2, this technical solution provides an embodiment. The JSON text module includes:

传输文件获取单元,用于通过预设的MQTT协议,获取传输文件;The transmission file acquisition unit is used to obtain transmission files through the preset MQTT protocol;

识别单元,用于识别所述传输文件的文件格式;An identification unit, used to identify the file format of the transmission file;

JSON文本单元,用于获取对文件格式为JSON的JSON文本。JSON text unit, used to obtain JSON text in the file format JSON.

上述技术方案的工作原理和有益效果在于:The working principle and beneficial effects of the above technical solution are:

本技术方案JSON文本模块,包括:传输文件获取单元,用于通过预设的MQTT协议,获取传输文件;识别单元,用于识别传输文件的文件格式;JSON文本单元,用于获取对文件格式为JSON的JSON文本,精准识别文本格式,减少不必要的资源占用,提供压缩性能。The JSON text module of this technical solution includes: a transmission file acquisition unit, used to obtain the transmission file through the preset MQTT protocol; an identification unit, used to identify the file format of the transmission file; a JSON text unit, used to obtain the file format of JSON text of JSON accurately identifies the text format, reduces unnecessary resource usage, and provides compression performance.

实施例3:Example 3:

根据图3所述,本技术方案提供了一种实施例,所述处理文本模块,包括:According to Figure 3, this technical solution provides an embodiment. The text processing module includes:

最优传输路径单元,用于通过预设的霍夫曼编码,计算所述JSON文本的最优传输路径;The optimal transmission path unit is used to calculate the optimal transmission path of the JSON text through preset Huffman coding;

压缩文件单元,用于通过预设的LZ77算法,删除JSON文本的格式描述符,并对所述JSON文本进行无损压缩,确定压缩文件;The compressed file unit is used to delete the format descriptor of the JSON text through the preset LZ77 algorithm, perform lossless compression on the JSON text, and determine the compressed file;

处理文件单元,用于将所述压缩文件和对应的最优传输路径进行打包,生成处理文件。A processing file unit is used to package the compressed file and the corresponding optimal transmission path to generate a processing file.

上述技术方案的工作原理和有益效果在于:The working principle and beneficial effects of the above technical solution are:

本技术方案处理文本模块,包括:最优传输路径单元,用于通过预设的霍夫曼编码,计算JSON文本的最优传输路径,使得压缩路径尽可能的小,压缩文件单元,用于通过预设的LZ77算法,删除JSON文本的格式描述符,并对JSON文本进行无损压缩,确定压缩文件,使得压缩的JSON数据包尽可能小,压缩率尽可能高,This technical solution processes text modules, including: an optimal transmission path unit, used to calculate the optimal transmission path of JSON text through preset Huffman coding, so that the compression path is as small as possible; a compressed file unit, used to The preset LZ77 algorithm deletes the format descriptor of the JSON text and performs lossless compression on the JSON text to determine the compressed file so that the compressed JSON data packet is as small as possible and the compression rate is as high as possible.

处理文件单元,用于将压缩文件和对应的最优传输路径进行打包,生成处理文件。The processing file unit is used to package the compressed file and the corresponding optimal transmission path to generate a processing file.

实施例4:Example 4:

本技术方案提供了一种实施例,所述最优传输路径单元,包括:This technical solution provides an embodiment. The optimal transmission path unit includes:

传输节点子单元,用于通过预设的霍夫曼编码,确定JSON文本的传输节点;The transmission node subunit is used to determine the transmission node of the JSON text through the preset Huffman encoding;

路径权值子单元,用于对所述传输节点赋予路径权值;Path weight subunit, used to assign path weight to the transmission node;

最优传输路径子单元,用于通过所述路径权值,计算所述JSON文本的最优传输路径。The optimal transmission path subunit is used to calculate the optimal transmission path of the JSON text based on the path weight.

上述技术方案的工作原理和有益效果在于:The working principle and beneficial effects of the above technical solution are:

本技术方案提供了一种实施例,所述最优传输路径单元,包括:传输节点子单元,用于通过预设的霍夫曼编码,确定JSON文本的传输节点;路径权值子单元,用于对所述传输节点赋予路径权值;最优传输路径子单元,用于通过所述路径权值,计算所述JSON文本的最优传输路径。有效解决了JSON数据中属性过多或者属性过长的这种情况,提高了JSON数据包的压缩率,减少带宽、流量等网络资源。This technical solution provides an embodiment. The optimal transmission path unit includes: a transmission node subunit, used to determine the transmission node of the JSON text through preset Huffman coding; a path weight subunit, using To assign a path weight to the transmission node; and the optimal transmission path subunit is to calculate the optimal transmission path of the JSON text through the path weight. It effectively solves the problem of too many attributes or too long attributes in JSON data, improves the compression rate of JSON data packets, and reduces network resources such as bandwidth and traffic.

实施例5:Example 5:

本技术方案提供了一种实施例,所述压缩文件单元,包括:This technical solution provides an embodiment. The compressed file unit includes:

滑动窗口的大小子单元,用于通过预设的LZ77算法,获取滑动窗口,并确定滑动窗口的大小;The size subunit of the sliding window is used to obtain the sliding window through the preset LZ77 algorithm and determine the size of the sliding window;

编码子单元,用于基于所述滑动窗口的大小,对删除JSON文本的格式描述符,同时,对所述JSON文本进行编码,生成对应的三元组;An encoding subunit, used to delete the format descriptor of the JSON text based on the size of the sliding window, and at the same time, encode the JSON text to generate corresponding triples;

解析子单元,用于接收终端设备的命令,通过所述命令,在预设的空间成本和时间成本内将所述三元组解析,确定对应的压缩文件。The parsing subunit is used to receive a command from the terminal device, and use the command to parse the triplet within a preset space cost and time cost to determine the corresponding compressed file.

上述技术方案的工作原理和有益效果在于:The working principle and beneficial effects of the above technical solution are:

本技术方案的压缩文件单元,包括:滑动窗口的大小子单元,用于通过预设的LZ77算法,获取滑动窗口,并确定滑动窗口的大小;编码子单元,用于基于所述滑动窗口的大小,对删除JSON文本的格式描述符,同时,对所述JSON文本进行编码,生成对应的三元组;解析子单元,用于接收终端设备的命令,通过所述命令,在预设的空间成本和时间成本内将所述三元组解析,确定对应的压缩文件。The compressed file unit of this technical solution includes: a sliding window size subunit, which is used to obtain the sliding window through the preset LZ77 algorithm and determine the size of the sliding window; an encoding subunit, which is used to determine the size of the sliding window based on the size of the sliding window. , delete the format descriptor of the JSON text, and at the same time, encode the JSON text to generate the corresponding triplet; the parsing subunit is used to receive the command of the terminal device, and through the command, the preset space cost is The triplet is parsed and the corresponding compressed file is determined within the time cost.

实施例6:Example 6:

根据图1所述,本技术方案提供了一种基于JSON的文件传输压缩方法,包括:According to Figure 1, this technical solution provides a JSON-based file transmission compression method, including:

获取JSON文本;Get JSON text;

通过预设的霍夫曼编码和LZ77算法,对所述JSON文本进行处理和压缩,确定处理文本;Process and compress the JSON text through the preset Huffman coding and LZ77 algorithm to determine the text to be processed;

基于预设的MQTT协议,将所述处理文本传输至预设的控制终端。Based on the preset MQTT protocol, the processing text is transmitted to the preset control terminal.

上述技术方案的工作原理和有益效果在于:The working principle and beneficial effects of the above technical solution are:

本技术方案提供了一种基于JSON的文件传输压缩方法,包括:获取JSON文本;通过预设的霍夫曼编码和LZ77算法,对所述JSON文本进行处理和压缩,确定处理文本,JSON因为简洁和清晰的层次结构,是理想的数据交换语言,易于人阅读和编写,也易于机器解析和生成,处理文本模块,用于通过预设的霍夫曼编码和LZ77算法,对JSON数据中属性太多或者属性过长的问题进行处理,基于预设的MQTT协议,将所述处理文本传输至预设的控制终端,提供一种更高效快捷的JSON数据包的动态无损压缩方法。This technical solution provides a JSON-based file transmission compression method, including: obtaining JSON text; processing and compressing the JSON text through the preset Huffman encoding and LZ77 algorithm to determine the processing text. JSON is concise because of its simplicity. With a clear hierarchical structure, it is an ideal data exchange language, easy for humans to read and write, and easy for machines to parse and generate. The text processing module is used to process attributes in JSON data through the preset Huffman encoding and LZ77 algorithm. Problems with too many or too long attributes are processed. Based on the preset MQTT protocol, the processed text is transmitted to the preset control terminal, providing a more efficient and faster dynamic lossless compression method for JSON data packets.

实施例7:Example 7:

本技术方案提供了一种实施例,所述获取JSON文本,包括:This technical solution provides an embodiment. Obtaining JSON text includes:

通过预设的MQTT协议,获取传输文件;Obtain transmission files through the preset MQTT protocol;

识别所述传输文件的文件格式;Identify the file format of the transmission file;

获取对文件格式为JSON的JSON文本。Get the JSON text of the file in JSON format.

上述技术方案的工作原理和有益效果在于:The working principle and beneficial effects of the above technical solution are:

本技术方案获取JSON文本,包括:通过预设的MQTT协议,获取传输文件;识别传输文件的文件格式;获取对文件格式为JSON的JSON文本。精准识别文本格式,减少不必要的资源占用,提供压缩性能。This technical solution obtains JSON text, including: obtaining the transmission file through the preset MQTT protocol; identifying the file format of the transmission file; and obtaining the JSON text whose file format is JSON. Accurately identify text formats, reduce unnecessary resource usage, and provide compression performance.

实施例8:Example 8:

本技术方案提供了一种实施例,所述通过预设的霍夫曼编码和LZ77算法,对所述JSON文本进行处理和压缩,确定处理文本,包括:This technical solution provides an embodiment in which the JSON text is processed and compressed through preset Huffman coding and LZ77 algorithm, and the processing text is determined, including:

最优传输路径单元,用于通过预设的霍夫曼编码,计算所述JSON文本的最优传输路径;The optimal transmission path unit is used to calculate the optimal transmission path of the JSON text through preset Huffman coding;

通过预设的LZ77算法,删除JSON文本的格式描述符,并对所述JSON文本进行无损压缩,确定压缩文件;Use the preset LZ77 algorithm to delete the format descriptor of the JSON text, perform lossless compression on the JSON text, and determine the compressed file;

将所述压缩文件和对应的最优传输路径进行打包,生成处理文件。Pack the compressed file and the corresponding optimal transmission path to generate a processing file.

上述技术方案的工作原理和有益效果在于:The working principle and beneficial effects of the above technical solution are:

本技术方案通过预设的霍夫曼编码和LZ77算法,对JSON文本进行处理和压缩,确定处理文本,包括:最优传输路径单元,用于通过预设的霍夫曼编码,计算JSON文本的最优传输路径;使得压缩路径尽可能的小,通过预设的LZ77算法,删除JSON文本的格式描述符,并对JSON文本进行无损压缩,确定压缩文件,将压缩文件和对应的最优传输路径进行打包,生成处理文件。This technical solution processes and compresses JSON text through the preset Huffman coding and LZ77 algorithm, and determines the processing text, including: the optimal transmission path unit, which is used to calculate the JSON text through the preset Huffman coding. Optimal transmission path; make the compression path as small as possible, delete the format descriptor of the JSON text through the preset LZ77 algorithm, perform lossless compression on the JSON text, determine the compressed file, and combine the compressed file and the corresponding optimal transmission path Package and generate processing files.

实施例9:Example 9:

本技术方案提供了一种实施例,所述通过预设的霍夫曼编码,计算所述JSON文本的最优传输路径,包括:This technical solution provides an embodiment that calculates the optimal transmission path of the JSON text through preset Huffman coding, including:

通过预设的霍夫曼编码,确定JSON文本的传输节点;Determine the transmission node of JSON text through the preset Huffman encoding;

对所述传输节点赋予路径权值;Assign path weights to the transmission nodes;

通过所述路径权值,计算所述JSON文本的最优传输路径。Based on the path weight, the optimal transmission path of the JSON text is calculated.

上述技术方案的工作原理和有益效果在于:The working principle and beneficial effects of the above technical solution are:

本技术方案通过预设的霍夫曼编码,计算JSON文本的最优传输路径,包括:通过预设的霍夫曼编码,确定JSON文本的传输节点;对传输节点赋予路径权值;通过路径权值,计算JSON文本的最优传输路径。有效解决了JSON数据中属性过多或者属性过长的这种情况,提高了JSON数据包的压缩率,减少带宽、流量等网络资源。This technical solution calculates the optimal transmission path of JSON text through preset Huffman coding, including: determining the transmission node of JSON text through preset Huffman coding; assigning path weights to transmission nodes; passing path weights Value, calculates the optimal transmission path for JSON text. It effectively solves the problem of too many attributes or too long attributes in JSON data, improves the compression rate of JSON data packets, and reduces network resources such as bandwidth and traffic.

实施例10:Example 10:

本技术方案提供了一种实施例,所述通过预设的LZ77算法,删除JSON文本的格式描述符,并对所述JSON文本进行无损压缩,确定压缩文件,包括:This technical solution provides an embodiment in which the format descriptor of the JSON text is deleted through the preset LZ77 algorithm, and the JSON text is losslessly compressed to determine the compressed file, including:

通过预设的LZ77算法,获取滑动窗口,并确定滑动窗口的大小;Through the preset LZ77 algorithm, obtain the sliding window and determine the size of the sliding window;

基于所述滑动窗口的大小,对删除JSON文本的格式描述符,同时,对所述JSON文本进行编码,生成对应的三元组;Based on the size of the sliding window, delete the format descriptor of the JSON text, and at the same time, encode the JSON text to generate the corresponding triple;

接收终端设备的命令,通过所述命令,在预设的空间成本和时间成本内将所述三元组解析,确定对应的压缩文件。Receive a command from the terminal device, and use the command to parse the triplet within a preset space cost and time cost to determine the corresponding compressed file.

上述技术方案的工作原理和有益效果在于:The working principle and beneficial effects of the above technical solution are:

本技术方案通过预设的LZ77算法,删除JSON文本的格式描述符,并对JSON文本进行无损压缩,确定压缩文件,包括:通过预设的LZ77算法,获取滑动窗口,并确定滑动窗口的大小;基于滑动窗口的大小,对删除JSON文本的格式描述符,同时,对JSON文本进行编码,生成对应的三元组;接收终端设备的命令,通过命令,在预设的空间成本和时间成本内将三元组解析,确定对应的压缩文件。This technical solution uses the preset LZ77 algorithm to delete the format descriptor of the JSON text, performs lossless compression on the JSON text, and determines the compressed file, including: obtaining the sliding window through the preset LZ77 algorithm and determining the size of the sliding window; Based on the size of the sliding window, delete the format descriptor of the JSON text, and at the same time, encode the JSON text to generate the corresponding triplet; receive the command from the terminal device, and pass the command within the preset space cost and time cost. Triplet analysis to determine the corresponding compressed file.

本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, magnetic disk storage, optical storage, etc.) embodying computer-usable program code therein.

本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each process and/or block in the flowchart illustrations and/or block diagrams, and combinations of processes and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine, such that the instructions executed by the processor of the computer or other programmable data processing device produce a use A device for implementing the functions specified in one process or processes of the flowchart and/or one block or blocks of the block diagram.

这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory that causes a computer or other programmable data processing apparatus to operate in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction means, the instructions The device implements the functions specified in a process or processes of the flowchart and/or a block or blocks of the block diagram.

这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions may also be loaded onto a computer or other programmable data processing device, causing a series of operating steps to be performed on the computer or other programmable device to produce computer-implemented processing, thereby executing on the computer or other programmable device. Instructions provide steps for implementing the functions specified in a process or processes of a flowchart diagram and/or a block or blocks of a block diagram.

显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the invention. In this way, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and equivalent technologies, the present invention is also intended to include these modifications and variations.

Claims (10)

1. A JSON-based file transfer compression system, comprising:
the JSON text module is used for acquiring the JSON text;
the text processing module is used for processing and compressing the JSON text through a preset Huffman coding and LZ77 algorithm to determine a processed text;
and the transmission module is used for transmitting the processing text to a preset control terminal based on a preset MQTT protocol.
2. The JSON-based file transfer compression system of claim 1, in which the JSON text module comprises:
the transmission file acquisition unit is used for acquiring a transmission file through a preset MQTT protocol;
the identification unit is used for identifying the file format of the transmission file;
and the JSON text unit is used for acquiring the JSON text with the file format of JSON.
3. The JSON-based file transfer compression system of claim 1, in which the process text module comprises:
an optimal transmission path unit, configured to calculate an optimal transmission path of the JSON text through a preset huffman code;
the compression file unit is used for deleting the format descriptor of the JSON text through a preset LZ77 algorithm, carrying out lossless compression on the JSON text and determining a compression file;
and the processing file unit is used for packaging the compressed file and the corresponding optimal transmission path to generate a processing file.
4. A JSON-based file transfer compression system as claimed in claim 3, in which the optimum transfer path unit comprises:
a transmission node subunit, configured to determine a transmission node of the JSON text through a preset huffman code;
a path weight subunit, configured to assign a path weight to the transmission node;
and the optimal transmission path subunit is used for calculating the optimal transmission path of the JSON text through the path weight.
5. A JSON-based file transfer compression system as claimed in claim 3, in which the compressed file unit comprises:
the sliding window size subunit is used for acquiring the sliding window through a preset LZ77 algorithm and determining the size of the sliding window;
the coding subunit is used for deleting the format descriptor of the JSON text based on the size of the sliding window, and simultaneously coding the JSON text to generate a corresponding triplet;
and the analysis subunit is used for receiving the command of the terminal equipment, analyzing the triples within the preset space cost and time cost through the command, and determining the corresponding compressed file.
6. The file transmission compression method based on JSON is characterized by comprising the following steps of:
acquiring a JSON text;
processing and compressing the JSON text through a preset Huffman coding and LZ77 algorithm to determine a processed text;
and transmitting the processing text to a preset control terminal based on a preset MQTT protocol.
7. The JSON-based file transfer compression method of claim 6, in which the obtaining JSON text includes:
acquiring a transmission file through a preset MQTT protocol;
identifying a file format of the transmission file;
obtaining a JSON text with a JSON file format.
8. The JSON-based file transmission compression method of claim 6, in which the processing and compressing the JSON text by a preset huffman coding and LZ77 algorithm, determining the processed text, includes:
an optimal transmission path unit, configured to calculate an optimal transmission path of the JSON text through a preset huffman code;
deleting a format descriptor of a JSON text through a preset LZ77 algorithm, performing lossless compression on the JSON text, and determining a compressed file;
and packaging the compressed file and the corresponding optimal transmission path to generate a processing file.
9. The JSON-based file transmission compression method of claim 8, in which the calculating the optimal transmission path of the JSON text by means of preset huffman coding includes:
determining a transmission node of the JSON text through a preset Huffman code;
assigning a path weight to the transmission node;
and calculating the optimal transmission path of the JSON text through the path weight.
10. The JSON-based file transmission compression method of claim 8, in which deleting the format descriptor of the JSON text by a preset LZ77 algorithm, and performing lossless compression on the JSON text, and determining the compressed file, includes:
acquiring a sliding window through a preset LZ77 algorithm, and determining the size of the sliding window;
based on the size of the sliding window, deleting a format descriptor of the JSON text, and simultaneously encoding the JSON text to generate a corresponding triplet;
and receiving a command of the terminal equipment, analyzing the triples within the preset space cost and time cost through the command, and determining the corresponding compressed file.
CN202211652776.2A 2022-12-15 2022-12-15 A new type of heterogeneous equipment networking system and method Pending CN116828068A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211652776.2A CN116828068A (en) 2022-12-15 2022-12-15 A new type of heterogeneous equipment networking system and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211652776.2A CN116828068A (en) 2022-12-15 2022-12-15 A new type of heterogeneous equipment networking system and method

Publications (1)

Publication Number Publication Date
CN116828068A true CN116828068A (en) 2023-09-29

Family

ID=88141778

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211652776.2A Pending CN116828068A (en) 2022-12-15 2022-12-15 A new type of heterogeneous equipment networking system and method

Country Status (1)

Country Link
CN (1) CN116828068A (en)

Similar Documents

Publication Publication Date Title
US11917038B2 (en) Methods and apparatus to compress packets in a computing environment
US10817460B2 (en) RDMA data sending and receiving methods, electronic device, and readable storage medium
CN112422489B (en) Service data transmission method, device, computer equipment and storage medium
CN114362885B (en) Data transmission method, communication system, equipment and medium of Internet of things
US20170078916A1 (en) Data processing method and apparatus
CN115643310B (en) Method, device and system for compressing data
CN111611129A (en) Performance monitoring method and device of PaaS cloud platform
CN113051202A (en) Interface adaptation method, device, electronic equipment and computer readable storage medium
CN112335203A (en) Processing local area network diagnostic data
CN112202623A (en) Data processing method and device
CN103503381B (en) The method of data transmission of device redirection, Apparatus and system
CN104954497A (en) Data transmission method and system for cloud storage system
CN112035401A (en) Model data processing method, apparatus, electronic device and readable medium
KR101228277B1 (en) Arrangement and method relating to messageing
CN105656694B (en) a kind of device log processing method
WO2021036189A1 (en) Rdma data sending and receiving methods, electronic device and readable storage medium
CN112422525B (en) Fault data transmission method, device, equipment and storage medium
CN116828068A (en) A new type of heterogeneous equipment networking system and method
CN111193678B (en) Data processing method, device, equipment and computer readable storage medium
CN106878054B (en) Service processing method and device
CN113595694B (en) Data transmission method, computing device and storage medium
US11979477B2 (en) Processing local area network diagnostic data
CN115988560A (en) A method and system for online training of a model for feeding back channel state information
CN115604365A (en) Data encoding and decoding method and device, electronic equipment and readable storage medium
CN117014527A (en) Data processing method and device, storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination