An encoding method and apparatus, a decoding method and apparatus

CN122621284APending Publication Date: 2026-08-21CHINA SATENT NETWORK APPLICATION RESEARCH INSTITUTE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510200248.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-21
Publication Date
2026-08-21

AI Technical Summary

Technical Problem

[0002]卫星互联网技术特别是低轨卫星互联网的快速发展,使卫星互联网具备全域无缝覆盖、传输时延短、链路损耗低等特点,但是其带宽资源相对地面网络而言仍然有限,尤其窄带资源更为稀缺

Benefits of technology

[0091] The eighth aspect of this application provides a computer program product, the computer program product including a computer program that, when executed by a processor of an Internet of Things application service device, implements the method described in any of the foregoing embodiments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122621284A_ABST
    Figure CN122621284A_ABST
Patent Text Reader

Abstract

The application relates to the field of satellite Internet of Things, and provides an encoding method and device, a decoding method and device, the encoding device comprises: an encoding unit configured to perform the following first operation: determining length domain data and value domain data of each source data in a source data group; determining a length domain dictionary and a length domain dictionary attribute according to the length domain data of each source data; determining the length domain data and the value domain data of the length domain dictionary attribute, and obtaining a first data item from the length domain data and the value domain data of the length domain dictionary attribute, and obtaining a second data item from the length domain dictionary; determining a third data item according to the length domain dictionary and the value domain data of each source data; generating an encoded data stream according to the first data item, the second data item and the third data item; and a communication unit configured to send the encoded data stream to a service platform. The application can reduce the amount of encoded data, improve the compression rate and improve the compression / decompression speed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of satellite Internet of Things, and in particular to an encoding method and apparatus, and a decoding method and apparatus. Background Technology

[0002] The rapid development of satellite internet technology, especially low-Earth orbit satellite internet, has enabled satellite internet to have the characteristics of seamless coverage, short transmission latency, and low link loss. However, its bandwidth resources are still limited compared to terrestrial networks, and narrowband resources are even scarcer.

[0003] With the increasing prevalence of satellite IoT devices and the continuous expansion of application scenarios, the amount of data processed by satellite IoT is increasing dramatically, which places higher demands on the bandwidth of satellite internet. To address the bandwidth requirements of satellite IoT data, it is necessary to select appropriate data compression technologies to compress IoT data, thereby reducing the data volume and lowering the bandwidth requirements.

[0004] IoT data, especially data from various sensors, generates a large amount of time-series data. Time-series data refers to data series recorded in chronological order for the same indicator. All data points within the same series must be of the same caliber and comparable. Considering the limited transmission capacity of satellite IoT communication, it is necessary to compress the original redundant data for time-series data. Summary of the Invention

[0005] This application addresses the problem that existing compression algorithms in the satellite Internet of Things (IoT) field can only achieve one of the following under the premise of lossless compression: compression ratio or compression / decompression speed. They cannot simultaneously achieve both compression ratio and compression / decompression speed.

[0006] To address the aforementioned technical problems, the first aspect of this application provides a data encoding apparatus, the apparatus comprising:

[0007] An encoding unit, configured to perform the following first operation:

[0008] Determine the length field and value field of each source data in the source data group;

[0009] Based on the length field data of each source data, determine the length field dictionary and its attributes;

[0010] Determine the length field data and value field data of the length field dictionary attribute, and obtain a first data item from the length field data and value field data of the length field dictionary attribute; construct a second data item from the length field dictionary; determine a third data item based on the length field dictionary and the value field data of each source data.

[0011] Generate an encoded data stream based on the first data item, the second data item, and the third data item;

[0012] A communication unit configured to send the encoded data stream to a service platform.

[0013] In a further embodiment of this application, the encoding unit is also configured to perform the following second operation:

[0014] Determine the array length of the source data group;

[0015] Determine the length field data and value field data of the array length, and obtain the fourth data item from the length field data and value field data of the array length;

[0016] An encoded data stream is generated based on the fourth data item, the first data item, the second data item, and the third data item.

[0017] In a further embodiment of this application, the encoding unit determines the third data item based on the length field dictionary and the value field data of each source data, including:

[0018] When the length field dictionary contains multiple length field data, an index dictionary is generated based on the length field dictionary, and each index in the index dictionary is associated with a length field data; the index associated with the length field data of each source data and the value field data of the source data constitute the third data item;

[0019] When the length field dictionary contains a length field data, the value field data of each source data is integrated to obtain the third data item.

[0020] In a further embodiment of this application, the encoding unit generates an index dictionary based on the length field dictionary, including:

[0021] Calculate the length of the length field dictionary;

[0022] Calculate the binary bit length occupied by the length field dictionary;

[0023] Generate an index sequence based on the stated binary bit length;

[0024] The index dictionary is obtained by establishing the association between the index in the index sequence and the length field data in the length field dictionary.

[0025] In a further embodiment of this application, the encoding unit is further configured to perform the following third operation: initial encoding of the source data group.

[0026] In a further embodiment of this application, the encoding unit determines the length field data and value field data of the target data, including:

[0027] The binary value of the target data is calculated using the target binary encoding algorithm;

[0028] The length field data is determined based on the bit length occupied by the binary value of the target data;

[0029] The highest bit of the binary value of the target data is omitted to obtain the value range data.

[0030] In a further embodiment of this application, the apparatus further includes:

[0031] A first processing unit is configured to perform the following operations to determine the target binary encoding algorithm:

[0032] Obtain historical source data;

[0033] The largest source data is selected from the historical source data;

[0034] The maximum source data is matched with the data range of multiple preset binary encoding algorithms;

[0035] The matched binary encoding algorithm is used as the target binary encoding algorithm.

[0036] In a further embodiment of this application, the apparatus further includes:

[0037] The second processing unit is configured to perform the following operations to determine the target binary encoding algorithm:

[0038] Filter the largest source data from the source data group;

[0039] Match the maximum source data with the data range of multiple preset binary encoding algorithms;

[0040] The matched binary encoding algorithm is used as the target binary encoding algorithm.

[0041] In a further embodiment of this application, the encoding unit determines the length field data based on the bit length occupied by the binary value of the target data, including:

[0042] Convert the bit length occupied by the binary value of the target data into a binary code of the target length;

[0043] The length field data is represented by a binary code of a preset length.

[0044] In a further embodiment of this application, the apparatus further includes:

[0045] A third processing unit is configured to perform the following operation to determine the target length:

[0046] The number of binary bits used by the target binary encoding algorithm is decomposed into powers of two;

[0047] Set the power as the target length.

[0048] A second aspect of this application provides a data decoding apparatus, wherein the apparatus includes:

[0049] A communication unit configured to receive an encoded data stream;

[0050] The decoding unit is configured to perform the following fourth operation:

[0051] Parse the encoded data stream to obtain the length field dictionary attribute;

[0052] Based on the length field dictionary attributes, continue parsing the remaining encoded data stream to obtain the length field dictionary;

[0053] Based on the length field dictionary, the remaining encoded data stream is further parsed to obtain the source data group.

[0054] In a further embodiment of this application, the decoding unit is further configured to perform the following fifth operation:

[0055] The length of the source data group is obtained by parsing the encoded data stream;

[0056] The number of parsed source data is counted. When the number reaches the length of the array, the parsing of the source data group is completed.

[0057] In a further embodiment of this application, the decoding unit continues to parse the remaining encoded data stream to obtain the source data group based on the length field dictionary, including:

[0058] Parse the remaining encoded data stream as follows:

[0059] Based on the length field dictionary, determine the dictionary index length and generate the dictionary index;

[0060] Based on the dictionary index bit length, read the first data from the remaining encoded data stream;

[0061] The length field data is determined based on the first data and the dictionary index;

[0062] When the length field data is a preset value, the original data is obtained by decoding the length field data.

[0063] When the length field data is not a preset value, the numerical length is determined based on the length field data, the value field data is read from the remaining encoded data stream based on the numerical length, the highest bit is padded in the value field data to obtain the original value field data, and the original value field data is decoded to obtain the source data.

[0064] In a further embodiment of this application, the decoding unit further includes, based on the length field dictionary, parsing the remaining encoded data stream to obtain the source data group, and further includes:

[0065] Determine the length field data contained in the length field dictionary. When the length field dictionary contains one length field data, parse the remaining encoded data stream as follows:

[0066] The numerical length is determined based on the length field data in the length field dictionary. The value field data is read from the encoded data stream based on the numerical length. The highest bit is padded in the value field data to obtain the original value field. The original value field is decoded to obtain the original data.

[0067] In a further embodiment of this application, the decoding unit determines the numerical length based on the length field data, including:

[0068] Decode the length field data to obtain the original length field value;

[0069] The numerical length is obtained by subtracting 1 from the original length field value.

[0070] A third aspect of this application provides a data encoding method, comprising:

[0071] Determine the length field and value field of each source data in the source data group;

[0072] Based on the length field data of each source data, determine the length field dictionary and its attributes;

[0073] Determine the length field data and value field data of the length field dictionary attribute, and obtain a first data item from the length field data and value field data of the length field dictionary attribute; construct a second data item from the length field dictionary; determine a third data item based on the length field dictionary and the value field data of each source data.

[0074] Generate an encoded data stream based on the first data item, the second data item, and the third data item;

[0075] The encoded data stream is sent to the service platform.

[0076] In a further embodiment of this application, the method further includes:

[0077] Determine the array length of the source data group;

[0078] Determine the length field data and value field data of the array length, and obtain the fourth data item from the length field data and value field data of the array length;

[0079] Sending the encoded data stream consisting of the first data item, the second data item, and the third data item to the service platform is further defined as: sending the encoded data stream consisting of the fourth data item, the first data item, the second data item, and the third data item to the service platform.

[0080] A fourth aspect of this application provides a data decoding method, wherein the method includes:

[0081] Receive encoded data stream;

[0082] Parse the encoded data stream to obtain the length field dictionary attribute;

[0083] Based on the length field dictionary attributes, continue parsing the remaining encoded data stream to obtain the length field dictionary;

[0084] Based on the length field dictionary, the remaining encoded data stream is further parsed to obtain the source data group.

[0085] In a further embodiment of this application, the method further includes:

[0086] The length of the source data group is obtained by parsing the encoded data stream;

[0087] The number of parsed source data is counted. When the number reaches the length of the array, the parsing of the source data group is completed.

[0088] A fifth aspect of this application provides an Internet of Things (IoT) device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the encoding method described in any of the foregoing embodiments.

[0089] The sixth aspect of this application provides an Internet of Things (IoT) application service device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the decoding method described in any of the foregoing embodiments.

[0090] A seventh aspect of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor of an Internet of Things application service device, implements the method described in any of the foregoing embodiments.

[0091] The eighth aspect of this application provides a computer program product, the computer program product including a computer program that, when executed by a processor of an Internet of Things application service device, implements the method described in any of the foregoing embodiments.

[0092] This application is applicable to data transmission in IoT scenarios, especially for data with small changes in each acquisition. It involves determining the length and value domain data of each source data in a source data group; determining a length domain dictionary and its attributes based on the length domain data of the source data group; determining the length and value domain data of the length domain dictionary attributes; obtaining a first data item from the length and value domain data of the length domain dictionary attributes; constructing a second data item from the length domain dictionary; determining a third data item based on the length domain dictionary and the value domain data of each source data; and generating an encoded data stream based on the first, second, and third data items. This approach reduces the amount of encoded data, improves the compression ratio, and increases compression / decompression speed.

[0093] To make the above and other objects, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0094] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0095] Figure 1 A structural diagram of the encoding system according to an embodiment of this application is shown;

[0096] Figure 2 A schematic diagram of the data encoding process according to an embodiment of this application is shown;

[0097] Figure 3 A flowchart of a data encoding method according to an embodiment of this application is shown;

[0098] Figure 4 Another flowchart of the data encoding method according to an embodiment of this application is shown;

[0099] Figure 5 A flowchart of a data decoding method according to an embodiment of this application is shown;

[0100] Figure 6 Another flowchart of the data decoding method according to an embodiment of this application is shown;

[0101] Figure 7 A structural diagram of a data encoding apparatus according to an embodiment of this application is shown;

[0102] Figure 8 Another structural diagram of the data encoding apparatus according to an embodiment of this application is shown;

[0103] Figure 9 Another structural diagram of the data encoding apparatus according to an embodiment of this application is shown;

[0104] Figure 10 Another structural diagram of the data encoding apparatus according to an embodiment of this application is shown;

[0105] Figure 11 A structural diagram of a data decoding apparatus according to an embodiment of this application is shown;

[0106] Figure 12 A structural diagram of an IoT application service device according to an embodiment of this application is shown.

[0107] Explanation of symbols in the attached drawings:

[0108] 101. Internet of Things (IoT) devices;

[0109] 102. Satellite communication network;

[0110] 103. Internet of Things (IoT) application service equipment;

[0111] 701. Encoding Unit;

[0112] 702. Communication Unit;

[0113] 703, First Processing Unit;

[0114] 704. Second processing unit;

[0115] 705. Third processing unit;

[0116] 1101. Communication Unit;

[0117] 1102. Decoding unit;

[0118] 1202. Internet of Things (IoT) application service equipment;

[0119] 1204, Processor;

[0120] 1206. Memory;

[0121] 1208. Drive mechanism;

[0122] 1210. Input / output module;

[0123] 1212. Input devices;

[0124] 1214. Output devices;

[0125] 1216. Presentation equipment;

[0126] 1218. Graphical User Interface;

[0127] 1220. Network interface;

[0128] 1222. Communication link;

[0129] 1224. Communication bus. Detailed Implementation

[0130] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0131] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, apparatus, product, or device that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.

[0132] This specification provides the operational steps of the methods described in the embodiments or flowcharts, but based on conventional or non-inventive labor, more or fewer operational steps may be included. The order of steps listed in the embodiments is merely one possible execution order among many and does not represent the only possible execution order. In actual system or device products, the methods shown in the embodiments or drawings can be executed sequentially or in parallel.

[0133] It should be noted that the data involved in this application (including but not limited to data used for analysis, data stored, data displayed, etc.) are all information and data authorized by the user or fully authorized by all parties, and the acquisition, transmission, storage, use and processing of the relevant data comply with the relevant laws, regulations and standards of the relevant countries and regions.

[0134] It should be noted that in the embodiments of this application, certain software, components, models and other existing solutions in the industry may be mentioned. These should be regarded as exemplary and are only intended to illustrate the feasibility of implementing the technical solution of this application. However, it does not mean that the applicant has used or necessarily used the solution.

[0135] As a typical application of satellite internet, satellite IoT is widely used in intelligent transportation, emergency rescue, security monitoring, and information sensing. With the increasing prevalence of satellite IoT devices and the continuous expansion of application scenarios, the amount of data processed by satellite IoT is increasing dramatically, placing higher demands on the bandwidth of satellite internet. To address the bandwidth requirements of satellite IoT data, it is necessary to select appropriate data compression technologies to compress IoT data, thereby reducing the data volume and lowering the bandwidth requirements.

[0136] IoT data is characterized by its massive volume, correlation, temporal sequence, and structure. IoT data exhibits strong spatial and temporal correlations and displays varying frequency distributions. Furthermore, the data is generated as a time series, with each data point accompanied by a timestamp. This temporal sequence facilitates the analysis of data timeliness, completeness, and consistency, enabling time series analysis to identify trends, periodicity, and anomalies. Finally, IoT data typically has fixed formats and types, stored and managed in tabular or database formats. The predominantly numerical data (such as temperature and humidity) allows for more efficient data compression processing.

[0137] Internet of Things (IoT) data, especially data from various sensors, generates a large amount of time-series data. Given the limited transmission capacity of satellite IoT communication, it is necessary to compress the original redundant data.

[0138] Temporal compression algorithms generally need to meet the following requirements: (1) greatly reduce data storage and transmission costs; (2) preserve the original characteristics of the data as much as possible, and be able to restore or approximately restore the original data; (3) reduce the computational complexity of the algorithm and improve the speed of compression, decompression, and random access. Therefore, compression ratio, loss ratio, and compression / decompression speed are important indicators for evaluating the quality of compression algorithms. Currently, existing compression algorithms, under the premise of lossless compression, can only achieve one of compression ratio and compression / decompression speed, and cannot simultaneously achieve both.

[0139] The purpose of this application is to compress redundant original data by dividing the source data into a length domain and a value domain using an encoding and decoding technology for time-series data, under the premise of lossless compression. Considering the relatively small differences in IoT data, a length domain dictionary is constructed by using the length domain data and the attributes of the length domain dictionary are determined. An encoded data stream is generated based on the length domain dictionary, its attributes, and the value domain data, which can further compress the data and improve the compression ratio. This approach balances compression ratio and compression / decompression speed, especially for satellite IoT time-series data, where the compression of redundant original data significantly reduces the bandwidth requirements of satellite network communication. In addition to time-series data compression and decompression scenarios, the embodiments of this application are also applicable to non-time-series data compression and decompression scenarios.

[0140] This application is highly suitable for low-bandwidth satellite IoT data transmission, reducing satellite network bandwidth requirements by compressing raw redundant data. In practical implementation, this application can also be applied to terrestrial network communications. The technical solution of this application is illustrated below using satellite IoT data compression and transmission as an example.

[0141] In some embodiments of this application, an encoding system is provided, such as... Figure 1 As shown, it includes: Internet of Things (IoT) device 101, satellite communication network 102, and IoT application service device 103.

[0142] The IoT device 101 is used to collect source data groups, determine the length field data and value field data of each source data in the source data group; determine the length field dictionary and length field dictionary attributes based on the length field data of each source data; determine the length field data and value field data of the length field dictionary attributes, and obtain the first data item from the length field data and value field data of the length field dictionary attributes, and construct the second data item from the length field dictionary; determine the third data item based on the length field dictionary and the value field data of each source data; generate an encoded data stream based on the first data item, the second data item and the third data item; and send the encoded data stream to the IoT application service device 103 through the satellite communication network 102.

[0143] The IoT application service device 103 receives the encoded data stream sent by the IoT device 101 and performs the following first operation to decode the encoded data stream: parse the encoded data stream to obtain the length field dictionary attribute; based on the length field dictionary attribute, continue to parse the remaining encoded data stream to obtain the length field dictionary; based on the length field dictionary, continue to parse the remaining encoded data stream to obtain the source data group.

[0144] The data collected by the IoT device 101 may include, for example, relative humidity and temperature. The specific data varies depending on the application scenario, and this application does not limit the specific data content. The collected data may be stored in JSON format.

[0145] The source data described in this application is non-negative integers. During implementation, the collected data is first formatted and standardized to non-negative integers. Specifically, signed integers are converted to non-negative integers using the ZigZag algorithm. Floating-point numbers are converted to integers using the IEEE 754 algorithm. This transforms the entire data compression problem into a non-negative integer compression problem.

[0146] The length field data and value field data of each source data in the source data group are implemented using the first encoding and decoding algorithm, and the above-mentioned encoded data stream is implemented using the second encoding and decoding algorithm.

[0147] The first encoding and decoding algorithm's encoding process includes: calculating the binary value of the source data using the target binary encoding algorithm; determining the length field data based on the bit length occupied by the binary value of the source data; and omitting the highest bit of the binary value of the source data to obtain the value field data.

[0148] In this application, "bit length" refers to the bit length. The length field data is the binary value of the source data occupying the specified bit length.

[0149] The binary value of the source data is calculated using the target binary encoding algorithm, such as int32, int64, int128, etc.

[0150] In some implementations, the target binary encoding algorithm is determined by: acquiring historical source data; filtering out the largest source data from the historical source data; matching the largest source data with the data range of multiple preset binary encoding algorithms; and using the matched binary encoding algorithm as the target binary encoding algorithm.

[0151] In some implementations, the target binary encoding algorithm is determined by: selecting the largest source data from the source data set; matching the largest source data with the data range of multiple preset binary encoding algorithms; and using the matched binary encoding algorithm as the target binary encoding algorithm.

[0152] In other embodiments, the target binary encoding algorithm can also be configured by the user, and the present invention does not specifically limit the target binary encoding algorithm.

[0153] The process of determining the length field data based on the bit length occupied by the binary value of the data includes: converting the bit length occupied by the binary value of the data into a binary code of the target length; and representing the length field data with a binary code of the preset length.

[0154] The target length is determined as follows: the number of binary bits occupied by the target binary encoding algorithm is decomposed into powers of two; the powers are set as the target length.

[0155] For example, when the target binary encoding algorithm is int32 encoding, the number of binary bits occupied by int32 is 2 to the power of 5. Therefore, the target length corresponding to int32 encoding is 5. Accordingly, the first encoding and decoding algorithm can be simply referred to as vuint28, and the second encoding and decoding algorithm can be simply referred to as DBD28.

[0156] For example, when the target binary encoding algorithm is int64, the number of binary bits occupied by int64 is 2 to the power of 6. Therefore, the target length corresponding to int64 encoding is 6. Accordingly, the first encoding and decoding algorithm can be simply referred to as vuint59, and the second encoding and decoding algorithm can be simply referred to as DBD59.

[0157] For example, when the target binary encoding algorithm is int128, the number of binary bits occupied by int128 is 2 to the power of 7. Therefore, the target length corresponding to int128 encoding is 7. Accordingly, the first encoding and decoding algorithm can be simply referred to as vuint122, and the second encoding and decoding algorithm can be simply referred to as DBD122.

[0158] The bit length occupied by the binary value of the source data refers to the bit length occupied starting from the first highest bit (i.e., the first 1 value) in the binary value obtained by encoding the source data using the target binary encoding algorithm.

[0159] The process of determining the length field dictionary and its attributes based on the length field data of each source data includes: traversing the length field data of each source data one by one; if the length field data does not exist in the length field dictionary, adding the length field data to the length field dictionary; obtaining the length field dictionary after traversing all the source data; and determining the length field dictionary attributes based on the length field dictionary, where the length field dictionary attributes include the length of the length field dictionary and the bit width of the length field dictionary.

[0160] The third data item is determined based on the length field dictionary and the value range data of each source data, including:

[0161] When the length field dictionary contains multiple length field data, an index dictionary is generated based on the length field dictionary. Each index in the index dictionary is associated with a length field data. The third data item is composed of the index associated with the length field data of each source data and the value field data of the source data.

[0162] When the length field dictionary contains a length field data, the value field data of each source data is integrated to obtain the third data item.

[0163] By introducing indexes, the amount of data can be further reduced while ensuring the reproducibility of the source data.

[0164] The process of generating an index dictionary from a length field dictionary includes: calculating the length of the length field dictionary; calculating the binary bit length occupied by the length of the length field dictionary; generating an index sequence based on the binary bit length; and establishing the association between the indexes in the index sequence and the length field data in the length field dictionary to obtain the index dictionary.

[0165] This application enables the terminal device to determine the length field dictionary attribute through the first data item, and enables the terminal device to determine the length field dictionary through the length field dictionary attribute, and enables the terminal device to determine the length field data and value field data through the length field dictionary, thereby obtaining the source data.

[0166] This application uses a length field to represent the bit length occupied by the binary value of the source data, and a value field to represent the data after omitting the most significant bit of the binary value of the source data. This allows for dynamic adjustment and reduction of the length of each encoded data, significantly improving the compression ratio and compression / decompression speed. By setting the first, second, and third data items, the amount of data in the length field can be further reduced, improving the compression ratio and compression / decompression speed.

[0167] In some embodiments of this application, the Internet of Things device 101 is further configured to perform the following second operation: determine the array length of the source data group; determine a fourth data item based on the length field data and value field data of the array length; and generate an encoded data stream based on the fourth data item, the first data item, the second data item, and the third data item.

[0168] This embodiment ensures decoding accuracy by adding the array length of the source data group to the encoded data stream.

[0169] The following uses the source data set [3, 15, 0, 15] (referred to as the array) as an example to illustrate the vunit28 encoding process. The specific process is as follows:

[0170] (1) Calculate the length field data: Calculate the bit length occupied by the non-negative integer binary code, use 5 bits to describe the length, and store it as the length field. The calculation results are shown in Table 1.

[0171] Table 1

[0172]

[0173] (2) Calculate the value range data: Use the int32 algorithm to calculate the binary value of non-negative integers, where the highest bit must be 1, which can be erased and does not need to be stored. The calculation results are shown in Table 2.

[0174] Table 2

[0175]

[0176] As shown in Table 2, for source data 0, omitting the most significant bit results in zero, and therefore no value range data exists. Similarly, for source data 1, omitting the most significant bit results in zero, and no value range data exists. Therefore, when the length field data

[00000] and

[00001] are identified, the source data can be determined to be 0 and 1 (see Tables 1 and 2 above). Thus, the length field data for source data 0 and 1 is set to a preset value. When the preset value is identified, the value range data can be directly determined.

[0177] (3) The length field data and the value field data are merged and output. The output results are shown in Table 3.

[0178] Table 3

[0179]

[0180] The DBD28 encoding process is illustrated below using the source data set [3, 15, 0, 15] as an example. Figure 2 As shown, the specific process is as follows: (1) Get the array length n. The length n of [3, 15, 0, 15] is 4. Encode the array length n using vuint28 to get [00011, 00].

[0181] (2) Encode any non-negative integer Ni in the array using vuint28. The encoded result is {[00010,1], [00100,111], [00000,], [00100,111]}.

[0182] (3) Form a separate length field dictionary bit_dictionary for the vuint28 encoded length field of all data in the array, which is {

[010] ,

[100] ,

[000] }.

[0183] (4) When encoding, first write the number of array elements 4 in vuint28 encoding mode. The vuint28 encoding is [00011,00].

[0184] (5) Then write the length field dictionary attribute, including:

[0185] The dictionary has a length of m, where m is 3, and its vuint28 encoding is [00010,1].

[0186] The dictionary bit width Itb (the binary bit width of the maximum value in the length field dictionary, Itb = bits(max(bit_dictionary)))) is 3, and its vuint28 encoding is [00010,1].

[0187] (6) Next, write each dictionary entry in the length field dictionary, {

[010] ,

[100] ,

[000] }.

[0188] (7) Finally, write the array elements. The specific encoding method is as follows:

[0189] (7.1) If the length field dictionary length is not equal to 1, the length field of the array element is referred to by the dictionary index. The binary length occupied by the dictionary index can be calculated from the dictionary length. The calculation method of the binary length Inb occupied by the dictionary index is as follows:

[0190] Inb = bits(len(bit_dictionary)), where bits(len(A)) refers to the number of bits contained in the binary representation of data A.

[0191] The result of Inb is

[11] , and the dictionary index is shown in Table 4 below:

[0192] Table 4

[0193] Serial Number Length field dictionary Dictionary Index 1 010 00 2 100 01 3 000 10

[0194] The value field data after the length field is written in vuint28 encoding. After integrating the dictionary index and the length field, the value field data is obtained, and the result is [001011111001111].

[0195] (7.2) If the length field dictionary length is equal to 1, do not write the length field, but directly write the value field data of the array element.

[0196] (8) Integrate array length, dictionary length, dictionary width, dictionary items, and value range items to complete DBD28 encoding. The result is [0001100000101000101010100000001011111001111].

[0197] The encoded data stream (i.e., bit stream) of DBD28 is transmitted to the IoT application service device 103 via the satellite communication network 102. The IoT application service device 103 receives the data and performs DBD28 decoding. The decoding process is as follows:

[0198] (1) For the input bit stream, first read the non-negative integer array length n according to vuint28, where n is 4.

[0199] (2) Then read the length field dictionary attributes from the bit stream, including the dictionary length m, where m is 3, and the bit width Itb occupied by each item in the dictionary, where Itb is 3. Then, according to the read length field dictionary attributes, read each item of the length field dictionary from the bit stream to form the length field dictionary bit_dictionary, which is {

[010] ,

[100] ,

[000] }.

[0200] (3) Calculate the bit length Inb of the dictionary index based on the length field dictionary, which is

[11] , and establish the index dictionary. The Internet of Things device 101 and the Internet of Things application service device 103 pre-agree on the calculation method of the index dictionary.

[0201] (4) Decode the range portion:

[0202] (4.1) If the dictionary length is not 1, for each array element, read Inb bits and find the association between the index dictionary and the length field dictionary to get the value L of the length field. Read L-1 bits to get the value field data. Set the Lth position of the value field data to 1 and output it as an array element. Decode all array elements in turn. The result is [3, 15, 0, 15].

[0203] (4.2) If the dictionary length is equal to 1, directly read L-1 bits according to the unique length field value L in the dictionary to obtain the value field data, set the Lth bit of the value field data to 1, and output it as an array element. Decode all array elements in turn.

[0204] In some embodiments of this application, the IoT device 101 performs initial encoding on the source data group before encoding the source data group itself. Initial encoding may include delta encoding of the source data group, or first dividing the source data group into blocks and then performing delta encoding on the blocks. For example, in addition to the DBD28 basic compression algorithm, variant algorithms may also be formed:

[0205] (1) First, perform delta encoding on the array, then perform DBD28 encoding, which is simply called the DBD28dlt encoding algorithm;

[0206] (2) First, divide the array into blocks, then perform delta encoding, and finally perform DBD28 encoding, which is simply called the DBD28blkdlt encoding algorithm.

[0207] In some embodiments of this application, a data encoding method is provided, which can be applied to Internet of Things (IoT) devices. Specifically, such as... Figure 3 As shown, it includes:

[0208] Step 301: Determine the length field data and value field data of each source data in the source data group.

[0209] This step can be implemented using the first encoding / decoding algorithm described above. The encoding process of the first encoding / decoding algorithm is described in the aforementioned embodiment and will not be detailed here.

[0210] Step 302: Determine the length field dictionary and length field dictionary attributes based on the length field data of each source data.

[0211] The length field dictionary is a collection of length field data from all source data. By setting the length field dictionary, length field data can be shared, reducing the amount of encoded data and improving encoding and decoding efficiency. The length field dictionary attributes include dictionary length and dictionary bit width.

[0212] Step 303: Determine the length field data and value field data of the length field dictionary attribute, and obtain the first data item from the length field data and value field data of the length field dictionary attribute, construct the second data item from the length field dictionary; determine the third data item based on the length field dictionary and the value field data of each source data.

[0213] When implementing this step, the first encoding and decoding algorithm described above can be used to determine the length field data and value field data of the length field dictionary attribute. The encoding process of the first encoding and decoding algorithm is described in the aforementioned embodiment and will not be detailed here.

[0214] The third data item, determined based on the length field dictionary and the value range data of each source data, includes:

[0215] When the length field dictionary contains multiple length field data, an index dictionary is generated based on the length field dictionary. Each index in the index dictionary is associated with a length field data. The third data item is composed of the index associated with the length field data of each source data and the value field data of the source data.

[0216] When the length field dictionary contains a length field data, the value field data of each source data is integrated to obtain the third data item.

[0217] The process of generating an index dictionary from a length field dictionary includes: calculating the length of the length field dictionary; calculating the binary bit length occupied by the length of the length field dictionary; generating an index sequence based on the binary bit length; and establishing the association between the indexes in the index sequence and the length field data in the length field dictionary to obtain the index dictionary.

[0218] Step 304: Generate an encoded data stream based on the first data item, the second data item, and the third data item. In this step, the encoded data stream is generated in the order of the first data item, the second data item, and the third data item.

[0219] Step 305: Send the encoded data stream to the service platform. This step involves sending the encoded data stream to the service platform via a satellite communication network.

[0220] In some embodiments of this application, another data encoding method is provided, which can be applied to Internet of Things (IoT) devices. Specifically, such as... Figure 4 As shown, it includes:

[0221] Step 401: Determine the length field data and value field data of each source data in the source data group.

[0222] Step 402: Determine the length field dictionary and length field dictionary attributes based on the length field data of each source data.

[0223] Step 403: Determine the array length of the source data group, as well as the length field data and value field data of the array length, and obtain the fourth data item from the length field data and value field data of the array length;

[0224] Determine the length field data and value field data of the length field dictionary attributes, and obtain the first data item from the length field data and value field data of the length field dictionary attributes, construct the second data item from the length field dictionary; determine the third data item based on the length field dictionary and the value field data of each source data.

[0225] Step 404: Generate an encoded data stream based on the fourth data item, the first data item, the second data item, and the third data item. In this step, the encoded data stream is generated in the order of the fourth data item, the first data item, the second data item, and the third data item.

[0226] Step 405: Send the encoded data stream to the service platform.

[0227] This embodiment ensures that the service platform can decode correctly by adding an array length to the encoded data stream.

[0228] In some embodiments of this application, before steps 301 and 401 are performed, the method further includes: initial encoding of the source data group. By initially encoding the source data group, the application scenarios of the encoding / decoding method of this application can be expanded.

[0229] In some embodiments of this application, a data decoding method is also provided, which can be applied to a service platform, such as an Internet of Things (IoT) application service device. Specifically, such as... Figure 5 As shown, the data decoding method includes:

[0230] Step 501: Receive the encoded data stream.

[0231] Step 502: Parse the encoded data stream to obtain the dictionary attributes of the length field.

[0232] Step 503: Based on the length field dictionary attributes, continue parsing the remaining encoded data stream to obtain the length field dictionary.

[0233] Step 504: Based on the length field dictionary, continue parsing the remaining encoded data stream to obtain the source data group.

[0234] In some embodiments of this application, another data decoding method is also provided, such as... Figure 6 As shown, the data decoding method includes:

[0235] Step 601: Receive the encoded data stream.

[0236] Step 602: Parse the encoded data stream to obtain the array length of the source data group.

[0237] Step 603: Parse the encoded data stream to obtain the length field dictionary attribute.

[0238] Step 604: Based on the length field dictionary attributes, continue parsing the remaining encoded data stream to obtain the length field dictionary.

[0239] Step 605: Based on the length field dictionary, continue parsing the remaining encoded data stream and count the number of parsed metadata. When the number reaches the array length, the source data group is obtained.

[0240] Figure 3The illustrated embodiments and Figure 5 The illustrated embodiment is compatible with, Figure 4 The illustrated embodiments and Figure 6 The illustrated embodiments, when used together, enable the sharing of length field data from each source data, reducing the amount of encoded data, improving the compression ratio, and increasing the compression / decompression speed.

[0241] In some embodiments of this application, a data encoding device is also provided, which can be applied to Internet of Things (IoT) devices, such as... Figure 7 As shown, the data encoding device includes:

[0242] Encoding unit 701 is configured to perform the following first operation:

[0243] Determine the length field and value field of each source data in the source data group;

[0244] Based on the length field data of each source data, determine the length field dictionary and its attributes;

[0245] Determine the length field data and value field data of the length field dictionary attributes, and obtain the first data item from the length field data and value field data of the length field dictionary attributes; construct the second data item from the length field dictionary; determine the third data item based on the length field dictionary and the value field data of each source data.

[0246] Generate an encoded data stream based on the first data item, the second data item, and the third data item;

[0247] Communication unit 702 is configured to send an encoded data stream to a service platform.

[0248] In a further embodiment of this application, the encoding unit 701 is also configured to perform the following second operation:

[0249] Determine the array length of the source data set;

[0250] Determine the length field data and value field data of the array length, and obtain the fourth data item from the length field data and value field data of the array length.

[0251] Generate an encoded data stream based on the fourth data item, the first data item, the second data item, and the third data item.

[0252] In a further embodiment of this application, the encoding unit 701 determines the third data item based on the length field dictionary and the value field data of each source data, including:

[0253] When the length field dictionary contains multiple length field data, an index dictionary is generated based on the length field dictionary. Each index in the index dictionary is associated with a length field data. The third data item is composed of the index associated with the length field data of each source data and the value field data of the source data.

[0254] When the length field dictionary contains a length field data, the value field data of each source data is integrated to obtain the third data item.

[0255] In a further embodiment of this application, the encoding unit 701 generates an index dictionary based on the length field dictionary, including:

[0256] Calculate the length of the length field dictionary;

[0257] Calculate the number of binary bits used to quantify the length of the length field dictionary;

[0258] Generate an index sequence based on the binary bit length;

[0259] The index dictionary is obtained by establishing the association between the index in the index sequence and the length field data in the length field dictionary.

[0260] In a further embodiment of this application, the encoding unit 701 is also configured to perform the following third operation:

[0261] Perform initial encoding on the source data set.

[0262] In a further embodiment of this application, the encoding unit 701 determines the length field data and value field data of the target data, including: calculating the binary value of the target data using a target binary encoding algorithm; determining the length field data based on the bit length occupied by the binary value of the target data; and omitting the highest bit of the binary value of the target data to obtain the value field data.

[0263] In some embodiments of this application, such as Figure 8 As shown, the data encoding device also includes:

[0264] The first processing unit 703 is configured to perform the following operations to determine the target binary encoding algorithm:

[0265] Obtain historical source data; filter out the largest source data from the historical source data; match the largest source data with the data range of multiple preset binary encoding algorithms; use the matched binary encoding algorithm as the target binary encoding algorithm.

[0266] In some embodiments of this application, such as Figure 9 As shown, the data encoding device also includes:

[0267] The second processing unit 704 is configured to perform the following operations to determine the target binary encoding algorithm:

[0268] Filter the largest source data from the source data group; match the largest source data with the data range of multiple preset binary encoding algorithms; and use the matched binary encoding algorithm as the target binary encoding algorithm.

[0269] In some embodiments of this application, the encoding unit 701 determines the length field data based on the bit length occupied by the binary value of the target data, including: converting the bit length occupied by the binary value of the target data into a binary code of the target length; and representing the length field data by a binary code of a preset length.

[0270] Furthermore, such as Figure 10 As shown, the data encoding device also includes:

[0271] The third processing unit 705 is configured to perform the following operations to determine the target length: decompose the number of binary bits occupied by the target binary encoding algorithm into powers of two; and set the powers as the target length.

[0272] In some embodiments of this application, a data decoding device is also provided, applied to a service platform, such as an Internet of Things (IoT) application service device, such as... Figure 11 As shown, the data decoding device includes:

[0273] Communication unit 1101 is configured to receive encoded data streams.

[0274] Decoding unit 1102 is configured to perform the following fourth operation: parse the encoded data stream to obtain the length field dictionary attribute; based on the length field dictionary attribute, continue to parse the remaining encoded data stream to obtain the length field dictionary; based on the length field dictionary, continue to parse the remaining encoded data stream to obtain the source data group.

[0275] In some embodiments of this application, the decoding unit 1102 is further configured to perform the following fifth operation:

[0276] Parse the encoded data stream to obtain the array length of the source data group; count the number of parsed source data, and when the number reaches the array length, the parsing of the source data group is completed.

[0277] In some embodiments of this application, the decoding unit 1102 continues to parse the remaining encoded data stream to obtain the source data group based on the length field dictionary, including:

[0278] Parse the remaining encoded data stream as follows:

[0279] Based on the length field dictionary, determine the dictionary index length and generate the dictionary index;

[0280] Based on the dictionary index bit length, read the first data from the remaining encoded data stream;

[0281] The length field data is determined based on the first data and the dictionary index;

[0282] When the length field data is a preset value, the original data is obtained by decoding the length field data.

[0283] When the length field data is not a preset value, the numerical length is determined based on the length field data, the value field data is read from the remaining encoded data stream based on the numerical length, the highest bit is padded in the value field data to obtain the original value field data, and the original value field data is decoded to obtain the source data.

[0284] The decoding unit 1102 determines the numerical length based on the length field data, including: decoding the length field data to obtain the original length field value; and subtracting 1 from the original length field value to obtain the numerical length.

[0285] In some embodiments of this application, the decoding unit 1102 further parses the remaining encoded data stream to obtain the source data group based on the length field dictionary, and also includes:

[0286] Determine the length field data contained in the length field dictionary. When the length field dictionary contains a length field data, parse the remaining encoded data stream as follows:

[0287] The numerical length is determined based on the length field data in the length field dictionary. The value field data is read from the encoded data stream based on the numerical length. The highest bit is padded in the value field data to obtain the original value field. The original value field is decoded to obtain the original data.

[0288] In summary, the encoding / decoding method and apparatus provided in this application can achieve the following technical effects:

[0289] (1) By omitting the highest bit of the binary value of the source data, the compression rate can be improved.

[0290] (2) By using a length field dictionary to index the length field, the compression rate can be further improved, especially for data sequences with only one element in the length field dictionary, the compression rate can be greatly improved.

[0291] (3) It has a high compression ratio while ensuring the compression / decompression rate.

[0292] (4) This application can represent most numbers in the physical world. For a few extremely large numbers, it can be flexibly modified by increasing the number of bits in the length field (such as DBD59, DBD122, etc.).

[0293] (5) If there are a few extremely large numbers in an array, most other algorithms will have their compression ratio greatly reduced due to the presence of these extremely large numbers. This application is not affected by this. It can appropriately match the target binary algorithm based on the largest number in the array, that is, appropriately increase the length field data, thereby improving the compression ratio.

[0294] In one embodiment of this application, weather relative humidity meteorological data is compressed and decompressed. The results are compared with over ten commonly used compression algorithms, including DBD28, DBD28dlt, DBD28blkdlt, and simple8b.

[0295] By comparing DBD28 with mainstream compression algorithms such as Google's Snappy, Facebook's Zstd, and Zlib, it was found that among the 11 compression algorithms (excluding memcpy which does not compress), DBD28 has the highest compression ratio, indicating that it has excellent compression capabilities. DBD28dlt and DBD28blkdlt are the two algorithms with the highest compression ratios, designed for satellite IoT transmission scenarios, maximizing data compression and saving communication bandwidth.

[0296] In one embodiment of this application, as Figure 12 As shown, an Internet of Things (IoT) application service device 1202 is also provided. The IoT application service device 1202 may include one or more processors 1204, such as one or more central processing units (CPUs), each of which can implement one or more hardware threads. The IoT application service device 1202 may also include any type of memory 1206 for storing information of any kind, such as code, settings, data, etc. Non-limitingly, for example, the memory 1206 may include any type of RAM, any type of ROM, flash memory, hard disk, optical disk, etc. More generally, any memory can use any technology to store information. Furthermore, any memory can provide volatile or non-volatile retention of information. Furthermore, any memory can represent a fixed or removable component of the IoT application service device 1202. In one case, when the processor 1204 executes associated instructions stored in any memory or combination of memories, the IoT application service device 1202 can perform any operation of the associated instructions. The Internet of Things application service device 1202 also includes one or more drive mechanisms 1208 for interacting with any memory, such as hard disk drive mechanism, optical disk drive mechanism, etc.

[0297] The IoT application service device 1202 may further include an input / output module 1210 (I / O) for receiving various inputs (via input device 1212) and providing various outputs (via output device 1214). A specific output mechanism may include a presentation device 1216 and an associated graphical user interface (GUI) 1218. In other embodiments, the input / output module 1210 (I / O), input device 1212, and output device 1214 may be omitted, and the device may function solely as an IoT application service device within a network. The IoT application service device 1202 may also include one or more network interfaces 1220 for exchanging data with other devices via one or more communication links 1222. One or more communication buses 1224 couple the components described above together.

[0298] Communication link 1222 can be implemented in any way, such as via a local area network, a wide area network (e.g., the Internet), a point-to-point connection, or any combination thereof. Communication link 1222 may include any combination of hardwired links, wireless links, routers, gateway functions, name servers, etc., governed by any protocol or combination of protocols.

[0299] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the above-described method.

[0300] This application also provides a computer-readable instruction, wherein when a processor executes the instruction, the program therein causes the processor to perform the method described in any of the foregoing embodiments.

[0301] It should be understood that in the various embodiments of this application, the order of the above-mentioned processes does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0302] It should also be understood that, in the embodiments of this application, the term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this application generally indicates that the preceding and following related objects have an "or" relationship.

[0303] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed in this application can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0304] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0305] In the embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the couplings or direct couplings or communication connections shown or discussed may be indirect couplings or communication connections through some interfaces, apparatuses, or units, or they may be electrical, mechanical, or other forms of connection.

[0306] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of the embodiments of this application, depending on actual needs.

[0307] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0308] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause an IoT application service device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0309] This application uses specific embodiments to illustrate the principles and implementation methods of this application. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A data encoding device, wherein, The device includes: An encoding unit, configured to perform the following first operation: Determine the length field and value field of each source data in the source data group; Based on the length field data of each source data, determine the length field dictionary and its attributes; Determine the length field data and value field data of the length field dictionary attribute, and obtain a first data item from the length field data and value field data of the length field dictionary attribute; construct a second data item from the length field dictionary; and determine a third data item based on the length field dictionary and the value field data of each source data. Generate an encoded data stream based on the first data item, the second data item, and the third data item; A communication unit configured to send the encoded data stream to a service platform.

2. The apparatus of claim 1, wherein, The encoding unit is also configured to perform the following second operation: Determine the array length of the source data group; Determine the length field data and value field data of the array length, and obtain the fourth data item from the length field data and value field data of the array length; An encoded data stream is generated based on the fourth data item, the first data item, the second data item, and the third data item.

3. The apparatus of claim 1, wherein, The encoding unit determines the third data item based on the length field dictionary and the value field data of each source data, including: When the length field dictionary contains multiple length field data, an index dictionary is generated based on the length field dictionary, and each index in the index dictionary is associated with a length field data; the index associated with the length field data of each source data and the value field data of the source data constitute the third data item; When the length field dictionary contains a length field data, the value field data of each source data is integrated to obtain the third data item.

4. The apparatus of claim 3, wherein, The encoding unit generates an index dictionary based on the length field dictionary, including: Calculate the length of the length field dictionary; Calculate the binary bit length occupied by the length field dictionary; Generate an index sequence based on the stated binary bit length; The index dictionary is obtained by establishing the association between the index in the index sequence and the length field data in the length field dictionary.

5. The apparatus of claim 1, wherein, The encoding unit is also configured to perform the following third operation: Perform initial encoding on the source data set.

6. The apparatus of claim 1, wherein, The encoding unit determines the length field data and value field data of the target data, including: The binary value of the target data is calculated using the target binary encoding algorithm; The length field data is determined based on the bit length occupied by the binary value of the target data; The highest bit of the binary value of the target data is omitted to obtain the value range data.

7. The apparatus of claim 6, wherein, The device further includes: A first processing unit is configured to perform the following operations to determine the target binary encoding algorithm: Obtain historical source data; The largest source data is selected from the historical source data; The maximum source data is matched with the data range of multiple preset binary encoding algorithms; The matched binary encoding algorithm is used as the target binary encoding algorithm.

8. The apparatus of claim 6, wherein, The device further includes: The second processing unit is configured to perform the following operations to determine the target binary encoding algorithm: Filter the largest source data from the source data group; Match the maximum source data with the data range of multiple preset binary encoding algorithms; The matched binary encoding algorithm is used as the target binary encoding algorithm.

9. The apparatus of claim 6, wherein, The encoding unit determines the length field data based on the bit length occupied by the binary value of the target data, including: Convert the bit length occupied by the binary value of the target data into a binary code of the target length; The length field data is represented by a binary code of a preset length.

10. The apparatus of claim 9, wherein, The device further includes: A third processing unit is configured to perform the following operation to determine the target length: The number of binary bits used by the target binary encoding algorithm is decomposed into powers of two; Set the power as the target length.

11. A data decoding apparatus, wherein, The device includes: A communication unit configured to receive an encoded data stream; The decoding unit is configured to perform the following fourth operation: Parse the encoded data stream to obtain the length field dictionary attribute; Based on the length field dictionary attributes, continue parsing the remaining encoded data stream to obtain the length field dictionary; Based on the length field dictionary, the remaining encoded data stream is further parsed to obtain the source data group.

12. The apparatus of claim 11, wherein, The decoding unit is also configured to perform the following fifth operation: The length of the source data group is obtained by parsing the encoded data stream; The number of parsed source data is counted. When the number reaches the length of the array, the parsing of the source data group is completed.

13. The apparatus of claim 11, wherein, The decoding unit continues to parse the remaining encoded data stream to obtain the source data group based on the length field dictionary, including: Parse the remaining encoded data stream as follows: Based on the length field dictionary, determine the dictionary index length and generate the dictionary index; Based on the dictionary index bit length, read the first data from the remaining encoded data stream; The length field data is determined based on the first data and the dictionary index; When the length field data is a preset value, the original data is obtained by decoding the length field data. When the length field data is not a preset value, the numerical length is determined based on the length field data, the value field data is read from the remaining encoded data stream based on the numerical length, the highest bit is padded in the value field data to obtain the original value field data, and the original value field data is decoded to obtain the source data.

14. The apparatus of claim 13, wherein, The decoding unit further parses the remaining encoded data stream to obtain the source data group based on the length field dictionary, and also includes: Determine the length field data contained in the length field dictionary. When the length field dictionary contains one length field data, parse the remaining encoded data stream as follows: The numerical length is determined based on the length field data in the length field dictionary. The value field data is read from the encoded data stream based on the numerical length. The highest bit is padded in the value field data to obtain the original value field. The original value field is decoded to obtain the original data.

15. The apparatus of claim 13, wherein, The decoding unit determines the numerical length based on the length field data, including: Decode the length field data to obtain the original length field value; The numerical length is obtained by subtracting 1 from the original length field value.

16. A data encoding method, wherein, include: Determine the length field and value field of each source data in the source data group; Based on the length field data of each source data, determine the length field dictionary and its attributes; Determine the length field data and value field data of the length field dictionary attribute, and obtain a first data item from the length field data and value field data of the length field dictionary attribute; construct a second data item from the length field dictionary; and determine a third data item based on the length field dictionary and the value field data of each source data. Generate an encoded data stream based on the first data item, the second data item, and the third data item; The encoded data stream is sent to the service platform.

17. The method of claim 16, wherein, The method further includes: Determine the array length of the source data group; The length field data and value field data of the array length are determined, and the fourth data item is obtained from the length field data and value field data of the array length. The encoded data stream composed of the first data item, the second data item and the third data item is sent to the service platform. The further step is to send the encoded data stream composed of the fourth data item, the first data item, the second data item and the third data item to the service platform.

18. A data decoding method, wherein, The method includes: Receive encoded data stream; Parse the encoded data stream to obtain the length field dictionary attribute; Based on the length field dictionary attributes, continue parsing the remaining encoded data stream to obtain the length field dictionary; Based on the length field dictionary, the remaining encoded data stream is further parsed to obtain the source data group.

19. The method of claim 18, wherein, The method further includes: The length of the source data group is obtained by parsing the encoded data stream; The number of parsed source data is counted. When the number reaches the length of the array, the parsing of the source data group is completed.

20. An Internet of Things (IoT) device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein, When the processor executes the computer program, it implements the method of claim 16 or 17.

21. An Internet of Things (IoT) application service device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein, When the processor executes the computer program, it implements the method of claim 18 or 19.

22. A computer-readable storage medium storing a computer program, wherein, When the computer program is executed by the processor of the Internet of Things application service device, it implements the method of any one of claims 16 to 19.

23. A computer program product, the computer program product comprising a computer program, wherein, When the computer program is executed by the processor of the Internet of Things application service device, it implements the method of any one of claims 16 to 19.