A data transmission method based on quantum communication
By using arithmetic encoding method in quantum communication, combining character frequency and combination frequency, the quantum communication data is compressed, and the problem of poor universality of data compression in the prior art is solved, and more efficient and reliable data transmission is achieved.
Patent Information
- Application Number
- CN202411558276.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-04
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2044-11-04
AI Technical Summary
The existing data compression method based on quantum communication is poor in the face of low repetition and high randomness data and cannot effectively adapt to various types of data.
The sequences to be transmitted are compressed by arithmetic encoding method. By combining all characters in pairs, the theoretical frequency of all character combinations is calculated, and the sequence is arithmeticly encoded according to the span, the frequency of all characters and the theoretical frequency of all character combinations is to expand the final obtained interval range and improve the compression rate.
It improves the universality of data compression, can better adapt to various types of data, and enhances the efficient and reliable information transmission capabilities of quantum communication under limited resources.
Smart Images

Figure CN119070955B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data transmission, and more specifically, to a data transmission method based on quantum communication. Background Art
[0002] Quantum communication is a communication technology based on the principles of quantum mechanics, using quantum bits to transmit information. Unlike traditional communication methods, quantum communication relies on the superposition and entanglement of quantum states, which significantly improves the security and transmission efficiency of information. The most famous quantum communication protocol is quantum key distribution, such as the BB84 protocol, which ensures that both parties in communication share a secure key without being eavesdropped by a third party.
[0003] The characteristics of quantum communication give it unparalleled advantages in security and efficiency over traditional communication methods. However, in order to give full play to these advantages, data compression becomes an indispensable link. Through compression, quantum communication can achieve more efficient and reliable information transmission under limited resources.
[0004] In the related technology, for example, the Chinese patent document with the authorization announcement number CN116782206B, this application involves the field of data processing, and specifically provides a train-mounted wireless self-organizing network security method and system based on quantum communication, including: obtaining data to be transmitted, and dividing the data to be transmitted into a first data group and a second data group based on the frequency of each character in the data to be transmitted; wherein the frequency of the characters in the first data group is less than the preset frequency, and the frequency of the characters in the second data group is greater than the preset frequency; salting the characters in the second data group to obtain first salted data; encoding the first salted data and transmitting it through a quantum encryption method, which can increase the obfuscation of the encoding result, and at the same time, the run length in the encoding result becomes longer.
[0005] In the related art, the salted data is compressed and encoded by the GZIP method. The GZIP method combines the LZ77 algorithm and Huffman coding to achieve data compression. Therefore, the GZIP method performs well when processing data with high repeatability and predictability, but its compression effect is not good when facing data with low repeatability and high randomness. The data compression method in the related art has poor universality. Summary of the invention
[0006] In order to solve the technical problem that the above data compression method has poor universality, the present invention provides solutions in the following aspects.
[0007] The present invention provides a data transmission method based on quantum communication, comprising: obtaining a sequence to be transmitted, wherein the same data in the sequence belongs to the same character; the frequency of the character is equal to the number of all data belonging to the character The number of all data in the sequence Ratio ; Combine all characters in pairs to obtain multiple character combinations, and the theoretical frequencies of all character combinations are equal; According to the span, the frequencies of all characters and the theoretical frequencies of all character combinations, perform arithmetic coding on the sequence to be transmitted, and obtain each object and its corresponding interval in turn, wherein the span is an integer within the target range, including: In response to the sequence number of the data , will Data and The combination of data as an object, The value range is , is the span, is a floor rounding function. The interval to which the previous object belongs is divided according to the theoretical frequencies of all character combinations to obtain the subintervals corresponding to each character combination. The subinterval corresponding to the character combination that is the same as the object is taken as the interval to which the object belongs. Otherwise, the subinterval corresponding to the character combination that is the same as the object is taken as the interval to which the object belongs. The data is taken as an object, and the interval to which the previous object belongs is divided according to the frequencies of all characters to obtain the sub-intervals corresponding to each character, and the sub-intervals corresponding to the characters that are the same as the object are taken as the interval to which the object belongs; in the interval to which the last object belongs, the binary result of the shortest binary value is taken as the compression result of the sequence to be transmitted, and the compressed result is transmitted through the quantum encryption method.
[0008] The present invention compresses and transmits data transmitted in quantum communication through arithmetic coding, which can better adapt to various types of data. For quantum communication with diverse application scenarios, the data compression method of the present invention has better universality. At the same time, the present invention combines part of adjacent data in the sequence to be transmitted according to the span, and performs arithmetic coding on the sequence to be transmitted according to the frequencies of all characters and the theoretical frequencies of all character combinations, so as to expand the range of the interval finally obtained, thereby improving the compression rate when compressing the data transmitted in quantum communication through arithmetic coding, so that quantum communication can achieve more efficient and reliable information transmission under limited resources.
[0009] Preferably, the span is any integer in a target range, and the target range is a subset of a preset range.
[0010] For any integer in the target range, the theoretical compression rate of the sequence under this integer is greater than the initial compression rate of the sequence. Therefore, when any integer in the target range is used as the span, the compression rate when the sequence to be transmitted is arithmetically encoded according to the span, the frequency of all characters and the theoretical frequency of all character combinations is greater than the compression rate when the sequence to be transmitted is compressed by conventional arithmetic coding, thereby achieving an improvement in the compression rate, enabling quantum communication to achieve more efficient and reliable information transmission under limited resources.
[0011] Preferably, the preset range is , is a preset value, and the preset value is an integer greater than 1.
[0012] Preferably, the span is an integer with the largest theoretical compression ratio in the target range.
[0013] For the integer with the largest theoretical compression rate in the target range, the theoretical compression rate of the sequence is the largest under this integer. Therefore, when the integer with the largest theoretical compression rate in the target range is used as the span, the compression rate when the sequence to be transmitted is arithmetic encoded is the largest according to the span, the frequency of all characters and the theoretical frequency of all character combinations, thereby maximizing the compression rate and enabling quantum communication to achieve more efficient and reliable information transmission with limited resources.
[0014] Preferably, the method for obtaining the target range is: calculating the initial compression rate of the sequence; for all integers within the preset range, calculating the theoretical compression rate of the sequence at each integer; obtaining the target range according to the relationship between the theoretical compression rate of the sequence at each integer and the initial compression rate of the sequence, including: in response to the existence of a value greater than 1 in the theoretical compression rate of the sequence at each integer The theoretical compression ratio is is the initial compression rate of the sequence, and the theoretical compression rate is greater than The target range is composed of all integers in .
[0015] Preferably, obtaining the theoretical compression ratio of the sequence under various integers includes: taking any integer within a preset range as a target integer; responding to the sequence number of the data in the sequence , is the target integer, The value range is , is the floor function, is the number of all data in the sequence, Data and The combination of data is regarded as an object, and the frequency of the object is equal to the theoretical frequency of the same character combination as the object; otherwise, the first data as an object; calculate the product of the frequencies of all objects as a sequence in the target integer Theoretical compression ratio.
[0016] The present invention combines part of adjacent data in the sequence to be transmitted according to the span, so as to expand the range of the interval finally obtained, thereby improving the compression rate when compressing the data transmitted in quantum communication through arithmetic coding, so that quantum communication can achieve more efficient and reliable information transmission under limited resources.
[0017] Preferably, the initial compression ratio of the sequence Satisfies the expression: ; In the formula, is the number of all data in the sequence, For the Data The frequency of the same characters, is a multiplication function.
[0018] Preferably, the theoretical frequencies of all character combinations are , is the number of all character types.
[0019] Preferably, the method further comprises transmitting the span, all characters and the frequencies of all characters.
[0020] Preferably, the method further includes: when obtaining the interval to which the first object belongs, if the first object belongs to a character combination, dividing the interval [0, 1] according to the theoretical frequencies of all character combinations, obtaining sub-intervals corresponding to each character combination, and taking the sub-interval corresponding to the character combination identical to the object as the interval to which the object belongs; if the first object belongs to a character, dividing the interval [0, 1] according to the frequencies of all characters, obtaining sub-intervals corresponding to each character, and taking the sub-interval corresponding to the character identical to the object as the interval to which the object belongs.
[0021] The beneficial effects of the present invention are:
[0022] The present invention compresses and transmits data transmitted in quantum communication through arithmetic coding, which can better adapt to various types of data. For quantum communication with diverse application scenarios, the data compression method of the present invention has better universality. At the same time, the present invention combines part of adjacent data in the sequence to be transmitted according to the span, and performs arithmetic coding on the sequence to be transmitted according to the frequencies of all characters and the theoretical frequencies of all character combinations, so as to expand the range of the interval finally obtained, thereby improving the compression rate when compressing the data transmitted in quantum communication through arithmetic coding, so that quantum communication can achieve more efficient and reliable information transmission under limited resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The above and other purposes, features and advantages of the exemplary embodiments of the present invention will become readily understood by reading the detailed description below through the accompanying drawings. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:
[0024] Figure 1 is a flow chart schematically illustrating a data transmission method based on quantum communication in the present invention;
[0025] Figure 2 Schematically shows an image to be transmitted. DETAILED DESCRIPTION
[0026] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0027] The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0028] The embodiment of the present invention discloses a data transmission method based on quantum communication, referring to Figure 1 , comprising steps S1 to S4:
[0029] S1. Obtain the sequence to be transmitted.
[0030] It should be noted that a major advantage of quantum communication is its flexibility and adaptability, which can meet the needs of different application scenarios and use the characteristics of quantum mechanics to improve security and transmission efficiency; therefore, data transmission in quantum communication is not limited to a certain type, but covers multiple forms such as numbers, text and images.
[0031] Specifically, according to the type of the object to be transmitted, the sequence to be transmitted is obtained, including:
[0032] 1. When the type of the object to be transmitted is a numeric type, the object to be transmitted is directly used as the sequence to be transmitted; illustratively, when the object to be transmitted is {38, 20, 17, ..., 69, 100}, the sequence to be transmitted is {38, 20, 17, ..., 69, 100}.
[0033] 2. When the type of the object to be transmitted is text, the object to be transmitted is encoded using Unicode encoding to obtain a sequence to be transmitted. The data in the sequence to be transmitted includes numbers from 0 to 9 and Latin letters A, B, C, D, E, F, and U. For example, when the object to be transmitted is "Hello", the sequence to be transmitted is {U, 4, F, 6, 0, U, 5, 9, 7, D}.
[0034] 3. When the type of the object to be transmitted is an image type, the grayscale values of all pixels are arranged in a row-by-row order as a sequence to be transmitted; for example, when the object to be transmitted is Figure 2 When the image is shown, the sequence to be transmitted is {91,91,92,94,94,93,93,95,93,96,…,87,87,84,83,95,98,99,99}.
[0035] S2. Obtain the frequencies of all characters and the theoretical frequencies of all character combinations.
[0036] Specifically, the same data in the sequence belongs to the same type of character, and the number of all character types is recorded as ; The frequency of the character is equal to the number of all data belonging to the character The number of all data in the sequence Ratio .
[0037] Further, all characters are combined into a character combination, and a total of character combinations; the theoretical frequencies of all character combinations are equal, then the theoretical frequencies of all character combinations are .
[0038] For example, when the sequence to be transmitted is {B, E, B, F, A, F, E, E, C, D, B, B, E, C, F, E, B, E, A, C}, there are 6 characters in the sequence, namely: A, B, C, D, E and F; among which, the frequency of character "A" is , the frequency of the character "B" , the frequency of the character "C" , the frequency of the character "D" , the frequency of the character "E" , the frequency of the character "F" ; For the 6 characters A, B, C, D, E, and F, all characters are combined in pairs, and a total of 36 character combinations are obtained, namely: AA, AB, AC, ..., AF, BA, BB, BC, ..., BF, FD, FE, FF. The theoretical frequencies of all character combinations are equal and are .
[0039] S3. Perform arithmetic coding on the sequence to be transmitted according to the span, the frequencies of all characters and the theoretical frequencies of all character combinations, and obtain each object and its corresponding interval in turn; in the interval to which the last object belongs, obtain the compression result of the sequence to be transmitted.
[0040] It should be noted that in the related art, the salted data is compressed and encoded by the GZIP method. The GZIP method combines the LZ77 algorithm and Huffman coding to achieve data compression. The LZ77 algorithm is a popular lossless data compression algorithm. Its basic principle is to use repeated patterns in the data to achieve compression. By finding the matching string before the current character, the repeated data is replaced with a pointer to the previous string and a character, thereby reducing data redundancy; therefore, the GZIP method performs well when processing data with high repeatability and predictability, but when facing low repeatability and high randomness data, its compression effect is not good, that is to say, the data compression method in the related art has poor universality; due to the diversity of application scenarios of quantum communication, data transmission in quantum communication covers a variety of forms such as numbers, texts and images. Therefore, a data compression method with better universality is needed to compress data transmitted in quantum communication.
[0041] It should be further explained that arithmetic coding does not rely on a fixed dictionary or pattern, but rather regards the entire sequence as a continuous interval and incorporates the probability distribution of different characters into the compression process. This feature enables arithmetic coding to better adapt to various types of data; therefore, the present invention compresses data transmitted in quantum communication through arithmetic coding.
[0042] It should be further explained that arithmetic coding obtains the interval corresponding to each data according to the order in which the data appear in the sequence. In this process, the interval corresponding to the previous data of the current data is mainly divided according to the frequency of the character to obtain the sub-interval corresponding to each character, wherein the sub-interval corresponding to the character with a greater frequency is larger, and the sub-interval corresponding to the character with a smaller frequency is smaller. The interval corresponding to the character that is the same as the current data is used as the interval corresponding to the current data; finally, a decimal with the shortest binary result is obtained from the interval corresponding to the last data in the sequence, and this decimal is in the range of [0.1], and its binary result is used as the final compression result; the larger the range of the interval, the shorter the binary result of the decimal, and the smaller the range of the interval, the longer the binary result of the decimal; that is, the larger the interval corresponding to the last data in the sequence, the greater the compression rate, and the smaller the interval corresponding to the last data in the sequence, the smaller the compression rate.
[0043] For example, for the larger interval [0.73, 0.77], the decimals in the interval include 0.73, 0.74, 0.75, 0.76, 0.77, 0.731, 0.732, 0.733, etc., where the decimal with the shortest binary result is 0.75, and its binary result is "11"; for the smaller interval [0.7519, 0.7521], the decimals in the interval include 0.7519, 0.752 , 0.7521, 0.75191, 0.75192, 0.75193, 0.75194, 0.75195, etc., among which the decimal with the shortest binary result is 0.751953125, and its binary result is "110000001"; therefore, the shortest binary result "11" obtained in a larger interval is shorter than the shortest binary result "110000001" obtained in a smaller interval.
[0044] In summary, the present invention improves the compression rate of data transmitted in quantum communication through arithmetic coding by expanding the range of the finally obtained interval, so that quantum communication can achieve more efficient and reliable information transmission under limited resources.
[0045] 1. Calculate the initial compression ratio of the sequence.
[0046] Specifically, calculate the initial compression ratio of the sequence It should be noted that the initial compression rate of the sequence is the compression rate when the sequence is compressed according to conventional arithmetic coding.
[0047] Then the initial compression ratio Satisfies the expression:
[0048] ;
[0049] In the formula, is the number of all data in the sequence, For the Data The frequency of the same characters, is a multiplication function.
[0050] It should be noted that, since conventional arithmetic coding is to continuously divide sub-intervals by the frequencies of all characters and determine the sub-intervals according to the frequencies of the characters that are the same as the data in the sequence, and then obtain the interval corresponding to the last data in the sequence, the range size of the interval corresponding to the last data in the sequence is equal to the cumulative multiplication result of the frequencies of the characters that are the same as the data in the sequence; and the compression rate is positively correlated with the range size of the interval corresponding to the last data in the sequence, therefore, the cumulative multiplication result of the frequencies of the characters that are the same as the data in the sequence is The larger the initial compression ratio of the sequence, The bigger.
[0051] For example, when the sequence {B,E,B,F,A,F,E,E,C,D,B,B,E,C,F,E,B,E,A,C} to be transmitted is compressed by conventional arithmetic coding, the initial compression rate of the sequence is ,in, , , , , , These are the frequencies of the six characters A, B, C, D, E, and F.
[0052] 2. For all integers in the preset range, calculate the theoretical compression ratio of the sequence at each integer.
[0053] Specifically, set a preset range to , is a preset value, wherein the specific value of the preset value can be set according to the actual application scenario and requirements, and the preset value is an integer greater than 1. In this embodiment, the preset value Set to 5.
[0054] Further, for all integers within a preset range, the theoretical compression ratio of the sequence under each integer is calculated; wherein obtaining the theoretical compression ratio of the sequence under each integer includes: taking any integer within the preset range as the target integer; responding to the sequence number of the data in the sequence , is the target integer, The value range is , is the floor function, is the number of all data in the sequence, Data and The combination of data is regarded as an object, and the frequency of the object is equal to the theoretical frequency of the same character combination as the object; otherwise, the first The data is taken as an object, and the frequency of the object is equal to the frequency of the same character as the object.
[0055] Compute the product of the frequencies of all objects as a sequence at the target integer Theoretical compression rate under the target integer The theoretical compression ratio under satisfies the expression:
[0056] ;
[0057] In the formula, is the number of all objects, For the Objects The frequency, is a multiplication function.
[0058] It should be noted that the present invention is to and The data is combined, and the sub-interval division and interval determination are performed according to the theoretical frequency of all character combinations and the frequency of this character combination. and The data is also divided into sub-intervals and determined in the conventional arithmetic coding method; therefore, by performing sub-interval division and interval determination according to the frequencies of all characters and the theoretical frequencies of all character combinations in the present invention, when the interval corresponding to the last data in the sequence is obtained, the range size of the interval corresponding to the last data in the sequence is equal to the cumulative multiplication result of the frequency of the character or the theoretical frequency of the character combination that is the same as each object; and the compression rate is positively correlated with the range size of the interval corresponding to the last data in the sequence, therefore, the cumulative multiplication result of the frequency of each object is The larger the sequence is, the The greater the theoretical compression rate.
[0059] Exemplarily, when the integer is 1, for the sequence to be transmitted {B, E, B, F, A, F, E, E, C, D, B, B, E, C, F, E, B, E, A, C}, the objects obtained are: B, EB, F, AF, E, EC, D, BB, E, CF, E, BE, A, C, among which the objects B, F, E, D, E, E, A, C are characters, and their frequencies are equal to the frequencies of the same characters as the objects, and the objects EB, AF, EC, BB, CF, BE are character combinations, and their frequencies are equal to the theoretical frequencies of the same character combinations as the objects, then the theoretical compression rate of the sequence under the target integer 1 is ,in, , They are the theoretical frequencies of character combination EB and character combination BE respectively.
[0060] Exemplarily, when the integer is 2, for the sequence to be transmitted {B, E, B, F, A, F, E, E, C, D, B, B, E, C, F, E, B, E, A, C}, the objects obtained are: B, E, BF, A, F, EE, C, D, BB, E, C, FE, B, E, AC, among which objects B, E, A, F, C, D, E, C, B, E belong to characters, and their frequencies are equal to the frequencies of the same characters as the objects, and objects BF, EE, BB, FE, AC belong to character combinations, and their frequencies are equal to the theoretical frequencies of the same character combinations as the objects. Then, the theoretical compression rate of the sequence under the target integer 2 is ,in, , They are the theoretical frequencies of character combination BF and character combination AC respectively.
[0061] Exemplarily, when the integer is 3, for the sequence to be transmitted {B, E, B, F, A, F, E, E, C, D, B, B, E, C, F, E, B, E, A, C}, the objects obtained are: B, E, B, FA, F, E, E, CD, B, B, E, CF, E, B, E, AC, among which the objects B, E, B, F, E, E, B, B, E, E, B, E are characters, and their frequencies are equal to the frequencies of the same characters as the objects, and the objects FA, CD, CF, AC are character combinations, and their frequencies are equal to the theoretical frequencies of the same character combinations as the objects. Then, the theoretical compression rate of the sequence under the target integer 3 is ,in, , They are the theoretical frequencies of character combination FA and character combination AC respectively.
[0062] Exemplarily, when the integer is 4, for the sequence to be transmitted {B, E, B, F, A, F, E, E, C, D, B, B, E, C, F, E, B, E, A, C}, the objects obtained are: B, E, B, F, AF, E, E, C, D, BB, E, C, F, E, BE, A, C, among which objects B, E, B, F, E, E, C, D, E, C, F, E, A, C are characters whose frequencies are equal to the frequencies of the same characters as the objects, and objects AF, BB, BE are character combinations whose frequencies are equal to the theoretical frequencies of the same character combinations as the objects. Then, the theoretical compression rate of the sequence under the target integer 4 is ,in, , They are the theoretical frequencies of character combination AF and character combination BE respectively.
[0063] Exemplarily, when the integer is 5, for the sequence to be transmitted {B,E,B,F,A,F,E,E,C,D,B,B,E,C,F,E,B,E,A,C}, the objects obtained are: B, E, B, F, A, FE, E, C, D, B, B, EC, F, E, B, E, A, C, among which objects B, E, B, F, A, E, C, D, B, B, F, E, B, E, A, C are characters whose frequencies are equal to the frequencies of the same characters as the objects, and objects FE and EC are character combinations whose frequencies are equal to the theoretical frequencies of the same character combinations as the objects. Then, the theoretical compression rate of the sequence under the target integer 5 is ,in, is the theoretical frequency of the character combination FE.
[0064] 3. According to the relationship between the theoretical compression rate of the sequence at each integer and the initial compression rate of the sequence, the target range is obtained, including: in response to the theoretical compression rate of the sequence at each integer being greater than The theoretical compression ratio is is the initial compression rate of the sequence, and the theoretical compression rate is greater than All integers of form a target range; in response to the theoretical compression rate of the sequence at each integer being less than , the target range is empty.
[0065] In one embodiment, the span is any integer in a target range, and the target range is a subset of a preset range.
[0066] It should be noted that for any integer in the target range, the theoretical compression rate of the sequence under this integer is greater than the initial compression rate of the sequence. Therefore, when any integer in the target range is used as the span, based on the span, the frequency of all characters and the theoretical frequency of all character combinations, the compression rate when the sequence to be transmitted is arithmetically encoded is greater than the compression rate when the sequence to be transmitted is compressed by conventional arithmetic coding, thereby achieving an improvement in the compression rate, enabling quantum communication to achieve more efficient and reliable information transmission under limited resources.
[0067] In another embodiment, the span is an integer with the largest theoretical compression ratio in the target range.
[0068] It should be noted that for the integer with the largest theoretical compression rate in the target range, the theoretical compression rate of the sequence is the largest under this integer. Therefore, when the integer with the largest theoretical compression rate in the target range is used as the span, the compression rate when the sequence to be transmitted is arithmetic encoded is the largest according to the span, the frequency of all characters and the theoretical frequency of all character combinations, thereby maximizing the compression rate and enabling quantum communication to achieve more efficient and reliable information transmission with limited resources.
[0069] For example, the initial compression ratio of the sequence , and the theoretical compression ratio of the sequence under the target integer 1 , the theoretical compression ratio of the sequence under the target integer 2 , the theoretical compression ratio of the sequence under the target integer 3 , the theoretical compression ratio of the sequence under the target integer 4 , the theoretical compression ratio of the sequence under the target integer 5 , where the theoretical compression ratio of the sequence under the target integer 3 is Greater than , that is to say, there is a theoretical compression ratio of the sequence under each integer greater than The theoretical compression rate, at this time, the theoretical compression rate is greater than The target range is composed of all integers in , that is, the target range contains the integer 3; therefore, the integer 3 is used as the span.
[0070] 3.1. When the span exists, the sequence to be transmitted is arithmetically coded according to the frequencies of all characters and the theoretical frequencies of all character combinations, and each object and its corresponding interval are obtained in turn, including:
[0071] Response to the data sequence number , will Data and The combination of data is regarded as an object, where is the span, which is an integer within a preset range, The value range is , is a floor rounding function. The interval to which the previous object belongs is divided according to the theoretical frequencies of all character combinations to obtain the subintervals corresponding to each character combination. The subinterval corresponding to the character combination that is the same as the object is taken as the interval to which the object belongs. Otherwise, the subinterval corresponding to the character combination that is the same as the object is taken as the interval to which the object belongs. Take each data as an object, divide the interval to which the previous object belongs according to the frequency of all characters, obtain the sub-interval corresponding to each character, and take the sub-interval corresponding to the same character as the object as the interval to which the object belongs.
[0072] Finally, in the interval to which the last object belongs, the binary result of the value with the shortest binary result is used as the compression result of the sequence to be transmitted.
[0073] It should be noted that since the first object does not have a previous object, when obtaining the interval to which the first object belongs, if the first object belongs to a character combination, the interval [0,1] is divided according to the theoretical frequencies of all character combinations to obtain the sub-intervals corresponding to each character combination, and the sub-interval corresponding to the character combination identical to the object is used as the interval to which the object belongs; if the first object belongs to a character, the interval [0,1] is divided according to the frequencies of all characters to obtain the sub-intervals corresponding to each character, and the sub-interval corresponding to the character identical to the object is used as the interval to which the object belongs.
[0074] For example, for the sequence to be transmitted {B,E,B,F,A,F,E,E,C,D,B,B,E,C,F,E,B,E,A,C}, the frequencies of characters A, B, C, D, E, and F are 0.1, 0.25, 0.15, 0.05, 0.3, and 0.15, respectively, and the theoretical frequencies of all character combinations are equal and are ; When the span is equal to 3, the sequence number is and The combination of data is taken as an object, and the data of the remaining serial numbers are taken as an object respectively. Then all the objects are: B, E, B, FA, F, E, E, CD, B, B, E, CF, E, B, E, AC. The process of obtaining the interval to which each object belongs is:
[0075] (1) For the first object "B", the interval [0,1] is divided according to the frequencies of characters A, B, C, D, E and F, and the sub-intervals corresponding to each character are obtained, which are [0,0.1), [0.1,0.35), [0.35,0.5), [0.5,0.55), [0.55,0.85), [0.85,1] respectively. The interval to which the first object "B" belongs is [0.1,0.35);
[0076] (2) For the second object "E", the interval [0.1, 0.35) to which the first object "B" belongs is divided according to the frequencies of characters A, B, C, D, E and F, and the sub-intervals corresponding to each character are obtained, which are [0.1, 0.125), [0.125, 0.1875), [0.1875, 0.225), [0.225, 0.2375), [0.2375, 0.3125), [0.3125, 0.35), respectively. Then the interval to which the second object "E" belongs is [0.2375, 0.3125);
[0077] (3) For the third object "B", the interval [0.2375, 0.3125) to which the second object "E" belongs is divided according to the frequencies of characters A, B, C, D, E and F, and the sub-intervals corresponding to each character are obtained, which are [0.2375, 0.245), [0.245, 0.26375), [0.26375, 0.275), [0.275, 0.27875), [0.27875, 0.30125), [0.30125, 0.3125), so the interval to which the third object "B" belongs is [0.245, 0.26375);
[0078] (4) For the fourth object "FA", the interval [0.245, 0.26375) to which the third object "B" belongs is divided according to the theoretical frequencies of all character combinations, and the subintervals corresponding to each character combination are obtained, which are [0.245, 0.2455), [0.2455, 0.2460), ..., [0.260625, 0.26115), [0.26115, 0.26167), [0.26167, 0.26219), [0.26219, 0.26271), [0.26271, 0.26323), [0.26323, 0.26375), so the interval to which the fourth object "FA" belongs is [0.260625, 0.26115);
[0079] (5) Continue in this way until the last object “AC” is in the interval [0.26107836217430268, 0.261078362174239102).
[0080] 3.2. When the target range is empty, the span does not exist. At this time, the sequence to be transmitted is arithmetically encoded according to the frequency of all characters, and the intervals to which each data in the sequence belongs are obtained in turn, including:
[0081] For any data in the sequence, the interval to which the previous data belongs is divided according to the frequencies of all characters to obtain the sub-intervals corresponding to each character, and the sub-intervals corresponding to the same characters as the data are taken as the interval to which the data belongs.
[0082] Finally, in the interval to which the last data belongs, the binary result of the value with the shortest binary result is used as the compression result of the sequence to be transmitted.
[0083] It should be noted that the above is a process of obtaining the interval to which each data in a sequence belongs and obtaining the compression result of the sequence to be transmitted in conventional arithmetic coding.
[0084] It should be noted that since the first object does not have a previous object, when obtaining the interval to which the first object belongs, if the first object belongs to a character combination, the interval [0,1] is divided according to the theoretical frequencies of all character combinations to obtain the sub-intervals corresponding to each character combination, and the sub-interval corresponding to the character combination identical to the object is used as the interval to which the object belongs; if the first object belongs to a character, the interval [0,1] is divided according to the frequencies of all characters to obtain the sub-intervals corresponding to each character, and the sub-interval corresponding to the character identical to the object is used as the interval to which the object belongs.
[0085] S4. The compressed result is transmitted through quantum encryption method.
[0086] Specifically, the compression result is transmitted through a quantum encryption method, and the span, all characters and the frequencies of all characters are transmitted as supplementary information; specifically, when the span does not exist, only all characters and the frequencies of all characters are transmitted as supplementary information.
[0087] It should be noted that the character combination in the present invention can be obtained by combining all characters, and the theoretical frequency can be calculated based on the number of all characters without the need for additional transmission.
[0088] It should be further explained that the present invention compresses and transmits data transmitted in quantum communication through arithmetic coding, which can be better adapted to various types of data. For quantum communication with diverse application scenarios, the data compression method of the present invention has better universality. At the same time, the present invention combines part of adjacent data in the sequence to be transmitted according to the span, and performs arithmetic coding on the sequence to be transmitted according to the frequencies of all characters and the theoretical frequencies of all character combinations, so as to expand the range of the interval finally obtained, thereby improving the compression rate when compressing data transmitted in quantum communication through arithmetic coding, so that quantum communication can achieve more efficient and reliable information transmission under limited resources.
[0089] In the description of this specification, "plurality" or "several" means at least two, such as two, three or more, etc., unless otherwise clearly and specifically defined.
[0090] Although this specification has shown and described a number of embodiments of the present invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art will conceive of many modifications, changes and alternatives without departing from the ideas and spirit of the present invention. It should be understood that in practicing the present invention, various alternatives to the embodiments of the present invention described herein may be employed.
Claims
1. A data transmission method based on quantum communication, characterized in that: include: Get the sequence to be transmitted, and the same data in the sequence belongs to the same character; the frequency of the character is equal to the number of all data belonging to the character The number of all data in the sequence Ratio ; Combine all characters in pairs to obtain multiple character combinations, and the theoretical frequencies of all character combinations are equal; According to the span, the frequency of all characters and the theoretical frequency of all character combinations, the sequence to be transmitted is arithmetically encoded to obtain each object and its corresponding interval in turn, wherein the span is an integer within the target range, including: , will Data and The combination of data as an object, The value range is , is the span, is a floor function. The interval to which the previous object belongs is divided according to the theoretical frequencies of all character combinations to obtain the subintervals corresponding to each character combination. The subinterval corresponding to the character combination that is the same as the object is taken as the interval to which the object belongs. Otherwise, the subinterval corresponding to the character combination that is the same as the object is taken as the interval to which the object belongs. Take each data as an object, divide the interval to which the previous object belongs according to the frequency of all characters, obtain the sub-intervals corresponding to each character, and take the sub-intervals corresponding to the same characters as the object as the interval to which the object belongs; The method for obtaining the target range is: Calculate the initial compression ratio of the sequence; for all integers in the preset range, calculate the theoretical compression ratio of the sequence at each integer, including: Take any integer within the preset range as the target integer; The sequence number of the data in the response sequence , is the target integer, The value range is , is the number of all data in the sequence, Data and The combination of data is regarded as an object, and the frequency of the object is equal to the theoretical frequency of the same character combination as the object; otherwise, the first Each data is regarded as an object; Compute the product of the frequencies of all objects as a sequence at the target integer Theoretical compression ratio under ; According to the relationship between the theoretical compression rate of the sequence at each integer and the initial compression rate of the sequence, the target range is obtained, including: in response to the presence of a value greater than 0. The theoretical compression ratio is is the initial compression ratio of the sequence, satisfying the expression: ; In the formula, For the Data The frequency of the same characters, is the cumulative multiplication function; The theoretical compression ratio is greater than All integers of constitute the target range; In the interval to which the last object belongs, the binary result of the shortest binary value is used as the compression result of the sequence to be transmitted, and the compression result is transmitted by a quantum encryption method.
2. The data transmission method based on quantum communication according to claim 1, characterized in that: The span is any integer in the target range, and the target range is a subset of the preset range.
3. The data transmission method based on quantum communication according to claim 2, characterized in that: The preset range is , is a preset value, and the preset value is an integer greater than 1.
4. The data transmission method based on quantum communication according to claim 1, characterized in that: The span is an integer with the largest theoretical compression ratio in the target range.
5. The data transmission method based on quantum communication according to claim 1, characterized in that: The theoretical frequencies of all character combinations are , is the number of all character types.
6. The data transmission method based on quantum communication according to claim 1, characterized in that: The method also includes transmitting the span, all the characters, and the frequencies of all the characters.
7. The data transmission method based on quantum communication according to claim 1, characterized in that: The method further comprises: When obtaining the interval to which the first object belongs, if the first object belongs to a character combination, the interval [0,1] is divided according to the theoretical frequencies of all character combinations to obtain sub-intervals corresponding to each character combination, and the sub-interval corresponding to the character combination identical to the object is taken as the interval to which the object belongs; if the first object belongs to a character, the interval [0,1] is divided according to the frequencies of all characters to obtain sub-intervals corresponding to each character, and the sub-interval corresponding to the character identical to the object is taken as the interval to which the object belongs.
Citation Information
Patent Citations
A Quantum Communication-Based Network Security Method and System for Train-Mounted Wireless Ad Hoc Networks
CN116782206B
Multi-dimensional quantum data compressing and uncompressing method and apparatus
CN104125475A
Compression coding method, electronic equipment and storage medium
CN113346911A