Method and apparatus for data compression and decompression

By using predefined codebooks to encode and decode data in data transmission, the problem of taking into account both data transmission efficiency and security is solved, and efficient and secure data transmission is achieved.

CN118945237BActive Publication Date: 2024-12-20SHANGHAI TUSHUANG PRECISION EQUIP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411425924.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-14
Publication Date
2024-12-20
Estimated Expiration
2044-10-14

AI Technical Summary

Technical Problem

During data transmission, the prior art is difficult to improve data compression efficiency without sacrificing data security, especially when bandwidth, storage space and energy consumption are limited, transmission efficiency and security are difficult to take into account.

Method used

By using the predefined codebook at the sender and the receiver, the data is encoded and decoded, divided into the first encoding part and the second encoding part, and combined and combined based on the predefined codebook to ensure the security of data transmission Sex and efficiency.

Benefits of technology

It realizes that without affecting data security, significantly improves data transmission efficiency, reduces the use of transmission resources, and ensures the security of data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118945237B_ABST
    Figure CN118945237B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a method and apparatus for data compression and decompression. The data compression method according to the present disclosure may include: determining one or more data to be compressed; encoding each of the one or more data to obtain one or more encoded data, wherein each of the one or more encoded data includes a first encoded part and a second encoded part; compressing the first encoded part of each encoded data to obtain a compressed first encoded part; selecting a codeword from a predefined codebook stored at the sender; and combining the compressed first encoded part and the second encoded part of each encoded data according to a rule corresponding to the selected codeword to obtain compressed data. The data compression method according to the present disclosure can compress data while ensuring security, reduce the transmission resources occupied during data transmission, and greatly improve transmission efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data transmission, and in particular to a method and device for data compression and decompression. Background Art

[0002] With the rapid development of information technology, data transmission has become an indispensable part of modern society. As the demand for data transmission grows, the requirements for data transmission rate are also getting higher and higher. However, when dealing with large amounts of data transmission, it is often limited by resources such as bandwidth, storage space, occupancy time and energy consumption. For example, in a communication system composed of multiple devices, the efficiency of data transmission directly affects the response speed and performance of the entire system. In order to reduce the occupation of resources, it is often necessary to compress the transmitted data. This requires not only that the compression technology can efficiently reduce the amount of data, but also that the compression and decompression process is fast enough to meet the needs of efficient communication. At the same time, data compression may affect the security of the data. When designing a compression algorithm, how to improve the compression efficiency without sacrificing data security has also become a technical problem that needs to be solved urgently.

[0003] Therefore, there is an urgent need for a method to improve compression efficiency while ensuring data security. Summary of the invention

[0004] To overcome one or more of the shortcomings of the prior art, the present disclosure provides a method and apparatus for data compression and decompression. According to the data compression method of the present disclosure, one or more data to be sent are encoded at the sender based on the predefined codebook stored at the sender to obtain one or more encoded data including a first encoding part and a second encoding part, the first encoding part is compressed, and the compressed first encoding part and the second encoding part are combined to obtain the final compressed data for sending to the receiver. According to the data decompression method of the present disclosure, compressed data and codewords are extracted from the received data at the receiver, and the first part and the second part of each of the one or more data are extracted based on the predefined codebook stored at the receiver, and the first part and the second part of each data are combined according to the rule to obtain one or more data respectively. According to the data compression or decompression method of the present disclosure, the predefined codebook stored at the sender and the receiver is used to compress and decompress the data to be transmitted, which reduces the transmission resources occupied during data transmission and greatly improves the transmission efficiency. In addition, since the predefined codebooks stored at the sender and the receiver are preset at the sender and the receiver at the time of initialization or before transmission. A third party who does not know the predefined codebook cannot decode the transmitted data, thus ensuring the security of data transmission.

[0005] In a first aspect, the present disclosure provides a data compression method performed by a sender. The data compression method may include: determining one or more data to be compressed; encoding each of the one or more data to obtain one or more encoded data, wherein each of the one or more encoded data includes a first encoded part and a second encoded part; compressing the first encoded part of each encoded data to obtain a compressed first encoded part; selecting a codeword from a predefined codebook stored at the sender; and combining the compressed first encoded part and the second encoded part of each encoded data according to a rule corresponding to the selected codeword to obtain compressed data.

[0006] According to one embodiment of the present disclosure, optionally, one or more data may be in a first format, and one or more encoded data may be in a second format.

[0007] According to one embodiment of the present disclosure, optionally, encoding each of the one or more data may further include: converting each of the one or more data from a first format to a second format, wherein the first encoded part of each encoded data is the remainder part of the corresponding encoded data, and the second encoded part is the integer part of the corresponding encoded data.

[0008] According to one embodiment of the present disclosure, optionally, the number of bits of the compressed first encoded part of one or more data, the number of bits of the second encoded part, the number of bits of the codewords in the predefined codebook, and the rules corresponding to each codeword are known in advance by both the sender and the receiver.

[0009] According to one embodiment of the present disclosure, optionally, compressing the first coded part known in advance by the sender to obtain a compressed first coded part may further include: converting the first coded part into a number having a corresponding number of bits according to the number of bits of the first coded part defined by a rule.

[0010] According to one embodiment of the present disclosure, optionally, combining the compressed first encoded part and the second encoded part of each encoded data according to a rule may further include: combining the compressed first encoded part and the second encoded part according to the order of the compressed first encoded part and the second encoded part of each encoded data in one or more encoded data defined by the rule to obtain compressed data.

[0011] According to one embodiment of the present disclosure, optionally, the data compression method may further include: combining the compressed data and the codeword according to a predetermined order to form combined data; converting the combined data into a first format; and transmitting the combined data to a receiver.

[0012] According to one embodiment of the present disclosure, optionally, the predetermined order may be known in advance by both the sender and the receiver.

[0013] In a second aspect, the present disclosure provides a data decompression method performed by a receiving party. The data decompression method may include: receiving combined data and decoding the combined data; decomposing the decoded combined data into compressed data and codewords; determining a rule corresponding to the codeword from a predefined codebook stored at the receiving party; extracting a first part and a second part of each of one or more data from the compressed data according to the rule; and combining the first part and the second part of each data to obtain one or more data respectively.

[0014] According to one embodiment of the present disclosure, optionally, the number of bits of the compressed first encoded part of one or more data, the number of bits of the second encoded part, the predefined codebook, the number of bits of the codewords in the predefined codebook, and the predetermined order of the compressed data and the codewords are known in advance by both the sender and the receiver.

[0015] According to one embodiment of the present disclosure, optionally, the combined data may be in a first format, and the decoded combined data may be in a second format.

[0016] According to one embodiment of the present disclosure, optionally, decoding the combined data may further include: converting the combined data into a second format.

[0017] According to one embodiment of the present disclosure, optionally, decomposing the decoded combined data into compressed data and codewords may further include: extracting the codewords according to a predetermined order and the number of bits of the codewords known in advance by the receiver and determining the remaining part of the decoded combined data after extracting the codewords as compressed data.

[0018] According to one embodiment of the present disclosure, optionally, the predetermined order may be known in advance by both the sender and the receiver.

[0019] According to one embodiment of the present disclosure, optionally, extracting the first part and the second part of each of one or more data from the compressed data according to a rule may further include: extracting the first part and the second part of each data according to the order of the first part and the second part of each data defined by the rule, wherein the first part of each data is the remainder part of the corresponding data, and the second part is the integer part of the corresponding data.

[0020] According to one embodiment of the present disclosure, optionally, combining the decompressed first part and the second part of each data according to a rule to respectively obtain one or more data may further include: decompressing the first part of each data to obtain the decompressed first part; and combining the decompressed first part and the second part of each data according to a rule to respectively obtain one or more data.

[0021] According to an embodiment of the present disclosure, optionally, decompressing the first part of each data to obtain the decompressed first part may further include: filling the first part with bits according to the number of bits of the first part defined by the rule to obtain the decompressed first part.

[0022] In a third aspect, the present disclosure provides an apparatus for data compression or decompression, which may include: a memory; and a processor, the processor being coupled to the memory and configured to execute the method described above.

[0023] In a fourth aspect, the present disclosure provides a non-transitory computer readable medium having codes stored thereon, which can be executed by a processor to perform the method as described above.

[0024] The data compression method or data decompression method according to the present disclosure can compress and decompress data, reduce the transmission resources occupied during data transmission (for example, the duration of occupying the channel, etc.), and greatly improve the transmission efficiency. At the same time, the data compression method or data decompression method according to the present disclosure relies on the predefined code stored at the sender and the receiver to compress and decompress the data, thereby improving the security of the data.

[0025] These and other features and advantages will become apparent by reading the following detailed description and by reference to the associated drawings.It is to be understood that the foregoing general description and the following detailed description are illustrative only and are not restrictive of the aspects of what is claimed. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to understand in detail the manner in which the above features of the present disclosure are used, the above briefly summarized contents may be described in more detail with reference to various embodiments, some of which are shown in the accompanying drawings. However, it should be noted that the accompanying drawings only show certain typical aspects of the present disclosure and should not be considered to limit its scope, as the description may allow for other equally effective aspects.

[0027] Figure 1 A schematic diagram illustrating a communication system according to an embodiment of the present disclosure is illustrated.

[0028] Figure 2 A flow chart illustrating a data compression method according to an embodiment of the present disclosure is illustrated.

[0029] Figure 3 A flow chart illustrating a data decompression method according to an embodiment of the present disclosure is illustrated.

[0030] Figure 4 A block diagram of an apparatus according to an embodiment of the present disclosure is illustrated. DETAILED DESCRIPTION

[0031] In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the described embodiments. However, it will be apparent to those skilled in the art that the described embodiments may be practiced without some or all of these specific details. In other embodiments, well-known structures or processing steps are not described in detail to avoid unnecessarily obscuring the concepts of the present disclosure.

[0032] In the description of the embodiments of the present disclosure, it should be noted that, unless otherwise specified, the term "plurality" means more than two; the term "and / or" is merely a description of the association relationship of associated objects, indicating that three relationships may exist, for example, A and / or B may represent: A exists alone, A and B exist at the same time, and B exists alone; the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship. In addition, the terms "first", "second", "third", etc. are used for descriptive purposes only and cannot be understood as indicating or implying relative importance.

[0033] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by technicians in the technical field to which the present disclosure belongs; the terms used herein are only for the purpose of describing specific embodiments and are not intended to limit the present disclosure; the terms "including" and "having" in the specification and claims of the present disclosure and the above-mentioned figure descriptions and any variations thereof are intended to cover non-exclusive inclusions.

[0034] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present disclosure. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0035] As used herein, the terms "coupled" and "coupled" mean directly connected to or connected through one or more intervening media or components. For those of ordinary skill in the art, the specific meanings of the above terms in the present disclosure can be understood as the specific circumstances. Moreover, in the following description and for the purpose of explanation, specific nomenclature is set forth to provide a thorough understanding of the various embodiments of the present disclosure. However, it will be apparent to those skilled in the art that the exemplary embodiments can be practiced without these specific details.

[0036] When dealing with large amounts of data transmission, it is often limited by resources such as bandwidth, storage space, occupancy time and energy consumption. For example, in the process of bus communication, such as but not limited to RS485, SPI, CAN bus, etc., since there are multiple devices hanging on the bus, the efficiency of data transmission directly affects the response speed and performance of the entire system. In order to reduce the occupancy time of the bus, it is often necessary to compress the transmitted data. This not only requires compression technology to be able to efficiently reduce the amount of data, but also requires the compression and decompression process to be fast enough to meet the needs of efficient communication. At the same time, data compression may affect the security of the data. When designing a compression algorithm, how to improve compression efficiency without sacrificing data security has also become a technical problem that needs to be solved urgently.

[0037] In order to solve one or more of the above problems, the present disclosure provides a method for data compression and decompression. According to the data compression method of the present disclosure, one or more data to be sent are respectively encoded at the sender to obtain one or more encoded data including a first encoding part and a second encoding part, the first encoding part is compressed, and the compressed first encoding part and the second encoding part are combined (or pieced together) based on the predefined code book stored at the sender to obtain the final compressed data for sending to the receiver. According to the data decompression method of the present disclosure, the compressed data and codewords are extracted from the received data at the receiver according to a predetermined order, the first part and the second part of each of the one or more data are respectively extracted based on the predefined code book stored at the receiver, and the first part and the second part of each data are combined according to the rule to obtain one or more data respectively. According to the data compression or decompression method of the present disclosure, the predefined code book stored at the sender and the receiver is used to compress and decompress the data to be transmitted, which reduces the transmission resources occupied during data transmission and greatly improves the transmission efficiency. In addition, since the predefined code books stored at the sender and the receiver are preset at the sender and the receiver at the time of initialization or before transmission. A third party who does not know the predefined codebook cannot decode the data, thus ensuring transmission security. The method for data compression and decompression will be specifically described below in conjunction with the accompanying drawings and some embodiments will be listed for further specific description.

[0038] Figure 11 illustrates a schematic diagram of a communication system 100 according to an embodiment of the present disclosure. Figure 1 As shown, the communication system 100 may include a sender 105 and a receiver 110. It is worth noting that although Figure 1 It is shown in the figure that the communication system 100 includes a sender 105 and a receiver 110, but the communication system 100 according to the present disclosure may include more than one sender and more than one receiver without departing from the scope of the present disclosure. For example, in a bus communication system, multiple devices may be hung on the bus. Those skilled in the art will appreciate that the method for data compression and decompression according to the present disclosure may be applicable to a bus communication system or to any other communication system without departing from the scope of the present disclosure. For ease of explanation, a sender 105 and a receiver 110 are defined. However, those skilled in the art will appreciate that in the present embodiment, the sender and the receiver may be interchangeable. The sender 105 may be a receiver, and the receiver 110 may be a sender.

[0039] Figure 2 A flow chart of a data compression method 200 according to an embodiment of the present disclosure is illustrated. Figure 2 , the data compression method 200 may be performed by the sender 105 (eg, a processor of the sender 105 ) and includes the following steps.

[0040] At 205, the sender 105 may determine one or more data to be compressed. As an example, the sender may determine that there are one or more data to be transmitted to the receiver 110. Before transmitting the one or more data, the one or more data need to be compressed.

[0041] At 210, the sender 105 may encode each of the one or more data to obtain one or more coded data. In this embodiment, each of the one or more coded data may include a first coding part and a second coding part. In an optional embodiment, the one or more data may be in a first format, and the one or more coded data may be in a second format. For example, the sender 105 may convert each of the one or more data from the first format to the second format. In this embodiment, the first coding part of each coded data may be the remainder part of the corresponding coded data, and the second coding part may be the integer part of the corresponding coded data. As an example, the first format may be hexadecimal, and the second format may be binary. For example, the sender 105 may convert each of the one or more data from hexadecimal to binary. That is, the one or more coded data adopts a binary format. The first coding part of each coded data may be the remainder part of the binary coded data, and the second coding part may be the integer part of the binary coded data. In some cases, the number of digits of the integer part may depend on the value range of the parameter. For example, the number of digits of the integer part may depend on the maximum value of the parameter. In some cases, the number of digits of the remainder part may depend on the precision of the parameter.

[0042] At 215, the sender 105 may compress the first coded part of each coded data to obtain a compressed first coded part. In an optional embodiment, the sender 105 may convert the first coded part into a number of corresponding bits according to the number of bits of the first coded part known in advance by the sender 105. In an example, the number of bits of the compressed first coded part and the number of bits of the second coded part of one or more data may be known in advance by both the sender and the receiver.

[0043] At 220, the sender 105 may select a codeword from a predefined codebook stored at the sender 105. In some cases, the predefined codebook may be known to both the sender 105 and the receiver 110. The predefined codebook includes one or more codewords. Each codeword may represent a rule corresponding to the codeword. In addition, in one example, the rule corresponding to each codeword may be known in advance by both the sender and the receiver. Examples of predefined codebooks will be given in the following embodiments.

[0044] At 225, the sender 105 may combine the compressed first encoded portion and the second encoded portion of each encoded data according to the rule corresponding to the selected codeword to obtain compressed data. In an optional embodiment, the sender 105 may combine the compressed first encoded portion and the second encoded portion of each encoded data according to the order defined by the rule to obtain compressed data. As an example, the rule may define the order of the compressed first encoded portion and the second encoded portion of each encoded data in one or more encoded data. For example, when encoding two data, the rule may define the order as: the compressed first encoded portion of the first encoded data, the compressed first encoded portion of the second encoded data, the second encoded portion of the first encoded data, and the second encoded portion of the second encoded data.

[0045] Additionally, in an optional embodiment, the data compression method 200 may further include: combining the compressed data and the codeword according to a predetermined order to form combined data; converting the combined data into a first format; and transmitting the combined data to the receiver. In some cases, the number of bits of the codewords in the predefined codebook may be known in advance by both the sender and the receiver. In some cases, the predetermined order of the compressed data and the codeword may be known in advance by both the sender and the receiver.

[0046] It is worth noting that the number of bits of the compressed first coded part of one or more data, the number of bits of the second coded part, the number of bits of the codewords in the predefined codebook, the rules corresponding to each codeword, and the predetermined order of the compressed data and codewords can be determined by initialization setting, by protocol setting, session negotiation before data transmission, etc. Alternatively, the number of bits of the compressed first coded part of one or more data, the number of bits of the second coded part, the number of bits of the codewords in the predefined codebook, the rules corresponding to each codeword, and the predetermined order of the compressed data and codewords can also be updated by initialization setting, by protocol setting, session negotiation before data transmission, etc. For example, the sender 105 and the receiver 110 can be initialized before the start of transmission to check whether the above information (for example, relevant information of the predefined codebook) is consistent. As another example, the above information can also be pre-set by a protocol. As an alternative example, the above information can be negotiated by both the sender 105 and the receiver 110 through a communication session (for example, handshake, etc.) before the start of transmission. Those skilled in the art will appreciate that the above information may be known to both the sender 105 and the receiver 110 in various ways before the transmission formally begins, without departing from the scope of the present disclosure. The data compression method will be further described below in conjunction with an embodiment.

[0047] Figure 3 A flow chart of a data decompression method 300 according to an embodiment of the present disclosure is illustrated. Figure 3The data compression method 300 may be executed by the receiver 110 (eg, a processor of the receiver 110 ) and includes the following steps.

[0048] At 305, the receiver 110 may receive the combined data and decode the combined data. In an optional embodiment, the combined data may be in a first format, and the decoded combined data may be in a second format. In this embodiment, the receiver 110 may convert the combined data into a second format. As an example, the first format may be hexadecimal, and the second format may be binary. For example, the receiver 110 may convert the combined data from hexadecimal to binary, respectively. The first coded part of the decoded combined data may be a remainder part of the binary coded data, and the second coded part may be an integer part of the binary coded data. In some cases, the number of bits of the integer part may depend on the value range of the parameter. For example, the number of bits of the integer part may depend on the maximum value of the parameter. When the current data of each parameter is less than the maximum value, the bit may be filled in the form of a padding bit (e.g., zero filling). In some cases, the number of bits of the remainder part may depend on the precision of the parameter. In some other cases, the number of bits of the compressed first coded part and the number of bits of the second coded part of one or more data may be known in advance by both the sender and the receiver.

[0049] At 310, the receiver 110 may decompose the decoded combined data into compressed data and codewords. In an optional embodiment, the receiver 110 may extract the codewords according to a predetermined order of the compressed data and the codewords and the number of bits of the codewords known in advance by the receiver and determine the remaining portion of the decoded combined data after extracting the codewords as the compressed data. In some cases, the predetermined order of the compressed data and the codewords and the number of bits of the codewords may be known in advance by both the sender and the receiver.

[0050] At 315, the receiver 110 may determine a rule corresponding to the codeword from a predefined codebook stored at the receiver. In some cases, the predefined codebook may be known to both the sender 105 and the receiver 110. The predefined codebook includes one or more codewords. Each codeword may represent a rule corresponding to the codeword. Examples of the predefined codebook will be given in the following embodiments.

[0051] At 320, the receiver 110 may extract the first part and the second part of each of the one or more data from the compressed data according to the rule. As an example, the rule may define the order of the first part and the second part of each data. In an optional embodiment, the receiver 110 may extract the first part and the second part of each data according to the order of the first part and the second part of each data defined by the rule, wherein the first part of each data is the remainder part of the corresponding data, and the second part is the integer part of the corresponding data. Those skilled in the art will appreciate that the first part and the second part can be interchangeable and defined by rules corresponding to the codewords in the predefined codebook. In some cases, the number of digits of these data may determine the precision of the parameter.

[0052] It is worth noting that the number of bits of the first coded part of one or more data, the number of bits of the second coded part, the number of bits of the codewords in the predefined codebook, the rules corresponding to each codeword, and the predetermined order of compressed data and codewords can be determined by initialization setting, protocol setting, session negotiation before data transmission, etc. Alternatively, the number of bits of the compressed first coded part of one or more data, the number of bits of the second coded part, the number of bits of the codewords in the predefined codebook, the rules corresponding to each codeword, and the predetermined order of compressed data and codewords can also be updated by initialization setting, protocol setting, session negotiation before data transmission, etc. For example, the sender 105 and the receiver 110 can be initialized before the start of transmission to check whether the above information (for example, relevant information of the predefined codebook) is consistent. As another example, the above information can also be pre-set by a protocol. As an alternative example, the above information can be negotiated by both the sender 105 and the receiver 110 through a communication session (for example, handshake, etc.) before the start of transmission. Those skilled in the art will appreciate that the above information may be known to both the sender 105 and the receiver 110 in various ways before the transmission formally begins without departing from the scope of the present disclosure.

[0053] At 325, the receiver 110 may combine the first part and the second part of each data to obtain one or more data respectively. In an optional embodiment, the receiver 110 may decompress the first part of each data to obtain a decompressed first part, and combine the decompressed first part and the second part of each data to obtain one or more data respectively. As an example, the receiver 110 may fill the first part with bits (e.g., 0) according to the number of bits of the first part defined by the rule to obtain the decompressed first part. The data decompression method will be further described below in conjunction with the embodiments.

[0054] Figure 4 A block diagram of an apparatus 400 according to an embodiment of the present disclosure is illustrated. Figure 4 , the apparatus 400 may include a memory 405 and a processor 410. In an embodiment of the present disclosure, the processor 410 may be configured to execute the above-mentioned data compression and decompression method.

[0055] Example 1

[0056] In this embodiment, the upper 4 bits of the predefined codebook may define the order of parameters (eg, physical quantities) to be transmitted, as shown in Table 1.

[0057] Table 1 Example of the upper 4 bits of the predefined codebook

[0058]

[0059] The codeword (lower 4 bits) in the predefined codebook may define the amount of parameters to be included, as shown in Table 2. Those skilled in the art will appreciate that the predefined codebooks shown in Tables 1 and 2 are shown only as examples. Embodiments of the present disclosure may also include other predefined codebooks. In some cases, the predefined codebook may be determined by initialization setting, by protocol setting, or by session negotiation before data transmission. In some alternative cases, the predefined codebook may also be updated by initialization setting, by protocol setting, or by session negotiation before data transmission.

[0060] Table 2 Examples of the lower 4 bits of the predefined codebook

[0061]

[0062] Two examples of compressing two parameters and three parameters are respectively given below according to the above codebook, as shown in Table 3.

[0063] The sender 105 may determine to send two parameters or three parameters to the receiver 110. For example, the three parameters may include:

[0064] The first parameter: temperature, with a value range of [20.0-100.5] degrees Celsius. In this embodiment, it is magnified 10 times to [200-1005], where the maximum value is 1005. The maximum value is converted into hexadecimal 0x3ED, occupying 2 bytes;

[0065] The second parameter: voltage, the value range is [800-5000]mv, the maximum value is 5000, the maximum value is converted into hexadecimal 0x1388, occupying 2 bytes;

[0066] The third parameter: pressure, with a value range of [0.0-101.0] kPa. In this embodiment, it is magnified 10 times to [0-1010] kPa, and the maximum value is 1010 kPa. The maximum value is converted into hexadecimal 0x3F2, which occupies 2 bytes, and the corresponding physical storage binary is 0000 0011 1111 0010. Assuming that the sender 105 wants to send the maximum temperature and the maximum voltage to the receiver 110, the receiver 105 can convert the temperature and the voltage into binary format respectively, as follows:

[0067] The physical storage binary corresponding to the first parameter temperature is: 0000 0011 1110 1101, where the integer part of the temperature (underscore) is: 0000 0011 , occupies 8 bits, the remainder of the temperature (underline) is: 0000 00 1110 1101, occupies 2 bits;

[0068] The physical storage binary corresponding to the second parameter voltage is: 0001 0011 1000 1000, where the integer part of the voltage (underscore) is: 0001 , occupies 12 bits, the remainder of the voltage (underline) is: 000 0011 1000 1000, occupies 1 bit;

[0069] The third parameter: The physical storage binary corresponding to the pressure is: 0000 0011 1110 1101, where the integer part of the pressure (underscore) is: 0000 0011 , occupies 8 bits, the remainder of the pressure (underline) is: 0000 00 1111 0010, occupies 2 bits.

[0070] As described above, the sender and the receiver (e.g., the master node and the slave node on the bus) may know in advance the predetermined number of bits of the integer part and the remainder part of each parameter, wherein the predetermined number of bits is determined according to the maximum value of each parameter. When the current data of each parameter is less than the maximum value, the padding bit (e.g., zero padding) may be used to fill the bit. In some cases, the predetermined number of bits of the remainder part may be determined according to the precision of each parameter.

[0071] Subsequently, the respective parts of the two parameters (the first parameter and the second parameter) or the three parameters (the first parameter, the second parameter and the third parameter) and the corresponding codewords in the predefined codebook may be combined in an order defined by the codewords in the predefined codebook.

[0072] As an example, the sender and the receiver may be combined in the order of remainder + integer. As an alternative example, the sender and the receiver may also be combined in the order of integer + remainder. In this embodiment, for example, assuming that the sender has three parameters to send to the receiver, the sender and the receiver are combined in the order of the first parameter remainder part + the second parameter remainder part + the third parameter remainder part + the first parameter integer part + the second parameter integer part + the third parameter integer part.

[0073] Table 3 Data compression example

[0074]

[0075] For example, when the predefined codebook is 0x11, that is, 0001 0001, two parameters are compressed in the order of voltage and temperature:

[0076] The two parameters are converted into binary: 111 0011 1000 1000 1110 1101 0001 0001, and the compressed data is converted into hexadecimal: 0x7388ED11. The compressed data is reduced from the original 5 bytes (maximum temperature 0x3ED, maximum voltage 0x1388, and predefined codebook maximum 0xFF) to 4 bytes, with a compression rate of 80%.

[0077] For example, when the predefined codebook is 0x72, that is, 0111 0010, the three parameters are compressed in the order of pressure, voltage, and temperature:

[0078] The three parameters are converted into binary: 1 11 11 1111 0010 0011 1000 1000 1110 11010111 0010, and the compressed data is converted into hexadecimal 0x1FF2388ED72. The compressed data is reduced from the original 7 bytes (maximum temperature 0x3ED, maximum voltage 0x1388, maximum vacuum pressure 0x3F2, and maximum predefined codebook value 0xFF) to 6 bytes, with a compression rate of 85.7%.

[0079] Example 2

[0080] When the receiver 110 receives the combined data 0x7388ED11 transmitted by the sender (see Example 1), the combined data 0x7388ED11 is converted into binary 0111 0011 1000 1000 1110 1101 0001 0001. According to the rule defined by the codeword known to the receiver 110, the last four bits are extracted from the binary 0111 0011 1000 1000 1110 1101 00010001 as the codeword 0001 and the rule corresponding to the codeword 0001 is determined: temperature remainder (2 bits) voltage remainder (1 bit) temperature integer (8 bits) voltage integer (12 bits) codeword (4 bits), thereby determining the compressed data bit 111 0011 10001000 1110 1101. According to the rule, the remainder part and the integer part of the voltage and temperature are respectively determined as shown in Table 4:

[0081] Table 4 Remainder and integer part of voltage and temperature

[0082]

[0083] Thus, the receiver 110 can determine that the sender 105 sent the following parameters: temperature 0011 1110 1101, that is, 0x3ED, and voltage 0001 0011 1000 1000, that is, 0x1388.

[0084] The receiver 110 may receive the combined data 0x1FF2388ED72 (see Example Embodiment 1) transmitted by the transmitter and convert the combined data 0x1FF2388ED72 into binary 1 11 11 1111 0010 0011 1000 1000 11101101 0111 0010. According to the number of bits of the codeword known by the receiver 110, the last eight bits are extracted from the binary 1 11 11 1111 0010 00111000 1000 1110 1101 0111 0010 as the codeword 0111 0010, and then according to the rule defined by the codeword 01110010 and the number of bits of each part of the corresponding parameter (known in advance by the receiver), the binary 11 111 1111 0010 0011 1000 1000 1110 1101 is determined to include: pressure remainder (2 bits), voltage remainder (1 bit), temperature remainder (2 bits), pressure integer (9 bits), voltage integer (12 bits), and temperature integer (8 bits). According to the rule, the remainders and integers combined in the order of pressure, voltage, and temperature are determined as follows:

[0085] Table 5 Remainder and integer part of pressure, voltage and temperature

[0086]

[0087] Thus, the receiver 110 can determine that the sender 105 sent the following parameters: temperature 0011 1110 1101, that is, 0x3ED, and voltage 0001 0011 1000 1000, that is, 0x1388.

[0088] Although the above embodiments show that two or three parameters are included and combined (e.g., pieced together) in a specific order, those skilled in the art will appreciate that more or fewer parameters may be combined (e.g., pieced together) in other ways without departing from the scope of the present disclosure.

[0089] The "range" disclosed herein is defined in the form of a lower limit and an upper limit, and a given range is defined by selecting a lower limit and an upper limit, and the selected lower limit and upper limit define the boundaries of the particular range. The range defined in this way can be inclusive or exclusive of the end values, and can be arbitrarily combined, that is, any lower limit can be combined with any upper limit to form a range. In this application, unless otherwise specified, the numerical range "ab" represents an abbreviation of any real number combination between a and b, where a and b are both real numbers.

[0090] In this application, unless otherwise specified, all embodiments and preferred embodiments mentioned herein can be combined with each other to form a new technical solution.

[0091] In the present application, unless otherwise specified, all technical features and preferred features mentioned herein can be combined with each other to form new technical solutions. Although the present application has been described with reference to optional embodiments, various improvements can be made thereto and components thereof can be replaced with equivalents without departing from the scope of the present application. In particular, as long as there is no structural conflict, the various technical features mentioned in the various embodiments can be combined in any manner. The present application is not limited to the specific embodiments disclosed herein, but includes all technical solutions falling within the scope of the claims.

Claims

1. A data compression method performed by a sender, comprising: determining one or more data to be compressed; Encode each of the one or more data to obtain one or more encoded data, wherein each of the one or more encoded data includes a first encoded part and a second encoded part; Compressing the first coded part of each coded data to obtain a compressed first coded part, wherein compressing the first coded part to obtain a compressed first coded part further comprises: converting the first coded part into a number of corresponding preset bits according to the preset number of bits of the first coded part known in advance by the sender, wherein the preset number of bits of the first coded part of each coded data depends on the accuracy of the corresponding parameter; and Selecting a codeword from a predefined codebook stored at the sender; The compressed first encoded portion and the second encoded portion of each encoded data are combined according to a rule corresponding to the selected codeword to obtain compressed data.

2. The data compression method according to claim 1, characterized in that: The one or more data are in a first format, and the one or more encoded data are in a second format, and encoding each of the one or more data further comprises: Each of the one or more data is converted from the first format to the second format, wherein the first encoded portion of each encoded data is a remainder portion of the corresponding encoded data and the second encoded portion is an integer portion of the corresponding encoded data.

3. The data compression method according to claim 1, characterized in that: The number of bits of the compressed first coded part of the one or more data, the number of bits of the second coded part, the number of bits of the codewords in the predefined codebook, and the rules corresponding to each codeword are known in advance by both the sender and the receiver.

4. The data compression method according to claim 1, characterized in that: Combining the compressed first encoded portion and the second encoded portion of each encoded data according to the rule further comprises: The compressed first encoded part and the second encoded part of each of the one or more encoded data are combined according to the order of the compressed first encoded part and the second encoded part defined by the rule to obtain compressed data.

5. The data compression method according to claim 1, wherein: Further including: combining the compressed data and the codeword according to a predetermined order of the compressed data and the codeword to form combined data; converting the combined data into a first format; as well as The combined data is transmitted to a receiver, wherein the predetermined sequence is known in advance by both the sender and the receiver.

6. A data decompression method performed by a receiving party, comprising: receiving combined data and decoding the combined data; decomposing the decoded combined data into compressed data and codewords; Determining a rule corresponding to the codeword from a predefined codebook stored at the receiving party; Extracting the first part and the second part of each of the one or more data from the compressed data according to the rule Extracting the first part and the second part respectively according to the order of the first part and the second part of each data defined by the rule and the preset number of bits of the first part and the number of bits of the second part, wherein the preset number of bits of the first part of each encoded data depends on the accuracy of the corresponding parameter; padding the first part with bits according to a preset number of bits of the first part defined by the rule to obtain a decompressed first part; as well as The first part and the second part of each data are combined to obtain the one or more data, respectively.

7. The data decompression method according to claim 6, characterized in that: The combined data is in a first format and the decoded combined data is in a second format, and The decoding of the combined data further comprises: converting the combined data into the second format, or Decomposing the decoded combined data into the compressed data and the codeword further comprises: extracting the codeword according to a predetermined order and the number of bits of the codeword known in advance by the receiver, and determining the remaining part after extracting the codeword from the decoded combined data as the compressed data.

8. The data decompression method according to claim 7, characterized in that: The number of bits of the compressed first encoded part of the one or more data, the number of bits of the second encoded part, the predefined codebook, the number of bits of the codewords in the predefined codebook, and the predetermined order of the compressed data and the codewords are known in advance by both the sender and the receiver.

9. The data decompression method according to claim 7, characterized in that: The first part of each data is a remainder part of the corresponding data, and the second part is an integer part of the corresponding data.

10. A device for data compression or decompression, comprising: Memory; as well as A processor is coupled to the memory and configured to execute the method according to any one of claims 1-9.

11. A non-transitory computer readable medium having code stored thereon, the code being executable by a processor to perform the method of any one of claims 1-9.