Satellite data frame processing method, device, electronic device and readable storage medium
By generating a compression header and encoding binary tree to compress satellite data frames, the existing lossless compression algorithm is solved to solve the problem of inapplicability of satellite differential data and corrected numbers, and more efficient data compression and transmission are achieved.
Patent Information
- Application Number
- CN202011447589.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-09
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2040-12-09
AI Technical Summary
Existing lossless compression algorithms, such as RLE and LZW, cannot effectively compress satellite differential data or corrected numbers, resulting in wasted data transmission bandwidth and low efficiency, and in extreme cases compressing data even exceeds the original data size.
By comparing the length of the satellite data frame with the preset length, a compression head is generated, and the original data is converted into encoding symbols according to the size relationship, an encoded binary tree is generated, and finally, the compressed data of the satellite data frame is generated based on the binary tree, using binary encoding and hexadecimal Coding symbols for compression.
It improves the lossless compression efficiency and reliability of satellite data frames, saves transmission bandwidth, and is suitable for irregular binary data, solving the problems of poor reliability and low efficiency of existing algorithms in satellite data compression.
Smart Images

Figure CN114614829B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of data compression, and in particular to a method, device, electronic device and readable storage medium for processing satellite data frames. Background Art
[0002] Data compression technology is widely used in various data processing, which can reduce the size of data while keeping the data information intact. The essence of data compression is to remove redundant information in the data, remove certain or inferable information, and retain uncertain information. Generally, data compression is divided into lossless compression and lossy compression. Lossless compression uses the statistical redundancy of data for compression, and information will not be lost. The compressed data can be completely restored to the original data after decompression.
[0003] In the broadcast of satellite differential data or correction numbers, these data are generally packaged into frames of data, and these data are often not compressed. If you want to compress satellite differential data, you must use lossless compression technology, because these data must be restored to the original data after being transmitted to the terminal, and no part can be lost. Commonly used lossless compression technologies include RLE encoding and LZW encoding.
[0004] RLE (Run Length Encoding) run length compression algorithm, also known as run length compression algorithm, is the earliest and simplest lossless data compression algorithm. The basic idea of the RLE algorithm is to divide the data into two cases according to a linear sequence: one is continuous repeated data blocks, and the other is continuous non-repeating data blocks. For the first case, the continuous repeated data blocks are compressed. The compression method is to use an attribute representing the number of blocks plus a data block to represent the original continuous blocks of data. For the second case, the RLE algorithm has two processing methods. One processing method is to process the continuous non-repeating data blocks in the same way as the first case, except that the attribute representing the number of blocks is always 1; the other processing method is not to process the data in any way and directly use the original data as the compressed data.
[0005] The LZW algorithm, also known as the "string table compression algorithm", achieves compression by creating a string table and using shorter codes to represent longer strings. The encoder continuously reads new characters from the original string and tries to encode a single character or string into a symbol. In this algorithm, there are two variables, one is P (Previous), which represents the string that has been on hand and has not been encoded, and the other is C (current), which represents the newly read character.
[0006] In the existing technology, satellite data compression includes two scenarios. One scenario is that the satellite differential data or correction numbers are not compressed at all. The biggest problem in this case is that the data is broadcast and transmitted in its original size, which leads to bandwidth waste, high cost and low transmission efficiency. The other scenario is the case of compressed data. The characteristic of the RLE compression algorithm is that when multiple consecutive identical bytes appear in the data, this algorithm can achieve a better compression ratio, which is generally suitable for the compression of image data. The LZW compression algorithm collects repeated strings as long as possible by establishing a string table and represents these strings with a single byte. It is generally suitable for the compression of text files or special binary files. For satellite differential data or correction numbers, the data frame is full of irregular binary data, and there are not many continuous and repeated data blocks in the data, which cannot meet the applicable conditions of these two algorithms. Therefore, these two compression algorithms are not suitable for compressing satellite data. In extreme cases, the RLE compression method even makes the compressed data exceed the size of the original data.
[0007] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0008] The purpose of the present disclosure is to provide a method, device, electronic device and readable storage medium for processing satellite data frames, which at least to some extent overcome the problem of poor reliability of lossless compression of satellite data in related technologies.
[0009] Other features and advantages of the present disclosure will become apparent from the subsequent detailed description, or may be learned in part by the practice of the present disclosure.
[0010] According to one aspect of the present disclosure, a method for processing a satellite data frame is provided, comprising: comparing a length of the satellite data frame with a preset length; generating a compression header of the satellite data frame according to the size relationship; determining original data in the satellite data frame as compressed data according to the size relationship, or converting the original data into coding symbols, generating a coding binary tree according to the coding symbols and the frequency of occurrence of the coding symbols in the original data, and generating compressed data of the satellite data frame according to the binary tree; generating a compressed data result of the satellite data frame according to the compression header and the compressed data.
[0011] In one embodiment of the present disclosure, generating a compression header of a satellite data frame according to a size relationship includes: determining that a length is less than or equal to a preset length according to the size relationship; and setting the compression header to a first type of binary code.
[0012] In one embodiment of the present disclosure, determining original data in a satellite data frame as compressed data according to a size relationship, or converting the original data into coding symbols, generating a coding binary tree according to the coding symbols and the frequency of occurrence of the coding symbols in the original data, and generating compressed data of the satellite data frame according to the binary tree includes: determining that a length is less than or equal to a preset length according to the size relationship; and setting the original data in the satellite data frame to be compressed data.
[0013] In one embodiment of the present disclosure, generating a compression header of a satellite data frame according to a size relationship includes: determining that a length is greater than a preset length according to the size relationship; and setting the compression header to a second type of binary code.
[0014] In one embodiment of the present disclosure, determining raw data in a satellite data frame as compressed data according to a size relationship, or converting the raw data into coding symbols, generating a coding binary tree according to the coding symbols and the frequency of occurrence of the coding symbols in the raw data, and generating compressed data of the satellite data frame according to the binary tree further includes: determining that a length is greater than a preset length according to the size relationship; converting frame data of each bit in the raw data into two 4-bit data; converting the 4-bit data into a hexadecimal coding symbol; counting the frequency of the hexadecimal coding symbols in the raw data; generating two child nodes under the same node of the binary tree using the two hexadecimal coding symbols and the frequency of each bit, and generating compressed data of the satellite data frame according to the binary tree.
[0015] In one embodiment of the present disclosure, two hexadecimal coding symbols and frequencies of each bit are respectively generated into two child nodes under the same node of a binary tree, and compressed data of a satellite data frame is generated according to the binary tree, including: determining two child nodes with the smallest frequencies among the child nodes of the binary tree; merging the two child nodes with the smallest frequencies, wherein the frequency of the merged node is the sum of the frequencies of the two child nodes with the smallest frequencies, until the number of nodes to be merged is 1; marking two paths under the same node of the binary tree after merging as the third type of binary coding and the fourth type of binary coding respectively; generating a compression code table according to the codes of all the paths of the binary tree; and determining the compression code table as the compressed data of the satellite data frame.
[0016] According to one aspect of the present disclosure, a method for processing a satellite data frame is provided, comprising: obtaining a compressed data result generated by the method for processing a satellite data frame using any one of the above technical solutions; parsing a compression header of the compressed data result; and decompressing the compressed data result according to the compression header.
[0017] In one embodiment of the present disclosure, decompressing the compressed data result according to the compression header includes: determining that the compression header is a first type binary code; skipping the first four bits of the compressed data result, and determining the compressed data after the first four bits as the original data of the satellite data frame.
[0018] In one embodiment of the present disclosure, decompression processing of the compressed data result according to the compression header specifically includes: determining that the compression header is a second-type binary code; obtaining a compression code table of the compressed data result; skipping the first four bits of the compressed data result, and reversely determining the hexadecimal encoding symbol based on the compressed data after the first four bits and the compression code table; and restoring the hexadecimal encoding symbol to compressed data.
[0019] In one embodiment of the present disclosure, the preset length is 64 bits, and a bit includes 8 bits.
[0020] According to another aspect of the present disclosure, a satellite data frame processing device is provided, including: a comparison module, used to compare the size relationship between the length of the satellite data frame and a preset length; a compression module, used to generate a compression header of the satellite data frame according to the size relationship; the compression module is also used to determine the original data in the satellite data frame as compressed data according to the size relationship, or convert the original data into coding symbols, generate a coding binary tree according to the coding symbols and the frequency of occurrence of the coding symbols in the original data, and generate compressed data of the satellite data frame according to the binary tree; the compression module is also used to generate a compressed data result of the satellite data frame according to the compression header and the compressed data.
[0021] According to another aspect of the present disclosure, a satellite data frame processing device is provided, including: an acquisition module, used to acquire a compressed data result generated by a satellite data frame processing method using any of the above technical solutions; a parsing module, used to parse a compression header of the compressed data result; and a decompression module, used to decompress the compressed data result according to the compression header.
[0022] According to another aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute any one of the above-mentioned satellite data frame processing methods by executing the executable instructions.
[0023] According to another aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, any one of the above-mentioned satellite data frame processing methods is implemented.
[0024] The satellite data frame processing scheme provided by the embodiments of the present disclosure determines the original data in the satellite data frame as compressed data according to the size relationship, or converts the original data into coding symbols, generates a coding binary tree according to the coding symbols and the frequency of occurrence of the coding symbols in the original data, generates compressed data of the satellite data frame according to the binary tree, and generates the compressed data result of the satellite data frame according to the compression header and the compressed data, which not only improves the efficiency and reliability of lossless compression of the satellite data frame, but also saves the transmission bandwidth of the satellite data frame.
[0025] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.
[0027] Figure 1 A schematic diagram showing a method for processing a satellite data frame in an embodiment of the present disclosure;
[0028] Figure 2 A flowchart showing another method for processing satellite data frames in an embodiment of the present disclosure;
[0029] Figure 3 A flowchart showing another method for processing satellite data frames in an embodiment of the present disclosure is shown;
[0030] Figure 4 A flowchart showing another method for processing satellite data frames in an embodiment of the present disclosure is shown;
[0031] Figure 5 A flowchart showing another method for processing satellite data frames in an embodiment of the present disclosure is shown;
[0032] Figure 6 A flowchart showing another method for processing satellite data frames in an embodiment of the present disclosure is shown;
[0033] Figure 7 A flowchart showing another method for processing satellite data frames in an embodiment of the present disclosure is shown;
[0034] Figure 8 A flowchart showing another method for processing satellite data frames in an embodiment of the present disclosure is shown;
[0035] Fig. 9A flowchart showing another method for processing satellite data frames in an embodiment of the present disclosure is shown;
[0036] Fig.10 A flowchart showing another method for processing satellite data frames in an embodiment of the present disclosure is shown;
[0037] Fig.11 A flowchart showing another method for processing satellite data frames in an embodiment of the present disclosure is shown;
[0038] Fig.12 A flowchart showing another method for processing satellite data frames in an embodiment of the present disclosure is shown;
[0039] Fig.13 A flowchart showing another method for processing satellite data frames in an embodiment of the present disclosure is shown;
[0040] Fig.14 A schematic diagram showing a satellite data frame processing device according to an embodiment of the present disclosure;
[0041] Fig.15 A schematic diagram showing another satellite data frame processing device according to an embodiment of the present disclosure;
[0042] Fig.16 A schematic diagram of an electronic device in an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0043] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the disclosure will be more comprehensive and complete and to fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0044] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0045] The solution provided by the present disclosure determines the original data in the satellite data frame as compressed data according to the size relationship, or converts the original data into coding symbols, generates a coding binary tree according to the coding symbols and the frequency of occurrence of the coding symbols in the original data, generates compressed data of the satellite data frame according to the binary tree, and generates the compressed data result of the satellite data frame according to the compression header and the compressed data, which not only improves the efficiency and reliability of lossless compression of the satellite data frame, but also saves the transmission bandwidth of the satellite data frame.
[0046] The above-mentioned satellite data frame processing solution can be implemented through the interaction of multiple terminals and a server cluster.
[0047] The terminal may be a mobile terminal such as a mobile phone, a game console, a tablet computer, an e-book reader, smart glasses, an MP4 (Moving Picture Experts Group Audio Layer IV) player, a smart home device, an AR (Augmented Reality) device, a VR (Virtual Reality) device, or the terminal may be a personal computer (PC), such as a laptop computer and a desktop computer.
[0048] The terminal may be installed with an application for providing satellite data frame processing.
[0049] The terminal is connected to the server cluster via a communication network. Optionally, the communication network is a wired network or a wireless network.
[0050] The server cluster is a server, or is composed of several servers, or is a virtualization platform, or is a cloud computing service center. The server cluster is used to provide background services for applications that provide satellite data frame processing. Optionally, the server cluster undertakes the main computing work and the terminal undertakes the secondary computing work; or, the server cluster undertakes the secondary computing work and the terminal undertakes the main computing work; or, a distributed computing architecture is used between the terminal and the server cluster for collaborative computing.
[0051] Optionally, the client of the application installed in different terminals is the same, or the client of the application installed on the two terminals is the client of the same type of application on different control system platforms. Based on the different terminal platforms, the specific form of the client of the application can also be different, for example, the application client can be a mobile client, a PC client or a global wide area network client, etc.
[0052] Those skilled in the art will appreciate that the number of the above terminals may be more or less. For example, the above terminal may be only one, or the above terminals may be dozens or hundreds, or more. The embodiments of the present disclosure do not limit the number of terminals and device types.
[0053] Optionally, the system may further include a management device, wherein the management device is connected to the server cluster via a communication network. Optionally, the communication network is a wired network or a wireless network.
[0054] Optionally, the above-mentioned wireless network or wired network uses standard communication technology and / or protocol. The network is usually the Internet, but it can also be any network, including but not limited to a local area network (LAN), a metropolitan area network (MAN), a wide area network (WAN), a mobile, wired or wireless network, a dedicated network or any combination of a virtual private network). In some embodiments, the data exchanged through the network is represented by technologies and / or formats including Hyper Text Mark-up Language (HTML), Extensible Markup Language (XML), etc. In addition, conventional encryption technologies such as Secure Socket Layer (SSL), Transport Layer Security (TLS), Virtual Private Network (VPN), Internet Protocol Security (IPsec) can also be used to encrypt all or some links. In other embodiments, customized and / or dedicated data communication technologies can also be used to replace or supplement the above-mentioned data communication technologies.
[0055] Below, each step of the method for processing satellite data frames in this example implementation will be described in more detail with reference to the accompanying drawings and embodiments.
[0056] Figure 1 A flowchart of a method for processing satellite data frames in an embodiment of the present disclosure is shown. The method provided in the embodiment of the present disclosure can be executed by any electronic device with computing and processing capabilities.
[0057] like Figure 1 As shown, the electronic device executes a method for processing satellite data frames, comprising the following steps:
[0058] Step S102, comparing the length of the satellite data frame with a preset length.
[0059] Step S104: Generate a compression header of the satellite data frame according to the size relationship.
[0060] In one embodiment of the present disclosure, the compression method of the satellite data frame is determined by the size relationship, and during the decompression process, the decompressed data is determined according to the compression header to improve the processing efficiency, reliability and applicability of the satellite data frame.
[0061] Step S106, determining the original data in the satellite data frame as compressed data according to the size relationship, or converting the original data into coding symbols, generating a coding binary tree according to the coding symbols and the frequency of occurrence of the coding symbols in the original data, and generating compressed data of the satellite data frame according to the binary tree.
[0062] In one embodiment of the present disclosure, two compression processes can be performed on the satellite data frame according to the size relationship. One is to determine the original data in the satellite data frame as compressed data, and the other is to convert the original data into coding symbols, generate a coding binary tree according to the coding symbols and the frequency of occurrence of the coding symbols in the original data, and generate compressed data of the satellite data frame according to the binary tree. The above two methods are used to achieve lossless compression of the satellite data frame.
[0063] Step S108: Generate a compressed data result of the satellite data frame according to the compressed header and the compressed data.
[0064] In one embodiment of the present disclosure, by determining the original data in the satellite data frame as compressed data according to the size relationship, or converting the original data into coding symbols, generating a coding binary tree according to the coding symbols and the frequency of occurrence of the coding symbols in the original data, generating compressed data of the satellite data frame according to the binary tree, and generating the compressed data result of the satellite data frame according to the compression header and the compressed data, not only the efficiency and reliability of the lossless compression of the satellite data frame are improved, but also the transmission bandwidth of the satellite data frame is saved.
[0065] based on Figure 1 The steps shown are as follows Figure 2 As shown, the compression header of the satellite data frame generated according to the size relationship includes:
[0066] Step S2042, determining, based on the size relationship, whether the length is less than or equal to a preset length.
[0067] In one embodiment of the present disclosure, the satellite data frame is usually binary data, and the preset length can be set in bits, for example, the preset length is 64 bytes.
[0068] Step S2044, setting the compression header to the first type of binary encoding.
[0069] In one embodiment of the present disclosure, for example, the first type of binary is 0, or the first type of binary is 1, but is not limited thereto.
[0070] based on Figure 1 The steps shown are as follows Figure 3 As shown, determining the original data in the satellite data frame as compressed data according to the size relationship, or converting the original data into coding symbols, generating a coding binary tree according to the coding symbols and the frequency of occurrence of the coding symbols in the original data, and generating compressed data of the satellite data frame according to the binary tree includes:
[0071] Step S3062, determining, based on the size relationship, that the length is less than or equal to a preset length.
[0072] Step S3064: setting the original data in the satellite data frame to be compressed data.
[0073] In one embodiment of the present disclosure,
[0074] based on Figure 1 The steps shown are as follows Figure 4 As shown, the compression header of the satellite data frame generated according to the size relationship includes:
[0075] Step S4042, determining that the length is greater than a preset length based on the size relationship.
[0076] Step S4044, setting the compression header to the second type of binary encoding.
[0077] In one embodiment of the present disclosure, for example, the first type of binary is 0 and the second type of binary is 1, or the first type of binary is 1 and the second type of binary is 0, but it is not limited thereto.
[0078] based on Figure 1 The steps shown are as follows Figure 5 As shown, determining the original data in the satellite data frame as compressed data according to the size relationship, or converting the original data into coding symbols, generating a coding binary tree according to the coding symbols and the frequency of occurrence of the coding symbols in the original data, and generating compressed data of the satellite data frame according to the binary tree also includes:
[0079] Step S5062, determining that the length is greater than a preset length based on the size relationship.
[0080] Step S5064, converting each bit of frame data in the original data into two 4-bit data.
[0081] Step S5066, convert the 4-bit data into hexadecimal encoding symbols.
[0082] Step S5068, counting the frequency of the hexadecimal encoding symbols in the original data.
[0083] Step S5070: Generate two child nodes under the same node of a binary tree using two hexadecimal coding symbols and a frequency of each bit, and generate compressed data of a satellite data frame according to the binary tree.
[0084] In one embodiment of the present disclosure, for satellite differential data or correction numbers, the data frame is entirely irregular binary data, and there are not many continuous and repeated data blocks in the data. By respectively generating two child nodes under the same node of a binary tree from two hexadecimal coding symbols and frequencies of each bit, and generating compressed data of the satellite data frame according to the binary tree, the higher the frequency of the coding symbol, the shorter the compressed data, and correspondingly, the lower the frequency of the coding symbol, the longer the compressed data. Compared with LZW and RLE, the processing method of the present disclosure is more suitable for lossless coding of satellite data frames.
[0085] based on Figure 1 and Figure 5 The steps shown are as follows Figure 6 As shown, two hexadecimal encoding symbols and frequencies of each bit are respectively generated into two child nodes under the same node of a binary tree, and compressed data of a satellite data frame is generated according to the binary tree, including:
[0086] Step S60702, determine the two child nodes with the smallest frequency among the child nodes of the binary tree.
[0087] Step S60704: merge the two child nodes with the smallest frequencies, and the frequency of the merged node is the sum of the frequencies of the two child nodes with the smallest frequencies, until the number of nodes to be merged is 1.
[0088] Step S60706: Mark the two paths under the same node of the merged binary tree as the third type of binary code and the fourth type of binary code respectively.
[0089] Step S60708, generating a compression code table according to the encoding of all paths of the binary tree.
[0090] Step S60710: determine the compression code table as the compressed data of the satellite data frame.
[0091] In one embodiment of the present disclosure, after a binary tree is generated according to the coding symbol frequency of the satellite data frame, a node containing the coding symbol is determined as a leaf node, a node obtained after the last merging process is determined as a root node, and the path from the root node to the left leaf node and the path from the right leaf node are encoded respectively to obtain compressed data corresponding to each coding symbol.
[0092] For example, the third type of binary is 0 and the fourth type of binary is 1, or the third type of binary is 1 and the fourth type of binary is 0, but the invention is not limited thereto.
[0093] Refer to the following Figure 7 A schematic diagram is provided to describe a processing scheme for satellite data frames according to this embodiment of the present disclosure. Figure 7 The processing scheme of the satellite data frame shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0094] like Figure 7 As shown, the execution steps of the satellite data frame processing scheme include:
[0095] Step S702, obtaining satellite data frames, the original data is Frame1, Frame2, ..., FrameN, N is an integer greater than or equal to 2.
[0096] Step S704, compressing the original data Frame (Raw Data) (Compressed Process).
[0097] Step S706, generating a compressed data result including a compression header Flag, Frame Length and Frame (Compressed).
[0098] Step S708, decompressing the Frame (Compressed) according to the compression header Flag (UncompressedProcess).
[0099] Step S710, after decompression processing, the original data obtained are Frame1, Frame2, ..., FrameN.
[0100] Refer to the following Figure 8 A schematic diagram is provided to describe a processing scheme for satellite data frames according to this embodiment of the present disclosure. Figure 8 The processing scheme of the satellite data frame shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0101] like Figure 8 As shown, the satellite data frame processing method includes:
[0102] Step S802, determine whether the length of the satellite data frame len≤64Byte, if so, execute step S818, if not, execute step S804.
[0103] Step S804, divide the satellite data frame into 2×len 4-bit hexadecimal coded symbols (0-9, AF), and then count the frequencies of the 16 coded symbols in the 2×len symbols. The symbols with frequencies greater than 0 have n nodes, and the frequencies of the n nodes are P1, P2, ..., P n , n≤16.
[0104] Step S806, determine whether the number of nodes is greater than 1, if so, execute step S808, if not, execute step S812.
[0105] Step S808, reading the two nodes i and j with the smallest frequencies from the n nodes.
[0106] Step S810: merge nodes i and j to generate a node k, corresponding to the frequency P k =P i +P j , then the number of nodes is reduced by 1, and the process returns to step S806.
[0107] Step S812, construct a binary tree, the leaf nodes are n hexadecimal symbols, and the nodes except the leaf nodes are generated by merging other nodes, and the corresponding frequency value is the sum of the frequencies between the two child nodes. Starting from the root node, the left branch node is marked as 0, the right branch node is marked as 1, and all branches are marked in turn, thereby establishing a binary sequence of all nodes of the binary tree. The binary sequence corresponding to each hexadecimal coded symbol is the code table of this compression algorithm. In the code table, the binary code table of the coded symbol with high frequency is short, and the binary code of the coded symbol with low frequency is long.
[0108] Step S814, fix this code table at the first 64 bytes of the compressed data, then use 2×len 4-bit hexadecimal symbols to query the code table, obtain the binary code corresponding to each coding symbol, and combine all binary codes following the code table to form compressed data, the length of the compressed data is clen.
[0109] Step S816, set the compression header's Flag=1, Frame Length=clen, where Flag occupies 1 bit and Frame Length occupies 31 bits.
[0110] Step S818, set the compression header's Flag=0, Frame Length=len, where Flag occupies 1 bit and Frame Length occupies 31 bits.
[0111] Step S820: The compressed header is followed by the original data.
[0112] Refer to the following Fig. 9A schematic diagram is provided to describe a processing scheme for satellite data frames according to this embodiment of the present disclosure. Fig. 9 The processing scheme of the satellite data frame shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0113] like Fig. 9 As shown, in the compression algorithm defined in the present disclosure, the basic structure of the code table is:
[0114] Typedef struct{
[0115] uint8_t symbol; / *4-bit hexadecimal data (encoded) symbol* /
[0116] uint8_t bit_len; / *Number of binary bits corresponding to the (encoded) symbol* /
[0117] uint16_t code; / *The binary value corresponding to the (encoded) symbol* /
[0118] }compress_map_t.
[0119] Combine the following Fig. 9 The generation process of the binary tree encoding in the data compression process of the disclosed technology is described as follows:
[0120] Assume that the hexadecimal sequence of the original data is: 009900AA00FFFF00, that is, a total of 8 bytes (64 bits) of data, of which the 4-bit symbols are only 0, 9, A, F. Note: The hypothetical data here is only used to demonstrate the generation process of the encoding binary tree. In the actual encoding process, the data compression of this algorithm is performed only when the data length exceeds 64 bytes.
[0121] like Fig. 9 As shown, 0 in node 902 appears 8 times, 9 in node 904 appears 2 times, A in node 906 appears 2 times, and F in node 908 appears 4 times, so the probability of 0 appearing is 1 / 2, the probability of 9 appearing is 1 / 8, the probability of A appearing is 1 / 8, and the probability of F appearing is 1 / 4. Therefore, the coding binary tree generation process has three stages:
[0122] Step 1: Prepare all leaf nodes and mark them all as unprocessed.
[0123] Step 2: From the unprocessed nodes, select the two nodes with the smallest freq (freq1, freq2) and mark them as processed; form the parent node of these two nodes, the freq of the parent node = freq1 + freq2, mark it as unprocessed, repeat Step 2 until all leaf nodes are processed, the merged node 910 and the node 908 are merged into a node 912, the merged node 902 and the node 912 are merged into a node 914, the frequency of node 914 is 1, and the node merging is completed.
[0124] Step 3: Starting from the root node, mark the path of the binary tree with 0 on the left and 1 on the right to form a coded binary tree, and generate the corresponding code table according to the data compression process.
[0125] Taking the above data as an example, according to the generated coding binary tree, the corresponding code table is generated as shown in Table 1 below.
[0126] According to this code table, the new code of each 4-bit symbol in the original data can be queried in the code table, thereby realizing the code conversion. The original data hexadecimal code 009900AA00FFFF00 is converted into the binary code 0010010000101101001111111100.
[0127] Table 1
[0128] symbol bit_len code (binary bit representation) 0 1 0 9 3 100 A 3 101 F 2 11
[0129] The original data is 16×4bit=64bit, of which 0 appears 8 times, 9 appears 2 times, A appears 2 times, and F appears 4 times. After the code table conversion, the original data length becomes 1×8+3×2+3×2+2×4=28bit. The purpose of data compression is achieved, and the compression rate reaches 28 / 64=43.75%.
[0130] The code table application of the data decompression process of the disclosed technology, taking the above data as an example, the compressed binary data is 0010010000101101001111111100, and a 64-Byte compressed code table is obtained from the compressed data result. The code table is queried, and the symbol is deduced from the code in the compressed data result, that is, 0->0x0, 100->0x9, 101->0xA, 11->0xF, and the original data is converted to hexadecimal 009900AA00FFFF00. At this point, the compressed data is restored to the original data through code table conversion.
[0131] Refer to the following Fig.10 A schematic diagram is provided to describe a processing scheme for satellite data frames according to this embodiment of the present disclosure. Fig.10The processing scheme of the satellite data frame shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0132] like Fig.10 As shown, the satellite data frame processing method includes:
[0133] Step S1002: Obtain the compressed data result generated by the satellite data frame processing method using any one of the above technical solutions.
[0134] Step S1004, parsing the compression header of the compressed data result.
[0135] Step S1006, decompressing the compressed data result according to the compression header.
[0136] In one embodiment of the present disclosure, the compressed data is decompressed by parsing the compression header of the compressed data result to achieve lossless decompression of the satellite data frame.
[0137] based on Fig.10 The steps shown are as follows Fig.11 As shown, decompressing the compressed data result according to the compression header includes:
[0138] Step S11062, determine that the compression header is the first type of binary code.
[0139] Step S11064, skipping the first four bits of the compressed data result, and determining the compressed data after the first four bits as the original data of the satellite data frame.
[0140] In one embodiment of the present disclosure, by determining that the compression header is the first type of binary code, it can be determined that all the original data of the satellite data frame is compressed data, and the compression header occupies 1 bit, and the following 31 bits are records of the data length. The compressed data is after four bits, and the compressed data can be determined to be the original data, so as to achieve an efficient lossless decompression process.
[0141] based on Fig.10 The steps shown are as follows Fig.12 As shown, decompressing the compressed data result according to the compression header specifically includes:
[0142] Step S12062, determine that the compression header is the second type of binary code.
[0143] Step S12064, obtaining a compression code table of the compressed data result.
[0144] Step S12066, skip the first four bits of the compressed data result, and reversely determine the hexadecimal encoding symbol based on the compressed data after the first four bits and the compression code table.
[0145] Step S12068, restore the hexadecimal encoding symbol to compressed data.
[0146] In one embodiment of the present disclosure, by determining that the compression header is the second type of binary code, it can be determined that all the original data of the satellite data frame is converted into compressed data through binary tree coding, and the compression header occupies 1 bit, and the following 31 bits are records of the data length. The compressed data is after four bits, and can be restored to the original data through the compressed data and the code table to achieve an efficient lossless decompression process.
[0147] In one embodiment of the present disclosure, the preset length is 64 bits, and a bit includes 8 bits.
[0148] Refer to the following Fig.13 A schematic diagram is provided to describe a processing scheme for satellite data frames according to this embodiment of the present disclosure. Fig.13 The processing scheme of the satellite data frame shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0149] like Fig.13 As shown, the execution steps of the satellite data frame processing scheme include:
[0150] Step S1302, take the first bit of the compressed data and set it as the compression header Flag.
[0151] Step S1304, determine if Flag == 0, if so, execute step S1312, if not, execute step S1306.
[0152] Step S1306, read 31 bits of data as the length clen of the compressed data.
[0153] Step S1308, read the 64-byte compression code table.
[0154] Step S1310, read the compressed data of length (clen-64) as a binary stream, query the binary codes in the code table in sequence, and invert the 4-bit hexadecimal encoding symbol corresponding to the binary, thereby deriving all the original data.
[0155] Step S1312, skip 4 bytes of data from the beginning, and the subsequent data is the uncompressed original data.
[0156] Refer to the following Fig.14 hereinafter, a satellite data frame processing apparatus 1400 according to the embodiment of the present disclosure is described. Fig.14 The satellite data frame processing device 1400 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0157] The satellite data frame processing device 1400 is implemented in the form of a hardware module. Components of the satellite data frame processing device 1400 may include but are not limited to: a comparison module 1402 and a compression module 1404 .
[0158] The comparison module 1402 is used to compare the length of the satellite data frame with a preset length.
[0159] The compression module 1404 is used to generate a compression header of the satellite data frame according to the size relationship.
[0160] The compression module 1404 is further used to determine the original data in the satellite data frame as compressed data according to the size relationship, or convert the original data into coding symbols, generate a coding binary tree according to the coding symbols and the frequency of occurrence of the coding symbols in the original data, and generate compressed data of the satellite data frame according to the binary tree.
[0161] The compression module 1404 is further configured to generate a compressed data result of a satellite data frame according to the compression header and the compressed data.
[0162] Refer to the following Fig.15 hereinafter, a satellite data frame processing apparatus 1500 according to the embodiment of the present disclosure is described. Fig.15 The satellite data frame processing device 1500 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0163] The satellite data frame processing device 1500 is implemented in the form of a hardware module. The components of the satellite data frame processing device 1500 may include but are not limited to: an acquisition module 1502 , a parsing module 1504 , and a decompression module 1506 .
[0164] The acquisition module 1502 is used to acquire the compressed data result generated by the satellite data frame processing method using any of the above technical solutions.
[0165] The parsing module 1504 parses the compressed header of the compressed data result, which is used to parse the compressed header of the compressed data result.
[0166] The decompression module 1506 decompresses the compressed data result according to the compression header.
[0167] Refer to the following Fig.16 1600 according to this embodiment of the present disclosure is described. Fig.16 The electronic device 1600 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0168] like Fig.16As shown, the electronic device 1600 is in the form of a general computing device. The components of the electronic device 1600 may include but are not limited to: at least one processing unit 1610, at least one storage unit 1620, and a bus 1630 connecting different system components (including the storage unit 1620 and the processing unit 1610).
[0169] The storage unit stores program codes, which can be executed by the processing unit 1610, so that the processing unit 1610 performs the steps according to various exemplary embodiments of the present disclosure described in the above “Exemplary Method” section of this specification. For example, the processing unit 1610 can perform the steps defined in the satellite data frame processing method of the present disclosure.
[0170] The storage unit 1620 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 16201 and / or a cache storage unit 16202 , and may further include a read-only storage unit (ROM) 16203 .
[0171] The storage unit 1620 may also include a program / utility 16204 having a set (at least one) of program modules 16205, such program modules 16205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0172] Bus 1630 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0173] The electronic device 1600 may also communicate with one or more external devices 1640 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device, and / or may communicate with any device that enables the electronic device 1600 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 1650. Furthermore, the electronic device 1600 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 1110, which communicates with other modules of the electronic device 1600 via a bus 1630. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RA identification systems, tape drives, and data backup storage systems.
[0174] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0175] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the above method of the present specification is stored. In some possible implementations, various aspects of the present disclosure may also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary implementations of the present disclosure described in the above "Exemplary Method" section of the present specification.
[0176] According to the program product for implementing the above method in the embodiment of the present disclosure, it can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited thereto. In this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.
[0177] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0178] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0179] Program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0180] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.
[0181] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0182] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0183] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the appended claims.
Claims
1. A method for processing satellite data frames, characterized in that: include: Comparing the length of the satellite data frame with a preset length; Generating a compression header of the satellite data frame according to the size relationship includes: Determining, according to the size relationship, that the length is less than or equal to the preset length; Setting the compression header to a first type binary code; Determining the original data in the satellite data frame as compressed data according to the size relationship includes: Determining, according to the size relationship, that the length is less than or equal to the preset length; Setting the original data in the satellite data frame to be the compressed data; Determining, based on the size relationship, that the length is greater than the preset length; Setting the compression header to the second type of binary encoding; Converting raw data into coding symbols, generating a coding binary tree according to the coding symbols and the frequencies at which the coding symbols appear in the raw data, and generating compressed data of the satellite data frame according to the binary tree, comprising: Determining, based on the size relationship, that the length is greater than the preset length; Convert each bit of frame data in the original data into two 4-bit data; Convert the 4-bit data into hexadecimal encoding symbols; Counting the frequency of the hexadecimal encoding symbol in the original data; Generate two child nodes under the same node of the binary tree using two hexadecimal encoding symbols of each bit and the frequency, respectively, and generate the compressed data of the satellite data frame according to the binary tree; A compressed data result of the satellite data frame is generated according to the compressed header and the compressed data.
2. The method for processing satellite data frames according to claim 1, characterized in that: Generating two child nodes under the same node of the binary tree respectively from the two hexadecimal encoding symbols of each bit and the frequency, and generating compressed data of the satellite data frame according to the binary tree comprises: Determine two child nodes with the smallest frequency among the child nodes of the binary tree; Merge the two child nodes with the smallest frequencies, where the frequency of the merged node is the sum of the frequencies of the two child nodes with the smallest frequencies, until the number of nodes to be merged is 1; Two paths under the same node of the binary tree that completes the merge are marked as the third type of binary coding and the fourth type of binary coding respectively; Generate a compression code table according to the encoding of all paths of the binary tree; The compression code table is determined as the compressed data of the satellite data frame.
3. A method for processing satellite data frames, characterized in that: include: Acquire a compressed data result generated by the satellite data frame processing method of claim 1; Parsing the compression header of the compressed data result; The compressed data result is decompressed according to the compression header.
4. The method for processing satellite data frames according to claim 3, characterized in that: Decompressing the compressed data result according to the compression header includes: Determining that the compression header is a first type binary code; The first four bits of the compressed data result are skipped, and the compressed data after the first four bits are determined as the original data of the satellite data frame.
5. The method for processing satellite data frames according to claim 3 or 4, characterized in that: Decompressing the compressed data result according to the compression header specifically includes: Determining that the compression header is a second type of binary code; Obtaining a compression code table of the compressed data result; Skipping the first four bits of the compressed data result, and reversely determining the hexadecimal encoding symbol according to the compressed data after the first four bits and the compression code table; The hexadecimal encoding symbol is restored to the compressed data.
6. The method for processing satellite data frames according to any one of claims 1 to 4, characterized in that: The preset length is 64 bits, and the bit includes 8 bits.
7. A satellite data frame processing device, characterized in that: include: A comparison module, used for comparing the length of the satellite data frame with a preset length; A compression module, used to generate a compression header of the satellite data frame according to the size relationship, comprising: Determining, based on the size relationship, that the length is less than or equal to the preset length; Setting the compression header to a first type binary code; The compression module is further used to determine the original data in the satellite data frame as the compressed data according to the size relationship, including: Determining, based on the size relationship, that the length is less than or equal to the preset length; Setting the original data in the satellite data frame to be the compressed data; Determining, based on the size relationship, that the length is greater than the preset length; Setting the compression header to the second type of binary encoding; The compression module is further used to convert the original data into coding symbols, generate a coding binary tree according to the coding symbols and the frequencies of occurrence of the coding symbols in the original data, and generate compressed data of the satellite data frame according to the binary tree, including: Determining, based on the size relationship, that the length is greater than the preset length; Convert each bit of frame data in the original data into two 4-bit data; Convert the 4-bit data into hexadecimal encoding symbols; Counting the frequency of the hexadecimal encoding symbol in the original data; Generate two child nodes under the same node of the binary tree using two hexadecimal encoding symbols of each bit and the frequency, and generate compressed data of the satellite data frame according to the binary tree; The compression module is further used to generate a compressed data result of the satellite data frame according to the compression header and the compressed data.
8. A satellite data frame processing device, characterized in that: include: An acquisition module, used for acquiring a compressed data result generated by the satellite data frame processing method of claim 1; A parsing module, used for parsing the compression header of the compressed data result; A decompression module is used to decompress the compressed data result according to the compression header.
9. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to execute the satellite data frame processing method according to any one of claims 1 to 6 by executing the executable instructions.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for processing satellite data frames according to any one of claims 1 to 6 is implemented.