A message analysis method, a message analyzer, a computer program product and a storage medium
Patent Information
- Application Number
- CN202510413398.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-02
- Publication Date
- 2026-10-16
AI Technical Summary
[0003]目前,报文解析器在面对灵活多变的网络环境或协议类型时,经常出现解析错误或解析不完整等问题,导致报文解析器的解析质量不佳,影响解析效果
[0014] This application also provides a computer program product, including a computer program that, when executed by one or more processors, causes the one or more processors to perform the aforementioned message parsing method.
Smart Images

Figure CN122933798A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of network technology, and in particular to a message parsing method, a message parser, a computer program product, and a storage medium. Background Technology
[0002] Packet parsing is the process of breaking down and analyzing received network packets to extract valuable information, enabling network devices or applications to understand and process the packets. Packet parsers can parse network packets through multiple parsing levels.
[0003] Currently, message parsers often encounter problems such as parsing errors or incomplete parsing when faced with flexible and ever-changing network environments or protocol types, resulting in poor parsing quality and affecting parsing performance. Summary of the Invention
[0004] This application provides a message parsing method, a message parser, a computer program product, and a storage medium to improve the message parsing quality of the message parser.
[0005] This application provides a message parsing method applicable to a message parser, wherein the message parser is configured with multiple parsing levels, and the method includes:
[0006] In response to receiving a target message to be parsed, the message header corresponding to the target message is extracted;
[0007] According to the information source configured for the target parsing level, the jump reference information is obtained. The information sources that can be configured in the message parser include the message information extracted in the current parsing level for jump judgment, as well as additional information maintained in the message parser that is not present in the current parsing level.
[0008] Based on the jump reference information obtained for the target parsing level, a jump judgment is made to determine the next parsing level for the packet header;
[0009] The target parsing level is any parsing level within the message parser used to parse the message header.
[0010] This application also provides a message parser, including a memory, a processor, and a communication component;
[0011] The memory is used to store one or more computer instructions;
[0012] The processor is coupled to the memory and the communication component and is used to execute one or more computer instructions to perform the aforementioned message parsing method.
[0013] This application also provides a computer-readable storage medium for storing a computer program, which, when executed by one or more processors, causes the one or more processors to perform the aforementioned message parsing method.
[0014] This application also provides a computer program product, including a computer program that, when executed by one or more processors, causes the one or more processors to perform the aforementioned message parsing method.
[0015] This application proposes a message parsing scheme and designs a novel jump determination mechanism from the perspective of parsing layers. This jump determination mechanism introduces multiple information sources, enabling the parsing layers to obtain various jump reference information. These information sources include not only the message information extracted from the parsing layers for jump determination but also rich additional information. By flexibly configuring preset rules in the message parser, the parser can maintain additional information flexibly for various network environments and protocol types, thereby providing more useful jump reference information for different application scenarios, rather than being limited to the message information extracted from the parsing layers for jump determination. Based on this, jump determination of the parsing layers can be performed more comprehensively and refinedly based on the jump reference information obtained from multiple information sources. This effectively ensures that the determined next parsing layer can fully adapt to the application scenario in which the message is located, thus ensuring that each parsing layer participating in parsing the target message can effectively adapt to the message parsing requirements of the target message's application scenario. Accordingly, in this embodiment of the application, by introducing jump reference information from multiple sources as the basis for judging jumps between parsing levels, more flexible and reasonable parsing level jumps can be achieved, thereby effectively adapting to the flexible and ever-changing message parsing requirements in different application scenarios, and thus ensuring the quality of message parsing in different application scenarios. Attached Figure Description
[0016] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0017] Figure 1 A flowchart illustrating a message parsing method provided for an exemplary embodiment of this application;
[0018] Figure 2 A logical schematic diagram of a message parsing method provided for an exemplary embodiment of this application;
[0019] Figure 3 A schematic diagram of the internal logic structure of a message parser provided for an exemplary embodiment of this application;
[0020] Figure 4 A schematic diagram of an application scenario provided for an exemplary embodiment of this application;
[0021] Figure 5 This is a schematic diagram of the structure of a message parser provided for another exemplary embodiment of this application. Detailed Implementation
[0022] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0023] It should be noted that, in the cases involving user information in the embodiments of this application, the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the embodiments of this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse. In addition, the various models involved in this application (including but not limited to language models or large models) comply with relevant laws and standards.
[0024] Before proceeding with a detailed description of the technical solutions provided in the various embodiments of this application, the following is a brief explanation of several technical concepts involved in this application.
[0025] Message parsing is the process of breaking down and analyzing received network messages to extract valuable information, enabling network devices or applications to understand and process the messages.
[0026] A packet parser can parse network packets through multiple parsing levels. This article mainly focuses on programmable packet parsers. A programmable packet parser is a tool that can analyze, process, and transform input packets according to user-defined rules and algorithms.
[0027] A message hierarchy can be understood as the logical layers in the message header structure, divided according to different functions and protocol specifications, and is usually adapted to the hierarchical structure of the network model. Typical message sub-layers can be divided into physical layer, data link layer, network layer, transport layer, session layer, presentation layer, and application layer, etc., but further examples will not be given here.
[0028] Parsing hierarchy can be understood as a progressive, phased processing method or logical step used when parsing a message. In other words, a message parser can set up a processing flow for message parsing, and the parsing hierarchy can be understood as the processing steps in that flow.
[0029] The jump decision between parsing levels can be understood as a means to advance the parsing process. After completing any parsing level, a jump decision can be made to determine the next parsing level, thus forming the message parsing processing flow.
[0030] As described in the background section, network environments and protocol types are becoming increasingly diverse, with more and more emerging protocols. This leads to increasingly flexible and diverse parsing requirements for packet parsers. However, it is clear that current packet parsers cannot cope with such diverse parsing requirements, often resulting in parsing errors or incomplete parsing, poor packet parsing quality, and affecting the effectiveness of packet parsing.
[0031] In response, this application proposes a message parsing scheme. The basic idea is to design a new jump judgment mechanism from the perspective of parsing level, so as to ensure that the parsing level to which the jump is made can fully adapt to the message parsing requirements of the application scenario when facing different application scenarios, thereby ensuring the message parsing quality in different application scenarios.
[0032] The technical solutions provided by the various embodiments of this application are described in detail below with reference to the accompanying drawings.
[0033] Figure 1 The following is a flowchart illustrating a message parsing method provided as an exemplary embodiment of this application. Figure 2 This is a logical schematic diagram of a message parsing method provided for an exemplary embodiment of this application. The method can be executed by a message parser, see reference... Figure 1 The method may include:
[0034] Step 100: In response to receiving the target message to be parsed, obtain the message header corresponding to the target message;
[0035] Step 101: Obtain jump reference information according to the information source configured for the target parsing level. The information sources that can be configured in the message parser include the message information extracted in the current parsing level for jump judgment, as well as additional information maintained by the message parser that is not present in the current parsing level.
[0036] Step 102: Based on the jump reference information obtained for the target parsing level, perform a jump judgment to determine the next parsing level for the packet header.
[0037] refer to Figure 2In this embodiment, the target packet can be any network packet that needs to be parsed and passed into the packet parser. This embodiment does not limit the packet type, protocol type, or network environment of the target packet. It supports processing network packets under various network environments and protocol types, and does not limit the application scenario of the target packet. Exemplary application scenarios will be provided later, and the adaptability of the packet parsing scheme provided in this embodiment to different application scenarios will be explained.
[0038] refer to Figure 1 In step 100, after receiving the target message, the message header corresponding to the target message can be obtained. The message header is a segment of data with a specific structure located at the beginning of the message. It contains various key information about the message and is used to guide the transmission, processing, and parsing of the message. It can be understood that the message header of the target message is the actual parsing object during message parsing in this embodiment.
[0039] Figure 3 This is a schematic diagram of the internal logic structure of a message parser provided for an exemplary embodiment of this application. (Reference) Figure 3 In this embodiment, the message parser may include a message header caching component. The message header caching component is responsible for executing step 100 and caching the message header extracted from the target message as the actual parsing object in this embodiment.
[0040] In this embodiment, multiple parsing levels can be configured in the message parser. Furthermore, this embodiment proposes supporting the application of multiple parsing levels to a single message level; that is, a single message level can be parsed through multiple parsing levels.
[0041] As mentioned earlier, this embodiment designs a new jump judgment mechanism from the perspective of parsing hierarchy; that is, the jump judgment perspective in this embodiment is the parsing hierarchy. Thus, in this embodiment, during the parsing of each message hierarchy, jump optimization between multiple parsing hierarchies under a message hierarchy can be achieved, and jump optimization between message hierarchies can be achieved by optimizing jumps between parsing hierarchies at message hierarchy boundaries.
[0042] The following section will use the target parsing level in the message parser used to parse the aforementioned message header as an example to explain the jump determination mechanism proposed in this embodiment. It is understood that the target parsing level can be any parsing level in the message parser used to parse the message header.
[0043] The jump determination mechanism proposed in this embodiment may include two stages: a jump reference information acquisition stage and a jump determination stage.
[0044] Continue to refer to Figure 1 Based on step 101, in the jump reference information acquisition step proposed in this embodiment, the jump reference information can be obtained according to the information source configured for the target parsing level used to parse the message header.
[0045] In this embodiment, it is supported to flexibly configure the information source for different parsing levels in the message parser.
[0046] refer to Figure 3 In this embodiment, the message parser may include a software configuration component, which is responsible for the flexible configuration of the message parser. This software configuration component provides a configuration interface to respond to relevant configuration operations for the message parser, thereby enabling flexible configuration of the message parser. Based on this, this embodiment proposes that the message parser can be configured with different parsing levels for different application scenarios. Furthermore, it also supports flexible configuration of parsing instruction information for different parsing levels to fully adapt to their corresponding application scenarios. Each parsing level corresponds to one parsing instruction, which may include the processing rules and actions required to be followed at the corresponding parsing level.
[0047] Based on this, optionally, in this embodiment, the information source can be pre-configured in the parsing instruction information corresponding to the target parsing level. When the message parser executes the parsing instruction information corresponding to the target parsing level for the above message header, it can know the information source that needs to be paid attention to, and obtain the jump reference information for the target parsing level from the information source that needs to be paid attention to.
[0048] In this embodiment, the information sources configured for the target parsing level can be one or more. In this embodiment, the information sources that can be configured in the message parser can include at least: message information extracted within the current parsing level for jump determination, and additional information maintained by the message parser that is not present in the current parsing level.
[0049] refer to Figure 3 In this embodiment, the message parser may include a message information extraction component. This component can be used to extract message information for jump determination within the current parsing level. Based on this, when the parsing instruction information corresponding to the target parsing level is executed for the aforementioned message header (i.e., the target parsing level is the current parsing level), the message information extraction component can extract the relevant message information from the message header according to the message information for jump determination indicated in the parsing instruction information.
[0050] In this embodiment, the message parser can maintain additional information according to preset rules. This additional information is a new type of information source introduced in the jump judgment mechanism. Additional information can be understood as information not configured in the parsing instruction information corresponding to the current parsing level, and not extracted from the parsed message by the current parsing level. In this embodiment, the additional information can be generated in other parsing levels for the same message, generated during the parsing of other messages, or generated by the message parser through pre-configuration. Here, the method of generating additional information in this embodiment is not limited. As mentioned above, this embodiment supports flexible configuration of the message parser. (Refer to...) Figure 3 The aforementioned software configuration components can support configuring preset rules in the message parser for maintaining additional information.
[0051] Furthermore, the additional information in this embodiment can be further subdivided into more information types as needed. Correspondingly, the aforementioned preset rules can include maintenance rules designed for different information types. These maintenance rules can be designed within the aforementioned parsing instruction information for the parsing level, or they can be designed into separate configuration information within the message parser. This embodiment does not limit the maintenance rules subdivided from the aforementioned preset rules or the design location of the maintenance rules, and can be flexibly designed according to different application scenarios. This will be explained in detail in the embodiments below.
[0052] It is understood that, in this embodiment, by flexibly configuring the aforementioned preset rules in the message parser, additional information can be maintained in the message parser, and this additional information can effectively cover diverse application scenarios. Furthermore, in this embodiment, the required information sources can be flexibly configured for the parsing layers in the message parser to fully adapt to the application scenarios corresponding to the parsing layers, thereby additionally obtaining information that was not extracted within the parsing layers but is closely related to the jump judgment in the application scenario where the message is located.
[0053] As can be seen, in this embodiment, preset rules for maintaining additional information can be flexibly configured, as can information sources that need to be focused on in different parsing levels. Through the flexible configuration of these two aspects, and their mutual cooperation, richer, more comprehensive and more suitable jump reference information for the target parsing level can be obtained in step 101.
[0054] Continue to refer to Figure 1 Based on step 102, in the jump judgment step proposed in this embodiment, a jump judgment can be made based on the jump reference information obtained for the target parsing level, so as to determine the next parsing level for the above message header.
[0055] Since multi-source jump reference information can be obtained for the target parsing layer in step 101, a more comprehensive and refined jump judgment can be achieved when performing the jump judgment in step 102. The target parsing layer is also determined according to the jump judgment mechanism proposed in this embodiment. Therefore, the target parsing layer is adapted to the application scenario of the target message; and the information sources configured for the target parsing layer are also adapted to the application scenario corresponding to the target parsing layer. Therefore, it can be ensured that the multi-source jump reference information obtained for the target parsing layer is adapted to the application scenario of the target message, and thus it can be ensured that the next parsing layer determined accordingly is adapted to the application scenario of the target message.
[0056] As can be seen, in this embodiment, during the jump determination, not only is the compatibility between the next parsing level and the message information extracted by the target parsing level itself evaluated, but also the compatibility between the next parsing level and the message parsing requirements in the application scenario where the target message is located is evaluated. Therefore, with the guarantee of compatibility in both aspects, the compatibility of the next parsing level determined in step 102 with the application scenario where the target message is located can be effectively improved, thereby effectively ensuring the message parsing quality of the next parsing level for the target message.
[0057] refer to Figure 3 The message parser may include a parsing instruction information reading component. After determining the next parsing level, the parsing instruction information reading component can read the parsing instruction information corresponding to the next parsing level and execute the parsing instruction information, thereby continuing to parse the above message header.
[0058] It is understood that in this embodiment, a loop logic can be formed between steps 101 and 102. That is, if the next parsing level determined in step 102 is not the last parsing level of the above-mentioned message header, steps 101 and 102 can be executed again until the next parsing level determined in step 102 is the last parsing level of the above-mentioned message header, at which point the loop can be stopped.
[0059] In this embodiment, the implementation of determining whether the next parsing level determined in step 102 is the last parsing level for the aforementioned message header is not limited. In one optional embodiment, a parsing progress pointer management component can be deployed in the message parser. After the next parsing level determined in step 102 completes the parsing process for the aforementioned message header, the parsing progress pointer management component can update the progress pointer in the message header. If the progress pointer points to the end of the message header, it can be determined that the next parsing level is the last parsing level for the aforementioned message header, and the above loop can be stopped. Of course, this embodiment is not limited to this, and examples of more optional solutions are not provided here.
[0060] In addition, in this embodiment, the target domain segment indicated in the domain segment extraction rule can be extracted from the packet header according to the domain segment extraction rule configured for the target parsing level; and the target domain segment can be written into the packet header vector corresponding to the target packet according to the write position indicated for the target domain segment in the domain segment extraction rule.
[0061] A segment is a specific area within a packet header, which can contain one or more fields. For example, an Ethernet packet's header might contain an Ethernet segment, which could include fields such as the source Media Access Control (MAC) address, destination MAC address, and protocol type. The Packet Header Vector (PHV) is a data structure used in network packet processing to store header and metadata fields. The PHV is crucial for network devices to understand the packet's origin, destination, and the protocol used, forming the basis for subsequent packet processing and forwarding. Furthermore, since the capacity of the PHV in a network device is typically limited, effectively utilizing the PHV and appropriately incorporating extracted segments from the header into it is an important issue.
[0062] In this regard, since the aforementioned jump judgment mechanism in this embodiment can ensure that the resolution layer to which the jump is made can fully adapt to the application scenario of the target packet, the domain segment extraction rules configured in the resolution layer to which the jump is made will fully adapt to the application scenario of the target packet. Therefore, according to these domain segment extraction rules, it can be ensured that the domain segments extracted from the packet header are written into the packet header vector more reasonably, thereby ensuring that the constructed packet header vector can fully adapt to the packet processing needs of the network device in the corresponding application scenario, and thus improve the packet processing performance of the network device.
[0063] In summary, this embodiment proposes a message parsing scheme and designs a novel jump determination mechanism from the perspective of parsing layers. This jump determination mechanism introduces multiple information sources, enabling the parsing layers to obtain various jump reference information. These information sources include not only the message information extracted from the parsing layers for jump determination but also rich additional information. By flexibly configuring preset rules in the message parser, the parser can maintain additional information for various network environments and protocol types, thus providing more useful jump reference information for different application scenarios, rather than being limited to the message information extracted from the parsing layers for jump determination. Based on this, jump determination of the parsing layers can be performed more comprehensively and refinedly based on the jump reference information obtained from multiple information sources. This effectively ensures that the determined next parsing layer can fully adapt to the application scenario in which the message is located, thereby ensuring that each parsing layer participating in parsing the target message can effectively adapt to the message parsing requirements of the target message's application scenario. Accordingly, in this embodiment, by introducing jump reference information from multiple sources as the basis for judging jumps between parsing levels, more flexible and reasonable parsing level jumps can be achieved, thereby effectively adapting to the flexible and ever-changing message parsing requirements in different application scenarios, and thus ensuring the quality of message parsing in different application scenarios.
[0064] In the above or following embodiments, various implementation methods can be adopted in the jump determination stage. One optional implementation method is provided below.
[0065] In this optional implementation, it is proposed that: the jump reference information obtained for the target parsing level can be processed according to the jump reference information processing rules configured for the target parsing level to obtain the jump matching information corresponding to the target parsing level; from the multiple parsing levels configured in the message parser, a parsing level that matches the jump matching information is searched and used as the next parsing level for parsing the message header; wherein the obtained jump matching information satisfies the matching requirements configured within the searched parsing level.
[0066] refer to Figure 3 The message parser may include a jump matching information building component, which is used to build jump matching information for the parsing layers in the message parser.
[0067] In this embodiment, flexible configuration of jump reference information processing rules for different parsing levels is supported in the message parser. The jump reference information processing rules may include processing operations to be performed on the acquired jump reference information. The processing operations supported in this embodiment may include, but are not limited to, arbitration, combination, and performing calculations according to configured operators. Arbitration can be understood as resolving information conflicts according to a preset strategy when conflicts exist. Combination can be understood as combining multiple jump reference information together. The operators supported in this embodiment may include, but are not limited to, arithmetic operators, comparison operators, and mapping operators, etc., without further examples. Furthermore, this embodiment supports flexible setting of operator combinations in the jump reference information processing rules to define processing actions. Here, operator combination can be understood as flexibly combining multiple operators together to form a calculation expression, into which multiple jump reference information can be substituted to produce a calculation result.
[0068] Based on this, in this optional implementation, a jump reference information processing rule that is adapted to the application scenario corresponding to the target parsing level can be configured, so that when making a jump judgment on the target parsing level, the obtained jump reference information can be processed reasonably, thereby ensuring that the obtained jump matching information can be adapted to the application scenario corresponding to the target parsing level and obtain a more suitable jump judgment basis.
[0069] For example, if the target parsing layer corresponds to a fragmented packet application scenario, a "combination" operation can be set in the jump reference information rules configured for the target parsing layer. This allows for the combination of packet information from multiple jump references to obtain jump matching information when determining a jump at the target parsing layer. This jump matching information is better suited to fragmented packet application scenarios, improving the accuracy of jump determination. This is because, in fragmented packet application scenarios, the "combination" operation effectively addresses the issue of incomplete packet information during fragmented packet parsing, ensuring that the jump matching information contains more comprehensive packet information, thus enabling more accurate jump determination.
[0070] In this optional implementation, the jump matching information generated for the target parsing level can be one or more. The number of jump matching information can be flexibly designed for different application scenarios, and is not limited here.
[0071] In this embodiment, flexible configuration of matching requirements for different parsing levels is also supported in the message parser. Similarly, the matching requirements are adapted to the application scenarios corresponding to the parsing levels. Thus, by setting matching requirements, it can be ensured that the parsing level can be matched to its corresponding application scenario. Furthermore, based on the multi-source jump reference information proposed in the jump reference information acquisition stage of this embodiment, the matching requirements configured in the parsing levels can be more comprehensive and refined, thereby better adapting to the application scenarios corresponding to the parsing levels.
[0072] Continuing with the fragmented packet scenario mentioned in the previous example, in the parsing layer corresponding to the fragmented packet scenario, matching requirements for more packet information can be set in the matching requirements. For example, the matching requirements can include requirements for the sending port and destination port. Thus, when the target packet is a non-header fragmented packet, in the jump determination stage, based on the additionally obtained sending and destination ports, it can be ensured that the determined next parsing layer is compatible with the sending and destination ports corresponding to the fragmented packet. Therefore, for non-header fragmented packets, the corresponding sending and destination ports can still be fully considered during packet parsing. By considering the sending and destination ports (essentially distinguishing different users), more suitable parsing instruction information can be designed for different users to adapt to their parsing needs. Accordingly, the next parsing layer determined in this embodiment can fully adapt to the application scenario of the target packet.
[0073] In summary, this embodiment supports flexible configuration of jump reference information processing rules for different parsing levels in the message parser. The jump reference information processing rules configured for different parsing levels can fully adapt to the application scenarios corresponding to the parsing levels, thereby ensuring that the processing results of jump reference information can fully adapt to the application scenarios corresponding to the parsing levels. This can effectively improve the accuracy of jump judgment and make the determined next parsing level more suitable for the application scenario of the message.
[0074] Of course, other implementation methods can be used in the jump determination stage in this embodiment. For example, matching requirements for jump reference information can be flexibly configured for different parsing levels in the message parser. Based on this, in the jump determination stage, the multi-source jump matching information obtained for the target parsing level can be matched and judged separately to find the parsing level that can be adapted to the jump reference information obtained for the target parsing level, and then used as the next parsing level. In this implementation method, the jump reference information can be directly used as the basis for jump determination. By carefully designing the matching requirements corresponding to the jump reference information, it can be ensured that the determined next parsing level can be adapted to the application scenario of the target message. It is understood that different implementation schemes may have differences in jump determination complexity and efficiency. However, based on the jump reference information obtained for the target parsing level in this embodiment that is fully adapted to the application scenario of the target message, it can be ensured that the determined next parsing level can be adapted to the application scenario of the target message. Here, the implementation method in the jump determination stage is not limited, nor are further examples provided.
[0075] In the above or following embodiments, the additional information supported in the message parser is diverse, and the additional information designed and maintained for different application scenarios can vary. Several exemplary information types that can be supported among the additional information are provided below.
[0076] refer to Figure 3 This embodiment proposes that additional information may include... Historical cache information .
[0077] The historical cache information here can be understood as some historical information cached by the message parser during the message parsing process. In this embodiment, the historical cache information may include information cached by the message parser during the parsing of other messages, and / or information cached according to the configured caching rules in other parsing levels used to parse the current message header (such as the message header of the target message mentioned above).
[0078] In this embodiment, the information cached in the historical cache information can be message information (such as the field values actually carried in the message header), or it can be non-message information generated at the parsing layer, such as information generated through calculation at the parsing layer. Here, there are no limitations on the construction method and information type of the information contained in the historical cache information; it can be flexibly designed for different application scenarios.
[0079] The historical cache information in this embodiment can provide sufficient reference information for some application scenarios that need to backtrack and parse history during the redirection decision-making process. We will not provide further examples of this type of application scenario here; a typical example is the aforementioned fragmented packet scenario.
[0080] Based on the historical cache information supported and maintained in this embodiment, the following is proposed in the step of obtaining jump reference information for the above-mentioned target parsing level:
[0081] If the information source configured for the target parsing layer includes historical cache information, then the historical cache information related to the target message is obtained from the additional information maintained in the message parser, and used as one of the jump reference information corresponding to the target parsing layer.
[0082] It is understood that in this embodiment, if the application scenario corresponding to the target parsing level needs to use historical cache information for jump determination, then the information sources configured in the target parsing level can include historical cache information. In this way, through on-demand configuration, it can be ensured that the parsing level corresponding to the aforementioned application scenario can obtain relevant jump reference information from historical cache information, thereby providing sufficient jump reference information for the aforementioned application scenario.
[0083] The following uses a fragmented message scenario as an example to explain in detail the application scheme of historical cache information in the jump reference information acquisition stage and the jump judgment stage.
[0084] Taking the target parsing level mentioned above as an example, this embodiment proposes that in the jump reference information acquisition stage: if the historical cache information configured in the target parsing level includes group-shared information, then the group-shared information cached by the original message to which the target message belongs is obtained from the additional information maintained by the message parser; wherein, the target message is any fragment message segmented from the original message.
[0085] In this embodiment, for the scenario of fragmented packets, an exemplary historical cache information—group-shared information—is proposed. The group-shared information includes packet information that can be shared by fragmented packets segmented from the original packet.
[0086] In fragmented message scenarios, a large original message can be divided into multiple message fragments, which are called fragmented messages. Each fragmented message also has a message header, and the message parser can parse each fragment separately. In fragmented message scenarios, the message information carried in the headers of the first fragmented message and the non-first fragmented message differs. Some message information from the header of the first fragmented message is typically not carried in the header of the non-first fragmented message, such as the sending port (S-PORT) and destination port (D-PORT).
[0087] In this embodiment, information missing in non-header fragmented packets can be cached using information sources such as group-shared information designed for fragmented packet scenarios, so as to provide jump reference information during the packet parsing process for non-header fragmented packets.
[0088] Furthermore, in the fragmented message scenario, this embodiment proposes the following for the jump reference information acquisition stage: the message identifier corresponding to the target message can be read from the field used to store the message identifier in the message header of the target message; the group-shared information associated with the message identifier can be obtained from the group-shared information cached for different original messages in the message parser; wherein, each fragmented message segmented from the original message carries the same message identifier.
[0089] In this embodiment, the message parser can independently maintain shared information within the group for different original messages to ensure the isolation between the shared information corresponding to different original messages. Furthermore, in this embodiment, the message parser can support comparison operations during the jump reference information acquisition stage. Through comparison operations, the appropriate shared information within the group can be accurately located for the target message, thereby ensuring accurate jump judgment criteria for subsequent jump decisions.
[0090] Furthermore, following the jump reference information processing rules proposed in the previous embodiments for the jump determination stage, this embodiment proposes the following for the jump determination stage in the case of fragmented packets:
[0091] If the jump reference information includes group-shared information obtained for the target message, the message information contained in the group-shared information and the message information extracted from the target parsing layer for jump judgment are combined to obtain a message information combination, which serves as one of the jump matching information corresponding to the target parsing layer.
[0092] For fragmented packet scenarios, this embodiment proposes that the processing operation designed in the jump determination stage can be a "combination." The resulting combination of packet information can include packet information extracted from the target parsing layer for jump determination, as well as packet information obtained from the shared information within the group corresponding to the original packet of the target packet, such as the aforementioned sending port and destination port. In this way, even when the target packet is a non-header fragment segmented from the original packet, sufficient packet information can be obtained in the jump determination stage. This allows for a more comprehensive and refined jump determination, effectively ensuring that the determined next parsing layer is suitable for fragmented packet scenarios.
[0093] In this embodiment, various implementation methods can be used to support the message parser in maintaining appropriate historical cache information for different application scenarios. The following example uses a fragmented message scenario to provide a caching implementation scheme for shared information within a group.
[0094] Taking the target resolution layer as an example, this exemplary caching implementation scheme proposes that if the caching rules configured for the target resolution layer indicate that the message information at the target location should be cached in the group-shared information, then the message information is extracted from the message header according to the target location and cached in the group-shared information corresponding to the original message to which the target message belongs.
[0095] In this embodiment, for each parsing level corresponding to the fragmented packet scenario, caching rules can be configured in the parsing instruction information, and the caching rules can specify which packet information needs to be extracted and cached in the group's shared information. By flexibly configuring caching rules for the parsing levels, the packet parser can progressively cache the packet information that should be shared by each fragmented packet during the parsing process of each fragmented packet segmented from the original packet. In this way, during the parsing process of fragmented packets, the relevant packet information cached in the group's shared information can be inherited from the previous fragmented packet and the previous parsing level corresponding to the current fragmented packet. This ensures that sufficient packet information can be obtained in the current parsing level for the current fragmented packet as jump reference information, thereby enabling a more comprehensive and refined jump judgment for the current parsing level.
[0096] The above describes the application scheme of historical cached information in the jump reference information acquisition stage and the jump judgment stage, taking the fragmented packet scenario as an example. However, it should be understood that the above application scheme is exemplary, and the application scheme for the fragmented packet scenario in this embodiment is not limited to this. For example, in this embodiment, it is not necessary to configure caching rules at the parsing level. Instead, packet information extraction rules can be configured in the independent configuration information of the packet parser. A dedicated component in the packet parser is responsible for actively extracting the packet information that needs to be shared from the relevant fragmented packets corresponding to the original packet and caching it in the group-shared information corresponding to the original packet, without needing to actively cache it at the parsing level. Further examples of implementation logic for other technical details in the application scheme are not provided here.
[0097] In addition, the above-mentioned fragmented message scenario is an example. In this embodiment, it is possible to flexibly configure the information type and information construction method in the historical cache information for different application scenarios. Here, the application scheme of historical cache information in other application scenarios is not limited, nor are specific examples provided.
[0098] refer to Figure 3 This embodiment proposes that additional information may include... Intermediate information.
[0099] The intermediate information here can include both message information and non-message information generated at the parsing layer. (See reference) Figure 3 For the target parsing level, the message information extraction component in the message parser can use the extracted part of the message information as intermediate information; after reading the parsing instruction information reading component in the message parser, it can construct the intermediate information according to the intermediate information construction rules configured in the parsing instruction information. Figure 3 The example illustrates the information construction methods for the two aspects mentioned above regarding intermediate information.
[0100] In this embodiment, the information type and information construction method in the intermediate information are not limited. No further examples are given here.
[0101] The intermediate information in this embodiment can provide more accurate jump reference information for some application scenarios that need to refer to some dynamically changing information in the jump determination process. Here, we will not give many examples of this type of application scenario. A typical example of this type of application scenario can be: Generic Network Virtualization Encapsulation (Geneve).
[0102] Based on the intermediate information supported for maintenance in this embodiment, the following is proposed in the step of obtaining jump reference information for the above-mentioned target parsing level:
[0103] If the information source configured for the target parsing layer includes intermediate information, then the intermediate information output by the target parsing layer according to the configured intermediate information construction rules is obtained from the additional information maintained in the message parser, and used as one of the jump reference information corresponding to the target parsing layer.
[0104] It is understood that in this embodiment, if the application scenario corresponding to the target parsing level requires the use of intermediate information for jump determination, then the information sources configured in the target parsing level may include intermediate information. In this way, through on-demand configuration, it can be ensured that the parsing level corresponding to the aforementioned application scenario can obtain relevant jump reference information from intermediate information, thereby providing accurate jump reference information for the aforementioned application scenario.
[0105] The following uses the Geneve scenario mentioned above as an example to explain in detail the application of intermediate information in the jump reference information acquisition stage and the jump judgment stage.
[0106] Taking the target parsing level mentioned above as an example, this embodiment proposes that in the jump reference information acquisition stage: when the intermediate information construction rule configured in the target parsing level indicates the calculation of the remaining parsing length, during the execution of the target parsing level, the remaining parsing length output by the previous parsing level used to parse the packet header is obtained; based on the parsing length configured for the target parsing level and the remaining parsing length output by the previous parsing level used to parse the packet header, the remaining parsing length corresponding to the packet header after the target parsing level is completed is calculated; the calculated remaining parsing length is used as the intermediate information output by the target parsing level.
[0107] As can be seen, for the Geneve scenario, this embodiment proposes an exemplary intermediate information—the remaining parsing length. The remaining parsing length is used to characterize the length of information in the message header that has not yet been parsed.
[0108] In the Geneve scenario, the header length of different messages is no longer a fixed value but a variable value. Therefore, during the jump determination, the next parsing level to which the jump occurs may not match the actual remaining parsing length in the Geneve message, potentially leading to incomplete parsing or parsing errors. In this embodiment, based on the proposed intermediate information source, the remaining parsing length variable can be used as intermediate information in the Geneve scenario, passed sequentially between different parsing levels as a basis for jump determination.
[0109] In this scenario, the remaining parsing length can be calculated in real-time within the target parsing layer, serving as a reference for jump decisions when determining which layer to jump to. During the calculation, the target parsing layer obtains the remaining parsing length output by the previous parsing layer for the target packet header, using this as its starting value. The target parsing layer also has a length to be parsed, which is the length of information it is responsible for parsing in the target packet header. Subtracting this length from the starting value yields the remaining parsing length in the packet header after the target parsing layer has completed parsing.
[0110] From the perspective of the target parsing layer, after calculating the intermediate information such as the remaining parsing length, it can be passed to the determined next parsing layer as the starting value for calculating the remaining parsing length in the next parsing layer. This transmission allows the remaining parsing length variable to be dynamically and accurately maintained during the parsing of Geneve messages, thus enabling the use of the accurate remaining parsing length as the basis for jump decisions.
[0111] For the Geneve scenario, this embodiment proposes that, in the jump determination stage, the remaining parsing length output by the target parsing level can be used as one of the jump matching information corresponding to the target parsing level.
[0112] Accordingly, in this embodiment, for the parsing level corresponding to the Geneve scenario, a matching requirement for the remaining parsing length can be configured in the matching requirements. For example, the matching requirement configured in a certain parsing level A corresponding to the Geneve scenario may include: remaining parsing length > 30. In this way, parsing level A will only be matched as the next parsing level when the remaining parsing length output in the target parsing level is greater than 30. This can effectively ensure that the jump to the parsing level that matches the actual remaining parsing length can be guaranteed, thereby ensuring the parsing quality of Geneve messages.
[0113] The above, using the Geneve scenario as an example, illustrates the application schemes of intermediate information in the jump reference information acquisition stage and the jump judgment stage. However, it should be understood that the above application schemes are merely exemplary, and the application schemes for the Geneve scenario in this embodiment are not limited to these. Further examples of the implementation logic of the technical details in the application schemes will not be provided here.
[0114] Furthermore, the above Geneve scenario is exemplified. In this embodiment, it is possible to flexibly configure the information type and information construction method in the intermediate information for different application scenarios. No limitation is made on the application scheme of intermediate information in other application scenarios, nor are specific examples provided.
[0115] refer to Figure 3 In this embodiment, auxiliary information is also supported in the additional information.
[0116] The auxiliary information here can be information pre-configured in the message parser that is useful for all application scenarios or for some application scenarios. This auxiliary information is usually not extracted or calculated at the parsing level.
[0117] refer to Figure 3 The message parser may include jump registers, and the aforementioned auxiliary information can be pre-stored in these jump registers. It is understood that the auxiliary information can be pre-stored in the jump registers by operators through software configuration. Furthermore, in this embodiment, a global-level jump register can be deployed in the message parser, which can pre-store information useful for all application scenarios; alternatively, a parsing-level jump register can be deployed, which can pre-store information useful for the corresponding parsing level.
[0118] Based on this, this embodiment proposes that in the jump reference information acquisition stage:
[0119] If the information source configured for the target parsing level includes a jump register, then auxiliary information can be obtained from the jump register pre-configured for the target parsing level as one of the jump reference information corresponding to the target parsing level.
[0120] In this embodiment, the type of information included in the auxiliary information is not limited; it can be any information that assists in the jump determination. This assistance can be in ways such as improving the efficiency or accuracy of the jump determination.
[0121] For example, the auxiliary information includes information used to assist in calculating jump matching information. Based on this, in the jump determination stage: if the jump reference information processing rules configured for the target parsing level indicate that jump matching information is calculated based on the auxiliary information for the target jump reference information, then the auxiliary information and the target jump reference information are calculated according to the operator combination configured in the jump reference information processing rules to obtain the calculation result, which is used as one of the jump matching information corresponding to the target parsing level; wherein, the target jump reference information is any type of jump reference information obtained for the target parsing level.
[0122] In this embodiment, the operator combination used can be flexibly determined from the jump reference information processing rules configured at the target parsing level for different auxiliary information. For example, if the auxiliary information is a mapping reference value, then the operator combination used for mapping calculation can be used. Based on this, the above-mentioned target jump reference information can be mapped to smaller-sized information according to the mapping reference value, as jump matching information (for example, 40-bit jump reference information can be mapped to 4-bit information). This can effectively reduce the amount of matching calculation in the jump judgment process and improve the efficiency of jump judgment.
[0123] It is understood that this embodiment supports various information types for auxiliary information, and the information type can be flexibly selected as needed during the configuration phase. Further specific explanations and examples of the application schemes for auxiliary information are not provided here.
[0124] In summary, this embodiment proposes several exemplary information types for additional information—historical cache information, intermediate information, and auxiliary information stored in the jump register, etc. These refined information sources can provide more comprehensive and granular jump reference information for different application scenarios. This ensures that appropriate, accurate, and comprehensive jump reference information is obtained for different application scenarios during the jump reference information acquisition process, thereby effectively guaranteeing the rationality of parsing level jumps under different application scenarios. As can be seen from the detailed description of the above exemplary additional information, the message parsing scheme provided in this embodiment can effectively adapt to various application scenarios, thus ensuring message parsing quality under different application scenarios.
[0125] In the above or below embodiments, in the jump determination stage, in addition to the jump matching information constructed in this embodiment, other types of jump determination criteria can also be used.
[0126] Another example of a jump determination criterion could be the parsing status.
[0127] To address this, this embodiment proposes configuring parsing state transition rules at different parsing levels and recording the parsing state switched to after each parsing level completes packet parsing. The parsing state can be used to characterize the progress or stage of packet parsing. This embodiment supports customizing parsing states as needed. For example, one parsing level can correspond to one parsing state; however, multiple parsing levels can also remain in the same parsing state, which is not limited here.
[0128] In this embodiment, the matching requirements configured in the parsing hierarchy may include not only the aforementioned requirements for jump matching information, but also requirements for the parsing status.
[0129] Based on this, in this embodiment, the following is proposed in the jump determination stage:
[0130] If a resolution state transition rule is configured in the target resolution layer, the target resolution state to which it switches after the target resolution layer is completed is obtained; from the multiple resolution layers configured in the message parser, the resolution layer that matches the target resolution state and jump information is searched and used as the next resolution layer for parsing the message header.
[0131] refer to Figure 3 In this embodiment, the message parser may include a hierarchical transition state machine, which can update the current parsing state of the target message in real time. For example, after the message parser has completed the target parsing hierarchy for the target message, the hierarchical transition state machine can update the current parsing state of the target message to the target parsing state.
[0132] refer to Figure 3 In this embodiment, the message parser may include a matching component, which is responsible for performing the aforementioned jump determination operation. (See reference...) Figure 3 The jump determination of this matching component can be based on two aspects: the jump matching information provided in this embodiment and the current parsing state maintained for the target message in the aforementioned hierarchical jump state machine. In this way, the matching component can use the jump matching information and the target parsing state as two aspects to base its jump determination. This can effectively improve the accuracy of jump determination.
[0133] In summary, this embodiment introduces another criterion for jump determination—parsing status—into the jump determination stage. The message parser can update the current parsing status of the target message in real time, and during jump determination, it identifies the parsing level that matches the current parsing status. Combined with the jump matching information constructed for the target parsing level, these two aspects of jump determination further improve the adaptability of the determined next parsing level to the application scenario of the target message, thereby further ensuring the parsing quality of the target message.
[0134] Figure 4 This is a schematic diagram illustrating an application scenario provided for an exemplary embodiment of this application. Figure 4 The diagram illustrates an exemplary application of the message parsing method provided in this embodiment.
[0135] refer to Figure 4 In this application scenario, the parsing hierarchy can be configured in the message parser for both fragmented message scenarios and Generate scenarios. (See reference) Figure 4 In this application scenario, a parsing table can be used to configure the parsing hierarchy. In this parsing table, each row corresponds to one parsing instruction; in other words, one row can be understood as one parsing hierarchy.
[0136] Figure 4 In the parsing table, the codes shown on the side can be understood as numbers representing the parsing levels, used to identify different parsing levels. The configured parsing levels can be independent of each other for different application scenarios. For example, the parsing levels configured for the fragmented packet scenario mentioned above could be numbered 2-5, while the parsing levels configured for the Geneve scenario could be numbered 6-10.
[0137] Furthermore, the processing actions and parameters configured in the parsing instruction information corresponding to different parsing levels can be set as needed to adapt to the application scenarios corresponding to the parsing levels.
[0138] In addition, the message parser may also include a parsing layer for traffic splitting based on different application scenarios, for example, Figure 4 The parsing level numbered 0 is responsible for receiving the target message to be parsed. The parsing instructions at this level can instruct the extraction of field values that characterize the application scenario from the message, such as the message type field. Thus, when determining which parsing level to jump to, the application scenario can be used as the basis for the jump, allowing the next parsing level that matches the actual application scenario of the target message to be found in the parsing table.
[0139] The following is combined first Figure 3 This section provides a brief explanation of the components that a message parser may contain. Then, it combines... Figure 4 The application scheme of the message parsing method provided in this embodiment in application scenarios will be further explained.
[0140] 1. Software configuration components:
[0141] It can be responsible for initializing and configuring the message parser. The configured aspects may include: initial instructions (such as the parsing instruction information corresponding to the parsing level numbered 0), parsing instruction information corresponding to each parsing level, jump registers, and the parsing table mentioned above.
[0142] 2. Message header caching component:
[0143] Receive the target message, extract the message header and cache it, and use it as the actual processing object for message parsing;
[0144] 3. Message information extraction component:
[0145] One of the key modules proposed in this embodiment is the message information to be extracted according to the parsing instruction information corresponding to the current parsing level (see reference). Figure 4 In the parsing table (column 3), combined with the data offset pointer information corresponding to the current parsing level (provided by the parsing progress pointer management component mentioned later), the message information is read from the corresponding position in the message header. (See reference...) Figure 3 The read message information can be used as a jump reference, while other message information can be used to calculate intermediate information.
[0146] 4. Intermediate information caching component:
[0147] After intermediate information is generated in the parsing layer, the intermediate information caching component can be responsible for caching this intermediate information, which can be used as a reference for subsequent parsing layers or for jumping to subsequent messages.
[0148] 5. Parse the progress pointer management component:
[0149] Based on the length to be parsed required by the current parsing level in the parsing instruction information, update the data offset caused by the current parsing level in the entire header. After the current parsing level is completed, update the data offset pointer information for the header.
[0150] 6. Redirect matching information building component:
[0151] One of the key modules proposed in this solution is the jump matching information construction component, which can be used to construct jump matching information for the parsing levels in the message parser. This information can be based on the information source configured in the parsing instruction information (see reference). Figure 4In the parsing table (column 9), jump reference information is obtained, and jump matching information is constructed. Information sources may include, but are not limited to, the aforementioned historical cache information, intermediate information, auxiliary information in the jump register, and message information extracted by the current parsing level itself. Furthermore, jump matching information construction rules can be built based on the jump matching information configured in the parsing instruction (see reference...). Figure 4 In the parsing table (column 10), the obtained multi-source jump reference information is arbitrated, combined, or calculated to obtain the final jump matching information.
[0152] 7. Hierarchical state machine:
[0153] The parsing state is switched according to the parsing state transition rules configured in each parsing instruction (see reference). Figure 4 In the parsing table, the first and fourth columns are analyzed.
[0154] 8. Matching component:
[0155] Ternary Content Addressable Memory (TCAM) technology can be used to address this issue. Figure 4 The parsing table shown is used for matching operations. Specifically, the current parsing status in column 1 and the requirements for jump matching information configured in column 2 of the parsing table can be used as the mode value in the TCAM matching process. Furthermore, it is also possible to configure a mask value for the matching requirements in column 2 of the parsing table to improve TCAM matching efficiency.
[0156] refer to Figure 3 The matching component can combine the jump matching information constructed by the jump matching information component with the current parsing state updated by the hierarchical jump state machine as the basis for jump judgment. In the parsing table, it can find the address (i.e. the number corresponding to the parsing level) that matches the jump judgment basis and use it as the result of TCAM matching.
[0157] 9. Command information parsing and reading component:
[0158] Based on the matched address, the corresponding parsing instruction information is read and executed to continue parsing the target packet.
[0159] 10. Domain Segment Extraction Component:
[0160] According to the target domain segment indicated by the domain segment extraction rules configured in the parsing instruction information (refer to...). Figure 4 In the parsing table (column 5), combined with the data offset pointer information corresponding to the current parsing level, the relevant field segment is read from the corresponding position in the message header.
[0161] Alternatively, you can write to the location indicated in the domain segment extraction rules (see reference). Figure 4 In the parsing table (the 5th column), the extracted relevant fields are written into the header vector of the target message.
[0162] Combined Figure 4 The application scheme of the message parsing method provided in this embodiment in application scenarios will be further explained.
[0163] 1. Upon receiving the target message, cache the message header;
[0164] 2. Based on the initial parsing level, determine the next parsing level for the target message that matches the application scenario (e.g., Figure 4 The parsing level numbered 1 in the middle is used as the target parsing level;
[0165] 3. In the target parsing layer, according to the parsing instruction information, extract message information, obtain historical cache information, construct intermediate information and / or obtain auxiliary information from the jump register to obtain jump reference information, and construct jump matching information based on the jump reference information;
[0166] 4. Based on the jump matching information and the current resolution status, perform TCAM matching to obtain the address of the resolution level (see reference). Figure 4 (The number on the left side of the middle);
[0167] 5. Based on the parsing instruction information corresponding to the target parsing level, extract the domain segments and write them into the message header vector;
[0168] 6. Based on the parsing instruction information corresponding to the next parsing level, determine whether the next parsing level is the last parsing level;
[0169] 7. If it is not the last level, take the next parsing level as the target parsing level and return to step 3;
[0170] 8. If it is the last layer, then the parsing process is complete.
[0171] Based on the application scheme of the message parsing method provided in this embodiment in the above exemplary application scenarios, it can be seen that the message parsing method provided in this embodiment can include a message parser that can effectively adapt to different application scenarios and accurately and flexibly realize the jump judgment between parsing levels in different application scenarios, thereby effectively ensuring the message parsing quality in different application scenarios.
[0172] It should be noted that some processes described in the above embodiments and accompanying drawings include multiple operations that appear in a specific order. However, it should be clearly understood that these operations may not be executed in the order they appear herein, or they may be executed in parallel. The operation numbers, such as 101, 102, etc., are merely used to distinguish different operations and do not represent any execution order. Furthermore, these processes may include more or fewer operations, and these operations may be executed sequentially or in parallel.
[0173] Figure 5 This is a schematic diagram of the structure of a message parser provided as another exemplary embodiment of this application. For example... Figure 5 As shown, the message parser may include: memory 50 and processor 51.
[0174] Memory 50 is used to store computer programs.
[0175] The processor 51, coupled to the memory 50, is used to execute the computer program in the memory 50 for performing the aforementioned message parsing method.
[0176] The packet parser provided in this embodiment is a hardware product that can be installed in various usage environments. For example, it can be installed in network devices such as programmable switches, or in chips such as cloud infrastructure processing units (CIPUs). No further examples of usage environments are provided here. Furthermore, this embodiment does not limit the product implementation form of the packet parser; it can be implemented as a chip, etc. No further examples of product forms are provided here.
[0177] Furthermore, such as Figure 5 As shown, the message parser also includes other components such as communication component 52 and power supply component 53. Figure 5 The diagram only shows some components and does not mean that the message parser only includes... Figure 5 The components shown.
[0178] It is worth noting that the technical details of the above-mentioned message parser embodiments can be found in the relevant descriptions in the foregoing method embodiments. To save space, they will not be repeated here, but this should not cause any loss to the scope of protection of this application.
[0179] The aforementioned memory can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random-Access Memory (SRAM), Electrically Erasable Programmable Read Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0180] The aforementioned communication component is configured to facilitate wired or wireless communication between the device containing the communication component and other devices. The device containing the communication component can access wireless networks based on communication standards, such as 2G, 3G, 4G / LTE, 5G, or combinations thereof. In one exemplary embodiment, the communication component receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel.
[0181] The aforementioned power supply components provide power to various components within the device in which they reside. These power supply components may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power to the device in which they reside.
[0182] Accordingly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, enables the processor to implement the steps in the above-described method embodiments. The computer-readable storage medium may be volatile, non-volatile, or a combination thereof, and may be removable or non-removable. Examples of computer-readable storage media include, but are not limited to, phase-change random access memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), flash memory or other memory technologies, CD-ROM, digital video disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transfer medium.
[0183] Accordingly, this application also provides a computer program product, which includes a computer program or instructions that, when executed by a processor, cause the processor to implement the steps in the above method embodiments. It should be understood that each step or combination of steps in the above method flow can be implemented by the computer program or instructions. Furthermore, these computer programs or instructions can be applied to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device, enabling the processor of the general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing device to function as an apparatus for implementing the corresponding functions in the above method embodiments.
[0184] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0185] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A message parsing method, characterized in that, Applicable to a message parser, wherein the message parser is configured with multiple parsing levels, the method includes: In response to receiving a target message to be parsed, the message header corresponding to the target message is extracted; According to the information source configured for the target parsing level, the jump reference information is obtained. The information sources that can be configured in the message parser include the message information extracted in the current parsing level for jump judgment, as well as additional information maintained by the message parser that is not present in the current parsing level. Based on the jump reference information obtained for the target parsing level, a jump judgment is made to determine the next parsing level for the packet header; The target parsing level is any parsing level within the message parser used to parse the message header.
2. The method according to claim 1, characterized in that, Based on the jump reference information obtained for the target parsing level, a jump determination is performed to determine the next parsing level for the packet header, including: According to the jump reference information processing rules configured for the target parsing level, the jump reference information obtained for the target parsing level is processed to obtain the jump matching information corresponding to the target parsing level; From the multiple parsing levels configured within the message parser, find the parsing level that matches the jump matching information, and use it as the next parsing level for parsing the message header; The jump matching information satisfies the matching requirements configured within the found parsing level.
3. The method according to claim 2, characterized in that, The processing operations include arbitration and / or combination and / or performing calculations according to the configured operators.
4. The method according to claim 1, characterized in that, According to the information sources configured for the target resolution level, obtain jump reference information, including: If the information source configured for the target parsing level includes historical cache information, then the historical cache information related to the target message is obtained from the additional information maintained in the message parser, and is used as one of the jump reference information corresponding to the target parsing level; The historical cache information includes information cached by the message parser during the parsing of other messages, and / or information cached according to the configured caching rules in other parsing layers of the message header.
5. The method according to claim 4, characterized in that, From the additional information maintained in the message parser, obtain historical cache information related to the target message, including: If the historical cache information configured in the target parsing layer includes group-shared information, then the group-shared information cached for the original message to which the target message belongs is obtained from the additional information maintained by the message parser. The target message is any fragment of the original message, and the shared information within the group includes message information that can be shared by the fragments of the original message.
6. The method according to claim 5, characterized in that, From the additional information maintained in the message parser, obtain the group-shared information cached for the original message to which the target message belongs, including: Read the message identifier corresponding to the target message from the field segment in the message header used to store the message identifier; Obtain the group-shared information associated with the message identifier from the group-shared information cached for different original messages in the message parser; Each segment of the original message carries the message identifier.
7. The method according to claim 5, characterized in that, The method further includes: If the caching rules configured for the target parsing layer indicate that the message information at the target location should be cached in the group-shared information, then the message information is extracted from the message header according to the target location and cached in the group-shared information corresponding to the original message to which the target message belongs.
8. The method according to claim 5, characterized in that, The jump reference information obtained for the target parsing level is processed to obtain the jump matching information corresponding to the target parsing level, including: If the jump reference information includes group-shared information obtained for the target message, the message information contained in the group-shared information and the message information extracted from the target parsing level for jump judgment are combined to obtain a message information combination, which is one of the jump matching information corresponding to the target parsing level.
9. The method according to claim 1, characterized in that, According to the information sources configured for the target resolution level, obtain jump reference information, including: If the information source configured for the target parsing layer includes intermediate information, then the intermediate information output by the target parsing layer according to the configured intermediate information construction rules is obtained from the additional information maintained in the message parser, and used as one of the jump reference information corresponding to the target parsing layer.
10. The method according to claim 9, characterized in that, Obtain the intermediate information output by the target parsing layer according to the configured intermediate information construction rules, including: When the intermediate information construction rule configured in the target parsing layer indicates the calculation of the remaining parsing length, during the execution of the target parsing layer, the remaining parsing length output by the previous parsing layer used to parse the packet header is obtained; Based on the parsing length configured for the target parsing level and the remaining parsing length output by the previous parsing level, calculate the remaining parsing length of the packet header after the target parsing level has been completed; The calculated remaining parsing length is used as the intermediate information output by the target parsing level.
11. The method according to claim 1, characterized in that, According to the information sources configured for the target resolution level, obtain jump reference information, including: If the information source configured for the target parsing level includes a jump register, then auxiliary information is obtained from the jump register pre-configured for the target parsing level as one of the jump reference information corresponding to the target parsing level; The auxiliary information includes information used to assist in calculating jump matching information.
12. The method according to claim 11, characterized in that, The jump reference information obtained for the target parsing level is processed to obtain the jump matching information corresponding to the target parsing level, including: If the jump reference information processing rules configured for the target parsing level indicate that jump matching information calculation is performed on the target jump reference information based on auxiliary information, then the calculation is performed on the auxiliary information and the target jump reference information according to the operator combination configured in the jump reference information processing rules to obtain the calculation result, which is used as one of the jump matching information corresponding to the target parsing level; The target jump reference information is any type of jump reference information obtained at the target parsing level.
13. The method according to claim 2, characterized in that, From the multiple parsing levels configured within the message parser, the parsing level that matches the jump matching information is selected as the next parsing level for parsing the message header, including: If a resolution state transition rule is configured in the target resolution layer, then the target resolution state switched to after the target resolution layer is completed is obtained; From the multiple parsing levels configured within the message parser, the parsing level that matches the target parsing state and the jump matching information is searched and used as the next parsing level for parsing the message header.
14. The method according to claim 1, characterized in that, Also includes: According to the segment extraction rules configured for the target resolution layer, extract the target segment indicated in the segment extraction rules from the packet header; According to the write position indicated for the target field segment in the field segment extraction rule, the target field segment is written into the packet header vector corresponding to the target packet.
15. A message parser, characterized in that, Includes memory, processor, and communication components; The memory is used to store one or more computer instructions; The processor is coupled to the memory and the communication component and is used to execute one or more computer instructions for performing the message parsing method according to any one of claims 1-14.
16. A computer-readable storage medium for storing a computer program, characterized in that, When the computer program is executed by one or more processors, it causes the one or more processors to perform the message parsing method according to any one of claims 1-14.
17. A computer program product, characterized in that, The method includes a computer program that, when executed by one or more processors, causes the one or more processors to perform the message parsing method according to any one of claims 1-14.