Data entropy coding method and device, electronic equipment and storage medium

By dividing the data into multiple sequence segments and processing based on Fibonacci sequences, the problem of low compression rate of high data entropy value in the prior art is solved, and higher compression rate and storage transmission efficiency are achieved.

CN119727736APending Publication Date: 2025-03-28SHENZHEN ZHI HUI LIN NETWORK TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411781212.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-05
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

When existing data compression technology processes data with high data entropy values, the compression rate is low, making it difficult to effectively reduce the entropy value of the data.

Method used

By dividing the binary sequence of data into multiple sequence segments and processing these segments based on the Fibonacci sequence, the binary bits are converted to reduce the data entropy value, thereby generating a new data sequence with lower data entropy value.

Benefits of technology

The data compression rate is improved, and new data sequences are compressed through preset compression methods, achieving higher storage and transmission efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119727736A_ABST
    Figure CN119727736A_ABST
Patent Text Reader

Abstract

The invention discloses a data entropy coding method and apparatus, an electronic device and a storage medium. The method comprises the steps of obtaining a binary sequence of first data; dividing the binary sequence of the first data into at least one first sequence segment, wherein each sequence segment in the at least one first sequence segment comprises n binary bits; the at least one first sequence segment is processed based on the Fibonacci sequence, at least one second sequence segment corresponding to the at least one first sequence segment is obtained, and the data entropy value of the second sequence segment is lower than the data entropy value of the corresponding first sequence segment; and generating entropy-coded second data corresponding to the first data according to the at least one second sequence segment. By implementing the steps in the method, the problem that the compression rate of the data with the high data entropy value is low under the existing compression technology is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a data entropy coding method, device, electronic device and storage medium. Background Art

[0002] In the modern digital age, efficient data storage and transmission are essential for a variety of industries and applications. As the amount of digital information continues to grow exponentially, the demand for effective data compression technology is increasing. Existing data compression technologies can minimize storage requirements and optimize transmission bandwidth without compromising data integrity. Existing lossless data compression algorithms have achieved remarkable success in reducing the size of different data types. However, they encounter limitations when processing data with high data entropy values, resulting in the problem of low compression rate of data with high data entropy values ​​under existing compression technologies. Summary of the invention

[0003] In response to the above problems, the example of the present application provides a data entropy coding method, device, electronic device and storage medium. The use of the solution of the present application is conducive to solving the problem of low compression rate of data with high data entropy value under existing compression technology.

[0004] To achieve the above-mentioned objectives, in a first aspect, an embodiment of the present application provides a method for entropy coding of data, the method comprising: obtaining a binary sequence of first data; dividing the binary sequence of the first data into at least one first sequence segment, each sequence segment in the at least one first sequence segment comprising n binary bits; processing the at least one first sequence segment based on the Fibonacci sequence to obtain at least one second sequence segment corresponding to the at least one first sequence segment, the data entropy value of the second sequence segment being lower than the data entropy value of the corresponding first sequence segment; and generating entropy-coded second data corresponding to the first data according to the at least one second sequence segment.

[0005] It can be seen that in the embodiment of the present application, the first data is converted into second data with a lower data entropy value by dividing the binary sequence of the first data into a plurality of first sequence segments, performing entropy coding on at least one first sequence segment to obtain a plurality of processed second sequence segments, and generating second data according to at least one second sequence segment. The compression rate of compressing the second data by the preset compression method is higher than the compression rate of directly compressing the first data, thereby improving the compression rate of the first data.

[0006] In combination with the first aspect, in a possible embodiment, at least one first sequence segment is processed separately based on the Fibonacci sequence, including: obtaining a first sequence, the first sequence being a sequence consisting of the first k values ​​in the Fibonacci sequence, where the kth value is less than or equal to n; converting the i-th binary bit in the first sequence segment based on the value i in the first sequence to obtain the sequence segment after the first conversion.

[0007] In combination with the first aspect, in a possible embodiment, after obtaining the sequence segment after the first conversion, the method also includes: calculating the data entropy value of the sequence segment after the first conversion; if the data entropy value of the sequence segment after the first conversion is lower than the preset entropy value, determining that the sequence segment after the first conversion is the second sequence segment.

[0008] It can be seen that in the embodiment of the present application, the Fibonacci sequence is used to determine the converted binary digits from the first sequence segment, and the corresponding binary values ​​are converted, thereby obtaining a second data sequence with a lower data entropy value, and then generating the second data of the first data according to the second data sequence, thereby reducing the data entropy value of the first data and improving the compression rate of the first data.

[0009] In combination with the first aspect, in a possible embodiment, if the data entropy value of the sequence segment after the first conversion is not less than the preset entropy value, the method also includes: obtaining a second number series, the second number series is obtained by adding m to each numerical value in the first number series; converting the jth binary bit in the sequence segment after the first conversion based on the numerical value j in the second number series to obtain the sequence segment after the second conversion; calculating the data entropy value of the sequence segment after the second conversion, if the data entropy value of the sequence segment after the second conversion is lower than the preset entropy value, determining that the sequence segment after the second conversion is the second sequence segment.

[0010] It can be seen that when the data entropy value of the converted sequence segment is lower than the preset entropy value, the first sequence segment is converted multiple times by determining a new number series, thereby ensuring that the data entropy value of the second sequence segment can be lower than the corresponding first sequence segment, thereby improving the compression rate of the first data.

[0011] In combination with the first aspect, in a possible embodiment, after generating second data corresponding to the first data according to at least one second sequence segment, the method also includes: generating compressed third data according to the second data; sending the third data, and entropy coding parameters of the third data, the entropy coding parameters including the n value and the number of conversions of the first sequence segment.

[0012] It can be seen that in the embodiment of the present application, the second data obtained by decompressing the third data can be processed through the entropy coding parameter to obtain the corresponding first data, thereby ensuring the integrity of the first data.

[0013] In a second aspect, an embodiment of the present application provides an entropy decoding method for data, comprising: receiving third data and entropy coding parameters; decompressing the third data to obtain second data; and entropy decoding the second data according to the entropy coding parameters to obtain first data.

[0014] In combination with the second aspect, in a possible embodiment, the entropy coding parameter includes an n value and a conversion number of each second sequence segment, and the second data is entropy encoded according to the entropy coding parameter to obtain the first data, including: dividing the binary sequence of the first data into at least one second sequence segment, each sequence segment in the at least one second sequence segment includes n binary bits; converting at least one second sequence segment based on the Fibonacci sequence and the conversion number corresponding to each second sequence segment to obtain at least one first sequence segment; splicing at least one first sequence segment according to the arrangement order of the second sequence segments corresponding to each first sequence segment in at least one first sequence in the second data to obtain the first data.

[0015] It can be seen that in the embodiment of the present application, the corresponding first data can be obtained according to the entropy encoded second data according to the entropy coding parameters, and then the data integrity of the original data, i.e., the first data, is guaranteed in the process of converting the first data into the second data and then saving and transmitting them.

[0016] In a third aspect, an embodiment of the present application provides an entropy coding device for data, for performing an entropy coding method for data, the device comprising:

[0017] An acquiring unit is used to acquire a binary sequence of first data.

[0018] The dividing unit is used to divide the binary sequence of the first data into at least one first sequence segment, each sequence segment in the at least one first sequence segment includes n binary bits.

[0019] The processing unit is used to process the at least one first sequence segment based on the Fibonacci sequence to obtain at least one second sequence segment corresponding to the at least one first sequence segment, wherein the data entropy value of the second sequence segment is lower than the data entropy value of the corresponding first sequence segment.

[0020] A generating unit is used to generate entropy-coded second data corresponding to the first data according to at least one second sequence segment.

[0021] In a fourth aspect, an embodiment of the present application provides an entropy decoding device for data, which is used to perform an entropy decoding method for data, and the device includes:

[0022] The receiving unit is used to receive third data and entropy coding parameters.

[0023] The decompression unit is used to decompress the third data to obtain the second data.

[0024] The calculation unit is used to perform entropy decoding on the second data according to the entropy coding parameter to obtain the first data.

[0025] In a fifth aspect, an embodiment of the present application provides an electronic device, comprising a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, and one or more instructions are suitable for being loaded by the processor and executing part or all of the methods of the first aspect and / or the second aspect.

[0026] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program for electronic data exchange, wherein the computer program enables a computer to execute part or all of the method of the first aspect.

[0027] In a seventh aspect, the present application provides a computer program product. When a computer reads and executes the computer program product, the computer executes the method in any possible design of the first aspect above.

[0028] It can be understood that the beneficial effects of the embodiments of the third to seventh aspects can refer to the beneficial effects of the method of the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0030] Figure 1 A schematic diagram of an application scenario of a method for entropy coding of data provided in an embodiment of the present application;

[0031] Figure 2 A schematic diagram of a flow chart of a method for entropy coding of data provided in an embodiment of the present application;

[0032] Figure 3 A schematic diagram of converting a first sequence segment according to the Fibonacci sequence provided in an embodiment of the present application;

[0033] Figure 4 A schematic diagram of a processing flow of a first sequence segment provided in an embodiment of the present application;

[0034] Figure 5 A schematic diagram of dividing a second data into subsequence segments provided in an embodiment of the present application;

[0035] Figure 6 A schematic diagram of a flow chart of a method for entropy decoding of data provided in an embodiment of the present application;

[0036] Figure 7A schematic diagram of the structure of a data entropy coding device provided in an embodiment of the present application;

[0037] Figure 8 A schematic diagram of the structure of a data entropy decoding device provided in an embodiment of the present application;

[0038] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0039] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0040] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.

[0041] 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 application. The appearance of the phrase in various locations 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.

[0042] The embodiments of the present application are described below in conjunction with the accompanying drawings.

[0043] See also Figure 1 , Figure 1 A schematic diagram of an application scenario of an entropy coding method for data provided in an embodiment of the present application, wherein the application scenario 100 includes a first terminal 101 and a second terminal 102, wherein the first terminal 101 and the second terminal 102 are specifically a user equipment (UE) such as a smart phone, a personal computer, a tablet computer, a smart wearable device, etc. The first terminal 101 and the second terminal 102 are connected via a communication link.

[0044] In the embodiment of the present application, the first terminal 101 obtains a binary sequence of the first data; the first data here can be specifically generated locally by the first terminal 101, or sent by other devices such as the second terminal 102. The type of the first data can be specifically text, video, picture, etc. The binary sequence of the first data here refers to the binary form of the first data. If the first data is in other forms (such as decimal data, etc.), it is necessary to first obtain the decimal sequence of the first data, and convert the decimal sequence of the first data into a corresponding binary sequence; the binary sequence of the first data includes all information in the first data.

[0045] The first terminal 101 divides the binary sequence of the first data into at least one first sequence segment, wherein each first sequence includes n binary bits, that is, the binary sequence of the first data is divided into a plurality of sequence segments with the same number of bits.

[0046] The first terminal 101 processes at least one first sequence segment based on the Fibonacci sequence to obtain at least one second sequence segment corresponding to the at least one first sequence segment, and the data entropy value of the second sequence segment is lower than the data entropy value of the corresponding first sequence segment. Here, at least one first sequence segment is processed based on the Fibonacci sequence, specifically, the data bits that need to be flipped in each first sequence segment are determined by the Fibonacci sequence, and the corresponding data are converted. The conversion here specifically includes converting "1" to "0" or converting "0" to "1". Thereby reducing the data entropy value of each sequence segment.

[0047] After processing each first sequence segment to obtain the corresponding second sequence segment, the first terminal 101 generates second data corresponding to the first data according to at least one second sequence segment. That is, at least one second sequence segment is merged into a complete piece of data. The data entropy value of the second data here is the first data, and includes all the information in the first data, that is, the second data is the data obtained after entropy coding of the first data.

[0048] After obtaining the second data, the first terminal 101 may further compress the second data into third data based on a preset compression method and then store the third data locally or send the third data to the second terminal 102 .

[0049] It can be seen that in the embodiment of the present application, by dividing the binary sequence of the first data into multiple first sequence segments, processing at least one first sequence segment to obtain multiple processed second sequence segments, generating second data according to at least one second sequence segment, and obtaining second data with a lower data entropy value by implementing entropy encoding of the first data, the compression rate of the first data is improved.

[0050] See also Figure 2 , Figure 2A flow chart of a method for entropy coding of data provided in an embodiment of the present application can be based on Figure 1 The application scenario shown is implemented as follows Figure 2 As shown, steps S201-S204 are included:

[0051] S201: A first terminal obtains a binary sequence of first data.

[0052] Specifically, the first data here is specifically data composed of multiple binary numbers, such as "11010101101", etc. If the first data is not binary data, before obtaining the binary sequence of the first data, the first data needs to be converted into binary data.

[0053] S202: The first terminal divides a binary sequence of first data into at least one first sequence segment, each sequence segment in the at least one first sequence segment includes n binary bits.

[0054] The binary sequence of the first data is divided into at least one first sequence segment, that is, n sequence segments are extracted from the binary sequence of the first data in sequence.

[0055] Exemplarily, if the binary sequence of the first data is "11010101101", n is 3, that is, the first first sequence segment of the binary sequence of the first data includes the first three digits of "11010101101", that is, "110"; the second first sequence segment is the 4th to 6th digits of "11010101101", that is, "101".

[0056] Furthermore, if the value in the target sequence is less than n bits, a multi-bit preset value is generated in the target sequence, and the value in the target sequence is equal to n bits. Take the binary sequence of the first data as "11010101101", and n is 3 as an example. The first three first sequence segments are "110", "101", and "011", and the last two bits "01" are left. If "01" is directly used as a first sequence segment, the requirement that each sequence segment includes n binary bits is not met. Therefore, a preset value is generated here, and the preset value is specifically "0" or "1". Change "01" to "010", so that "010" is used as the last first sequence segment of "11010101101".

[0057] S203: The first terminal processes the at least one first sequence segment based on the Fibonacci sequence to obtain at least one second sequence segment corresponding to the at least one first sequence segment, wherein the data entropy value of the second sequence segment is lower than the data entropy value of the corresponding first sequence segment.

[0058] Specifically, the Fibonacci sequence here is "1, 1, 2, 3, 5, 8, 13...", where each value can correspond to a binary bit in the first sequence, for example, "1" corresponds to the first bit, and "2" corresponds to the second bit. Here, the value on at least one binary bit in the first sequence segment is converted by indicating at least one value in the Fibonacci sequence, thereby obtaining a second sequence segment with a reduced data entropy value.

[0059] In a possible embodiment, at least one first sequence segment is processed based on the Fibonacci sequence, including: obtaining a first sequence, the first sequence being a sequence consisting of first k values ​​in the Fibonacci sequence, wherein the kth value is less than or equal to n; converting the i-th binary bit in the first sequence segment based on the value i in the first sequence to obtain the sequence segment after the first conversion.

[0060] Specifically, in the embodiment of the present application, the binary bits that need to be converted in each first number sequence are determined by the Fibonacci sequence. The Fibonacci sequence here can also be replaced by other number sequences arranged in ascending order of numerical value, such as "1, 3, 5, 7, 9...", "2, 4, 6, 8, 10...", etc.

[0061] The first sequence here is a sequence consisting of the first k values ​​in the Fibonacci sequence, where k is determined according to the number of values ​​in the first sequence segment. For example, see Figure 3 , Figure 3 A conversion diagram of a first sequence segment is provided for an embodiment of the present application, wherein the first sequence segment is "11001", which includes five numerical values ​​and it can be seen that n is 5. The first number series here includes all numerical values ​​less than or equal to 5 in the Fibonacci sequence, that is, the first number series is "1, 1, 2, 3, 5".

[0062] After determining the first number sequence, the i-th binary digit in the first sequence segment is converted based on the value i in the first number sequence to obtain the first converted sequence segment. The first sequence segment and the first number sequence are also used as examples for explanation. The first number sequence here includes the values ​​"1", "2", "3" and "5", so the first, second, third and fifth binary digits in the first sequence segment "11001" need to be converted to obtain the first converted sequence segment, that is, "00100" here.

[0063] In a possible embodiment, after obtaining the sequence segment after the first conversion, the method further includes: calculating a data entropy value of the sequence segment after the first conversion; if the data entropy value of the sequence segment after the first conversion is lower than a preset entropy value, determining that the sequence segment after the first conversion is a second sequence segment.

[0064] Specifically, after obtaining the sequence segment after the first conversion, it is necessary to determine whether the data entropy value of the corresponding sequence segment has been reduced by calculating the data entropy value of the sequence segment after the first conversion, so as to avoid the corresponding first sequence segment increasing the data entropy value after the conversion based on the Fibonacci sequence. The preset entropy value here can be an arbitrary value set in advance or determined based on the data entropy value of the first sequence segment after calculating the data entropy value of the first sequence segment before the first conversion.

[0065] If the data entropy value of the sequence segment after the first conversion is lower than the preset entropy value, that is to say, the corresponding first sequence segment has achieved the effect of reducing the data entropy value after the first conversion, then the sequence segment after the first conversion is determined to be the second sequence segment.

[0066] It can be seen that in the embodiment of the present application, the Fibonacci sequence is used to determine the converted binary digits from the first sequence segment, and the corresponding binary values ​​are converted, thereby obtaining a second data sequence with a lower data entropy value, and then generating the second data of the first data according to the second data sequence, thereby reducing the data entropy value of the first data and improving the compression rate of the first data.

[0067] In a possible embodiment, if the data entropy value of the sequence segment after the first conversion is not less than the preset entropy value, the method also includes: obtaining a second number series, the second number series is obtained by adding m to each numerical value in the first number series; converting the jth binary bit in the sequence segment after the first conversion based on the numerical value j in the second number series to obtain the sequence segment after the second conversion; calculating the data entropy value of the sequence segment after the second conversion, if the data entropy value of the sequence segment after the second conversion is lower than the preset entropy value, determining that the sequence segment after the second conversion is the second sequence segment.

[0068] Specifically, in the embodiment of the present application, if the data entropy value of the sequence segment after the first conversion is not less than the preset entropy value, it proves that the data entropy value of the data segment obtained after the first conversion of the first data segment is still relatively high, and it is impossible to reduce the data entropy value and improve the corresponding first data compression rate.

[0069] Therefore, when the data entropy value of the sequence segment after the first conversion is not less than the preset entropy value, it is necessary to obtain a second sequence, which is obtained by adding m to each value in the first sequence, where m is a positive integer such as 1, 2, 3, 4, etc. Exemplarily, if the first sequence is "1, 1, 2, 3" and m is "1", the corresponding second sequence is obtained by adding "1" to each value in the first sequence, that is, the second sequence is "2, 2, 3, 4".

[0070] After determining the second number sequence, for the relevant description of converting the j-th binary bit in the first converted sequence segment based on the value j in the second number sequence, please refer to the relevant description of converting the first sequence segment based on the first number sequence, which will not be repeated here.

[0071] After converting part of the binary numbers in the first converted sequence segment through the second number sequence, the second converted sequence segment is obtained. The first number sequence is "1, 1, 2, 3" and the corresponding conversion bits are the first, second and third bits. The second number sequence here is "2, 2, 3, 4" and the corresponding conversion bits are the second, third and fourth bits. It can be seen that in the process of the second conversion here, the number and position of the actual conversion values ​​are different from those of the first conversion. Calculate the data entropy value of the sequence segment after the second conversion. If the data entropy value of the sequence segment after the second conversion is lower than the preset entropy value, the sequence segment after the second conversion is determined to be the second sequence segment.

[0072] Furthermore, if the data entropy value of the sequence segment after the second conversion is still not lower than the preset entropy value, it is necessary to continue to determine a new second sequence based on the second sequence, so as to further process the first sequence segment. Figure 4 , Figure 4 A schematic diagram of a processing flow of a first sequence segment provided for an embodiment of the present application. Among them, the target sequence is generated based on the Fibonacci sequence, including a first sequence and a second sequence. The target sequence segment is one of at least one first sequence segment. If it is the first execution of the process, the target sequence generated here is specifically to generate a target sequence (i.e., the first sequence described above), and the target sequence is a sequence composed of the first k values ​​in the Fibonacci sequence, where the kth value is less than or equal to n. If it is not the first execution of the process, the target sequence here is obtained by adding m to each value in the target sequence in the last cycle. If it is the first execution of the process, the target sequence segment here is the corresponding first sequence segment; if it is not the first execution of the process, the target sequence segment here is the sequence segment after the last conversion. In this example, the target sequence segment will be converted multiple times until the data entropy of the target sequence segment is less than the preset entropy value or the number of conversions is not less than the preset number of times.

[0073] It can be seen that when the data entropy value of the converted sequence segment is lower than the preset entropy value, the first sequence segment is converted multiple times by determining a new number series, thereby ensuring that the data entropy value of the second sequence segment can be lower than the corresponding first sequence segment, thereby improving the compression rate of the first data.

[0074] S204: The first terminal generates second data corresponding to the first data according to at least one second sequence segment.

[0075] Specifically, the at least one second sequence segment here is converted based on at least one first sequence segment in the first data, so there is a one-to-one correspondence between the first sequence segment and the second sequence segment. Generating the second data corresponding to the first data according to the at least one second sequence segment here specifically involves splicing multiple second sequence segments in sequence to obtain the second data here according to the arrangement order of the first sequence segments corresponding to each second sequence segment in the first data.

[0076] In a possible embodiment, after generating second data corresponding to the first data according to at least one second sequence segment, the method also includes: generating compressed third data according to the second data; sending the third data, and entropy coding parameters of the third data, the entropy coding parameters including the n value and the number of conversions of the first sequence segment.

[0077] Specifically, the second data here is generated by at least one second sequence segment, and at least one second sequence segment corresponds to at least one first sequence segment in the first data, that is, the second data includes all the information in the first data. And the overall data entropy value of the second data is smaller than that of the first data, so the compression rate of the compressed third data generated according to the second data will be lower than that of the compressed data directly generated according to the first data.

[0078] The third data here is specifically obtained by compressing the second data according to compression techniques such as Huffman coding, LZW coding, run length coding, and reduction algorithm.

[0079] The second data here can be obtained after decompression based on the third data, but to determine the first data from the second data, the second data needs to be divided into at least one second sequence segment, and then based on the number of conversions of each second sequence segment corresponding to the first sequence segment, the corresponding second sequence segment is reconverted to obtain the corresponding first sequence segment, so as to determine the corresponding first data.

[0080] Therefore, after obtaining the third data, if the third data needs to be sent to the second terminal, the entropy coding parameters here need to be determined, including the n value and the number of conversions of the first sequence segment. The third data and the entropy coding parameters of the third data are sent to the second terminal, so that the second terminal can obtain the corresponding first data according to the third data and the entropy coding parameters of the third data.

[0081] Furthermore, the entropy coding parameters here also include an m value, and other parameters generated in the process of entropy coding at least one second sequence segment.

[0082] It can be seen that in the embodiment of the present application, the second data obtained by decompressing the third data can be processed through the entropy coding parameter to obtain the corresponding first data, thereby ensuring the integrity of the first data.

[0083] In a possible embodiment, before generating compressed third data based on the second data, the method also includes: dividing the second data into multiple subsequence segments, each of the multiple subsequence segments includes a binary bits, and a is less than n; determining the binary combination with the largest number in the multiple subsequence segments as the target subsequence segment; converting at least one non-target subsequence segment in the multiple subsequence segments into a target subsequence segment, obtaining the transformed second data, and recording the position of the converted subsequence segment; generating compressed third data based on the second data, including: generating compressed third data based on the transformed second data; the entropy coding parameter also includes the position of the converted subsequence segment.

[0084] Specifically, in the aforementioned application embodiment, a method is described for reducing the data entropy value of the first data by performing entropy encoding on each first sequence segment respectively. Based on this, after performing entropy encoding on each first sequence segment respectively, for the overall second data, the embodiment of the present application also provides an entropy encoding method for the overall data.

[0085] The second data is divided into a plurality of subsequence segments, each of the plurality of subsequence segments includes a binary bits, where a is less than n. For example, see Figure 5 , Figure 5 A schematic diagram of the division of subsequence segments of the second data provided in an embodiment of the present application, wherein only part of the binary numbers of the corresponding second data are shown. It can be seen that if the value of a is 3, the first subsequence segment of the second data includes the values ​​of the first, second and third digits, that is, "100" as shown in the figure; the second subsequence segment of the second data includes the values ​​of the second, third and fourth digits, that is, "000" as shown in the figure; the third subsequence segment of the second data includes the values ​​of the third, fourth and fifth digits, that is, "000" as shown in the figure. All subsequence segments in the second data can be obtained by analogy.

[0086] Determine the binary combination with the largest number among the multiple subsequence segments as the target subsequence segment. Take the second data "11001100110" as an example, if a is 3. The binary combinations of the subsequence segments existing therein include four types: "011", "110", "100", and "001", among which the number of "011" is 2, the number of "110" is 3, the number of "100" is 2, and the number of "001" is 2. Therefore, the target subsequence segment here is "110".

[0087] After determining the binary combination of the target subsequence segment, at least one non-target subsequence segment among the multiple subsequence segments is converted into the target subsequence segment to obtain the transformed second data. Here, converting at least one non-target subsequence segment among the multiple subsequence segments into the target subsequence segment means increasing the occurrence frequency of the target subsequence segment in the corresponding second data, thereby further reducing the data entropy value of the second data.

[0088] Further, converting at least one non-target subsequence segment among the multiple subsequence segments into a target subsequence segment specifically includes directly replacing the non-target subsequence segment with the target subsequence segment, for example, replacing "110" with "001". Alternatively, replacing is achieved by inserting or deleting a numerical value, for example, adding the numerical value "0" to "110110" to obtain "10101010" to replace "110" with "101".

[0089] In addition, the entropy coding parameters also include the position of the converted subsequence segment, where the position of the converted subsequence segment has different forms based on different processing methods.

[0090] If the replacement method here is to directly replace the non-target subsequence segment with the target subsequence segment, the position of the converted subsequence segment represents the position of the corresponding non-target subsequence segment in the second data and the real value of the replaced non-target subsequence segment. For example, "010" in the second data "100010001" is replaced with "100" to obtain "100100001". The position of the corresponding replaced subsequence segment represents that the subsequence segment "100" at the 4th to 6th positions of the second data is obtained by replacing "010".

[0091] If the replacement is achieved by inserting or deleting a value, the position of the converted subsequence segment represents the position of the inserted or deleted value in the second data, as well as the inserted or deleted value (i.e., "0" or "1"). For example, in the second data "110111110", the value "0" is added after the fifth bit, and the value "1" of the sixth bit is deleted to obtain "110110110". The position of the corresponding replaced subsequence segment represents that the value "0" of the sixth bit of "110110110" is added, and there is a deleted value "1" after the sixth bit.

[0092] It can be seen that in the embodiment of the present application, by converting at least one non-target subsequence segment among multiple subsequence segments into a target subsequence segment, the data entropy value in the second data is further reduced, thereby further improving the compression rate of the first data.

[0093] In a possible embodiment, before dividing the binary sequence of the first data into at least one first sequence segment, the method also includes: calculating a first hash value of the first data according to a hash function; before generating compressed third data according to the second data, the method also includes: performing entropy decoding on the second data according to an entropy coding parameter to obtain fourth data; calculating a second hash value of the fourth data according to the hash function, and if the first hash value is equal to the second hash value, generating compressed third data according to the second data and subsequent steps.

[0094] Specifically, in the embodiment of the present application, before processing the first data, a first hash value of the first data is first calculated according to a hash function and recorded.

[0095] Before generating the compressed third data according to the second data, it is necessary to entropy decode the second data according to the entropy coding parameters to obtain the fourth data, where the fourth data is the first data obtained again after entropy decoding of the second data. Then calculate the second hash value of the fourth data. If the first hash value is equal to the second hash value, it can be determined that the processing terminal or other processing terminals can obtain the original first data based on the second data and the entropy coding parameters, and then the integrity of the first data can be guaranteed in the subsequent compression, transmission, storage and other steps.

[0096] See also Figure 6 , Figure 6 A flow chart of a method for entropy decoding of data provided in an embodiment of the present application can be based on Figure 1 The application scenario shown is implemented as follows Figure 6 As shown, steps S601-S603 are included:

[0097] S601: The second terminal receives third data and entropy coding parameters, where the third data is data obtained by compressing the second data.

[0098] Specifically, the third data here is obtained by the first terminal compressing the second data through a preset compression method. The entropy coding parameter here is a parameter generated and recorded when the first terminal performs entropy coding on the first data, and is used by the second terminal to entropy decode the second data to obtain the first data.

[0099] S602: The second terminal decompresses the third data to obtain second data, where the second data is data obtained by entropy encoding the first data.

[0100] Specifically, the third data here is obtained by compressing the second data based on any one of the compression technologies such as Huffman coding, LZW coding, run length coding, and reduction algorithm. The second terminal can identify the compression technology corresponding to the third data and decompress the third data to obtain the corresponding second data.

[0101] S603: The second terminal performs entropy decoding on the second data according to the entropy coding parameter to obtain the first data.

[0102] Specifically, the entropy coding parameter here is a parameter that records the process, number of times, location of the processing object, etc. of the first data obtained by entropy coding. The second terminal can convert the second data back to the first data based on the entropy coding parameter, that is, entropy decode the second data according to the entropy coding parameter to obtain the first data.

[0103] In a possible embodiment, the entropy coding parameter includes an n value and a conversion number of each second sequence segment, and entropy coding the second data according to the entropy coding parameter to obtain the first data, including: dividing the binary sequence of the second data into at least one second sequence segment, each sequence segment in the at least one second sequence segment includes n binary bits; converting at least one second sequence segment according to the conversion number corresponding to each second sequence segment to obtain at least one first sequence segment; splicing at least one first sequence segment according to the arrangement order of the second sequence segments corresponding to each first sequence segment in the at least one first sequence in the second data to obtain the first data.

[0104] Specifically, in an embodiment of the present application, the entropy coding parameter includes an n value and the number of conversions of each second sequence segment, wherein the n value is used to divide the binary sequence of the second data into at least one second sequence segment according to the length of n binary bits. The number of conversions of each second sequence segment is used to convert the second sequence segment to obtain the corresponding first sequence segment. This is because the first data is entropy encoded, specifically, the binary sequence of the first data is divided into at least one first sequence segment, each first sequence segment includes n binary bits, and then each first sequence segment is converted at least once to obtain the corresponding second sequence segment, and then the second data is generated according to at least one second sequence segment.

[0105] First, the binary sequence of the second data is divided into at least one second sequence segment, each second sequence segment includes n binary bits.

[0106] If the entropy coding parameters also include the position of the converted sub-sequence segment, before the binary sequence of the second data is divided into at least one second sequence segment, it is also necessary to convert the converted sub-sequence segment into the original sub-sequence segment according to the position of the converted sub-sequence segment. For a detailed description of the conversion, please refer to the relevant description of the aforementioned sub-sequence segment, which will not be repeated here.

[0107] According to the conversion times of each second sequence segment, the corresponding second sequence segment is converted back to the first sequence segment.

[0108] Exemplarily, take the second sequence segment of "000000" in the second data as an example, where the value of n is 6, the number of conversions of the first sequence segment is 2, and m is 1. First, the second sequence of the last conversion (i.e., the second conversion) is determined according to the value of n, the value of m, and the number of conversions, which is "2, 2, 3, 4, 6", that is, the sequence determined according to each of the first five digits of the Fibo sequence + m (the value of m in this example is 1). The second, third, fourth, and sixth digits of "100001" are reconverted to obtain "011101". Since the number of conversions is 2, "011101" is not the corresponding first sequence segment, and it is necessary to determine the first sequence "1, 1, 2, 3, 5", and convert the first, second, third, and fifth digits of "011101" again to obtain "100111". "100111" is the first sequence segment corresponding to the second sequence segment here.

[0109] Finally, at least one first sequence segment is concatenated according to the arrangement order of the second sequence segments corresponding to each first sequence segment in at least one first sequence in the second data to obtain the first data.

[0110] It can be seen that in the embodiment of the present application, the corresponding first data can be obtained according to the entropy encoded second data according to the entropy coding parameters, and then the data integrity of the original data, i.e., the first data, is guaranteed in the process of converting the first data into the second data and then saving and transmitting them.

[0111] By implementing the method in the above application embodiment, it can be seen that by entropy encoding the binary sequence of the first data to obtain the corresponding second data, and compressing the second data as the first data to obtain the compressed third data, the data compression rate is improved compared to directly compressing the first data. Therefore, when storing and transmitting the third data, the storage and transmission efficiency is improved. By dividing the first data into multiple binary sequence segments and converting them multiple times to obtain the second sequence segments, and then obtaining the corresponding second data, the entropy encoding of the first data is realized; the integrity of the first data is guaranteed by the entropy encoding parameters.

[0112] Based on the description of the above configuration method embodiment, the present application also provides a data entropy coding device 700, which is specifically operated at Figure 1 A computer program (including program code) in the first terminal 101 or the second terminal 102 shown in FIG. Figure 1 The application scenario shown in the figure is executed Figure 2 and / or Figure 6 See the method shown in Figure 7 , Figure 7A schematic diagram of the structure of an entropy coding device for data provided in an embodiment of the present application, wherein the entropy coding device 700 for data includes:

[0113] The acquisition unit 701 is configured to acquire a binary sequence of first data.

[0114] The dividing unit 702 is configured to divide the binary sequence of the first data into at least one first sequence segment, each sequence segment in the at least one first sequence segment includes n binary bits.

[0115] The processing unit 703 is used to process the at least one first sequence segment based on the Fibonacci sequence to obtain at least one second sequence segment corresponding to the at least one first sequence segment, wherein the data entropy value of the second sequence segment is lower than the data entropy value of the corresponding first sequence segment.

[0116] The generating unit 704 is configured to generate entropy-encoded second data corresponding to the first data according to at least one second sequence segment.

[0117] In a possible embodiment, in terms of processing at least one first sequence segment based on the Fibonacci sequence, the acquisition unit 701 is further specifically used to: acquire a first sequence, the first sequence being a sequence consisting of the first k values ​​in the Fibonacci sequence, wherein the kth value is less than or equal to n; and converting the i-th binary bit in the first sequence segment based on the value i in the first sequence to obtain the sequence segment after the first conversion.

[0118] In a possible embodiment, after obtaining the sequence segment after the first conversion, the processing unit 703 is further specifically used to: calculate the data entropy value of the sequence segment after the first conversion; if the data entropy value of the sequence segment after the first conversion is lower than the preset entropy value, determine that the sequence segment after the first conversion is the second sequence segment.

[0119] In a possible embodiment, if the data entropy value of the sequence segment after the first conversion is not less than the preset entropy value, the acquisition unit 701 is further specifically used to: obtain a second sequence, where the second sequence is obtained by adding m to each numerical value in the first sequence; convert the j-th binary bit in the sequence segment after the first conversion based on the numerical value j in the second sequence to obtain the sequence segment after the second conversion; calculate the data entropy value of the sequence segment after the second conversion, and if the data entropy value of the sequence segment after the second conversion is lower than the preset entropy value, determine that the sequence segment after the second conversion is the second sequence segment.

[0120] In a possible embodiment, after generating entropy-coded second data corresponding to the first data according to at least one second sequence segment, the generation unit 704 is further specifically used to: generate compressed third data according to the second data; send the third data, and the entropy coding parameters of the third data, the entropy coding parameters including the n value and the number of conversions of the first sequence segment.

[0121] Based on the description of the above configuration method embodiment, the present application also provides a data entropy decoding device 800, which is specifically operated on Figure 1 A computer program (including program code) in the first terminal 101 or the second terminal 102 shown in FIG. Figure 1 The application scenario shown in the figure is executed Figure 2 and / or Figure 6 See the method shown in Figure 8 , Figure 8 A schematic diagram of the structure of an entropy decoding device for data provided in an embodiment of the present application, wherein the entropy decoding device 800 for data includes:

[0122] The receiving unit 801 is used to receive third data and entropy coding parameters, where the third data is data obtained by compressing the second data.

[0123] The decompression unit 802 is used to decompress the third data to obtain second data, where the second data is data obtained by entropy encoding the first data.

[0124] The calculation unit 803 is used to perform entropy decoding on the second data according to the entropy coding parameter to obtain the first data.

[0125] In a possible embodiment, the entropy coding parameter includes an n value and a conversion number of each second sequence segment. In terms of performing entropy coding on the second data according to the entropy coding parameter to obtain the first data, the calculation unit 803 is further specifically used to: divide the binary sequence of the first data into at least one second sequence segment, each sequence segment in the at least one second sequence segment includes n binary bits; convert at least one second sequence segment according to the conversion number corresponding to each second sequence segment to obtain at least one first sequence segment; splice at least one first sequence segment according to the arrangement order of the second sequence segments corresponding to each first sequence segment in the at least one first sequence in the second data to obtain the first data.

[0126] Based on the description of the above method embodiment and device embodiment, please refer to Fig. 9 , Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Fig. 9 The electronic device 900 shown (the electronic device 900 may be a computer device) includes a memory 901, a processor 902, a communication interface 903 and a bus 904. The memory 901, the processor 902 and the communication interface 903 are connected to each other through the bus 904.

[0127] The memory 901 may be a read-only memory (ROM), a static storage device, a dynamic storage device or a random access memory (RAM).

[0128] The memory 901 can store program code. When the program code stored in the memory 901 is executed by the processor 902, the processor 902 and the communication interface 903 are used to perform various steps of the data entropy encoding and / or data entropy decoding method of the embodiment of the present application.

[0129] The processor 902 can adopt a general central processing unit (CPU), a microprocessor, an application specific integrated circuit (ASIC), a graphics processing unit (GPU) or one or more integrated circuits to execute relevant programs to implement the functions required to be performed by the units in the electronic device 900 of the embodiment of the present application, or to perform the entropy encoding and / or entropy decoding method of the data of the method embodiment of the present application.

[0130] The processor 902 may also be an integrated circuit chip with signal processing capabilities. In the implementation process, the various steps of the entropy coding of the data and / or the entropy decoding method of the data of the present application may be completed by the hardware integrated logic circuit or software instructions in the processor 902. The above-mentioned processor 902 may also be a general-purpose processor, a digital signal processor (Digital Signal Processing, DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application may be implemented or executed. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application may be directly embodied as being executed by a hardware decoding processor, or executed by a combination of hardware and software modules in a decoding processor. The software module may be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 901, and the processor 902 reads the information in the memory 901, and combines its hardware to complete the functions required to be performed by the units included in the electronic device 900 of the embodiment of the present application, or executes the entropy encoding method of the data and / or the entropy decoding method of the data of the method embodiment of the present application.

[0131] The communication interface 903 uses a transceiver such as, but not limited to, a transceiver to implement communication between the electronic device 900 and other devices or a communication network. For example, data can be acquired through the communication interface 903 .

[0132] The bus 904 may include a path for transmitting information between various components of the electronic device 900 (eg, the memory 901 , the processor 902 , and the communication interface 903 ).

[0133] It should be noted that although Fig. 9 The electronic device 900 shown only shows a memory 901, a processor 902, and a communication interface 903. However, in the specific implementation process, those skilled in the art should understand that the electronic device 900 also includes other devices necessary for normal operation. At the same time, according to specific needs, those skilled in the art should understand that the electronic device 900 may also include hardware devices for implementing other additional functions. In addition, those skilled in the art should understand that the electronic device 900 may also only include the devices necessary for implementing the embodiments of the present application, and does not necessarily include Fig. 9 All devices shown in .

[0134] An embodiment of the present application also provides a chip, which includes a processor and a data interface. The processor reads instructions stored in a memory through the data interface to implement the data entropy encoding and / or data entropy decoding method.

[0135] Optionally, as an implementation method, the chip may also include a memory, in which instructions are stored, and the processor is used to execute the instructions stored in the memory. When the instructions are executed, the processor is used to execute the data entropy encoding and / or data entropy decoding method.

[0136] An embodiment of the present application also provides a computer-readable storage medium, which stores instructions. When the computer-readable storage medium is executed on a computer or a processor, the computer or the processor executes one or more steps in any of the above methods.

[0137] The embodiment of the present application further provides a computer program product including instructions. When the computer program product is executed on a computer or a processor, the computer or the processor executes one or more steps in any of the above methods.

[0138] Those skilled in the art will appreciate that the functions described in conjunction with the various illustrative logic blocks, modules, and algorithm steps disclosed herein can be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions described in the various illustrative logic blocks, modules, and steps can be stored or transmitted as one or more instructions or codes on a computer-readable medium and executed by a hardware-based processing unit. Computer-readable media may include computer-readable storage media, which corresponds to tangible media, such as data storage media, or includes any media (e.g., based on a communication protocol) that facilitates the transfer of a computer program from one place to another. In this manner, computer-readable media may generally correspond to (1) non-temporary tangible computer-readable storage media, or (2) communication media, such as signals or carrier waves. Data storage media may be any available media that can be accessed by one or more computers or one or more processors to retrieve instructions, codes, and / or data structures for implementing the techniques described in this application. A computer program product may include computer-readable media.

[0139] As an example and not limitation, such computer-readable storage media may include RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage, flash memory, or any other medium that can be used to store the desired program code in the form of instructions or data structures and can be accessed by a computer. Also, any connection is properly referred to as a computer-readable medium. For example, if instructions are transmitted from a website, server or other remote source using a coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio and microwave are included in the definition of media. However, it should be understood that the computer-readable storage media and data storage media do not include connections, carrier waves, signals or other temporary media, but are actually directed to non-temporary tangible storage media. As used herein, disks and optical disks include compact disks (CDs), laser optical disks, optical optical disks, digital versatile disks (DVDs), and Blu-ray disks, where disks typically reproduce data magnetically, while optical disks reproduce data optically using lasers. Combinations of the above should also be included within the scope of computer-readable media.

[0140] Instructions may be executed by one or more processors, such as one or more digital signal processors (DSPs), general purpose microprocessors, application specific integrated circuits (ASICs), field programmable logic arrays (FPGAs), or other equivalent integrated or discrete logic circuits. Thus, the term "processor" as used herein may refer to any of the aforementioned structures or any other structures suitable for implementing the techniques described herein. Additionally, in some aspects, the functions described by the various illustrative logic blocks, modules, and steps described herein may be provided within dedicated hardware and / or software modules configured for encoding and decoding, or incorporated in a combined codec. Moreover, the techniques may be fully implemented in one or more circuits or logic elements.

[0141] The techniques of the present application may be implemented in a variety of devices or apparatuses, including a wireless handset, an integrated circuit (IC), or a set of ICs (e.g., a chipset). Various components, modules, or units are described in this application to emphasize functional aspects of devices for performing the disclosed techniques, but do not necessarily need to be implemented by different hardware units. In fact, as described above, the various units may be combined in an encoded hardware unit in conjunction with appropriate software and / or firmware, or provided by interoperating hardware units (including one or more processors as described above).

[0142] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the specific descriptions of the corresponding steps in the aforementioned method embodiments, and will not be repeated here.

[0143] It should be understood that in the description of the present application, unless otherwise specified, " / " indicates that the objects associated before and after are in an "or" relationship, for example, A / B can represent A or B; wherein A and B can be singular or plural. Also, in the description of the present application, unless otherwise specified, "multiple" refers to two or more than two. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, wherein a, b, c can be single or multiple. In addition, in order to facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, the words "first", "second", etc. are used to distinguish the same items or similar items with substantially the same functions and effects. Those skilled in the art can understand that the words "first", "second", etc. do not limit the quantity and execution order, and the words "first", "second", etc. do not limit them to be necessarily different. Meanwhile, in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete manner for ease of understanding.

[0144] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the division of the unit is only a logical function division, and there may be other division methods in actual implementation, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. The mutual coupling, direct coupling, or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0145] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0146] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted through the computer-readable storage medium. The computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that contains one or more available media integrations. The available medium may be a read-only memory (ROM), or a random access memory (RAM), or a magnetic medium, such as a floppy disk, a hard disk, a tape, a disk, or an optical medium, such as a digital versatile disc (DVD), or a semiconductor medium, such as a solid state disk (SSD), etc.

[0147] The above is only a specific implementation of the embodiment of the present application, but the protection scope of the embodiment of the present application is not limited thereto, and any changes or replacements within the technical scope disclosed in the embodiment of the present application should be included in the protection scope of the embodiment of the present application. Therefore, the protection scope of the embodiment of the present application should be based on the protection scope of the claims.

[0148] The device embodiments described above are merely illustrative, wherein the units and modules described as separate components may or may not be physically separated. In addition, some or all of the units and modules may be selected according to actual needs to achieve the purpose of the present embodiment. Those of ordinary skill in the art may understand and implement the present invention without creative effort.

[0149] The above is only a specific implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A method for entropy coding of data, characterized in that: The method comprises: Acquire a binary sequence of first data; Divide the binary sequence of the first data into at least one first sequence segment, each sequence segment of the at least one first sequence segment includes n binary bits; Processing the at least one first sequence segment respectively based on the Fibonacci sequence to obtain at least one second sequence segment corresponding to the at least one first sequence segment, wherein the data entropy value of the second sequence segment is lower than the data entropy value of the corresponding first sequence segment; Generate entropy-encoded second data corresponding to the first data according to the at least one second sequence segment.

2. The method according to claim 1, characterized in that: The processing of the at least one first sequence segment based on the Fibonacci sequence respectively includes: Obtain a first number sequence, where the first number sequence is a number sequence consisting of the first k values ​​in the Fibonacci sequence, wherein the kth value is less than or equal to n; The i-th binary bit in the first sequence segment is converted based on the value i in the first number series to obtain a sequence segment after the first conversion.

3. The method according to claim 2, characterized in that After obtaining the sequence segment after the first conversion, the method further includes: Calculating the data entropy value of the sequence segment after the first conversion; If the data entropy value of the sequence segment after the first conversion is lower than the preset entropy value, the sequence segment after the first conversion is determined to be the second sequence segment.

4. The method according to claim 3, characterized in that If the data entropy value of the sequence segment after the first conversion is not less than a preset entropy value, the method further includes: Obtain a second number sequence, where the second number sequence is obtained by adding m to each value in the first number sequence; Convert the jth binary bit in the first converted sequence segment based on the value j in the second number sequence to obtain a second converted sequence segment; The data entropy value of the sequence segment after the second conversion is calculated, and if the data entropy value of the sequence segment after the second conversion is lower than a preset entropy value, the sequence segment after the second conversion is determined to be the second sequence segment.

5. The method according to any one of claims 1 to 4, characterized in that: After generating entropy-encoded second data corresponding to the first data according to the at least one second sequence segment, the method further includes: generating compressed third data according to the second data; The third data and entropy coding parameters of the third data are sent, where the entropy coding parameters include an n value and a number of conversions of the first sequence segments.

6. A method for entropy decoding of data, characterized in that: The method comprises: receiving third data and an entropy coding parameter, wherein the third data is data obtained by compressing the second data; Decompressing the third data to obtain the second data, where the second data is data obtained by entropy encoding the first data; The second data is entropy decoded according to the entropy coding parameter to obtain the first data.

7. The method according to claim 6, characterized in that The entropy coding parameter includes an n value and a number of conversions of each second sequence segment, and performing entropy coding on the second data according to the entropy coding parameter to obtain the first data includes: Divide the binary sequence of the first data into at least one second sequence segment, each second sequence segment in the at least one second sequence segment includes n binary bits; Convert the at least one second sequence segment based on the Fibonacci sequence and the number of conversions corresponding to each second sequence segment to obtain at least one first sequence segment; The at least one first sequence segment is concatenated according to the arrangement order of the second sequence segments corresponding to each first sequence segment in the at least one first sequence in the second data to obtain the first data.

8. A data entropy coding device, characterized in that: The device is used to perform an entropy coding method for data, and the device includes: An acquisition unit, configured to acquire a binary sequence of first data; a dividing unit, configured to divide the binary sequence of the first data into at least one first sequence segment, each sequence segment of the at least one first sequence segment including n binary bits; a processing unit, configured to process the at least one first sequence segment respectively based on the Fibonacci sequence to obtain at least one second sequence segment corresponding to the at least one first sequence segment, wherein a data entropy value of the second sequence segment is lower than a data entropy value of the corresponding first sequence segment; A generating unit is used to generate entropy-coded second data corresponding to the first data according to the at least one second sequence segment.

9. An electronic device, characterized in that: The method comprises a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, and the programs include instructions for executing the steps in the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program for electronic data exchange, wherein the computer program enables a computer to execute the method according to any one of claims 1 to 7.