A header decoding method and device
By identifying and decoding the header field during the HTTP/2 decoding process, and activating the single header field decoding exception repair mechanism, the problem of data packets being unable to participate in XDR synthesis caused by packet loss during the HTTP/2 decoding process is solved, and the problem of packet loss is realized Packet decoding and dynamic table synchronization below.
Patent Information
- Application Number
- CN202111125652.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-24
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2041-09-24
AI Technical Summary
When the existing technology encounters packet loss or decoding errors during the HTTP/2 decoding process, the entire data packet will not be able to participate in XDR synthesis, resulting in decoding failure and dynamic table synchronization failure.
The header decoding method is adopted, including receiving the HEADER frame from the sending end, identifying and decoding the encoding format of multiple encoding header fields, judging whether the decoding is successful, and starting the single header field decoding exception repair mechanism when decoding fails, repairing the dynamic table and decoding As a result, packets are ensured to participate in XDR synthesis.
It avoids the direct error return caused by decoding failure, ensures that the header fields required for subsequent processing are decoded as much as possible in the case of packet loss, and the dynamic table is resynchronized in a short time to prevent packet loss.
Smart Images

Figure CN115883683B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of network protocols, and in particular to a header decoding method and device. Background Art
[0002] In general, the HTTP / 2 transport layer uses the TCP protocol, which provides a connection-oriented, reliable, byte-stream-based transport layer communication protocol, which can ensure that the data received by both the client and the service will not be out of order or lost, which is also the requirement of the HAPCK protocol for the underlying transmission. That is, as long as it can be ensured that the received data packets are not out of order or lost, the decryption rate of header compression can definitely reach 100%.
[0003] However, in the application field of network protocol monitoring and analysis technology, bypass methods such as splitting are generally used to obtain HTTP2 data packets. In bypass mode, the data obtained by the application system will inevitably have the following anomalies:
[0004] 1. HTTP2 long connection causes the loss of data packets between the start of the connection and the start of the collection and analysis device:
[0005] The so-called long connection means that the client initiates a connection to the server, the server accepts the client connection, and the two parties establish a connection. After the client and the server complete a request, the connection between them will not be actively closed, and subsequent read and write operations will continue to use this connection. The HTTP2 links between 5G core network (5GC) devices are mostly long connections, and the data source for signaling collection is often after the long connection has been established. This means that the data entering the collection device has been header compressed from the moment of access. At this time, the decoding program will not get the dynamic table negotiated by the communication network element before the program is started.
[0006] 2. Message loss: If the HTTP / 2 header frame carrying the header text with the incremental index is lost, the dynamic table will be inconsistent with the actual situation, which may cause the subsequent header frame decoding to lose decoding information or obtain incorrect decoding results.
[0007] Reference below Figure 1 , an example is given to illustrate the impact of packet loss on HTTP2 decoding: the scenario is that HADER_1 sends six header fields: 1) method: GET; 2) scheme: https; 3) host: example.com; 4) path: / resource; 5) accept: image / jgeg; 6) user-agent: Mozilla / 5.0. Among them, the four header fields 3, 4, 5, and 6 will be added to the dynamic table, and the dynamic table after the message is shown in Table 1 below.
[0008] Table 1
[0009] 62 User-agent Mozilla / 5.0 63 accept image / jgeg 64 :path / resource 65 :host example.com
[0010] HEADER_3 sends 6 header fields: 1) method: GET; 2) scheme: https; 3) host: example.com; 4) path: / new_resource; 5) accept: image / jgeg; 6) user-agent: Mozilla / 5.0.
[0011] 3, 5, and 6 are encoded in the header field index format; 4 is encoded in the header field incremental index with index name format. The dynamic table after the message is shown in Table 2 below.
[0012] Table 2
[0013] 62 :path / new_resource 63 User-agent Mozilla / 5.0 64 accept image / jgeg 65 :path / resource 66 :host example.com
[0014] However, packet loss is possible in the bypass. Now suppose that the HEAD1 data packet is lost and the HEAD3 data table is received directly:
[0015] Because the HEAD1 packet is lost, the dynamic table of the link is empty when HEAD3 is received. When decoding, it is found that the header field index format is decoded to index ID values 64, 63, and 62. At this time, our dynamic table is empty. At this time, the general decoder will think that an exception has occurred and return directly. This will cause the HEAR3 frame decoding to fail.
[0016] If the bypass encounters the above abnormal situation, the following errors may occur during header field decoding:
[0017] 1. Header field index format: The decoded index value cannot find the corresponding record in the dynamic table and the static table;
[0018] 2. Header field incremental index with index name format: The decoded name index value cannot find the corresponding record in the dynamic table and static table; or the name found by the index value does not correspond to the value of the decoded header field. For example, the decoded header field name is: method, and the value is 156; 156 is not in the valid value range of: method, so the decoded header field must be abnormal.
[0019] 3. Header field is not indexed with index name format: the decoded name index value cannot find the corresponding record in the dynamic table and static table; or the name found by the index value does not correspond to the value of the decoded header field. For example, the decoded header field name is: method, and the value is 156; 156 is not in the valid value range of: method, so the decoded header field must be abnormal.
[0020] refer to Figure 2 When encountering the above decoding errors, traditional decoding solutions will directly return an error, causing the entire data packet to be unable to participate in subsequent processing such as XDR synthesis. In order to reduce the impact of the above factors on decoding and subsequent XDR synthesis, we introduced a check and repair mechanism to supplement the decoding and dynamic table mechanism, decode as many normal header field lists as possible, and resynchronize the dynamic table in the shortest possible time. Summary of the invention
[0021] In view of the above analysis, the embodiments of the present invention aim to provide a header decoding method and device to solve the problem that the existing decoding method directly returns an error when encountering a decoding error, resulting in the entire data packet being unable to participate in subsequent processing such as XDR synthesis.
[0022] On the one hand, an embodiment of the present invention provides a header decoding method, comprising: receiving a HEADER frame from a transmitting end, and the HEADER frame includes multiple encoded header fields; performing the following steps in sequence for each of the multiple encoded header fields: identifying the encoding format of the encoded header field, wherein the encoding format includes header field index format encoding, header field incremental index with index name format encoding, header field incremental index with text name format encoding, header field non-index with index name format encoding and header field non-index with text name format encoding; decoding the identified encoded header field based on the identified encoding format and determining whether the decoding is successful; and when decoding fails, starting a single header field decoding exception repair mechanism.
[0023] The beneficial effects of the above technical solution are as follows: when decoding fails, a single header field decoding exception repair mechanism is started to avoid direct error return, thereby preventing the entire data packet from being unable to participate in subsequent processing such as XDR synthesis.
[0024] Based on the further improvement of the above method, the header decoding method also includes: when the decoding is successful, the decoded header field is added to the header field list; and when the identified encoding format is the header field incremental index with index name format encoding or the header field incremental index with text name format encoding, the decoded header field is inserted into the dynamic table and the packet loss status of the start table entry of the dynamic table is set to the default value 0.
[0025] Based on further improvement of the above method, starting a single header field decoding exception repair mechanism includes: when no record content corresponding to the index value is retrieved in the index table based on the index value, determining that a HEADER frame is lost on the TCP link associated with the dynamic table, wherein the HEADER frame carries a header field with an incremental index encoded in an index name format or a header field with an incremental index encoded in a text name format; and inserting an empty header field in the dynamic table according to the index value and setting the packet loss status of the table entry corresponding to the index value in the dynamic table to 1, wherein the index table includes a static table and the dynamic table, the index value of the static table is 1 to 61 and the index value of the dynamic table is greater than or equal to 62.
[0026] Based on further improvement of the above method, starting a single header field decoding exception repair mechanism includes: when the decoded header field name and the header field value do not correspond, deriving the header field name according to the header field value to modify the decoded header field and dynamic table, wherein the header field includes the header field name and the header field value.
[0027] Based on the further improvement of the above method, after the decoding of the multiple encoded header fields is completed, it also includes: checking whether there are still header fields with decoding abnormalities in the header field list; and when there are, starting a repair mechanism based on the 3GPP specification and normal decoding statistical structure.
[0028] Based on further improvement of the above method, starting a repair mechanism based on 3GPP specifications and normal decoding statistical structure also includes: after receiving the HEADER frame, receiving a DATA frame; determining the header field in the HEADER frame corresponding to the DATA frame based on all information units in the DATA frame; and repairing the header field with decoding abnormality based on the determined header field in the HEADER frame.
[0029] Based on further improvement of the above method, initiating a repair mechanism based on 3GPP specifications and normal decoding statistical structure also includes: in the case of the same device and the same type of HEADER frame, storing the header fields in the successfully decoded HEADER frame and the order in which the header fields appear; repairing the header fields with abnormal decoding according to the stored header fields in the successfully decoded HEADER frame and the order in which the header fields appear.
[0030] Based on a further improvement of the above method, before receiving the HEADER frame, it further includes encoding each of the multiple header fields through the following steps to obtain the HEADER frame to be sent: querying the header field in the static table and the dynamic table; when the header field is in the static table or the dynamic table, encoding the header field according to the header field index format; when the header field is not in the static table or the dynamic table, encoding the header field according to a coding format other than the header field index format according to whether the header field name is in the static table or the dynamic table and whether the header field is placed in the dynamic table, wherein the header field includes a header field name and a header field value.
[0031] Based on the further improvement of the above method, according to whether the header field name is in the static table or the dynamic table and whether the header field is placed in the dynamic table, encoding the header field according to a coding format other than the header field index format further includes: when the header field name is in the static table or the dynamic table and the header field is placed in the dynamic table, encoding the header field according to the header field incremental index name format; when the header field name is in the static table or the dynamic table and the header field is not placed in the dynamic table, encoding the header field according to the header field non-index with index name format; when the header field name is not in the static table or the dynamic table and the header field is placed in the dynamic table, encoding the header field according to the header field incremental index with text name format; and when the header field name is not in the static table or the dynamic table and the header field is not placed in the dynamic table, encoding the header field according to the header field non-index with text name format.
[0032] On the other hand, an embodiment of the present invention provides a header decoding device including: a receiving module, used to receive a HEADER frame from a transmitting end, and the HEADER frame includes multiple encoded header fields; an identification module, used to identify the encoding format of an encoded header field, wherein the encoding format includes header field index format encoding, header field incremental index with index name format encoding, header field incremental index with text name format encoding, header field non-index with index name format encoding and header field non-index with text name format encoding; a decoding module, used to identify the encoded header field based on the identified encoding format; a judgment module, used to judge whether the decoding is successful; and a repair module, used to start a single header field decoding exception repair mechanism when the decoding fails. Compared with the prior art, the present invention can achieve at least one of the following beneficial effects:
[0033] 1. When decoding fails, a single header field decoding exception repair mechanism is started to avoid direct error return, thereby preventing the entire data packet from being unable to participate in subsequent processing such as XDR synthesis.
[0034] 2. In the event of HTTP / 2 header frame decoding anomalies, the repair mechanism is started to repair the decoding results and dynamic tables to ensure that the header fields required for subsequent processing are decoded as much as possible in the event of packet loss, and the dynamic table is resynchronized as quickly as possible.
[0035] 3. In the 3GPP specification, some header fields in some operations are fixed. For example, for some operations, the method or status is fixed. If the method or status header field is not decoded or the decoded method or status header field is inconsistent with the 3GPP specification, it can be repaired according to the 3GPP specification.
[0036] 4. In the embodiment of the present application, the header field content and the header field order carried in the same PATH type of the same network element are basically the same. Based on this understanding, for successful HEADER frame decoding, we count the header fields that appear and the order in which the header fields appear according to the device + PATH type as the dimension. We can use the statistical results to repair the abnormally decoded header fields.
[0037] In the present invention, the above-mentioned technical solutions can also be combined with each other to achieve more preferred combination solutions. Other features and advantages of the present invention will be described in the subsequent description, and some advantages can become obvious from the description, or can be understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained through the contents particularly pointed out in the description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The drawings are only for the purpose of illustrating particular embodiments and are not to be considered limiting of the present invention. Like reference symbols denote like components throughout the drawings.
[0039] Figure 1 This is an example of using the HAPCK protocol to transmit information between the client and the server.
[0040] Figure 2 A block diagram of an existing header decoding method.
[0041] Figure 3 4 is a flowchart of a header decoding method according to an embodiment of the present invention.
[0042] Figure 4 A diagram of the 5G network structure and related interface protocols.
[0043] Figure 5 4 is a flowchart of a header encoding method according to an embodiment of the present invention.
[0044] Figure 6 4 is a specific flow chart of the header decoding method according to an embodiment of the present invention.
[0045] Figure 7 is a block diagram of a header decoding device according to an embodiment of the present invention.
[0046] Figure 8 Diagram of the static table used by HPACK.
[0047] Fig. 9 Schematic diagram for HPACK header compression. DETAILED DESCRIPTION
[0048] The preferred embodiments of the present invention are described in detail below in conjunction with the accompanying drawings, wherein the accompanying drawings constitute a part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not used to limit the scope of the present invention.
[0049] A specific embodiment of the present invention discloses a header decoding method. Figure 3 The method for header decoding comprises: step S302, receiving a HEADER frame from a transmitting end, and the HEADER frame comprises a plurality of coded header fields; performing the following steps in sequence for each of the plurality of coded header fields: step S304, identifying a coding format of a coded header field, wherein the coding format comprises a header field index format coding, a header field incremental index with an index name format coding, a header field incremental index with a text name format coding, a header field non-index with an index name format coding, and a header field non-index with a text name format coding; step S306, decoding the identified coded header field based on the identified coding format and determining whether the decoding is successful; and step S308, when decoding fails, starting a single header field decoding abnormality repair mechanism.
[0050] Compared with the prior art, the header decoding method provided in this embodiment starts a single header field decoding exception repair mechanism when decoding fails, thereby avoiding direct error return, thereby preventing the entire data packet from being unable to participate in XDR synthesis (XDR synthesis: collecting and processing the full amount of data from the operator's communication network to generate XDR records), wherein XDR is a detailed record of services generated for use by signaling monitoring platforms and signaling applications after processing the full amount of data from the operator's communication network.
[0051] In the following, reference will be made to Figures 3 to 6 , a header decoding method according to an embodiment of the present invention is described in detail.
[0052] refer to Figure 3The header decoding method includes: step S302, receiving a HEADER frame from a transmitting end, and the HEADER frame includes a plurality of encoded header fields. Specifically, an HTTP / 2 request is divided into two frames: a HEADER frame and a DATA frame, wherein the HEADER frame is header compressed, and the DATA frame is a request content frame in plain text. In the field of mobile communications, the content of the DATA frame is defined by the 3GPP specification.
[0053] The following steps are performed sequentially for each of the multiple encoded header fields: Step S304, identifying the encoding format of the encoded header field, wherein the encoding format includes header field index format encoding, header field incremental index with index name format encoding, header field incremental index with text name format encoding, header field non-index with index name format encoding and header field non-index with text name format encoding.
[0054] refer to Figure 5 , before receiving the HEADER frame, further includes encoding each header field in the multiple header fields to obtain the HEADER frame to be sent through the following steps: querying the header field in the static table and the dynamic table; when the header field is in the static table or the dynamic table, encoding the header field according to the header field index format; when the header field is not in the static table or the dynamic table, encoding the header field according to a coding format other than the header field index format according to whether the header field name is in the static table or the dynamic table and whether the header field is placed in the dynamic table, wherein the header field includes a header field name and a header field value. Depending on whether the header field name is in the static table or the dynamic table and whether the header field is placed in the dynamic table, encoding the header field according to an encoding format other than the header field index format further includes: when the header field name is in the static table or the dynamic table and the header field is placed in the dynamic table, encoding the header field according to the header field incremental index name format; when the header field name is in the static table or the dynamic table and the header field is not placed in the dynamic table, encoding the header field according to the header field non-index with index name format; when the header field name is not in the static table or the dynamic table and the header field is placed in the dynamic table, encoding the header field according to the header field incremental index with text name format; and when the header field name is not in the static table or the dynamic table and the header field is not placed in the dynamic table, encoding the header field according to the header field non-index with text name format.
[0055] Step S306, based on the identified encoding format, decode the identified encoded header field and determine whether the decoding is successful. When the decoding is successful, add the decoded header field to the header field list; and when the identified encoding format is header field incremental index with index name format encoding or header field incremental index with text name format encoding, insert the decoded header field into the dynamic table and set the packet loss state of the start table entry of the dynamic table to the default value 0. The packet loss state value includes 0 and 1, the default value 0 represents a non-packet loss state, and 1 represents a packet loss state.
[0056] Step S308, when decoding fails, start a single header field decoding anomaly repair mechanism. Starting a single header field decoding anomaly repair mechanism includes: when the record content corresponding to the index value is not retrieved in the index table based on the index value, determining that a HEADER frame is lost on the TCP link associated with the dynamic table, wherein the HEADER frame carries a header field with an index name format encoding of a header field incremental index or a header field with a text name format encoding of a header field incremental index; and inserting an empty header field into the dynamic table according to the index value and setting the packet loss state of the table entry corresponding to the index value in the dynamic table to 1, wherein the index table includes a static table and a dynamic table, the index value of the static table is 1 to 61 and the index value of the dynamic table is greater than or equal to 62. In an optional embodiment, starting a single header field decoding anomaly repair mechanism includes: when the decoded header field name and the header field value do not correspond, deriving the header field name according to the header field value to modify the decoded header field and the dynamic table, wherein the header field includes the header field name and the header field value.
[0057] After the decoding of multiple encoded header fields is completed, it also includes: checking whether there are still header fields with decoding abnormalities in the header field list; and when there are, starting the repair mechanism based on the 3GPP specification and the normal decoding statistical structure. Specifically, starting the repair mechanism based on the 3GPP specification and the normal decoding statistical structure also includes: receiving a DATA frame, or after receiving a HEADER frame, receiving a DATA frame; determining the header field in the HEADER frame corresponding to the DATA frame according to all information units in the DATA frame; and repairing the header field with decoding abnormalities according to the determined header field in the HEADER frame. Starting the repair mechanism based on the 3GPP specification and the normal decoding statistical structure also includes: in the case of the same device and the same type of HEADER frame, storing the header fields in the HEADER frame that are decoded successfully and the order in which the header fields appear; repairing the header field with decoding abnormalities according to the stored header fields in the HEADER frame that are decoded successfully and the order in which the header fields appear.
[0058] In the following, reference Figures 4 to 6, the header decoding method according to an embodiment of the present invention is described in detail by way of a specific example.
[0059] HTTP / 2 header compression principle
[0060] HTTP1.X has been criticized for a long time due to its design flaws. One of the headaches is the meaningless repeated headers. As a result, various solutions have emerged. For example, Google designed the SPDY protocol directly based on HTTP1.X, using the deflate algorithm to compress the headers, solving multiplexing and priority issues. The implementation of HTTP2 refers to the SPDY protocol, but a set of compression algorithms is specially designed for header compression, namely HPACK (for example, Header Compression for HTTP2-RFC7541).
[0061] refer to Fig. 9 HPACK treats the header field list (Header List) as an ordered set of header fields (HTTP / 2 HeaderField, name-value pairs in the HTTP / 2 HEADER frame), and HPACK compresses and decompresses each header field pair sequentially.
[0062] HPACK uses two index tables (static table and dynamic table) to map message fields to index values, and uses Huffman encoding for header fields that do not exist in the static table and dynamic table, and dynamically caches them in the dynamic table, thereby achieving the effect of compressing the header. Figure 8 The static table consists of a static list of header fields predefined by the HPACK protocol (i.e., 61 commonly used header fields), with index values ranging from 1 to 61. The static table is read-only, and the entries and their positions (index values) cannot be changed. For example, Figure 8 All static table entries are listed. The dynamic table (Dynamic Table, a dynamically maintained list of header fields used to eliminate redundant header fields) is also composed of a series of header fields, but the elements are not fixed. New entries are inserted or existing entries are deleted as needed during the actual encoding process. The HPACK protocol requires that the static table and the dynamic table be merged in the same storage space, with the static table placed in the front and the dynamic table following closely. Then in the entire index table space, the index of the first entry in the dynamic table will be 62. The maintenance principle of the dynamic table is first-in-first-out (FIFO, the newest entry is at the lowest index and the oldest entry is at the highest index). When adding an entry to the dynamic table, it will always be inserted from the 62nd position, and all the original entries will be moved one position to the right. When deleting an entry from the dynamic table, it will always be deleted from the last position.
[0063] The entire compression and decompression process of HPACK: the data sender independently decides which header fields need to be added to the dynamic table and adds them to the dynamic table and compresses them according to the HPACK specification. After all header dictionaries are encoded, the data packet is sent to the data receiver; the data receiver receives the data packet and decodes it according to the HPACK specification to restore the same header field list and dynamic table as the data sender.
[0064] refer to Fig. 9 The header compression principle diagram shows that the sender is ready to send the following six header fields: 1) method: GET; 2) scheme: https; 3) host: example.com; 4) path: / resource; 5) user-agent: Mozilla / 5.0; 6) custom-hdr: some-value. Now there are two entries in the dynamic table of the index table: user-agent: Mozilla / 5.0 at index 62; host: example.com at index 63. The first method:GET header field is at position 2 in the static table. When encoding, the header field is encoded as the index value "2" in the index table; the second:scheme:https header field is at position 7 in the static table. When encoding, the header field is encoded as the index value "7" in the index table; the third:host:example.com is at the second position in the dynamic table, corresponding to index 63 in the index table. When encoding, the header field is encoded as the index value "63" in the index table; the fourth:path: / resource header field, the header field name ":path" is at position 19 in the static table. When encoding, the encoder chooses to use the "header field incremental index with index name format" header field name ":pat h" is encoded as the index value in the index table, and the value of the header field is encoded using the huffman encoding method; the fifth user-agent: Mozilla / 5.0 header field is in the first position in the dynamic table, and its corresponding value in the index table is 62. When encoded, this header field is encoded as the index value "62" in the index table; the header field name of the sixth custom-hdr: some-value header field is not in the dynamic table and the static table. The encoding end chooses to use the "header field does not index with text name format", and the header field name "custom-hdr" is encoded as huffman (coustom-hdr), and the header field value "some-value" is encoded as huffman (some-value). The following describes the entire compression process according to the HPACK specification. Reference Figure 5 , HPACK encodes each header field in the order listed in the header list:
[0065] 1. Search the static and dynamic dictionaries. If the header field exists completely in the dynamic table, encode it using the Indexed Header Field Representation (using the index value in the dynamic table or static table to encode a header field). This usually consumes one byte, and at most two bytes are enough. Because many headers are repeated, this strategy has a very high success rate.
[0066] If the four header fields in the HPACK header compression schematic diagram above, 1) method: GET; 2) scheme: https; 3) host: example.com; 5) user-agent: Mozilla / 5.0, are encoded as index values 2, 7, 63, and 62, each occupying one byte.
[0067] 2. When a complete header field cannot be matched in the static table and the dynamic table, try to match the header field name in the static table and the dynamic table. If a match is found, get the index value of the header field name in the dynamic table or the static table.
[0068] 3. Decide whether to add the header field being encoded to the dynamic table. If the header field is to be added to the dynamic table, the first two bits of the encoding are 01; if the header field is not to be added to the dynamic table, the first four bits of the encoding are 0000.
[0069] 4. If you decide to add the header field to the dynamic table, you can use "Literal Header Field with Incremental Indexing-Index Name (use the header index value to get the name in the dynamic table or static table, and then directly get the header field value to form a header field attached to the decoded header list; and insert it into the dynamic table as a new entry)" or "Literal Header Field with Incremental Indexing--New Name. When decoding in this format, the header field name and header field value are directly decoded to form a header field attached to the decoded header list; and insert it into the dynamic table as a new entry)" One of the two formats is used for encoding. "Header Field Incremental Indexing with Index Name Format Encoding" means that the header field name is in the index table, but the header field value is not in the index table. The name is encoded with the index value in the index table, and the value is encoded using Huffman. The ":path: / resource" header field in the above hpack header compression principle diagram uses this encoding. "Header field incremental index with text name format encoding" means that the name and value of the header field are not in the index table, and both the name and value are encoded using Huffman. The custom-hdr:some-value in the hpack header compression principle diagram above uses this encoding. If both fields are decided to be added to the dynamic table, the encoded dynamic table (refer to Table 3 below) is:
[0070] Table 3
[0071] Static table
[0072] 1 2 … … … 51 refer … … … 62 costom-hdr some-value 63 :path / resource 64 User-agent Mozilla / 5.0 65 :host example
[0073] Dynamic table
[0074] 5. If you decide not to add the encoded header field to the dynamic table, you can use "Literal Header Field without Indexing--Indexed Name. When decoding in this format, the header index value is used to get the name in the dynamic table or static table, and then the header field value is directly obtained to form a header field that is attached to the decoded header list; the dynamic table is not changed, and the new entry cannot be inserted into the dynamic table)" and "Literal Header Field without Indexing--New Name. When decoding in this format, the header field name and header field value are directly decoded to form a header field that is attached to the decoded header list; the dynamic table is not changed, and the new entry cannot be inserted into the dynamic table" can be used. "Literal Header Field without Indexing--New Name" means that the header field name is in the index table, but the header field value is not in the index table. The name is encoded with the index value in the index table, and the value is encoded using Huffman. The ":path: / resource" header field in the hpack header compression principle diagram above uses this encoding. "Header field is not indexed with text name format encoding" means that the name and value of the header field are not in the index table, and both the name and value are encoded using Huffman. The custom-hdr:some-value in the hpack header compression principle diagram above uses this encoding. If the header field is not added to the dynamic table, the dynamic table remains unchanged after the encoding is completed.
[0075] refer to Figure 4 , the 5G core network subverts the traditional CT network architecture and protocols and introduces service-oriented interfaces.
[0076] The abbreviations of each network element are explained as follows:
[0077] AUSF: Authentication Server Function, authentication service function;
[0078] AMF: Access and Mobility Management Function, access and mobility management function;
[0079] SMF: Session Management Function, session management function;
[0080] NSSF: Network Slice Selection Function, network slice selection function;
[0081] UDM: Unified Data Management;
[0082] NEF: Network Exposure Function, network exposure function;
[0083] NRF: Network Repository Function, network registration function;
[0084] PCF: Policy Control Function, policy control function;
[0085] UPF: User Plane Function, user plane function;
[0086] AF: Application Function, application function;
[0087] DN: Data Network, data network;
[0088] Figure 4 The interfaces Nnssf, Nnef, Nnrf, Npcf, Nudm, Naf, Nausf, Namf and Nsmf all use HTTP2 protocol for communication. In order to improve the security and communication efficiency during HTTP2 communication, key information such as operation type, operation resource, and operation result are all in the dynamic table; if this information is not decoded successfully, it will affect XDR synthesis. Therefore, the accuracy of HTTP2 dynamic header decompression in the signaling collection and analysis system will determine the accuracy and availability of the entire system.
[0089] The present invention increases the situation that when HTTP / 2 header frame decoding exception occurs, a repair mechanism is started to repair the decoding result and the dynamic table, so as to ensure that the header fields required for subsequent processing are decoded as much as possible in the case of packet loss, and the content of the dynamic table is resynchronized in the shortest possible time.
[0090] refer to Figure 6 , the header decoding method is described in detail.
[0091] 1. Determine the encoding format of the header field.
[0092] 2. Decode the header field according to its encoding format.
[0093] 3. If the header field is decoded successfully, check whether the header field needs to be inserted into the dynamic table. For header fields encoded using one of the two formats, "header field incremental index with index name format encoding" or "header field incremental index with text name format encoding", the dynamic table needs to be inserted. The current dynamic table content is shown in Table 4 below.
[0094] Table 4
[0095] 62 User-agent Mozilla / 5.0 63 accept image / jgeg 64 :path / resource 65 :host example.com
[0096] If a data packet is received and the decoding encounters the ":path: / new_resource" header field which needs to be inserted into the dynamic table, then the packet ":path: / new_resource" needs to be inserted into the dynamic table. After the insertion, the content of the dynamic table can be found in Table 5.
[0097] Table 5
[0098] 62 :path / new_resource 63 User-agent Mozilla / 5.0 64 accept image / jgeg 65 :path / resource 66 :host example.com
[0099] 4. If the header field decoding fails, start the single header field decoding exception repair mechanism.
[0100] At this stage, it can be found that decoding failures occur when the header field format is header field index, header field incremental index with index name, or header field non-index with index name, and the index value is not found in the index table.
[0101] This error usually occurs when an HTTP2 Header frame carrying a header field of "header field incremental index with index name" or "header field incremental index with text name" is lost on the TCP link associated with the dynamic table. At this time, an empty header field needs to be inserted into the dynamic table for subsequent repair mechanisms. The insertion position is the position where the TCP link associated with the dynamic table has recently lost packets. If the link management of the TCP link of the TCP connection associated with the dynamic table finds that there is packet loss on the TCP link, the packet loss status of the start table entry of the dynamic table is set to 1 (the default is 0); the packet loss position is traversed from the beginning of the dynamic table until there is an entry with a packet loss status of 1 or the end of the dynamic table. If the packet loss status of the dynamic table entry is 1, the insertion position is in front of the entry; if the dynamic table is traversed to the end, the insertion position is the end of the dynamic table. For example, the current dynamic table content refers to Table 6.
[0102] Table 6
[0103] 62 User-agent Mozilla / 5.0 63 accept image / jgeg 64 :path / resource 65 :host example.com
[0104] If the header field index value of a received data packet is 66, and the packet loss status of the entry corresponding to 62 in the dynamic table is 0, and the packet loss status of 63 is 1; then an empty header field needs to be inserted before 63. After the insertion, the content of the dynamic table refers to Table 7.
[0105] Table 7
[0106] 62 User-agent Mozilla / 5.0 63 64 accept image / jgeg 65 :path / resource 66 :host example.com
[0107] At this time, the value of index 66 is considered to be ":host:example.com" and the value of index 63 is empty content.
[0108] 5. After all header fields are decoded, check whether there are any header fields with decoding exceptions in the header field list.
[0109] 6. If there are abnormal header fields, start the repair mechanism based on the 3GPP specification.
[0110] (1) In the 3GPP specification, some header fields in some operations are fixed. For example, for some operations, the method or status is fixed. If the method or status header field is not decoded or the decoded method or status header field is inconsistent with the 3GPP specification, it can be repaired according to the 3GPP specification.
[0111] For example, the operation method of path {apiRoot} / nsmf-pdusession / v1 / sm-contexts must be post; the status of a successful response must be 201. If the decoded method is put or the status is 201, then the decoding must be wrong, and you need to clear the table entries corresponding to the index value of method: put and the index value of status: 201.
[0112] For example: At the beginning, the dynamic table status is as shown in Table 8 below
[0113] Table 8
[0114] 62 User-agent Mozilla / 5.0 63 method put 64 accept image / jgeg 65 :path / resource 66 :host example.com
[0115] The received data packet is decoded to have path {apiRoot} / nsmf-pdusession / v1 / sm-contexts and method: put header field. The index corresponding to the method: put header field is 63, so it can be considered that the table entry 63 is abnormal. Performing a repair operation can clear the table entry corresponding to 63. The dynamic table after the repair is shown in Table 9.
[0116] Table 9
[0117] 62 User-agent Mozilla / 5.0 63 64 accept image / jgeg 65 :path / resource 66 :host example.com
[0118] (2) Repair based on DATA frame
[0119] An HTTP / 2 request is divided into two frames, a HEADER frame and a DATA frame. The HEADER frame is header compressed, and the DATA frame is the request content frame in plain text. In the field of mobile communications, the content of the DATA frame is defined by the 3GPP specification.
[0120] If there is a header field decoding anomaly when decoding the HEADERS frame, the processing can be delayed until the DATA frame corresponding to the HEADERS frame is processed. The header fields that need to be carried in the HEADERS frame can be derived from the decoded content of the DATA frame and the 3GPP specification. If the header fields that need to be carried are not complete in the header fields that we have successfully decoded, these contents must be in the header fields with decoding anomalies. Then we can know the value range of the header fields with decoding anomalies.
[0121] If there is only one header field with a decoding exception and a header field that needs to be carried is missing, then the value of the header field with the decoding exception can be determined. At this time, the header field with the decoding exception can be corrected and the dynamic table can be repaired by adding the header field to the dynamic table according to the index value.
[0122] For example, according to the 3GPP specification, if all of the following information units appear in the data message of the SMF service:
[0123] -dnn
[0124] -vsmfId
[0125] -servingNetwork
[0126] -vsmfPduSessionUri
[0127] -vcnTunnelInfo
[0128] -anType
[0129] It can be confirmed that the service corresponding to the data is:
[0130] {apiRoot} / nsmf-pdusession / v1 / pdu-sessions
[0131] Thus, the headers frame corresponding to the data frame contains the following header fields:
[0132] -method: post
[0133] -content-length: length of data
[0134] -content-type: application / json or multipart / related (depends on the format of the data frame. Once the data is determined, the content-type can be uniquely determined)
[0135] -path: {apiRoot} / nsmf-pdusession / v1 / pdu-sessions
[0136] If the content-type is not decoded when decoding the HEADER frame and there is an index of 63 that does not get the content in the dynamic table, then it can be determined that the table entry value corresponding to index 63 is "content-type: application / json".
[0137] If the content of the dynamic table before decoding is as shown in Table 10.
[0138] Table 10
[0139] 62 User-agent Mozilla / 5.0 63 64 accept image / jgeg 65 :path / resource 66 :host example.com
[0140] Then the content of the dynamic table after repair is as follows Table 11
[0141] Table 11
[0142] 62 User-agent Mozilla / 5.0 63 content-type application / json 64 accept image / jgeg 65 :path / resource 66 :host example.com
[0143] In the second example, according to the 3GPP specification, if all of the following information elements appear in the data message of the UDM service:
[0144] -smfInstanceId
[0145] -pduSessionId
[0146] -singleNssai
[0147] -plmnId
[0148] It can be confirmed that the service corresponding to the data is:
[0149] / {ueId} / registrations / smf-registrations / {pduSessionId}
[0150] It can be obtained that the headers frame corresponding to the data frame must contain the following header fields:
[0151] -path: / {ueId} / registrations / smf-registrations / {pduSessionId}
[0152] -method: put
[0153] -content-length: length of data
[0154] -content-type:application / json
[0155] If the content-type is not decoded when decoding the HEADER frame and there is an index of 63 that does not get the content in the dynamic table, then it can be determined that the table entry value corresponding to index 63 is "content-type: application / json".
[0156] If the content of the dynamic table before decoding is as shown in Table 12 below.
[0157] Table 12
[0158] 62 User-agent Mozilla / 5.0 63 64 accept image / jgeg 65 :path / resource 66 :host example.com
[0159] Then the content of the dynamic table after repair is as shown in Table 13 below.
[0160] Table 13
[0161] 62 User-agent Mozilla / 5.0 63 content-type application / json 64 accept image / jgeg 65 :path / resource 66 :host example.com
[0162] In the third example, according to the 3GPP specification, if all of the following information elements appear in the DATA message of the udm service:
[0163] -amfInstanceId
[0164] -imsVoPs
[0165] -deregCallbackUri
[0166] -guami
[0167] -ratType
[0168] The direction in DATA can be used to determine whether the DATA frame is a request DATA frame or a response DATA frame (if the destination address of the DATA frame is UDM, it is a request frame; if the source address of the DATA frame is UDM, it is a response frame).
[0169] It can be confirmed that the service corresponding to the data is:
[0170] / {ueId} / registrations / amf-non-3gpp-access
[0171] It can be obtained that the headers frame corresponding to the data frame must contain the following header fields:
[0172] -path: / {ueId} / registrations / amf-non-3gpp-access
[0173] -method: put
[0174] -content-length: length of data
[0175] -content-type:application / json
[0176] If the method is not decoded when decoding the HEADER frame and there is an index of 63 that does not get the content in the dynamic table, then it can be determined that the table entry value corresponding to the index 63 is "methon: put".
[0177] If the content of the dynamic table before decoding is as shown in Table 14 below.
[0178] Table 14
[0179] 62 User-agent Mozilla / 5.0 63 64 accept image / jgeg 65 :path / resource 66 :host example.com
[0180] Then the content of the repaired dynamic table is as shown in Table 15 below.
[0181] Table 15
[0182] 62 User-agent Mozilla / 5.0 63 method put 64 accept image / jgeg 65 :path / resource 66 :host example.com
[0183] 7. Start the statistical repair mechanism based on 3GPP network elements and PATH types
[0184] We believe that the header field content and header field order carried in the same PATH type HEADER of the same network element are basically the same.
[0185] Based on this knowledge, for successful HEADER frame decoding, we count the header fields that appear and the order in which they appear according to the device + PATH type. We can use the statistical results to repair the abnormal header fields that are decoded.
[0186] The following examples illustrate scenarios that can be repaired using statistical results:
[0187] (1) If, in a PATH operation, header field A appears only once in all normal HEADERS frames, but this time the decoded header field A appears multiple times, then it is certain that there is a decoding anomaly. By combining the order in which header field A appears in normal HEADERS frames, we can confirm which header field A is decoded normally. Except for this header field that is decoded normally, all others are decoded abnormally.
[0188] (2) If two content-types are decoded from a packet, but the content-type of the PATH operation only appears once in all normal HEADERS frames, then there must be an abnormal dynamic entry corresponding to the content-type header field index. The order in which the content-types appear in the normal HEADERS frames of the PATH operation can be combined to determine which content-type header field index corresponds to the abnormal dynamic entry.
[0189] (3) If a header field A appears in all normal HEADERS frames in a certain PATH operation, but does not appear in the HEADERS frame with a decoding abnormality, it is considered that the header field A must exist in the header field with the decoding abnormality. The order in which the header field A appears in the normal HEADERS frame can be combined to determine which field in the header field with the decoding abnormality has the value of the header field A.
[0190] (4) If in a certain PATH operation, header field A appears frequently in a normal HEADERS frame (e.g., more than 95%), but does not appear in the HEADERS frame of the header field with decoding abnormality, then it is considered that header field A may exist in the header field with decoding abnormality; combined with the order in which header field A appears in a normal HEADERS frame, it may be possible to confirm which value in the header field with decoding abnormality is header field A.
[0191] (5) If in a certain PATH operation, a header field sequence (header field A, header field B, header field C) appears in all normal HEADERS frames or appears very frequently, but does not appear in the HEADER frame with the header field with decoding anomalies; but a header field sequence (header field A, decoding anomaly header field, header field C) appears, then the decoding anomaly header field can be considered to be header field B.
[0192] (6) When multiple header fields with decoding anomalies that need to appear appear and multiple header words that need to be carried are missing, the values corresponding to the decoding anomaly header fields can be determined by the order in which the missing fields appear in a normal HEADERS frame.
[0193] In the fourth example, the probability of the order of appearance of various header fields in the HEADER frames of various services sent by various devices in the mobile communication network can be counted according to various arrangements of "service + source IP address + header field". Thus, the order of header fields with the highest probability of appearance of various services in various devices can be obtained.
[0194] If statistics show that the most likely header field sequence in the HEADER frame of the / sm-contexts / {smContextRef} / modify service sent by a certain IP address (IP1) is:
[0195] 1): authority; 2): method; 3): path; 4): scheme; 5): content-type If we receive the / sm-contexts / {smContextRef} / modify sent by IP1, the server decodes two content-types. The decoding results are shown in Table 16 below.
[0196] Table 16
[0197] Header Field Index Header field name Header field value 68 :content-type application / json 3 :method post 64 :path / nsmf-pduusession / v1 / sm-contexts / 1 / modify 6 :scheme http 62 :content-type application / json
[0198] Then there must be an abnormal dynamic table entry corresponding to the content-type header field index.
[0199] Through learning, we know that the order of appearance of the service header fields is 1): authority; 2): method; 3): path; 4): scheme; 5): content-type. The probability of this sequence is very high, so we can try to repair it with this sequence; and we can think that the value decoded from the header field index 68 is abnormal, and the entry corresponding to the 68 index value in the dynamic table is abnormal. The table entry with the 68 index value can be repaired: the table entry name is: authority; the table entry value is unknown: the dynamic content before decoding is as shown in Table 17 below.
[0200] Table 17
[0201] 62 :content-type application / json 63 User-agent Mozilla / 5.0 64 :path / nsmf-pduusession / v1 / sm-contexts / 1 / modify 65 :path / resource 66 :host example.com 67 accept image / jgeg 68 :content-type application / json
[0202] The content of the dynamic table after repair is shown in Table 18 below.
[0203] Table 18
[0204] 62 :content-type application / json 63 User-agent Mozilla / 5.0 64 :path / nsmf-pduusession / v1 / sm-contexts / 1 / modify 65 :path / resource 66 :host example.com 67 accept image / jgeg 68 :authority
[0205] In the fifth example, the probability of the order of appearance of various header fields in the HEADER frames of various services sent by various devices in the mobile communication network can be counted according to the dimension of "service+source IP address+header field", so as to obtain the header fields with the top probability of appearance of various services in various devices.
[0206] If the TOPN header field in the HEADER frame of the / sm-contexts / {smContextRef} / modify service sent by a certain IP address (IP1) is obtained through statistics, it is as shown in Table 19 below.
[0207] Table 19
[0208] Header field name Header field value Probability :content-type application / json 100% :method post 100% :path / nsmf-pduusession / v1 / sm-contexts / 1 / modify 100% :scheme http 100%
[0209] If we receive the Header frame decoding result of the service / sm-contexts / {smContextRef} / modify sent by the IP1 address, the result is shown in Table 20 below.
[0210] Table 20
[0211] Header Field Index Header field name Header field value 68 :authority 10.10.10.10:80 3 :method post 64 :path / nsmf-pduusession / v1 / sm-contexts / 1 / modify 6 :scheme http 62 :accept-encoding gzip
[0212] From the statistics, it can be confirmed that the service / sm-contexts / {smContextRef} / modify sent by IP1 address must carry: content-type, but it is not in the decoding result this time. It can be considered that there is a header field with decoding abnormality this time. Combined with the statistical results of the order of appearance of the header fields of this service (see Example 1), it can be determined that the header field corresponding to 62 is decoded abnormally. The table entry with index value 62 can be repaired: the table entry name is: content-type; the table entry value is application / json. The content of the dynamic table before decoding is shown in the following Table 21.
[0213] Table 21
[0214] 62 :accept-encoding gzip 63 User-agent Mozilla / 5.0 64 :path / nsmf-pduusession / v1 / sm-contexts / 1 / modify 65 :path / resource 66 :host example.com 67 accept image / jgeg 68 : authority 10.10.10.10:80
[0215] The content of the dynamic table after repair is shown in Table 22 below.
[0216] Table 22
[0217] 62 : content-type application / json 63 user-agent Mozilla / 5.0 64 : path / nsmf-pdusession / v1 / sm-contexts / 1 / modify 65 : path / resource 66 : host example.com 67 accept image / jgeg 68 : authority 10.10.10.10:80
[0218] In the sixth example, the probability of the order in which various header field arrangements appear in the HEADER frames of various services sent by various devices in the mobile communication network can be counted according to various arrangements of "service+source IP address+header field" as the dimension.
[0219] If we receive the decoding result in the server of / sm-contexts / {smContextRef} / modify sent by IP1 address, the result is shown in Table 23 below.
[0220] Table 23
[0221] Header Field Index Header Field Name Header Field Value 68 : authority 10.10.10.10:80 3 : method post 64 : path / nsmf-pdusession / v1 / sm-contexts / 1 / modify 6 : scheme http 62 : accept-encoding gzip
[0222] The header field sequence of the decoding result is: 1): authority; 2): method; 3): path; 4): scheme; 5): accept-encoding. It has basically never appeared. It can be guessed that there may be a decoding exception. Try to fix it.
[0223] Through learning, we know that the probability of the service appearing in the similar header field sequence 1): authority; 2): method; 3): path; 4): scheme; 5): content-type is very high, so we can try to repair it with this sequence; and we can think that the value decoded from the header field index 62 is abnormal, so we can repair the table item worth the 62 index: the table item name is content-type; the table item value is application / json.
[0224] The dynamic content before decoding is shown in Table 24 below.
[0225] Table 24
[0226] 62 : accept-encoding gzip 63 user-agent Mozilla / 5.0 64 : path / nsmf-pdusession / v1 / sm-contexts / 1 / modify 65 : path / resource 66 : host example.com 67 accept image / jgeg 68 : authority 10.10.10.10:80
[0227] The content of the dynamic table after repair is shown in Table 25 below.
[0228] Table 25
[0229] 62 : content-type application / json 63 user-agent Mozilla / 5.0 64 : path / nsmf-pdusession / v1 / sm-contexts / 1 / modify 65 : path / resource 66 : host example.com 67 accept image / jgeg 68 : authority 10.10.10.10:80
[0230] Another specific embodiment of the present invention discloses a header decoding device. Figure 7 The header decoding device includes: a receiving module 702, which is used to receive a HEADER frame from a sending end, and the HEADER frame includes multiple encoded header fields; an identification module 704, which is used to identify the encoding format of an encoded header field, wherein the encoding format includes header field index format encoding, header field incremental index with index name format encoding, header field incremental index with text name format encoding, header field non-index with index name format encoding and header field non-index with text name format encoding; a decoding module 706, which is used to identify the encoded header field based on the identified encoding format; a judgment module 708, which is used to judge whether the decoding is successful; and a repair module 710, which is used to start a single header field decoding exception repair mechanism when the decoding fails.
[0231] The header decoding device also includes a plurality of other modules. The header decoding device corresponds to the header decoding method, so in order to avoid redundancy, detailed descriptions of the plurality of other modules are omitted.
[0232] Compared with the prior art, the present invention can achieve at least one of the following beneficial effects:
[0233] 1. When decoding fails, a single header field decoding exception repair mechanism is started to avoid direct error return, thereby preventing the entire data packet from being unable to participate in subsequent processing such as XDR synthesis.
[0234] 2. In the event of HTTP / 2 header frame decoding anomalies, the repair mechanism is started to repair the decoding results and dynamic tables to ensure that the header fields required for subsequent processing are decoded as much as possible in the event of packet loss, and the dynamic table is resynchronized as quickly as possible.
[0235] 3. In the 3GPP specification, some header fields in some operations are fixed. For example, for some operations, the method or status is fixed. If the method or status header field is not decoded or the decoded method or status header field is inconsistent with the 3GPP specification, it can be repaired according to the 3GPP specification.
[0236] 4. In the embodiment of the present application, the header field content and the header field order carried in the same PATH type of the same network element are basically the same. Based on this understanding, for successful HEADER frame decoding, we count the header fields that appear and the order in which the header fields appear according to the device + PATH type as the dimension. We can use the statistical results to repair the abnormally decoded header fields.
[0237] Those skilled in the art will appreciate that all or part of the processes of the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium, wherein the computer-readable storage medium is a disk, an optical disk, a read-only storage memory, or a random access memory, etc.
[0238] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by any technician familiar with the technical field within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention.
Claims
1. A header decoding method, It is characterized in that include: receiving a HEADER frame from a transmitting end and the HEADER frame includes a plurality of encoded header fields; The following steps are sequentially performed for each of the plurality of coded header fields: Identify the encoding format of the encoding header field, wherein the encoding format includes header field index format encoding, header field incremental index with index name format encoding, header field incremental index with text name format encoding, header field non-index with index name format encoding and header field non-index with text name format encoding; Decoding the identified coded header field based on the identified coding format and determining whether the decoding is successful; and When decoding fails, a single header field decoding exception repair mechanism is started, wherein starting the single header field decoding exception repair mechanism includes: when no record content corresponding to the index value is retrieved in the index table based on the index value, determining that a HEADER frame is lost on the TCP link associated with the dynamic table, wherein the HEADER frame carries a header field with an incremental index encoded in an index name format or a header field with an incremental index encoded in a text name format; and inserting an empty header field into the dynamic table according to the index value and setting the packet loss status of the table entry corresponding to the index value in the dynamic table to 1, wherein the index table includes a static table and the dynamic table, the index value of the static table is 1 to 61 and the index value of the dynamic table is greater than or equal to 62.
2. The header decoding method according to claim 1, It is characterized in that Also includes: When decoding is successful, the decoded header field is added to the header field list; as well as When the recognized encoding format is header field incremental index with index name format encoding or header field incremental index with text name format encoding, the decoded header field is inserted into the dynamic table and the packet loss status of the start table entry of the dynamic table is set to the default value 0.
3. The header decoding method according to claim 1, It is characterized in that The mechanism to repair abnormal decoding of single header fields includes: When the decoded header field name and the header field value do not correspond, the header field name is derived according to the header field value to modify the decoded header field and the dynamic table, wherein the header field includes the header field name and the header field value.
4. The header decoding method according to claim 2, It is characterized in that After the decoding of the plurality of coded header fields is completed, the method further comprises: Check whether there are any header fields with decoding exceptions in the header field list; and When present, a repair mechanism based on the 3GPP specification and normal decoding statistics structure is initiated.
5. The header decoding method according to claim 4, It is characterized in that Initiating a repair mechanism based on 3GPP specifications and normal decoding statistics structure also includes: After receiving the HEADER frame, receiving a DATA frame; Determine, based on all information units in the DATA frame, a header field in the HEADER frame corresponding to the DATA frame; and The header field with the decoding abnormality is repaired according to the determined header field in the HEADER frame.
6. The header decoding method according to claim 4 or 5, It is characterized in that Initiating a repair mechanism based on 3GPP specifications and normal decoding statistics structure also includes: In the case of the same device and the same type of HEADER frame, storing the header fields in the successfully decoded HEADER frame and the order in which the header fields appear; and The header field with abnormal decoding is repaired according to the stored header fields in the successfully decoded HEADER frame and the order in which the header fields appear.
7. The header decoding method according to claim 2 or 4, It is characterized in that Before receiving the HEADER frame, the method further includes encoding each of the plurality of header fields to obtain a HEADER frame to be sent by: Querying the header field in the static table and the dynamic table; When the header field is in the static table or the dynamic table, encoding the header field according to a header field index format; When the header field is not in the static table or the dynamic table, the header field is encoded according to a coding format other than the header field index format according to whether the header field name is in the static table or the dynamic table and whether the header field is placed in the dynamic table, wherein the header field includes a header field name and a header field value.
8. The header decoding method according to claim 7, It is characterized in that According to whether the header field name is in the static table or the dynamic table and whether the header field is placed in the dynamic table, encoding the header field according to an encoding format other than the header field index format further comprises: When the header field name is in the static table or the dynamic table and the header field is placed in the dynamic table, encoding the header field in accordance with the header field incremental index name format; When the header field name is in the static table or the dynamic table and the header field is not placed in the dynamic table, encoding the header field in a format of a header field without an index but with an indexed name; When the header field name is not in the static table or the dynamic table and the header field is placed in the dynamic table, encoding the header field in a header field incremental index with text name format; and When the header field name is not in the static table or the dynamic table and the header field is not placed in the dynamic table, the header field is encoded in a header field unindexed with text name format.
9. A header decoding device, It is characterized in that include: A receiving module, configured to receive a HEADER frame from a transmitting end, wherein the HEADER frame includes a plurality of coded header fields; An identification module, used to identify the encoding format of an encoded header field, wherein the encoding format includes header field index format encoding, header field incremental index with index name format encoding, header field incremental index with text name format encoding, header field non-index with index name format encoding and header field non-index with text name format encoding; a decoding module for decoding the identified encoded header field based on the identified encoding format; A judging module, used to judge whether the decoding is successful; and A repair module is used to start a single header field decoding exception repair mechanism when decoding fails, wherein starting the single header field decoding exception repair mechanism includes: when no record content corresponding to the index value is retrieved in the index table based on the index value, determining that a HEADER frame is lost on the TCP link associated with the dynamic table, wherein the HEADER frame carries a header field incremental index with an index name format encoding header field or a header field incremental index with a text name format encoding header field; and inserting an empty header field in the dynamic table according to the index value and setting the packet loss status of the table entry corresponding to the index value in the dynamic table to 1, wherein the index table includes a static table and the dynamic table, the index value of the static table is 1 to 61 and the index value of the dynamic table is greater than or equal to 62.
