Message parsing method and device

By determining the message type in the HTTP message and parsing the message header, extracting the data in key=value format, the problem of low parsing efficiency of HTTP message nested format in the existing technology is solved, and more efficient packet analysis is achieved .

CN114124918BActive Publication Date: 2025-01-14BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111415195.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-25
Publication Date
2025-01-14
Estimated Expiration
2041-11-25

AI Technical Summary

Technical Problem

The existing HTTP message resolution scheme cannot perform detailed parsing of other nested format messages (such as key=value, XML, JSON, etc.), resulting in low parsing efficiency and error-prone.

Method used

By determining the message type in the received HTTP message, parsing the message header according to preset conditions and characters, the parsing results in key=value format are extracted, and stored as separate key=value format data.

Benefits of technology

It improves the parsing efficiency of HTTP packets, can parse nested other format packets in more detail, and reduces human analysis errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114124918B_ABST
    Figure CN114124918B_ABST
Patent Text Reader

Abstract

The present invention discloses a message parsing method and device, and relates to the field of mobile internet technology. The method comprises: when the received HTTP message is a standard HTTP message, determining the message type of the HTTP message according to whether a preset position in the HTTP message contains a preset message type identifier; when the message type of the HTTP message is a GET type, parsing the HTTP message to obtain a first message header; when it is determined according to preset conditions that the first message header contains a message in a key=value format, parsing the first message header according to preset characters to obtain at least one parsing result in a key=value format; the preset conditions contain characters that should exist in the message format, characters that cannot exist, and preset formats of preset variables; and storing the obtained parsing results in the key=value format as individual data in the key=value format. The message parsing efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of mobile internet technology, and in particular to a message parsing method and device. Background Art

[0002] This section is intended to provide a background or context to the embodiments of the invention recited in the claims. No admission is made that the description herein is prior art by inclusion in this section.

[0003] HTTP messages include standard HTTP messages and non-standard HTTP messages. At present, for the parsing of standard HTTP messages, the message can only be parsed into a message header or into two parts: a message header and a message body. However, HTTP messages often contain messages of other formats (such as messages in key=value, XML, JSON, etc.). Standard HTTP messages are divided into two types: one is a GET type HTTP message: it only contains a message header, and messages in the message header may be nested in the key=value format; the other is a non-GET type HTTP message: it contains a message header and a message body, wherein the message header contains normal message data in the HTTP message, and messages in the message body may be nested in key=value or XML or JSON format. The existing parsing scheme for HTTP messages cannot perform more detailed parsing of messages in other formats contained in HTTP messages, and requires manual analysis to obtain more detailed parsing results, which is labor-intensive, error-prone, and has low efficiency in HTTP message parsing. Summary of the invention

[0004] The embodiment of the present invention provides a message parsing method for further parsing messages of other formats embedded in HTTP messages to improve the parsing efficiency of HTTP messages. The method includes:

[0005] When the received HTTP message is a standard HTTP message, determining the message type of the HTTP message according to whether a preset position in the HTTP message contains a preset message type identifier;

[0006] When the message type of the HTTP message is a GET type, parsing the HTTP message to obtain a first message header;

[0007] When determining that the first message header contains a message in a key=value format according to a preset condition, the first message header is parsed according to preset characters to obtain at least one parsing result in a key=value format; wherein the preset condition includes characters that should exist in the message format, characters that cannot exist, and a preset format of a preset variable;

[0008] The obtained parsing results in the key=value format are stored as single data in the key=value format. The embodiment of the present invention also provides a message parsing device for further parsing messages of other formats nested in HTTP messages to improve the parsing efficiency of HTTP messages, the device comprising:

[0009] A message type determination module, used to determine the message type of the HTTP message according to whether a preset position in the HTTP message contains a preset message type identifier when the received HTTP message is a standard HTTP message;

[0010] A first parsing module, used for parsing the HTTP message to obtain a first message header when the message type of the HTTP message is a GET type;

[0011] A second parsing module is used to parse the first message header according to preset characters to obtain at least one parsing result in the key=value format when it is determined according to preset conditions that the first message header contains a message in the key=value format; wherein the preset conditions include characters that should exist in the message format, characters that cannot exist, and preset formats of preset variables;

[0012] The storage module is used to store the parsing results obtained in the key=value format as individual data in the key=value format.

[0013] An embodiment of the present invention further provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned message parsing method when executing the computer program.

[0014] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned message parsing method is implemented.

[0015] An embodiment of the present invention further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the above-mentioned message parsing method is implemented.

[0016] In an embodiment of the present invention, when the received HTTP message is a standard HTTP message, the message type of the HTTP message is determined according to whether the preset position in the HTTP message contains a preset message type identifier; when the message type of the HTTP message is a GET type, the HTTP message is parsed to obtain a first message header; when it is determined according to a preset condition that the first message header contains a message in a key=value format, the first message header is parsed according to preset characters to obtain at least one parsing result in a key=value format; wherein the preset condition includes characters that should exist in the message format, characters that cannot exist, and preset formats of preset variables; the obtained parsing results in the key=value format are stored as single data in the key=value format. In this way, messages of other formats nested in the HTTP message can be further parsed, thereby improving the parsing efficiency of the HTTP message. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0018] Figure 1 A flowchart of a message parsing method provided in an embodiment of the present invention;

[0019] Figure 2 A flowchart of a method for parsing the first message header according to preset characters to obtain at least one parsing result in a key=value format provided in an embodiment of the present invention;

[0020] Figure 3 A flowchart of a method for parsing a non-GET type message provided in an embodiment of the present invention;

[0021] Figure 4 A flowchart of a method for parsing a non-standard HTTP message provided in an embodiment of the present invention;

[0022] Figure 5 A schematic diagram of a message parsing device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0023] To make the purpose, technical solution and advantages of the embodiments of the present invention more clear, the embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings. Here, the exemplary embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.

[0024] The term "and / or" herein only describes an association relationship, indicating that three relationships may exist. For example, A and / or B may represent the following three situations: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C may represent including any one or more elements selected from the set consisting of A, B, and C.

[0025] In the description of this specification, the terms "include", "including", "have", "contain", etc. are all open terms, which mean including but not limited to. The descriptions with reference to the terms "one embodiment", "a specific embodiment", "some embodiments", "for example", etc. mean that the specific features, structures or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures or characteristics described may be combined in a suitable manner in any one or more embodiments or examples. The order of steps involved in each embodiment is used to schematically illustrate the implementation of the present application, and the order of steps is not limited and can be appropriately adjusted as needed.

[0026] According to research, HTTP messages include standard HTTP messages and non-standard HTTP messages. At present, for the parsing of standard HTTP messages, the message can only be parsed into a message header or into two parts: a message header and a message body. However, HTTP messages often contain messages of other formats (such as messages in key=value, XML, JSON, etc.). Standard HTTP messages are divided into two types: one is a GET type HTTP message: it only contains a message header, and messages in the message header may be nested in the key=value format; the other is a non-GET type HTTP message: it contains a message header and a message body, wherein the message header contains normal message data in the HTTP message, and messages in the message body may be nested in key=value or XML or JSON format. The existing parsing scheme for HTTP messages cannot perform more detailed parsing of messages in other formats contained in HTTP messages, and requires manual analysis to obtain more detailed parsing results, which is labor-intensive, error-prone, and has low efficiency in HTTP message parsing.

[0027] In view of the above research, an embodiment of the present invention provides a message parsing method, such as Figure 1 As shown, including:

[0028] S101: When the received HTTP message is a standard HTTP message, determine the message type of the HTTP message according to whether a preset position in the HTTP message contains a preset message type identifier;

[0029] S102: When the message type of the HTTP message is a GET type, parse the HTTP message to obtain a first message header;

[0030] S103: when it is determined according to a preset condition that the first message header contains a message in a key=value format, the first message header is parsed according to preset characters to obtain at least one parsing result in a key=value format; wherein the preset condition includes characters that should exist in the message format, characters that cannot exist, and a preset format of a preset variable;

[0031] S104: The obtained parsing results in the key=value format are stored as individual data in the key=value format.

[0032] In an embodiment of the present invention, when the received HTTP message is a standard HTTP message, the message type of the HTTP message is determined according to whether the preset position in the HTTP message contains a preset message type identifier; when the message type of the HTTP message is a GET type, the HTTP message is parsed to obtain a first message header; when it is determined according to a preset condition that the first message header contains a message in a key=value format, the first message header is parsed according to preset characters to obtain at least one parsing result in a key=value format; wherein the preset condition includes characters that should exist in the message format, characters that cannot exist, and preset formats of preset variables; the obtained parsing results in the key=value format are stored as single data in the key=value format. In this way, messages of other formats nested in the HTTP message can be further parsed, thereby improving the parsing efficiency of the HTTP message.

[0033] The above-mentioned S101 to S104 are described in detail below.

[0034] First, some terms in the embodiments of the present invention are described:

[0035] The standard HTTP message described in the embodiment of the present invention is an HTTP message containing only a message header or a message header and a message body, and the custom HTTP message is an HTTP message containing custom data other than a message header and a message body;

[0036] The standard HTTP message described in the embodiment of the present invention includes a GET type HTTP message and a non-GET type HTTP message; wherein, the GET type HTTP message only includes a message header, and the message header may include only normal HTTP message data, and may also embed messages in the key=value format; the non-GET type HTTP message includes a message header and a message body.

[0037] With respect to the above S101, when the received HTTP message is a standard HTTP message, the message type of the HTTP message is determined according to whether the preset position in the HTTP message contains a preset message type identifier. For example, the message type of the HTTP message is determined according to the first 3 bytes in the HTTP message. If the first three bytes of the HTTP message are "GET", it means that the HTTP message is a GET type HTTP message, otherwise, it means that the HTP message is a non-GET type.

[0038] With respect to the above S102, when the first three bytes in the HTTP message are "GET", the HTTP message is a GET type HTTP message, which only includes a message header but not a message body. The GET type HTTP message is parsed to obtain a first message header.

[0039] For the above S103, the preset conditions include characters that should exist in the message format, characters that cannot exist, and preset formats of preset variables. When determining that the first message header contains a message in the key=value format according to the preset conditions, for example, when it is determined that the symbol: "=" exists in the first message header, and the symbols: "<", "[", "{" do not exist, and the value corresponding to the variable after the symbol "=" is a letter or a number, it is determined that the first message header contains a message in the key=value format.

[0040] Specifically, Figure 2 As shown, a flowchart of a method for parsing the first message header according to preset characters to obtain at least one parsing result in a key=value format provided by an embodiment of the present invention includes:

[0041] S201: traverse the first message header, search for preset characters in the first message header string, and divide the first message header string at each preset character to obtain at least one substring.

[0042] Exemplarily, a message in the key=value format is separated by the character “&”, for example, “key1=value1&key2=value2&…”, and at least one substring is obtained from each preset character, for example, “key1=value1&”, “key2=value2&”….

[0043] S202: extracting the contents of each substring except the preset characters, and obtaining at least one parsing result in a key=value format.

[0044] Exemplarily, for the substring "key1=value1&", the content except "&" is extracted to obtain "key1=value1", and for the substring "key3=value3", "key3=value3" is directly extracted.

[0045] For the above S104, each variable in the message body and the corresponding value of each variable are stored as a single key=value format data. For example, after parsing the message "key1=value1&key2=value2&...", it is stored as "key1=value1", "key2=value2"...

[0046] In addition, when the received HTTP message is a standard HTTP message and the HTTP message contains a message body in addition to a message header, the HTTP message is a non-GET type HTTP message. The message header of the non-GET type HTTP message contains normal message data of the HTTP message, but the message body may embed messages in key=value format or XML format, or JSON format.

[0047] Therefore, if Figure 3 As shown, a flowchart of a method for parsing a non-GET type message provided by an embodiment of the present invention includes:

[0048] S301: When the message type of the HTTP message is non-GET type, parse the HTTP message to obtain a second message header and a message body.

[0049] S302: according to the message format nested in the message body, a corresponding parsing function is called to parse the message body to obtain the numerical value corresponding to each variable in the message body; wherein the message format nested in the message body includes: key=value format, or XML format, or JSON format.

[0050] Specifically, for example, it is determined according to a preset condition whether a message in another format is embedded in the message body. When a message in another format is embedded in the message body, a corresponding parsing function is called according to the message format embedded in the message body to parse the message body.

[0051] Here, the preset conditions include characters that should exist in the message format, characters that should not exist in the message format, and preset formats of preset variables. The preset conditions corresponding to each nested message format are different.

[0052] In one embodiment of the present invention, when a corresponding parsing function is called according to a message format nested in the message body to parse the message body and obtain the numerical values ​​corresponding to the variables in the message body, for example, when the message format nested in the message body is in the key=value format, the parsing function corresponding to the key=value format is called, and each line in the message body is taken out separately as a separate parsing result in the key=value format to obtain the numerical values ​​corresponding to the variables in each line.

[0053] Here, the message in the key=value format nested in the message body has a "key=value" string in each line, for example, the first line is "key1=value1", the second line is "key2=value2"...

[0054] In another embodiment of the present invention, when a corresponding parsing function is called according to a message format nested in the message body to parse the message body to obtain a numerical value corresponding to each variable in the message body, for example, when the message format nested in the message body is in JSON format, reserved characters and parsing rules are set in JavaCC according to the characters in the JSON format message to generate a parsing function; the parsing function is called to parse the message body string to obtain a numerical value corresponding to each variable in the message body.

[0055] The parsing function for parsing the message in XML format can directly call the existing Java standard library function, which will not be described in detail here.

[0056] S303: Store each variable in the message body and the value corresponding to each variable as a single data in the key=value format.

[0057] In addition, non-standard HTTP messages are composed of custom data and standard HTTP messages. Existing analysis of non-standard HTTP messages cannot analyze the custom data part.

[0058] Therefore, if Figure 4 As shown, it is a flowchart of a method for parsing a non-standard HTTP message provided by an embodiment of the present invention, including:

[0059] S401: when the received HTTP message is a non-standard HTTP message, extract a substring of preset digits from a preset position in the HTTP message string according to a pre-agreed non-standard HTTP message generation rule to obtain custom data and a standard HTTP message;

[0060] S402: parsing the custom data according to a pre-agreed non-standard HTTP message parsing rule to obtain a value corresponding to each variable in the custom data; wherein the non-standard HTTP message parsing rule is obtained according to a non-standard HTTP message generation rule;

[0061] S403: storing each variable in the user-defined data and the value corresponding to each variable as a single data in the key=value format.

[0062] The present invention also provides a message parsing device, as described in the following embodiments. Since the principle of solving the problem by the device is similar to that of the message parsing method, the implementation of the device can refer to the implementation of the message parsing method, and the repeated parts will not be repeated.

[0063] like Figure 5 As shown, a message parsing device provided by an embodiment of the present invention includes: a message type determination module 501, a first parsing module 502, a second parsing module 503, and a storage module 504; wherein,

[0064] The message type determination module 501 is used to determine the message type of the HTTP message according to whether a preset position in the HTTP message contains a preset message type identifier when the received HTTP message is a standard HTTP message;

[0065] A first parsing module 502, configured to parse the HTTP message to obtain a first message header when the message type of the HTTP message is a GET type;

[0066] The second parsing module 503 is used to parse the first message header according to preset characters to obtain at least one parsing result in the key=value format when it is determined according to preset conditions that the first message header contains a message in the key=value format; wherein the preset conditions include characters that should exist in the message format, characters that cannot exist, and preset formats of preset variables;

[0067] The storage module 504 is used to store the obtained parsing results in the key=value format as individual data in the key=value format.

[0068] In a possible implementation, the second parsing module is specifically used to traverse the first message header, search for preset characters in the first message header string, split the first message header string at each preset character to obtain at least one substring, extract the content of each substring except the preset characters, and obtain at least one parsing result in key=value format.

[0069] In a possible implementation, it further includes: a third parsing module, which is used to parse the HTTP message when the message type of the HTTP message is non-GET type, to obtain a second message header and a message body; call the corresponding parsing function according to the message format nested in the message body to parse the message body, to obtain the numerical value corresponding to each variable in the message body; wherein the message format nested in the message body includes: key=value format, or XML format, or JSON format; the storage module is also used to store each variable in the message body and the numerical value corresponding to each variable as a single key=value format data.

[0070] In one possible implementation, the third parsing module is specifically used to call the parsing function corresponding to the key=value format when the message format nested in the message body is in the key=value format, and to take out each line in the message body separately as a separate parsing result in the key=value format to obtain the numerical value corresponding to the variable in each line.

[0071] In a possible implementation, the third parsing module is specifically used for setting reserved characters and parsing rules in JavaCC according to the characters in the JSON format message when the message format is nested in the message body, and generating a parsing function; calling the parsing function to parse the message body string to obtain the numerical values ​​corresponding to the variables in the message body.

[0072] In a possible implementation, it further includes: a fourth parsing module, which is used to extract a substring of preset digits from a preset position in the HTTP message character string according to a pre-agreed non-standard HTTP message generation rule when the received HTTP message is a non-standard HTTP message, so as to obtain custom data and a standard HTTP message; according to the pre-agreed non-standard HTTP message parsing rule, the custom data is parsed to obtain the numerical value corresponding to each variable in the custom data; wherein the non-standard HTTP message parsing rule is obtained according to the non-standard HTTP message generation rule; and the storage module is further used to store each variable in the custom data and the numerical value corresponding to each variable as a single data in the key=value format.

[0073] An embodiment of the present invention further provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned message parsing method when executing the computer program.

[0074] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned message parsing method is implemented.

[0075] An embodiment of the present invention further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the above-mentioned message parsing method is implemented.

[0076] In an embodiment of the present invention, when the received HTTP message is a standard HTTP message, the message type of the HTTP message is determined according to whether the preset position in the HTTP message contains a preset message type identifier; when the message type of the HTTP message is a GET type, the HTTP message is parsed to obtain a first message header; when it is determined according to a preset condition that the first message header contains a message in a key=value format, the first message header is parsed according to preset characters to obtain at least one parsing result in a key=value format; wherein the preset condition includes characters that should exist in the message format, characters that cannot exist, and preset formats of preset variables; the obtained parsing results in the key=value format are stored as single data in the key=value format. In this way, messages of other formats nested in the HTTP message can be further parsed, thereby improving the parsing efficiency of the HTTP message.

[0077] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0078] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0079] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0080] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0081] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A message parsing method, characterized in that: include: When the received HTTP message is a standard HTTP message, determining the message type of the HTTP message according to whether a preset position in the HTTP message contains a preset message type identifier; When the message type of the HTTP message is a GET type, parsing the HTTP message to obtain a first message header; When determining that the first message header contains a message in a key=value format according to a preset condition, the first message header is parsed according to preset characters to obtain at least one parsing result in a key=value format; wherein the preset condition includes characters that should exist in the message format, characters that cannot exist, and a preset format of a preset variable; The obtained parsing results in the key=value format are stored as individual data in the key=value format; Also includes: When the received HTTP message is a non-standard HTTP message, according to a pre-agreed non-standard HTTP message generation rule, a substring of preset digits is extracted from a preset position in the HTTP message string to obtain custom data and a standard HTTP message; According to the pre-agreed non-standard HTTP message parsing rules, the custom data is parsed to obtain the values ​​corresponding to the variables in the custom data; wherein the non-standard HTTP message parsing rules are obtained according to the non-standard HTTP message generation rules; Each variable in the custom data and the value corresponding to each variable are stored as a single key=value format data.

2. The message parsing method according to claim 1, characterized in that: The first message header is parsed according to preset characters to obtain at least one parsing result in a key=value format, including: Traversing the first message header, searching for a preset character in the first message header string, and dividing the first message header string at each preset character to obtain at least one substring; The content except the preset characters in each substring is extracted to obtain at least one parsing result in a key=value format.

3. The message parsing method according to claim 1, characterized in that: Also includes: When the message type of the HTTP message is non-GET type, parsing the HTTP message to obtain a second message header and a message body; According to the message format nested in the message body, the corresponding parsing function is called to parse the message body to obtain the numerical value corresponding to each variable in the message body; wherein the message format nested in the message body includes: key=value format, or XML format, or JSON format; Each variable in the message body and the value corresponding to each variable are stored as a single key=value format data.

4. The message parsing method according to claim 3, characterized in that: According to the message format embedded in the message body, the corresponding parsing function is called to parse the message body to obtain the value corresponding to each variable in the message body, including: When the message format nested in the message body is key=value format, the parsing function corresponding to the key=value format is called, and each line in the message body is taken out separately as a separate parsing result in the key=value format to obtain the value corresponding to the variable in each line.

5. The message parsing method according to claim 3, characterized in that: According to the message format embedded in the message body, the corresponding parsing function is called to parse the message body to obtain the value corresponding to each variable in the message body, including: When the message format embedded in the message body is in JSON format, reserved characters and parsing rules are set in JavaCC according to the characters in the JSON format message to generate a parsing function; Call the parsing function to parse the message body string and obtain the numerical value corresponding to each variable in the message body.

6. A message parsing device, characterized in that: include: A message type determination module, used to determine the message type of the HTTP message according to whether a preset position in the HTTP message contains a preset message type identifier when the received HTTP message is a standard HTTP message; A first parsing module, used for parsing the HTTP message to obtain a first message header when the message type of the HTTP message is a GET type; A second parsing module is used to parse the first message header according to preset characters to obtain at least one parsing result in the key=value format when it is determined according to preset conditions that the first message header contains a message in the key=value format; wherein the preset conditions include characters that should exist in the message format, characters that cannot exist, and preset formats of preset variables; A storage module, used to store the parsing results obtained in the key=value format as individual data in the key=value format; The system further comprises: a fourth parsing module, which is used to extract a substring of preset digits from a preset position in the HTTP message string according to a pre-agreed non-standard HTTP message generation rule when the received HTTP message is a non-standard HTTP message, so as to obtain custom data and a standard HTTP message; and parse the custom data according to the pre-agreed non-standard HTTP message parsing rule to obtain a value corresponding to each variable in the custom data; wherein the non-standard HTTP message parsing rule is obtained according to the non-standard HTTP message generation rule; The storage module is also used to store each variable in the custom data and the value corresponding to each variable as a single data in the key=value format.

7. The message parsing device according to claim 6, characterized in that: The second parsing module is specifically used to traverse the first message header, search for preset characters in the first message header string, split the first message header string at each preset character to obtain at least one substring, extract the content of each substring except the preset characters, and obtain at least one parsing result in key=value format.

8. The message parsing device according to claim 6, characterized in that: Also includes: A third parsing module, used for parsing the HTTP message to obtain a second message header and a message body when the message type of the HTTP message is non-GET type; According to the message format nested in the message body, the corresponding parsing function is called to parse the message body to obtain the numerical value corresponding to each variable in the message body; wherein the message format nested in the message body includes: key=value format, or XML format, or JSON format; The storage module is also used to store each variable in the message body and the value corresponding to each variable as a single data in the key=value format.

9. The message parsing device according to claim 8, characterized in that: The third parsing module is specifically used to call the parsing function corresponding to the key=value format when the message format nested in the message body is in the key=value format, and take out each line in the message body separately as a separate parsing result in the key=value format to obtain the numerical value corresponding to the variable in each line.

10. The message parsing device according to claim 8, characterized in that: The third parsing module is specifically used for setting reserved characters and parsing rules in JavaCC according to characters in the JSON format message when the message format embedded in the message body is in JSON format, and generating a parsing function; Call the parsing function to parse the message body string and obtain the numerical value corresponding to each variable in the message body.

11. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 5 is implemented.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.

13. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.