Data analysis and matching automaton and method based on packet classification rule definition
By building a nested automata structure, the problems of redundant parsing and repeated data scanning in the existing package classification system are solved, and the processing efficiency and hardware performance are improved.
Patent Information
- Application Number
- CN202411221925.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-02
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2044-09-02
AI Technical Summary
Due to the decentralized and modular design, the existing package classification system has caused redundant analytical calculations and repeated data scanning, which has low processing efficiency and cannot fully utilize hardware performance.
The data analysis and matching automaton is adopted based on the packet classification rules, and the nested automaton structure is constructed through the analytical pattern construction module, the feature automatic mechanism construction module and the automatic machine nested construction module to achieve seamless integration of the analysis and matching process. Avoid redundant calculations and repeated data scanning.
It significantly improves the overall processing efficiency, gives full play to the hardware performance, and reduces unnecessary computing overhead and module switching overhead.
Smart Images

Figure CN119094634A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of data analysis, and in particular to an automaton and method for data analysis and matching based on packet classification rule definition. Background Art
[0002] As a basic means of data preprocessing, packet classification technology is widely used in scenarios such as Internet traffic statistics analysis and data restoration analysis. The packet classification system parses the input network message data, extracts the message information field, and matches it with the characteristics described by the packet classification rules entered by the user, and performs corresponding actions on the successfully matched messages, such as forwarding, discarding, or marking. With the increasing popularity of Internet applications, packet classification technology faces severe challenges such as the rapid increase in the number of protocols, the increasing complexity of parsing, and the continuous expansion of the network bandwidth that needs to be covered, which places extremely high demands on its performance.
[0003] Existing software package classification systems usually adopt modular design, implementing message parsing and rule feature matching logic as independent modules. Due to the numerous layers of network protocols, multiple parsing modules are required to complete the parsing of different levels; and feature matching also requires multiple matching engines to process different types of features.
[0004] This decentralized modular architecture has many problems: on the one hand, it leads to a large number of redundant parsing calculations in the packet classification process, and the message data segments are frequently scanned repeatedly by multiple modules; on the other hand, frequent switching between modules introduces additional interface overhead. Overall, the existing technology lacks a unified architecture, making it difficult to dynamically tailor and optimize the core process according to user rule requirements. A large number of unnecessary calculations are often performed, and the repeated scanning and module switching overhead lead to low overall processing efficiency and inability to fully utilize hardware performance. This situation needs to be further improved. Summary of the invention
[0005] In order to solve the problem of low processing efficiency in the existing packet classification system, the present application provides an automatic machine and method for data parsing and matching based on packet classification rule definition, which adopts the following technical solutions: In a first aspect, the present application provides an automaton for data parsing and matching based on packet classification rule definition, comprising: A parsing mode construction module is used to construct a parsing automaton according to the protocol field parsing requirements defined in the packet classification rules; A feature automaton construction module is used to classify multiple feature options of the same field according to the protocol field feature options defined in the packet classification rule, and generate corresponding feature automatons; The automaton nesting construction module is used to embed the runtime state of the generated feature automaton into the state of the corresponding parsing automaton to construct a complete nested automaton structure; The automaton operation module is used to drive the operation of the constructed nested automaton structure, perform parsing, decoding and feature matching operations on the input data message, and output the matching results.
[0006] By adopting the above technical scheme, since the existing software package classification system adopts a decentralized modular design, there are a lot of redundant parsing calculations in the packet classification process, the message data segments are repeatedly scanned, and the interface overhead caused by frequent switching between modules, and the overall processing efficiency is low. The present application proposes a data parsing and matching automaton based on the packet classification rule definition, including: a parsing mode construction module, which constructs a parsing automaton according to the protocol field parsing requirements defined in the rule; a feature automaton construction module, which classifies the same fields according to the feature options of the rule to generate a feature automaton; an automaton nesting construction module, which embeds the generated feature automaton running state into the corresponding parsing automaton state to construct a complete nested structure; finally, the automaton running module drives the nested structure to complete the parsing decoding and feature matching of the input message at one time, and outputs the matching result, which effectively solves the various inefficiencies brought about by the traditional decentralized modular architecture, and seamlessly integrates the parsing and matching processes through the nested automaton structure, avoiding redundant calculations and repeated data scanning, while eliminating the overhead of module switching, thereby significantly improving the overall processing efficiency and giving full play to the hardware performance.
[0007] Optionally, the parsing mode construction module includes: A mode selection unit, used to select a corresponding parsing mode from a preset protocol field parsing mode set according to the protocol field parsing requirements defined in the packet classification rules; The parsing automaton construction unit is used to construct a parsing automaton by combining the selected parsing patterns or connecting them in series.
[0008] By adopting the above-mentioned technical scheme, the pattern selection unit of the present application selects the corresponding parsing pattern from the set of protocol field parsing patterns preset by the system according to the protocol field parsing requirements defined in the packet classification rules, and the parsing automaton construction unit merges the selected parsing patterns by pattern union or pattern series connection to construct a parsing automaton for the rule requirements; through a step-by-step method of dynamic selection and merging, a streamlined parsing automaton is generated according to the specific requirements of different rules, avoiding the execution of redundant parsing operations, thereby further reducing unnecessary computing overhead and improving parsing efficiency.
[0009] Optionally, the state of the parsing automaton includes: A feature automaton for storing the end-of-field identifier; Variable used to calculate the offset value of the end position of the current field; Variable used to store the index of the embedded feature automaton state.
[0010] By adopting the above technical scheme, each parsing automaton state of the present application contains a feature automaton for storing a field end identifier. When parsing to this state, the automaton can be used to determine whether the field has been parsed. Secondly, the state also contains a variable for calculating the offset value of the current field end position relative to the message start position, providing position information for feature matching. Finally, the state also contains a variable for storing the state index of the feature automaton embedded in the state as an entry for starting feature matching. Through this special state design, when the parsing automaton runs to a certain state, it can automatically determine the field start boundary and obtain the field start position based on the stored information, and immediately start the corresponding feature automaton to perform matching operations, thereby achieving seamless integration of parsing and matching.
[0011] Optionally, the feature automation construction module includes: A rule parsing unit is used to parse the feature options described in the rule set and classify the feature options of the same field according to the field type; The automaton compilation unit is used to compile the classified feature options into corresponding feature automata.
[0012] By adopting the above technical solution, since the packet classification rules usually include multiple different feature options for the same protocol field, in order to avoid constructing an automaton separately for each feature option and thus causing waste of resources, the present application parses all the feature options described in the rule set through a rule parsing unit, and classifies the multiple feature options for the same field according to their corresponding field types. Then, the automaton compilation unit compiles the classified feature option set into a corresponding feature automaton; by having multiple feature options share the same automaton, the waste of resources caused by constructing an automaton separately for each option is avoided; at the same time, classification by field type ensures that similar options can be efficiently represented by one automaton.
[0013] Optionally, the automaton nested construction module includes: A mapping table building unit, used to build a mapping table of the correspondence between the parsing status and the protocol field ID; The nested association unit is used to embed the runtime state of the constructed feature automaton into the corresponding parsing automaton state according to the mapping table.
[0014] By adopting the above technical solution, since the parsing automaton and the feature automaton correspond to different levels of the protocol respectively, in order to accurately start the feature automaton related to the current parsing field when the parsing automaton is running, the present application defines the state mapping and nested association process in the automaton nested construction module. First, the mapping table construction unit establishes a mapping table of the correspondence between the parsing state and the protocol field ID, which corresponds to the specific protocol field parsed by each parsing state; secondly, the nested association unit embeds the runtime state of the constructed feature automaton into the corresponding parsing automaton state according to the above mapping table. When the parsing automaton runs to a certain state, it can accurately start the corresponding feature automaton according to the field ID mapped to the state; through the design of state mapping and nested association, a close binding relationship is established between the parsing automaton and the feature automaton, so that the parsing and matching processes can be seamlessly switched and run collaboratively and efficiently, reducing the complexity and implementation difficulty of the system.
[0015] Optionally, the automatic machine operation module includes: An initialization unit, used to initialize message information and status information; A parsing driving unit, used to drive the parsing automaton to scan and parse the input message data; The feature driving unit is used to perform feature matching processing on the parsed protocol fields according to the embedded feature automaton.
[0016] By adopting the above technical solution, since the nested automaton structure seamlessly integrates the parsing and matching processes, in order to efficiently drive the unified structure to perform one-time processing on the message, first, the initialization unit will initialize the message information and state information to prepare for subsequent processing. Secondly, the parsing drive unit drives the parsing automaton to scan and parse the input message data. In this process, once the parsing reaches a state in which a feature automaton is embedded, the parsing drive unit will automatically trigger the feature drive unit to perform work; finally, the feature drive unit performs feature matching processing on the parsed protocol field according to the embedded feature automaton, and returns control to the parsing drive unit after completing the matching task of the field to continue parsing; through the method of parsing drive, feature drive, and alternating execution, efficient driving of the nested automaton structure is achieved, so that the parsing and matching processes can be closely coordinated, quickly and efficiently completed in a single module, avoiding the overhead of module switching and data conversion in traditional technologies.
[0017] Optionally, the automaton operation module further includes a PKT structure for storing data information during the automaton operation process, and the PKT structure includes: The message information field is used to store the address index and length information of the original message data; The parsing status field is used to store the running status of the current parsing automaton; The feature status field is used to store the current running status of the feature automaton; The message position field is used to store the byte position of the message currently being processed; The message end field is used to store the message end position; The parsing result field is used to store the message parsing result information generated during the operation of the automaton; The matching result field is used to store the feature matching result information generated during the operation of the automatic machine.
[0018] By adopting the above technical solution, since the automaton operation module needs to maintain a large amount of intermediate states and result information during the parsing and matching process, in order to ensure the efficiency and convenience of data access, the present application designs a unified data storage structure PKT, and the PKT structure includes multiple fields for storing various data information during the operation of the automaton: first, it contains a message information field for storing the address index and length information of the original data of the message, so as to facilitate fast access to the message; secondly, it contains a parsing state field and a feature state field for storing the running states of the current parsing automaton and the feature automaton respectively, and supporting the automaton state to resume execution after interruption; thirdly, it contains a message position field and a message end field for recording the byte position and the message end position of the currently processed message, and providing position information for the parsing and matching process; finally, it contains a parsing result field and a matching result field for storing the message parsing result and feature matching result information generated during the operation of the automaton; through this unified PKT structure design, the automaton operation module can efficiently access and update all necessary information in the same data space, greatly reducing the overhead of data exchange and state maintenance, and improving the operation efficiency. At the same time, it also simplifies the automation control logic and improves reliability.
[0019] Optionally, the analysis driving unit includes: The message reading subunit is used to read the message bytes in sequence according to the position indicated by the message position field of the PKT structure and input them into the parsing automaton to drive the migration of the parsing state field; The byte jump subunit is used to call the byte jump function defined in the parsing automaton state, skip the message data segment that does not need to be parsed, and update the message position field of the PKT structure; The byte preprocessing subunit is used to call the byte operation function defined in the parsing automaton state to perform preprocessing on the input bytes; The feature-driven calling subunit is used to drive the operation of the embedded feature automaton according to the receiving state reached by the operation of the parsing automaton.
[0020] By adopting the above technical solution, since the parsing driving unit needs to efficiently drive the parsing automaton to scan and process the input message, in order to maximize the parsing efficiency, the present application has made a refined division of labor in the design of the parsing driving unit; first, the message reading subunit reads the message bytes in sequence according to the position indicated by the message position field in the PKT structure and inputs them into the parsing automaton, driving the parsing state field to perform state migration; secondly, the byte jump subunit calls the byte jump function defined in the parsing automaton state, which can skip the data segments in the input message that do not need to be parsed, and updates the message position field in the PKT structure, avoiding unnecessary processing of these data. Scan; again, the byte preprocessing subunit calls the byte operation function defined in the parsing automaton state, and performs necessary preprocessing on the input bytes, such as big-endian and small-endian conversion, mask operations, etc., to prepare data for automaton state migration; finally, the feature-driven calling subunit drives the operation of the embedded feature automaton according to the special receiving state reached by the parsing automaton, and performs corresponding feature matching operations; through the division of labor and cooperation of the parsing driving units, the parallel computing capabilities of modern processors are fully utilized, a highly refined message processing flow is realized, and feature matching is automatically triggered when needed, so that the parsing and matching processes can be seamlessly connected and operate efficiently.
[0021] Optionally, the feature driving unit includes: The feature reading subunit is used to read the message bytes in sequence according to the position indicated by the message position field of the PKT structure and input them into the feature automaton to drive the migration of the feature state field; The result recording subunit is used to write the rule index information identified by the receiving state reached by the feature automaton into the matching result field of the PKT structure; The matching feedback subunit is used to return the matching result and matching position of the feature automaton to the corresponding parsing automaton state. The parsing drive unit updates the message position field of the PKT structure according to the matching position to skip the matched message data segment.
[0022] By adopting the above-mentioned technical solution, the present application realizes efficient interaction between the parsing driver unit and the feature driver unit under the support of the PKT structure. The parsing driver is responsible for message scanning and state switching. Once it switches to the state of the embedded feature automaton, the feature driver is triggered to perform a matching operation. After the matching is completed, the feature driver feeds back the result to the parsing driver to adjust the message scanning position, and the above process is repeated, thereby avoiding the overhead of module switching. At the same time, through the mediation of PKT, data copying is effectively reduced and the overall execution efficiency is improved.
[0023] In a second aspect, the present application provides a data parsing and matching method based on packet classification rule definition, comprising the following steps: Construct a parsing automaton according to the protocol field parsing requirements defined in the packet classification rules; According to the protocol field feature options defined in the packet classification rules, multiple feature options of the same field are classified to generate corresponding feature automata; Embed the runtime state of the generated feature automaton into the state of the corresponding parsing automaton to construct a complete nested automaton structure; Drive the operation of the constructed nested automaton structure, perform parsing, decoding and feature matching operations on the input data message, and output the matching results.
[0024] In summary, the present application includes at least one of the following beneficial technical effects: 1. The present application proposes a data parsing and matching automaton based on packet classification rule definition, including: a parsing mode construction module, which constructs a parsing automaton according to the protocol field parsing requirements defined in the rule; a feature automaton construction module, which classifies the same fields according to the feature options of the rule and generates a feature automaton; an automaton nesting construction module, which embeds the generated feature automaton running state into the corresponding parsing automaton state to construct a complete nested structure; finally, the automaton running module drives the nested structure to complete the parsing decoding and feature matching of the input message at one time, and outputs the matching result, which effectively solves the various inefficiencies brought about by the traditional decentralized modular architecture, and seamlessly integrates the parsing and matching processes through the nested automaton structure, avoiding redundant calculations and repeated data scanning, while eliminating the overhead of module switching, thereby significantly improving the overall processing efficiency and giving full play to the hardware performance; 2. The mode selection unit of the present application selects a corresponding parsing mode from a set of protocol field parsing modes preset by the system according to the protocol field parsing requirements defined in the packet classification rules, and the parsing automaton construction unit merges the selected parsing modes by mode combination or mode series connection to construct a parsing automaton for the rule requirements; through a step-by-step method of dynamic selection and merging, a streamlined parsing automaton is generated according to the specific requirements of different rules, avoiding the execution of redundant parsing operations, thereby further reducing unnecessary computational overhead and improving parsing efficiency; 3. In the present application, each parsing automaton state includes a feature automaton for storing a field end identifier. When parsing to this state, the automaton can be used to determine whether the field has been parsed. Secondly, the state also includes a variable for calculating the offset value of the current field end position relative to the message start position, providing position information for feature matching. Finally, the state also includes a variable for storing the state index of the feature automaton embedded in the state as an entry for starting feature matching. Through this special state design, when the parsing automaton runs to a certain state, it can automatically determine the field start boundary and obtain the field start position based on the stored information, and immediately start the corresponding feature automaton to perform matching operations, thereby achieving seamless integration of parsing and matching. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 It is a schematic diagram of input and output boundary definition of a packet classification automaton method in a data parsing and matching automaton based on packet classification rule definition in an embodiment of the present application; Figure 2 It is a module schematic diagram of a data parsing and matching automaton defined based on packet classification rules according to an embodiment of the present application; Figure 3 It is a schematic diagram of generating a parsing automaton based on a parsing pattern preset in a data parsing and matching automaton defined based on a packet classification rule in an embodiment of the present application; Figure 4 It is a schematic diagram of the construction process of the overall structure in an automatic machine for data parsing and matching based on packet classification rule definition in an embodiment of the present application; Figure 5 It is a schematic diagram of the overall automaton nested structure in an automaton for data parsing and matching defined based on packet classification rules in an embodiment of the present application; Figure 6 It is a schematic diagram of a merging method of serial relations in an automaton for data parsing and matching based on packet classification rule definition in an embodiment of the present application; Figure 7 It is a schematic diagram of a merging method of joint relations in an automaton for data parsing and matching based on packet classification rule definition in an embodiment of the present application; Figure 8 It is a schematic diagram of the operation of input drive by an instance parsing mode in an automaton for data parsing and matching based on packet classification rule definition in an embodiment of the present application; Fig. 9 It is a schematic diagram of the mapping relationship between a feature automaton and a parsing automaton in a data parsing and matching automaton defined based on a packet classification rule in an embodiment of the present application; Fig.10It is a schematic diagram of the overall operation structure and examples in an automatic machine for data parsing and matching based on packet classification rule definition in an embodiment of the present application; Fig.11 It is a flowchart of a data parsing and matching method based on packet classification rule definition in an embodiment of the present application; Fig.12 It is a diagram of the internal structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0026] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to be used as limitations to the present application. As used in the specification and appended claims of the present application, the singular expressions "one", "a kind of", "said", "above", "the" and "this" are intended to also include plural expressions, unless there is a clear indication to the contrary in the context. It should also be understood that the term "and / or" used in the present application refers to any or all possible combinations comprising one or more listed items.
[0027] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features, and in the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more.
[0028] The packet classification system of the present application refers to a packet classification function implemented using software based on a pure x86 platform. The packet classification service of the present application includes the parsing and feature matching functions of data fields from the link layer, transport layer to the application layer, and supports the matching capabilities of features described by regular expressions. The rules of the present application are a formatted combination of link layer feature options, transport layer feature options, and application layer data feature options. Within the same rule, each feature option has an "and" relationship, and the rules have an "or" relationship.
[0029] The DFA (Deterministic Finite Automaton) automaton compilation and construction algorithms of this application are all based on well-known principles and will not be described in detail herein. In the rules of the present invention, the process of constructing the features of the regular description and the precise string features to form a DFA automaton is a public algorithm and will not be described in detail herein. The automaton optimization algorithm mentioned in the present invention is a currently mature public algorithm and will not be described in detail herein.
[0030] The embodiments of the present application are further described in detail below in conjunction with the drawings in the specification.
[0031] like Figure 1As shown, the input data defined by the packet classification automaton method defined in this application include: the packet classification rules input by the user and the original data message to be matched. The output data is the packet classification rule matching result information of the data packet. After inputting the packet classification rules and the original data message to be matched, this embodiment is compiled and run through the DFA automaton method to output the data packet matching result.
[0032] Reference Figure 2 The present application provides a data parsing and matching automaton defined based on packet classification rules, including a parsing pattern construction module, a feature automaton construction module, an automaton nesting construction module and an automaton operation module.
[0033] The parsing mode construction module is used to construct a parsing automaton according to the protocol field parsing requirements defined in the packet classification rules.
[0034] Among them, the parsing pattern construction module includes a pattern selection unit and a parsing automation unit. The pattern selection unit is used to select the corresponding parsing pattern from the preset protocol field parsing pattern set according to the protocol field parsing requirements defined in the packet classification rules; the parsing automation unit is used to construct a parsing automaton with the selected parsing pattern through pattern combination or pattern series connection.
[0035] Specifically, Figure 3 As shown, the system parses and counts the combined rules issued by the user. The feature option format defines a set of correspondences between the protocol fields described by the feature and the parsing requirements. The correspondence is preset within the system. For example, the feature field name IPv4 corresponds to the parsing requirements of the source and destination IP addresses of the IP header, and the field name HTTP-HOST corresponds to the parsing requirements of the Host field in the HTTP protocol header. Then, based on the parsing requirements of the user rules, the parsing patterns preset in the system are selected to form a parsing pattern set. All patterns in the parsing pattern set are then merged. During the merging process, the patterns are "combined" or "connected in series" according to the order in which the protocol parsing start position is located in the message to form a basic parsing automaton.
[0036] The feature automaton construction module is used to classify multiple feature options of the same field according to the protocol field feature options defined in the packet classification rules and generate corresponding feature automatons.
[0037] Among them, the feature automaton construction module includes a rule parsing unit and an automaton compilation unit. The rule parsing unit is used to parse the feature options described in the rule set and classify the feature options of the same field according to the field type; the automaton compilation unit is used to compile the classified feature options into corresponding feature automata.
[0038] Specifically, in this embodiment, refer to Figure 4, by extracting (combining) the feature content of the feature options in the rules, classifying multiple feature fields of multiple rules, merging the feature content describing the same field into a DFA automaton, and recording the index address of the feature automaton when it is running into the state corresponding to the parsing automaton according to the correspondence between the feature automaton and the parsing automaton (i.e., the protocol ID and the field ID). If there is an automaton with the "feature of the end of the field" in the state, the automaton is connected in series with the feature automaton. For example, the feature state machine of HTTP-HOST is combined with the parsing process of the field: in the parsing automaton, the character feature "HOST:" is described as of a certain state, then the state is indexed with the host feature automaton. If it contains a "field end feature automaton" describing the feature "\r\n", the automaton is connected in series with the feature automaton, with the "feature automaton" first and the "field end feature automaton" later.
[0039] The automaton nesting construction module is used to embed the runtime state of the generated feature automaton into the state of the corresponding parsing automaton to construct a complete nested automaton structure.
[0040] Among them, the automaton nested construction module includes a mapping table construction unit and a nested association unit. The mapping table construction unit is used to establish a mapping table of the correspondence between the parsing state and the protocol field ID; the nested association unit is used to embed the runtime state of the constructed feature automaton into the corresponding parsing automaton state according to the mapping table.
[0041] Specifically, refer to Figure 5 The DFA automaton operation structure of this embodiment consists of two parts, the inner part and the outer part. The outer part consists of the (rule-customized) message parsing process automaton (i.e., the "parsing automaton" in this article), some states of which contain the feature DFA automaton inside this application, which is compiled and generated by "classifying" and "combining" the feature options defined by the rules according to the parsing mode they depend on (i.e., the "feature automaton" in this article).
[0042] It is worth noting that the merging of automata in this application is divided into two modes: serial connection and combination.
[0043] like Figure 6As shown, the concatenation of DFA automata is used to merge two feature automata with a "concatenation relationship". Such as the HOST field content feature automata and the "field end feature automata" in the above example. After merging two DFA automata A and B with a sequence, the operation logic is implemented as reaching the receiving state of DFA when A is satisfied first and B is satisfied later. The concatenation method is mainly used to merge the sequence relationship between parsing patterns, and to merge the parsing "field end feature automata" with its corresponding feature automata. The serial merging method follows the following method: connect the receiving state of the first matched automaton and the initial state of the later matched automaton using an ε (epsilon) edge, where ε is a cost-free transformation that is necessary in the construction process of the DFA automaton. It is common knowledge and will not be elaborated here; if the state after the ε edge migration of the former receiving state is not a receiving state, the former receiving state is changed to a normal state; construct a new DFA automaton by iteratively calculating the ε closure (Epsilon Closure) of the automaton (the process is a public algorithm and will not be elaborated in this article); execute the state machine optimization (minimization) process to trim redundant states and their migration process.
[0044] like Figure 7 As shown in the figure, the union of DFA automata is used to merge two automata with "intersection relationship". Intersection relationship refers to the situation where the same data segment needs to match multiple features, and the above features are in an intersection relationship. After merging the automata A and B with the intersection relationship, the operation logic is realized to meet A or meet B, and reach the receiving state of DFA corresponding to A or B. The union method is mainly used in the parsing process between parsing modes, the parsing process with some identical message fields, and the process when the features of the same fields of multiple rules are combined into one DFA automata. The union merging method follows the following method: create a new initial state as the initial state of the new automata, and connect the initial state with the initial state of the original DFA automata using an ε edge; obtain a new DFA automata by iteratively calculating the ε closure (Epsilon Closure) of the automata; if the final target of the migration process of the automata after the union does not have a receiving state, delete (prune) the migration process; execute the state machine optimization (minimization) process to prune redundant states and their migration processes.
[0045] Furthermore, the state of the parsing automaton includes a feature automaton for storing a field end identifier, a variable for calculating the current field end position offset value, and a variable for storing an embedded feature automaton state index. The parsing mode of the present application is to abstractly implement the parsing process of the code of a protocol field as a DFA automaton. The present invention defines the DFA as consisting of a special state, namely the P state in this article. Not every field (supported by the packet classification system) needs to be independently implemented as a parsing mode. The selection of fields should be combined with the requirements for protocol parsing of the fields covered by the description capabilities of the feature options of the packet classification combination rules. Since the parsing capability of packet classification is certain, the set of parsing modes that can be abstracted is a finite set. The specific operation methods can be divided into: 1. Take the first significant and unique feature of a protocol as the starting state, take the feature that appears in a field as the receiving state, and generate the intermediate DFA state transition process.
[0046] 2. If the field is the end position marked by the signature feature, the signature feature is compiled separately into a DFA, and then connected in series with the feature automaton (which establishes an index relationship with the receiving state of the field). If the field is the starting position of the field obtained by value calculation, the function of the value calculation needs to be preset into the receiving state of the field, and the starting position of the field is obtained in real time during the running process.
[0047] 3. According to the specific characteristics of the protocol parsing process, each state, including the receiving state, can skip a section of data in bytes through an "operation" on the "input drive" process of the automaton.
[0048] 4. According to the characteristics of the protocol field, each state, including the receiving state, can realize the characteristics of state migration after the data byte performs operation through an "operation" on the "input drive" process of the automaton.
[0049] 5. Other information generated by the parsing process is cached through the global PKT structure of the process and used in subsequent calculations.
[0050] 6. The DFA automaton in the parsing mode is suitable for the automaton optimization algorithm itself, but it is necessary to add the state characteristics of the parsing mode of this application as a filtering condition for the characteristics of state merging in the optimization algorithm: that is, if the characteristics of the P state connotations of the two states to be merged are different, they will not be merged.
[0051] like Figure 8As shown, the set of parsing patterns is a preset fixed DFA set in the system of the present application, which is used to meet the parsing requirements of the features described by the rules and generate a parsing process for all fields described in the combined rule set issued by the user. During the operation of the parsing process, the structure other than the automaton may be operated, such as the input drive process and the PKT structure. For example, the process of parsing the IPv4 address field from the message is an independent mode, and the IPv6 address field is another independent mode. These two parsing modes will be "combined" into the same logically complete DFA automaton during the DFA compilation process (depending on the situation).
[0052] Figure 8 The example shown is an example of the operation of the IPv4 address resolution and IPv6 address resolution state machines on the DFA input driver. The DFA input driver has the function operation functions of CAL (numerical operation) operation and JUMP (skip byte). Each state in the DFA can provide its own custom operation function for the DFA input driver to call and run. The IP_ver state operates the current input byte (the first byte of the low address of the IP header in this example) to perform a right shift operation of four bits. If the result of the operation is equal to 4, the character "4" is input, and if it is equal to 6, the character "6" is input. The receiving state operation input driver skips the length of the possible IP header options (or extension headers). The IP header length is assigned to the PKT structure in the operation function of the Ip_ver state (see this section for details), and the fixed length from the start position of the IP header to the IP address (the resolution target of this example) considered by the parsing process is subtracted during the skipping process, which is 11 and 7 bytes respectively.
[0053] The P state in the parsing mode of this application has the following characteristics: 1. A DFA automaton containing the field end position feature of the preset fixed regular semantic description. This feature automaton will be "connected in series" with the feature automaton to generate a new feature automaton, and its runtime index will be nested in this state.
[0054] 2. The variable containing the relative offset of the end position of the field of the current input data, in bytes. The variable is set by the system's preset method for calculating the length of a certain field, which is also located in the state.
[0055] 3. The P state stores the mapping of another DFA (feature automaton) running state. Another automaton can be nested during runtime, that is, after the DFA input driver triggers the current state, a piece of data (the content of the field) is input to another internally mapped DFA, so that it runs and caches the receiving state information to the PKT structure. If the current state records the starting position of the field, it is used as the parameter of the input driver of the internally mapped DFA and is input to the internal DFA for operation. Otherwise, after the internally mapped DFA enters the receiving state, it ends the internal DFA input, that is, the field scan is completed.
[0056] 4. The P state contains the jump length (in bytes) processing function JUMP of the state transition process to quickly skip the data segment with clear length that has no parsing requirements. During operation, the DFA input driver calls the jump length processing function of the state (if it exists) and skips the bytes of this length before the next DFA input data.
[0057] 5. The P state contains the operation processing function CAL for the input data during the state transition process to handle the situation where the state transition direction can only be determined after the input automaton data is operated. During the operation, the DFA input driver calls the operation function of the state (if it exists) and uses the function's return information as the input data of the DFA.
[0058] Among them, there are two field parsing methods in this application: 1. Use regular features to describe how fields start and end.
[0059] During the construction of the P state of the present invention, the end feature is compiled into a DFA automaton of a single pattern string, and it is connected in series (in the overall construction process) behind the feature DFA automaton that establishes a mapping relationship with the current state to form a new automaton and establish a mapping relationship with it.
[0060] 2. Calculate the starting position of the field.
[0061] In the process of constructing the P state of the present invention, if the field is a case where a calculation is required to obtain the starting position of the field, the calculation is implemented as a fixed function and preset in the state. For example, in the data segment of the A record in the DNS message, the first byte represents the length of the subsequent data. The parsing process needs to obtain this byte and convert it into the length of the subsequent data segment for parsing.
[0062] like Fig. 9As shown, each state in the parsing mode is composed of the P state defined in this application. After the parsing mode forms a parsing automaton, the P state stores the start feature, starting position (if any) or end feature DFA of each field. At the same time, the P state stores a protocol ID and field ID represented by the state, and the field ID value is unique within a protocol. The mapping relationship between the parsing automaton and the feature automaton is established through the values of the above-mentioned protocol ID and field ID. The index relationship is implemented as a reference from the state of the parsing automaton to the address of the running state of the feature automaton nested inside it.
[0063] The present application uses a mapping table of protocol ID, field ID and parsing state to establish a mapping relationship between the feature automaton and the state in the parsing automaton. In the process of constructing the overall structure of the present invention, firstly, according to the parsing requirements of the feature options in the rule set, the parsing modes are selected and merged into the parsing automaton. In this process, each state uses the protocol ID and field ID it represents as the key and the state address as the value to insert it into the mapping table. In the process of generating the feature automaton of the construction process, after the feature automaton is built, according to its protocol ID and field ID, the mapping table is queried to obtain the address of the corresponding state of the parsing automaton, and the runtime structure address of the feature automaton is written into the state for storage, thereby forming a mapping relationship between the two when the overall structure is running.
[0064] The automaton operation module is used to drive the operation of the constructed nested automaton structure, perform parsing, decoding and feature matching operations on the input data message, and output the matching results.
[0065] Among them, the automaton operation module includes an initialization unit, a parsing drive unit and a feature drive unit. The initialization unit is used to initialize the message information and status information; the parsing drive unit is used to drive the parsing automaton to scan and parse the input message data; the feature drive unit is used to perform feature matching processing on the parsed protocol fields according to the embedded feature automaton.
[0066] Specifically, in this embodiment, a PKT structure that describes the automaton state and message information is defined, and the structure corresponds one-to-one to the data message being processed. It describes the structure, parsing state, current scanning position, current automaton state and other necessary information of an original data message. In the core process of the packet classification system, the life cycle of the PKT structure is consistent with the message it describes. PKT contains an index of the original data content of the message, and can store the parsing result information of the message on demand. At the same time, it saves the necessary state variables during the operation of the overall system of the present invention. The types of data stored in the PKT structure include: 1. Message index information: including the original data message address index, data message length, IP fragmentation and other necessary original data message description information. Since the core process of the present invention does not involve the generation of this part of data, it will not be described in detail in this article.
[0067] 2. Parsing result information: including the parsing result information generated during the operation of the parsing automaton, such as the length of a certain protocol layer, the number of occurrences of the protocol field, etc. The parsing result information is used to assist the parsing automaton in reading the various parsing states and results of the message between the different parsing modes within it during the operation of the parsing automaton. And this information can be used in the final result matching judgment process.
[0068] 3. State machine operation information: Contains a set of variables to record the state information of each DFA operation process, so as to maintain the smooth operation of each state machine and ensure the logical integrity of the state machine.
[0069] 4. Feature matching result information: The receiving state in the feature automaton records the index information of the rule to which the feature matched by the current receiving state belongs, including the rule ID, rule address index and other necessary information that can locate the packet classification rule issued by the specific user. After the automaton state migrates to the receiving state, the above rule information will be added to the matching result information of the PKT structure.
[0070] The PKT structure stores the automaton operation variables defined in this application, which mainly include the following: 1. Member CS: stores the current parsed DFA state number.
[0071] 2. Member CSS: stores the current feature DFA state number.
[0072] 3. Member PD: points to the data byte being read in the current message. The incremental transformation is controlled by the automaton driver.
[0073] 4. Member EOF: points to the end position of the current message.
[0074] The parsing drive unit includes a message reading subunit, a byte jump subunit, a byte preprocessing subunit and a feature drive calling subunit. The message reading subunit is used to read the message bytes in sequence and input them into the parsing automaton according to the position indicated by the message position field of the PKT structure, so as to drive the migration of the parsing state field; the byte jump subunit is used to call the byte jump function defined in the parsing automaton state, skip the message data segment that does not need to be parsed, and update the message position field of the PKT structure; the byte preprocessing subunit is used to call the byte operation function defined in the parsing automaton state to perform preprocessing on the input bytes; the feature drive calling subunit is used to drive the operation of the embedded feature automaton according to the receiving state reached by the parsing automaton. The feature driving unit includes a feature reading subunit, a result recording subunit and a matching feedback subunit. The feature reading subunit is used to read the message bytes in sequence and input them into the feature automaton according to the position indicated by the message position field of the PKT structure, thereby driving the migration of the feature state field; the result recording subunit is used to write the rule index information identified by the receiving state reached by the feature automaton into the matching result field of the PKT structure; the matching feedback subunit is used to return the matching result and matching position of the feature automaton to the corresponding parsing automaton state, and the parsing driving unit updates the message position field of the PKT structure according to the matching position, thereby skipping the matched message data segment.
[0075] Specifically, the automaton input driver defined in this application refers to a functional module that reads data in bytes of the original message (indexed by PKT), inputs it into the DFA automaton, updates the various states and variables of the relevant automaton operation, and calls the mapped internal automaton or writes the matching result information according to the received state, so as to "drive" the operation of the automaton.
[0076] This application divides automata into parsing automata and feature automata, and the automata input drivers of the two are different. In addition to the normal input reading and input process in the parsing automata, the driver also has the function of calling a special input calculation function (CAL) or byte skipping function (JUMP) in the parsing state (P state). At the same time, if the P state of the parsing automata contains the mapping of the feature automata, the driver also has the function of starting the automata and its driver operation mapped inside it.
[0077] In the overall operation structure, such as Fig.10 As shown, the static data structure has 1. Message information in the PKT structure and its index message original data.
[0078] 2. Parsing automata, usually implemented as static tables.
[0079] 3. Feature automata, implemented in the form of static tables. Dynamic data is mainly stored in the PKT structure. The operation of the core process is mainly implemented in the above two automata drivers.
[0080] like Fig.10 As shown in the figure, in the overall operation process, the character feature "G:N / n" in the rule matching message is used as an example to explain the operation process of each component in detail. In this example, a field of a certain protocol starts with the feature "G:", and the field ends with the feature "\n" (newline character). The packet classification rule must match the field value as the character "N". The specific operation steps are as follows.
[0081] 1. PKT information data initialization: establish an index relationship with the original data message described by PKT, and store other message information about the message obtained from the packet classification system. Initialize (clear) parsing result information, state machine operation information, feature matching result information, etc. The PD member is initialized to the first byte of the original data of the message, EOF is initialized to the last byte of the original data of the message, CS is initialized to the initial state value of the parsing automaton, and CSS is initialized to 0.
[0082] 2. Start the parsing automaton driver: read a byte of the original data content of the message through the PKT structure. The data read comes from the current original message byte pointed to by the PKT structure member PD. When the byte content of the PD input is the character "G" in the above example, the parsing automaton state is migrated from E0 to E1, and E1 is recorded and saved in the PKT member CS. When there is a CAL operation function in the P state, the parsing automaton needs to call the function and process the current byte to be input into the automaton. When the P state contains a JUMP operation function, the parsing automaton needs to run the function and obtain the skipped byte data of the next input byte and save it.
[0083] 3. Parsing automaton driven operation: continue to read data through the PKT structure. If the JUMP operation result information is currently saved, the parsing automaton updates the PKT member PD to read the byte after the number of JUMP bytes skipped. Update PD to the new position and drive state migration. If the automaton terminates prematurely, the state transition fails, or all PD read data (PD equals EOF) fails to reach a certain receiving state, the operation driven by the parsing automaton is terminated, that is, the core process returns failure. In the above example, after the parsing automaton reads the character ":" pointed to by PD and enters the parsing automaton, the P state migrates to the receiving state E3, that is, the automaton operation matches the starting position of a specific field of a protocol. Read the mapping of the feature automaton in the receiving state to obtain and enter the feature automaton operation context.
[0084] 4. Feature automaton driver starts: According to the PKT structure, read the original data pointed to by its PD member, update PD to the next byte, and record the feature automaton state information in CSS. In the above example, the PD data read after the feature automaton driver starts is the character "N" (that is, the content feature describing the protocol field issued by the user rule is hit), the feature automaton state is migrated from the initial state T0 to T1, and T1 is recorded in the PKT member CSS.
[0085] 5. End of feature automaton operation: continue to read the data pointed to by the PKT member PD and update CSS. If the automaton terminates prematurely, the state transition fails, or all PD read-in data (that is, PD equals EOF) fails to reach a certain receiving state, the operation driven by the feature automaton is terminated, that is, the feature matching returns failure, and the execution process (3) continues. In the above example, the current PD reads the character "\n" (from the state after the end feature DFA of the protocol field parsing feature is merged with the feature automaton) and reaches the receiving state T2, that is, the feature matching is successful. Record the current PD information, read the rule information in the current state, and update it to the matching result member of PKT.
[0086] 6. After the match is successful, the feature automaton returns the location information of the field match to the driver corresponding to the P state of the mapped parsing automaton. The parsing state driver executes the JUMP function of the changed state according to the above position, skipping the byte content hit by the feature running automaton. The subsequent process continues to run 3 to 6 until all data is read into the system, that is, when PD is equal to EOF, the overall running process ends.
[0087] The subsequent packet classification process determines the matching result of the execution rule according to the result information cached in the PKT, and executes the action defined by the rule to complete the specific business of packet classification. Since the subsequent process does not belong to the core process of the present invention, it will not be described here.
[0088] On the second aspect, the present application provides a data parsing and matching method based on packet classification rule definition. The data parsing and matching method based on packet classification rule definition of the present application is described below in combination with the above-mentioned data parsing and matching system based on packet classification rule definition.
[0089] Reference Fig.11 , a data parsing and matching method based on packet classification rule definition, comprising the following steps: S10, constructing a parsing automaton according to the protocol field parsing requirements defined in the packet classification rules; S20, classifying multiple feature options of the same field according to the protocol field feature options defined in the packet classification rule, and generating a corresponding feature automaton; S30, embedding the runtime state of the generated feature automaton into the state of the corresponding parsing automaton to construct a complete nested automaton structure; S40, driving the operation of the constructed nested automaton structure, performing parsing, decoding and feature matching operations on the input data message, and outputting the matching result.
[0090] In one embodiment, step S10 includes the following steps: S11. According to the protocol field parsing requirements defined in the packet classification rules, a corresponding parsing mode is selected from a preset protocol field parsing mode set; S12. Construct a parsing automaton by combining the selected parsing patterns or by connecting them in series.
[0091] In one embodiment, the states of the parsing automaton include: A feature automaton for storing the end-of-field identifier; Variable used to calculate the offset value of the end position of the current field; Variable used to store the index of the embedded feature automaton state.
[0092] In one embodiment, step S20 includes the following steps: S21, parsing the feature options described in the rule set, and classifying the feature options of the same field according to the field type; S22. Compile the classified feature options into corresponding feature automata.
[0093] In one embodiment, step S30 includes the following steps: S31, establishing a mapping table of the correspondence between the parsing status and the protocol field ID; S32. According to the mapping table, embed the runtime state of the constructed feature automaton into the corresponding parsing automaton state.
[0094] In one embodiment, step S40 includes the following steps: S41, initializing message information and status information; S42, driving the parsing robot to scan and parse the input message data; S43. Perform feature matching processing on the parsed protocol fields according to the embedded feature automaton.
[0095] In one embodiment, a PKT structure is also included for storing data information during the operation of the automaton. The PKT structure includes: The message information field is used to store the address index and length information of the original message data; The parsing status field is used to store the running status of the current parsing automaton; The feature status field is used to store the current running status of the feature automaton; The message position field is used to store the byte position of the message currently being processed; The message end field is used to store the message end position; The parsing result field is used to store the message parsing result information generated during the operation of the automaton; The matching result field is used to store the feature matching result information generated during the operation of the automatic machine.
[0096] In one embodiment, step S42 includes the following steps: S421, according to the position indicated by the message position field of the PKT structure, read the message bytes in sequence and input them into the parsing automaton, driving the migration of the parsing status field; S422, calling the byte jump function defined in the parsing automaton state, skipping the message data segment that does not need to be parsed, and updating the message position field of the PKT structure; S423, calling the byte operation function defined in the parsing automaton state to perform preprocessing on the input bytes; S424: According to the receiving state reached by the parsing automaton, the embedded feature automaton is driven to run.
[0097] In one embodiment, step S43 includes the following steps: S431, according to the position indicated by the message position field of the PKT structure, read the message bytes in sequence and input them into the feature automaton to drive the migration of the feature state field; S432, writing the rule index information identified by the receiving state reached by the feature automaton into the matching result field of the PKT structure; S433. Return the matching result and matching position of the feature automaton to the corresponding parsing automaton state, and the parsing drive unit updates the message position field of the PKT structure according to the matching position to skip the matched message data segment.
[0098] In one embodiment, the present application provides an electronic device, which may be a server, and its internal structure diagram may be as follows: Fig.12As shown. The electronic device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the electronic device is used to store data. The network interface of the electronic device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a data parsing and matching method based on the definition of packet classification rules is implemented.
[0099] Those skilled in the art will understand that Fig.12 The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the electronic device to which the scheme of the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0100] In one embodiment, an electronic device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0101] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the above-mentioned computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0102] The above are all preferred embodiments of the present application, and the protection scope of the present application is not limited thereto. Therefore, any equivalent changes made according to the structure, shape, and principle of the present application should be included in the protection scope of the present application.
Claims
1. A data parsing and matching automaton based on packet classification rule definition, characterized in that: include: A parsing mode construction module is used to construct a parsing automaton according to the protocol field parsing requirements defined in the packet classification rules; A feature automaton construction module is used to classify multiple feature options of the same field according to the protocol field feature options defined in the packet classification rule, and generate corresponding feature automatons; The automaton nesting construction module is used to embed the runtime state of the generated feature automaton into the state of the corresponding parsing automaton to construct a complete nested automaton structure; The automaton operation module is used to drive the operation of the constructed nested automaton structure, perform parsing, decoding and feature matching operations on the input data message, and output the matching results.
2. The data parsing and matching automaton defined based on packet classification rules according to claim 1, characterized in that: The analytical mode construction module includes: A mode selection unit, used to select a corresponding parsing mode from a preset protocol field parsing mode set according to the protocol field parsing requirements defined in the packet classification rules; The parsing automaton construction unit is used to construct a parsing automaton by combining the selected parsing patterns or connecting them in series.
3. The data parsing and matching automaton defined based on packet classification rules according to claim 1, characterized in that: The states of the parsing automaton include: A feature automaton for storing the end-of-field identifier; Variable used to calculate the offset value of the end position of the current field; Variable used to store the index of the embedded feature automaton state.
4. The data parsing and matching automaton defined based on packet classification rules according to claim 1, characterized in that: The feature automation construction module includes: A rule parsing unit is used to parse the feature options described in the rule set and classify the feature options of the same field according to the field type; The automaton compilation unit is used to compile the classified feature options into corresponding feature automata.
5. The data parsing and matching automaton defined based on packet classification rules according to claim 1, characterized in that: The automaton nested construction module comprises: A mapping table building unit, used to build a mapping table of the correspondence between the parsing status and the protocol field ID; The nested association unit is used to embed the runtime state of the constructed feature automaton into the corresponding parsing automaton state according to the mapping table.
6. The data parsing and matching automaton defined based on packet classification rules according to claim 1, characterized in that: The automatic machine operation module includes: An initialization unit, used to initialize message information and status information; A parsing driving unit, used to drive the parsing automaton to scan and parse the input message data; The feature driving unit is used to perform feature matching processing on the parsed protocol fields according to the embedded feature automaton.
7. The data parsing and matching automaton defined based on packet classification rules according to claim 6, characterized in that: The automatic machine operation module also includes a PKT structure for storing data information during the automatic machine operation process. The PKT structure includes: The message information field is used to store the address index and length information of the original message data; The parsing status field is used to store the running status of the current parsing automaton; The feature status field is used to store the current running status of the feature automaton; The message position field is used to store the byte position of the message currently being processed; The message end field is used to store the message end position; The parsing result field is used to store the message parsing result information generated during the operation of the automaton; The matching result field is used to store the feature matching result information generated during the operation of the automatic machine.
8. The data parsing and matching automaton defined based on packet classification rules according to claim 7, characterized in that: The analysis driving unit comprises: The message reading subunit is used to read the message bytes in sequence according to the position indicated by the message position field of the PKT structure and input them into the parsing automaton to drive the migration of the parsing state field; The byte jump subunit is used to call the byte jump function defined in the parsing automaton state, skip the message data segment that does not need to be parsed, and update the message position field of the PKT structure; The byte preprocessing subunit is used to call the byte operation function defined in the parsing automaton state to perform preprocessing on the input bytes; The feature-driven calling subunit is used to drive the operation of the embedded feature automaton according to the receiving state reached by the operation of the parsing automaton.
9. The data parsing and matching automaton defined based on packet classification rules according to claim 8, characterized in that: The feature driving unit comprises: The feature reading subunit is used to read the message bytes in sequence according to the position indicated by the message position field of the PKT structure and input them into the feature automaton to drive the migration of the feature state field; The result recording subunit is used to write the rule index information identified by the receiving state reached by the feature automaton into the matching result field of the PKT structure; The matching feedback subunit is used to return the matching result and matching position of the feature automaton to the corresponding parsing automaton state. The parsing drive unit updates the message position field of the PKT structure according to the matching position to skip the matched message data segment.
10. A data parsing and matching method based on packet classification rule definition, characterized in that: The steps include: Construct a parsing automaton according to the protocol field parsing requirements defined in the packet classification rules; According to the protocol field feature options defined in the packet classification rules, multiple feature options of the same field are classified to generate corresponding feature automata; Embed the runtime state of the generated feature automaton into the state of the corresponding parsing automaton to construct a complete nested automaton structure; Drive the operation of the constructed nested automaton structure, perform parsing, decoding and feature matching operations on the input data message, and output the matching results.
Citation Information
Patent Citations
Parameter acquiring and general protocol analyzing method and device
CN102143148A
A data matching detection method based on a determinacy finite state automation
CN103685222A
High-speed network message monitoring and analyzing method and system supporting custom rules
CN112468370A
