A data transmission method and device based on HTTP2 protocol
By using multiple encoding formats and decoding exception repair mechanisms in the HTTP2 protocol, the problem of header field decoding errors in HTTP/2 transmission is solved, which improves data transmission efficiency and system reliability, and ensures that you can participate in time in packet loss situations XDR synthesis.
Patent Information
- Application Number
- CN202111122426.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-24
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2041-09-24
AI Technical Summary
The existing HTTP/2 transmission method results in errors in header field decoding in the case of long connections and message loss, which reduces data transmission efficiency and speed, and is unable to participate in follow-up processing such as XDR synthesis in a timely manner.
Using the HTTP2 protocol data transmission method, the header frame with multiple encoding formats is generated and sent, including index format, incremental index format and non-index format. The single header field decoding exception repair mechanism is activated during decoding, and the dynamic table and Decode the results to ensure the correctness and integrity of the header field.
It improves data transmission speed and efficiency, avoids data retransmission, ensures that you can participate in XDR synthesis in a timely manner in case of packet loss, repairs dynamic tables, and improves the reliability and accuracy of the system.
Smart Images

Figure CN115883682B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a data transmission method and device based on HTTP2 protocol. 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 3, 4, 5, and 6 header fields 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;
[0011] 6)user-agent:Mozilla / 5.0.
[0012] 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.
[0013] Table 2
[0014] 62 :path / new_resource 63 User-agent Mozilla / 5.0 64 accept image / jgeg 65 :path / resource 66 :host example.com
[0015] 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:
[0016] 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. This requires the client to retransmit the HEAD1 frame, DATA1 frame, HEAD3 frame, and DATA3 frame to the server, thereby reducing the data transmission rate and efficiency.
[0017] If the bypass encounters the above abnormal situation, the following errors may occur during header field decoding:
[0018] 1. Header field index format: The decoded index value cannot find the corresponding record in the dynamic table and the static table;
[0019] 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.
[0020] 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.
[0021] refer to Figure 2 When encountering the above decoding errors, the traditional decoding scheme will directly return an error and retransmit the information data, thereby reducing the data transmission rate and efficiency, and causing the entire data packet to be unable to participate in subsequent processing such as XDR synthesis. Summary of the invention
[0022] In view of the above analysis, the embodiments of the present invention aim to provide a header decoding method and apparatus to solve the problems of reduced data transmission efficiency and rate caused by decoding errors encountered in existing transmission methods.
[0023] On the one hand, an embodiment of the present invention provides a data transmission method based on the HTTP2 protocol, including: generating multiple sender requests, wherein each sender request includes a header frame and a request data frame, and the header frame includes multiple header fields; encoding each of the multiple header fields according to a coding format to form multiple encoded header fields as compressed header frames, wherein the coding format includes header field index format coding, header field incremental index with index name format coding, header field incremental index with text name format coding, header field non-index with index name format coding and header field non-index with text name format coding; sending the compressed header frame and the request data frame in each sender request to the receiving end separately and sequentially; and decoding each encoded header field in each sender request separately and sequentially according to the coding format, and starting a decoding exception repair mechanism when decoding fails.
[0024] 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 and data retransmission, thereby improving data transmission speed and efficiency, and being able to participate in subsequent processing such as XDR synthesis in a timely manner.
[0025] Based on the further improvement of the above method, each of the multiple encoded header fields is decoded in sequence according to the encoding format, and when the decoding fails, the decoding exception repair mechanism is started, which further includes: identifying the encoding format of an encoded header field; decoding the identified encoded header field based on the identified encoding format and judging whether the decoding is successful, wherein 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 state of the start table entry of the dynamic table is set to a non-packet loss state; when the decoding fails, the single header field decoding exception repair mechanism is started.
[0026] Based on further improvement of the above method, starting a single header field decoding exception repair mechanism further includes: when searching in the index table based on the index value and no record content corresponding to the index value is retrieved, determining that a header frame carrying a header field with the incremental index of the header field with an index name or the incremental index of the header field with a text name is lost on the TCP link associated with the dynamic table; and inserting an empty header field into the dynamic table according to the index value for use by a subsequent modification mechanism and setting the state of the table entry at the insertion position to a packet loss state, 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.
[0027] 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.
[0028] 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 exceptions in the header field list; and when there are header fields with decoding exceptions, starting a repair mechanism based on the 3GPP specification and normal decoding statistical structure.
[0029] 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 request data frame, determining multiple header fields in the header frame corresponding to the request data frame according to all information units in the request data frame; and repairing the header field with abnormal decoding according to the determined multiple header fields to restore the empty header field and modify the state of the table entry at the insertion position to a non-packet loss state.
[0030] 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, pre-storing multiple header fields of the successfully decoded header frame and the order in which the header fields appear; repairing the header field with the decoding abnormality according to the stored header fields and the order in which the header fields appear in the successfully decoded header frame.
[0031] Based on a further improvement of the above method, encoding each of the multiple header fields according to a coding format to form multiple encoded header fields as a compressed header frame further includes: querying the header field in a static table and a 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.
[0032] 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.
[0033] On the other hand, an embodiment of the present invention provides a data transmission device based on the HTTP2 protocol, comprising: a sending end and a receiving end, wherein the sending end comprises a request generation module, an encoding module and a transmission module, and the receiving end comprises a decoding module and a repair module, wherein the request generation module is used to generate multiple sending end requests, wherein each sending end request comprises a header frame and a request data frame, and the header frame comprises multiple header fields; the encoding module is used to encode each of the multiple header fields according to a coding format to form multiple encoded header fields as compressed header frames, wherein the The encoding formats include 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; the transmission module is used to transmit the compressed header frame and the request data frame in each sender request to the receiving end separately and sequentially; the decoding module is used to decode each encoded header field in each sender request separately and sequentially according to the encoding format; and the repair module is used to start the decoding exception repair mechanism when the decoding fails.
[0034] Compared with the prior art, the present invention can achieve at least one of the following beneficial effects:
[0035] 1. When decoding fails, the single header field decoding exception repair mechanism is started to avoid direct error return and data retransmission, thereby improving data transmission speed and efficiency, and being able to participate in subsequent processing such as XDR synthesis in a timely manner.
[0036] 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.
[0037] 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.
[0038] 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.
[0039] 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 achieved and obtained through the contents particularly pointed out in the description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] 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.
[0041] Figure 1 This is an example of using the HAPCK protocol to transmit information between the client and the server.
[0042] Figure 2 A block diagram of an existing header decoding method.
[0043] Figure 3 The figure is a flowchart of a data transmission method based on the HTTP2 protocol according to an embodiment of the present invention.
[0044] Figure 4 A diagram of the 5G network structure and related interface protocols.
[0045] Figure 5 4 is a flowchart of a header encoding method according to an embodiment of the present invention.
[0046] Figure 6 4 is a specific flow chart of the header decoding method according to an embodiment of the present invention.
[0047] Figure 7 4 is a block diagram of a data transmission device based on the HTTP2 protocol according to an embodiment of the present invention.
[0048] Figure 8 Diagram of the static table used by HPACK.
[0049] Fig. 9 Schematic diagram for HPACK header compression. DETAILED DESCRIPTION
[0050] 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.
[0051] In order to reduce the impact of the above factors on decoding and subsequent XDR synthesis, a check and repair mechanism is introduced to supplement the decoding and dynamic table mechanism, so as to decode as many normal header field lists as possible and resynchronize the dynamic table in the shortest possible time.
[0052] A specific embodiment of the present invention discloses a header decoding method. Figure 3 , a data transmission method based on HTTP2 protocol, comprising: in step S302, generating multiple sender requests, wherein each sender request includes a header frame and a request data frame, and the header frame includes multiple header fields; in step S304, encoding each of the multiple header fields according to a coding format to form multiple coded header fields as compressed header frames, wherein the coding format includes header field index format coding, header field incremental index with index name format coding, header field incremental index with text name format coding, header field non-index with index name format coding and header field non-index with text name format coding; in step S306, sending the compressed header frame and request data frame in each sender request to the receiving end respectively and sequentially; and in step S308, decoding each coded header field in each sender request respectively and sequentially according to the coding format, and starting a decoding abnormality repair mechanism when decoding fails.
[0053] 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 and data retransmission, thereby improving data transmission speed and efficiency, and being able to promptly participate in subsequent processing such as XDR synthesis (XDR synthesis: collecting and processing the full amount of data of 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 of the operator's communication network.
[0054] In the following, reference will be made to Figure 3 , each step of the data transmission method based on the HTTP2 protocol according to an embodiment of the present invention is described in detail.
[0055] In step S302, multiple sender requests are generated, wherein each sender request includes a header (HEADER) frame and a request data (DATA) frame, and the header frame includes multiple header fields. For example, a first sender request and a second sender request are generated, and the first sender request includes a HEADER1 frame and a DATA1 frame. The second sender request includes a HEADER2 frame and a DATA2 frame. 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.
[0056] In step S304, each of the plurality of header fields is encoded according to an encoding format to form a plurality of encoded header fields as a compressed header frame, 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. Encoding each of the plurality of header fields according to an encoding format to form a plurality of encoded header fields as a compressed header frame further includes: querying the header field in a static table and a 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 an encoding 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.
[0057] In step S306, the compressed header frame and request data frame in each sender request are sent to the receiving end in sequence. For example, first, a first sender request is sent to the receiving end, a second receiving end response is received from the receiving end, and a third sender request is sent to the receiving end, the first sender request includes a HEADER1 frame and a DATA1 frame. The second receiving end response includes a HEADER2 frame and a DATA2 frame. The third sender request includes a HEADER3 frame and a DATA3 frame. The header frame is sent in a compressed manner, and the request data frame is sent in a plain text manner.
[0058] In step S308, each coded header field in each sender request is decoded in sequence according to the coding format, and a decoding anomaly repair mechanism is started when decoding fails.
[0059] Specifically, each of the multiple coded header fields is decoded in sequence according to the coding format, and when the decoding fails, the decoding anomaly repair mechanism is started, which further includes: identifying the coding format of a coded header field; decoding the identified coded header field based on the identified coding format and judging whether the decoding is successful, wherein when the decoding is successful, the decoded header field is added to the header field list; and when the identified coding format is a header field incremental index with index name format encoding or a header field incremental index with text name format encoding, the decoded header field is inserted into the dynamic table and the state of the start table entry of the dynamic table is set to a non-packet loss state (for example, set to 0 by default); when the decoding fails, the single header field decoding anomaly repair mechanism is started. The state value of the table entry includes 0 and 1, and the default value 0 represents a non-packet loss state, and 1 represents a packet loss state.
[0060] Starting a single header field decoding anomaly repair mechanism further includes: when searching in the index table based on the index value and no record content corresponding to the index value is retrieved, determining that a header frame carrying a header field with an incremental index of a header field with an index name or a header field incremental index with a text name is lost on the TCP link associated with the dynamic table; and inserting an empty header field into the dynamic table according to the index value for use by a subsequent modification mechanism and setting the state of the table entry at the insertion position to a packet loss state, 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 a header field name and a header field value.
[0061] After the decoding of multiple coded 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 header fields with decoding abnormalities, 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: after receiving the request data frame, according to all information units in the request data frame, determining multiple header fields in the header frame corresponding to the request data frame; and according to the determined multiple header fields, repairing the header field with decoding abnormalities to restore the empty header field and modify the state of the table entry at the insertion position to a non-packet loss state. 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, pre-storing multiple header fields of the successfully decoded header frame and the order in which the header fields appear; repairing the header field with decoding abnormalities according to the stored header fields and the order in which the header fields appear in the successfully decoded header frame.
[0062] 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.
[0063] HTTP / 2 header compression principle
[0064] 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).
[0065] 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.
[0066] 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 8The 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.
[0067] 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.
[0068] refer to Fig. 9 The header compression principle diagram shows that the sender is ready to send the following 6 header fields:
[0069] 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:
[0070] 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.
[0071] If the four header fields in the HPACK header compression schematic above are:
[0072] 1)method:GET; 2):scheme:https; 3):host:example.com; 4)user-agent:Mozilla / 5.0, encoded as index values 2, 7, 63, 62, each occupying one byte.
[0073] 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.
[0074] 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.
[0075] 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 () is as shown in Table 3 below.
[0076] Table 3
[0077] Statie table
[0078] 1 2 … … … 51 refer … … … 62 eostom-hdr some-value 63 :path / resouree 64 User-agent Vozilla / 5.0 65 :host example
[0079] Dynamic table
[0080] 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.
[0081] refer to Figure 4 , the 5G core network subverts the traditional CT network architecture and protocols and introduces service-oriented interfaces.
[0082] The abbreviations of each network element are explained as follows:
[0083] AUSF: Authentication Server Function, authentication service function;
[0084] AMF: Access and Mobility Management Function, access and mobility management function;
[0085] SMF: Session Management Function, session management function;
[0086] NSSF: Network Slice Selection Function, network slice selection function;
[0087] UDM: Unified Data Management;
[0088] NEF: Network Exposure Function, network exposure function;
[0089] NRF: Network Repository Function, network registration function;
[0090] PCF: Policy Control Function, policy control function;
[0091] UPF: User Plane Function, user plane function;
[0092] AF: Application Function, application function;
[0093] DN: Data Network, data network;
[0094] 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.
[0095] 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.
[0096] refer to Figure 6 , the header decoding method is described in detail.
[0097] 1. Determine the encoding format of the header field.
[0098] 2. Decode the header field according to its encoding format.
[0099] 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.
[0100] Table 4
[0101] 62 User-agent Mozilla / 5.0 63 accept image / jgeg 64 :path / resource 65 :host example.com
[0102] 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 is as shown in Table 5.
[0103] Table 5
[0104] 62 :path / new_resource 63 User-agent Mozilla / 5.0 64 accept image / jgeg 65 :path / resource 66 :host example.com
[0105] 4. If the header field decoding fails, start the single header field decoding exception repair mechanism.
[0106] 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.
[0107] 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 from the beginning of the dynamic table, until there is a table 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 table 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 is shown in Table 6 below.
[0108] Table 6
[0109] 62 User-agent Mozilla / 5.0 63 accept image / jgeg 64 :path / resource 65 :host example.com
[0110] 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 is as shown in Table 7 below.
[0111] Table 7
[0112] 62 User-agent Mozilla / 5.0 63 64 accept image / jgeg 65 :path / resource 66 :host example.com
[0113] At this time, the value of index 66 is considered to be ":host:example.com" and the value of index 63 is empty content.
[0114] 5. After all header fields are decoded, check whether there are any header fields with decoding exceptions in the header field list.
[0115] 6. If there are abnormal header fields, start the repair mechanism based on the 3GPP specification.
[0116] (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.
[0117] 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.
[0118] For example, at the beginning, the dynamic table status is as shown in Table 8:
[0119] Table 8
[0120] 62 user--agent Mozilla / 5.0 63 method put 64 accept image / jgeg 65 :path / resource 66 :host example.com
[0121] 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. After the repair is performed, the dynamic table is shown in Table 9 below.
[0122] Table 9
[0123] 62 user--agent Mozilla / 5.0 63 64 accept image / jgeg 65 :path / resource 66 :host example.com
[0124] (2) Repair based on DATA frame
[0125] 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.
[0126] 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.
[0127] 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.
[0128] In the first example, according to the 3GPP specification, if all of the following information elements appear in the data message of the smf service:
[0129] -dnn
[0130] -vsmfId
[0131] -servingNetwork
[0132] -vsmfPduSessionUri
[0133] -vcnTunnelInfo
[0134] -anType
[0135] It can be confirmed that the service corresponding to the data is:
[0136] {apiRoot} / nsmf-pdusession / v1 / pdu-sessions
[0137] Thus, the headers frame corresponding to the data frame contains the following header fields:
[0138] -method: post
[0139] -content-length: length of data
[0140] -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)
[0141] -path: {apiRoot} / nsmf-pdusession / v1 / pdu-sessions
[0142] 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".
[0143] If the content of the dynamic table before decoding is as shown in Table 10 below.
[0144] Table 10
[0145] 62 user--agent Mozilla / 5.0 63 64 accept image / jgeg 65 :path / resource 66 :host example.com
[0146] Then the content of the dynamic table after repair is as shown in Table 11 below.
[0147] Table 11
[0148] 62 User-agent Mozilla / 5.0 63 content-type application / json 64 accept image / jgeg 65 :path / resource 66 :host example.com
[0149] 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:
[0150] -smfInstanceId
[0151] -pduSessionId
[0152] -singleNssai
[0153] -plmnId
[0154] It can be confirmed that the service corresponding to the data is:
[0155] / {ueId} / registrations / smf-registrations / {pduSessionId}
[0156] It can be obtained that the headers frame corresponding to the data frame must contain the following header fields:
[0157] -path: / {ueId} / registrations / smf-registrations / {pduSessionId}
[0158] -method: put
[0159] -content-length: length of data
[0160] -content-type:application / json
[0161] 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".
[0162] If the content of the dynamic table before decoding is as shown in Table 12 below.
[0163] Table 12
[0164] 62 user--agent Mozilla / 5.0 63 64 accept image / jgeg 65 :path / resource 66 :host example.com
[0165] Then the content of the dynamic table after repair is as shown in Table 13 below.
[0166] Table 13
[0167] 62 user--agent Mozilla / 5.0 63 content-type application / json 64 accept image / jgeg 65 :path / resource 66 :host example.com
[0168] 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:
[0169] -amfInstanceId
[0170] -imsVoPs
[0171] -deregCallbackUri
[0172] -guami
[0173] -ratType
[0174] 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).
[0175] It can be confirmed that the service corresponding to the data is:
[0176] / {ueId} / registrations / amf-non-3gpp-access
[0177] It can be obtained that the headers frame corresponding to the data frame must contain the following header fields:
[0178] -path: / {ueId} / registrations / amf-non-3gpp-access
[0179] -method: put
[0180] -content-length: length of data
[0181] -content-type:application / json
[0182] 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".
[0183] If the content of the dynamic table before decoding is as shown in Table 14 below.
[0184] Table 14
[0185] 62 user--agent Mozilla / 5.0 63 64 accept image / jgeg 65 :path / resource 66 :host example.com
[0186] Then the content of the repaired dynamic table is as shown in Table 15 below.
[0187] Table 15
[0188] 62 user--agent Mozilla / 5.0 63 method put 64 accept image / jgeg 65 :path / resource 66 :host example.com
[0189] 7. Start the statistical repair mechanism based on 3GPP network elements and PATH types
[0190] We believe that the header field content and header field order carried in the HEADER of the same PATH type in the same network element are basically the same.
[0191] 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.
[0192] The following examples illustrate scenarios that can be repaired using statistical results:
[0193] (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.
[0194] (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.
[0195] (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.
[0196] (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.
[0197] (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.
[0198] (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.
[0199] 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.
[0200] If we get statistics of / sm-contexts / sent by a certain IP address (IP1)
[0201] The most probable header fields in the HEADER frame of the {smContextRef} / modify service are in the following order:
[0202] 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.
[0203] Table 16
[0204] 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
[0205] Then there must be an abnormal dynamic table entry corresponding to the content-type header field index.
[0206] Through learning, we know that the order of appearance of the service header fields is 1): authority;
[0207] 2):method; 3):path; 4):scheme; 5):content-type. The probability of this sequence is very high. You can try to use this sequence to repair it. It can be considered that the value decoded from the header field index 68 is abnormal, and the entry corresponding to the index value 68 in the dynamic table is abnormal. The table entry with the index value 68 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.
[0208] Table 17
[0209] 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
[0210] The content of the dynamic table after repair is shown in Table 18 below.
[0211] Table 18
[0212] 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
[0213] 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.
[0214] If we get statistics of / sm-contexts / sent by a certain IP address (IP1)
[0215] The TOPN header field in the HEADER frame of the {smContextRef} / modify service is as shown in Table 19 below.
[0216] Table 19
[0217] 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%
[0218] 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.
[0219] Table 20
[0220] 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
[0221] 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.
[0222] Table 21
[0223] 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
[0224] The content of the dynamic table after repair is shown in Table 22 below.
[0225] Table 22
[0226] 62 : content-type application / json 63 user-agent Mozilla / 5.0 64 : path / nsmf-pdusession / y1 / sm-contexts / 1 / modify 65 : path / resource 66 : host example.com 67 accept image / jgeg 68 : authority 10.10.10.10:80
[0227] 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.
[0228] 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.
[0229] Table 23
[0230] 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
[0231] 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.
[0232] Through learning, we know that the service is similar to the header field sequence 1): authority; 2): method;
[0233] 3): path; 4): scheme; 5): content-type has a high probability of appearing, so you can try to repair it with this sequence; and you can assume that the value decoded from the header field index 62 is abnormal, so you can repair the table entry with the index value of 62: the table entry name is content-type; the table entry value is application / json.
[0234] The dynamic content before decoding is shown in Table 24 below.
[0235] Table 24
[0236] 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
[0237] The content of the dynamic table after repair is shown in Table 25 below.
[0238] Table 25
[0239] 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
[0240] Another specific embodiment of the present invention discloses a data transmission device based on HTTP2 protocol. Figure 7The data transmission device based on HTTP2 protocol includes: a sending end and a receiving end, wherein the sending end includes a request generation module 702, an encoding module 704 and a transmission module 706, and the receiving end includes a decoding module 708 and a repair module 710. The request generation module 702 is used to generate multiple sending end requests, wherein each sending end request includes a header frame and a request data frame, and the header frame includes multiple header fields. The encoding module 704 is used to encode each header field in the multiple header fields according to the encoding format to form multiple encoded header fields as compressed header frames, 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. The transmission module 706 is used to sequentially transmit the compressed header frame and request data frame in each sending end request to the receiving end. The decoding module 708 is used to sequentially decode each encoded header field in each sending end request according to the encoding format. The repair module 710 is used to start a decoding anomaly repair mechanism when decoding fails.
[0241] The data transmission device based on the HTTP2 protocol also includes a plurality of other modules. Since the data transmission method based on the HTTP2 protocol corresponds to the data transmission device based on the HTTP2 protocol, in order to avoid redundancy, detailed descriptions of the plurality of other modules are omitted in this article.
[0242] Compared with the prior art, the present invention can achieve at least one of the following beneficial effects:
[0243] 1. When decoding fails, the single header field decoding exception repair mechanism is started to avoid direct error return and data retransmission, thereby improving data transmission speed and efficiency, and being able to participate in subsequent processing such as XDR synthesis in a timely manner.
[0244] 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.
[0245] 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.
[0246] 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.
[0247] 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.
[0248] 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 data transmission method based on HTTP2 protocol, characterized in that: include: Generate a plurality of sender requests, wherein each sender request comprises a header frame and a request data frame, and the header frame comprises a plurality of header fields; Encoding each of the plurality of header fields according to an encoding format to form a plurality of encoded header fields as a compressed header frame, 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; Sequentially sending the compressed header frame and the request data frame in each sender request to the receiving end respectively; and Decode each encoded header field in each sender request separately and sequentially according to the encoding format, and start the decoding anomaly repair mechanism when the decoding fails, wherein each encoded header field in the multiple encoded header fields is decoded separately and sequentially according to the encoding format, and start the decoding anomaly repair mechanism when the decoding fails, further comprising: identifying the encoding format of an encoded header field; decoding the identified encoded header field based on the identified encoding format and judging whether the decoding is successful, wherein 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 state of the start table entry of the dynamic table is set to a non-packet loss state; when the decoding fails, start the single header field decoding anomaly repair mechanism; Among them, 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.
2. The data transmission method based on HTTP2 protocol according to claim 1, characterized in that: Starting a single header field decoding anomaly repair mechanism further includes: When searching in the index table based on the index value and no record content corresponding to the index value is retrieved, determining that a header frame carrying the header field with the header field incremental index with index name or the header field incremental index with text name is lost on the TCP link associated with the dynamic table; and According to the index value, an empty header field is inserted into the dynamic table for use by a subsequent modification mechanism and the state of the table entry at the insertion position is set to a packet loss state, 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.
3. The data transmission method based on HTTP2 protocol according to claim 2, characterized in that: After the decoding of the plurality of coded header fields is completed, the method further comprises: Checking whether there are any header fields with decoding abnormalities in the header field list; and When there is a header field with decoding anomaly, a repair mechanism based on the 3GPP specification and normal decoding statistics structure is initiated.
4. The data transmission method based on HTTP2 protocol according to claim 3, characterized in that: Initiating a repair mechanism based on 3GPP specifications and normal decoding statistics structure also includes: After receiving the request data frame, determining a plurality of header fields in the header frame corresponding to the request data frame according to all information units in the request data frame; and According to the determined multiple header fields, the header field with decoding abnormality is repaired to restore the empty header field and modify the state of the entry at the insertion position to a non-packet loss state.
5. The data transmission method based on HTTP2 protocol according to claim 3 or 4, 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, pre-storing multiple header fields of the successfully decoded header frame and the order in which the header fields appear; The header field with abnormal decoding is repaired according to the header fields in the successfully decoded header frame stored and the order in which the header fields appear.
6. The data transmission method based on HTTP2 protocol according to claim 1, characterized in that: Encoding each of the plurality of header fields according to the encoding format to form a plurality of encoded header fields as a compressed header frame further comprises: Look up header fields in static and dynamic tables; 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, 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.
7. The data transmission method based on HTTP2 protocol according to claim 6, 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.
8. A data transmission device based on HTTP2 protocol, characterized in that: include: A sending end and a receiving end, wherein the sending end includes a request generation module, an encoding module and a transmission module, and the receiving end includes a decoding module and a repair module, wherein, The request generation module is used to generate multiple sender requests, wherein each sender request includes a header frame and a request data frame, and the header frame includes multiple header fields; The encoding module is used to encode each of the multiple header fields according to an encoding format to form multiple encoded header fields as compressed header frames, 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; The transmission module is used to sequentially transmit the compressed header frame and the request data frame in each sending end request to the receiving end respectively; The decoding module is used to decode each encoded header field in each sender request separately and sequentially according to the encoding format, wherein the decoding module is also used to identify the encoding format of an encoded header field; decode the identified encoded header field based on the identified encoding format and determine whether the decoding is successful, wherein 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 a dynamic table and the state of the start table entry of the dynamic table is set to a non-packet loss state; and The repair module is used to start the decoding exception repair mechanism when decoding fails. The repair module is used to derive the header field name according to the header field value to modify the decoded header field and dynamic table when the decoded header field name and the header field value do not correspond, wherein the header field includes the header field name and the header field value.
