Automatic machine management method and device

By introducing fractal automata, the problem of high performance overhead of AC automata when the pattern string data source changes frequently is solved. A solution that supports dynamic and fast construction/updating of AC automata is realized, supporting fuzzy search and incremental update/deletion, and reducing the overall storage space requirement.

CN121278142APending Publication Date: 2026-01-06YINWANG INTELLIGENT TECHNOLOGIES CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410855358.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-27
Publication Date
2026-01-06

AI Technical Summary

Technical Problem

Existing AC automata incur significant performance overhead when the pattern string data source changes frequently, making it difficult to meet real-time requirements.

Method used

By introducing a generalized AC automaton, fuzzy search and incremental updates/deletions are supported.

Benefits of technology

It achieves an efficient and economical solution for building/updating AC automata by introducing a generalized automaton (e.g., fractal automata) to support single-pattern matching or multi-pattern matching, as well as fuzzy search and incremental updates/deletions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121278142A_ABST
    Figure CN121278142A_ABST
Patent Text Reader

Abstract

An automaton management method and device, in which a computational node constructs a fractal automaton according to first information, the first information comprises at least one first pattern string, the first pattern string comprises at least one character, a first dictionary tree comprises a plurality of nodes, and if at least one first pattern string comprises at least one universal character, the first pattern string comprises at least one character; the plurality of nodes comprise a first root node, at least one second root node and a plurality of non-root nodes, the first root node is empty, one second root node corresponds to one universal character, and the non-root nodes correspond to one non-universal character; the failure pointer of the first root node or the at least one second root node points to itself, the plurality of non-root nodes comprise a first non-root node, the first non-root node is such as a father node, a brother node or a child node of the second root node, and the failure pointer of the first non-root node points to the second root node. The optimized automaton structure is provided through the method, so that the automaton can support fuzzy matching, and operation and maintenance management is facilitated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method and apparatus for managing automata. Background Technology

[0002] The multi-pattern string algorithm based on the Aho-Corasick automaton (AC) is a common string matching algorithm (also known as a pattern matching algorithm). In practical applications, the AC automaton not only considers pattern matching but also the processing of the pattern string data source. When the pattern string data source changes frequently, the Trie tree of the AC automaton needs to be rebuilt. This complete reconstruction of the AC automaton incurs a huge performance overhead and is difficult to meet real-time requirements. Therefore, a solution that supports dynamic and rapid construction and updating of the AC automaton is needed.

[0003] One current optimization approach is to implement real-time updates of the AC automaton using a Directed Acyclic Word Graph (DAWG) (also known as a suffix automaton). However, this approach requires the introduction of the suffix automaton, which involves complex and cumbersome computations. It also requires additional storage space to store the suffix automaton's data, resulting in a higher overall storage footprint and making it less than ideal.

[0004] Therefore, how to design a scheme that supports the dynamic and rapid construction / updating of AC automata remains an important problem that urgently needs to be solved. Summary of the Invention

[0005] This application provides a method and apparatus for managing automata, for supporting fuzzy matching and incrementally updating automata, and for managing the automata.

[0006] In a first aspect, embodiments of this application provide an automaton management method applied to a computing node. The method may include: constructing a first trie based on first information, wherein the first information includes at least one first pattern string, each first pattern string includes at least one character, the first trie includes multiple nodes, if the at least one first pattern string includes at least one wildcard character, the multiple nodes include a first root node, at least one second root node, and multiple non-root nodes, the first root node is empty, one second root node corresponds to one wildcard character, and each non-root node corresponds to one non-wildcard character; constructing failure pointers of the multiple nodes to form a first automaton, wherein the failure pointer of the first root node or the at least one second root node points to itself, the multiple non-root nodes include the first non-root node, the first non-root node includes at least one of the following of any second root node among the at least one second root node: parent node, sibling node, or child node, and the failure pointer of the first non-root node points to the second root node.

[0007] In conjunction with the first aspect, in one possible implementation, the plurality of non-root nodes further includes at least one of the following: a second non-root node, a third non-root node, or a fourth non-root node, wherein the failure pointers of different types of non-root nodes satisfy at least one of the following: the second non-root node includes a child node of the first root node, and the failure pointer of the second non-root node points to the first root node; the third non-root node corresponds to a first pattern string, and the failure pointer of the third non-root node points to the first root node; the failure pointer of the fourth non-root node points to the node with the longest common suffix found by searching upwards along the failure pointer of the parent node, and if the first root node or the second root node is encountered first during the search process, the search is stopped, and the failure pointer of the fourth non-root node points to the found first root node or the second root node.

[0008] In conjunction with the first aspect, in one possible implementation, the method further includes: obtaining second information, the second information including a newly added second pattern string, the second pattern string including at least one character, the second pattern string being different from the at least one first pattern string; adding one or more new nodes to the first trie to obtain a second trie, wherein if at least one character of the second pattern string has a common prefix with any of the at least one first pattern string, the number of new nodes is less than the number of characters contained in the second pattern string, and the new nodes correspond to non-common characters in the second pattern string; and reconstructing the failure pointers of some nodes in the second trie according to the relationship between the characters corresponding to the one or more new nodes and the characters corresponding to other nodes in the second trie, forming a second automaton.

[0009] In conjunction with the first aspect, in one possible implementation, the method further includes: determining to change a third pattern string in the at least one first pattern string to a fourth pattern string, wherein the third pattern string and the fourth pattern string have at least one common character and at least one non-common character; updating the node corresponding to the at least one non-common character in the first trie according to the fourth pattern string to obtain a third trie; and reconstructing the failure pointers of some nodes in the third trie according to the relationship between the at least one non-common character and the characters corresponding to other nodes in the third trie to form a third automaton.

[0010] In conjunction with the first aspect, in one possible implementation, the method further includes: determining to delete a fifth pattern string from the at least one first pattern string, the fifth pattern string including at least one character; starting from the last character of the at least one character of the fifth pattern string, sequentially deleting nodes corresponding to at least one character in the fifth pattern string from the first trie, and performing the following actions after each deletion of a node: reconstructing a failure pointer for the target node, the target node including the node whose original failure pointer pointed to the deleted node; stopping the operation until the first non-root node of the first trie is reached.

[0011] In conjunction with the first aspect, in one possible implementation, the method further includes: traversing from the first root node, sequentially serializing and encoding the data associated with each node of the first trie of the first automaton according to the parent-child dependency relationship of each node and the frequency at which each node of the first trie is pointed to by the failure pointers of other nodes, to obtain a first data sequence; compressing the first data sequence to obtain a first compressed file; and saving the first compressed file in the persistent storage medium of the computing node.

[0012] In conjunction with the first aspect, in one possible implementation, the method further includes: reading the first compressed file from the persistent storage medium of the computing node; decompressing the first compressed file to obtain the first data sequence; constructing the first trie based on the first data sequence, and constructing failure pointers for multiple nodes of the first trie to form the first automaton.

[0013] In conjunction with the first aspect, in one possible implementation, any of the at least one first pattern string can be implemented as any of the following: a single pattern string; a multi-pattern string; a pattern string containing wildcard characters.

[0014] Secondly, embodiments of this application provide an automaton management method applied to a computing node. The method includes: acquiring a first automaton, wherein the first automaton is constructed based on first information, the first information including at least one first pattern string, each first pattern string including at least one character, a first trie of the first automaton including multiple nodes, if the at least one first pattern string includes at least one wildcard character, the multiple nodes including a first root node, at least one second node and multiple non-root nodes, the first root node being empty, one second node corresponding to one wildcard character, and each non-root node corresponding to one non-wildcard character; acquiring second information, the second information including newly added second... A pattern string, the second pattern string including at least one character, the second pattern string being different from the at least one first pattern string; adding one or more new nodes to the first trie to obtain a second trie, wherein if at least one character of the second pattern string has a common prefix with any of the at least one first pattern string, the number of new nodes is less than the number of characters contained in the second pattern string, and the new nodes correspond to non-common characters in the second pattern string; based on the relationship between the characters corresponding to the one or more new nodes and the characters corresponding to other nodes in the second trie, reconstructing the failure pointers of some nodes in the second trie to form a second automaton.

[0015] In conjunction with the second aspect, in one possible implementation, multiple nodes of the first or second trie satisfy at least one of the following conditions: the failure pointer of the first root node or the at least one second root node points to itself; the multiple non-root nodes further include at least one of the following: a first non-root node, a second non-root node, a third non-root node, or a fourth non-root node, wherein the first non-root node includes at least one of the following of any second root node among the at least one second root node: a parent node, a sibling node, or a child node, and the failure pointer of the first non-root node points to the second root node; the second non-root node includes a child node of the first root node, and the failure pointer of the second non-root node points to the first root node; the third non-root node corresponds to a first pattern string, and the failure pointer of the third non-root node points to the first root node; the failure pointer of the fourth non-root node points to the node with the longest common suffix found by searching upwards along the failure pointer of the parent node, and if the first root node or the second root node is encountered first during the search process, the search stops, and the failure pointer of the fourth non-root node points to the found first root node or the second root node.

[0016] In conjunction with the second aspect, in one possible implementation, the method further includes: determining to delete a fifth pattern string from the at least one first pattern string, the fifth pattern string including at least one character; starting from the last character of the at least one character of the fifth pattern string, sequentially deleting nodes corresponding to at least one character in the fifth pattern string from the first trie, and performing the following actions after each deletion of a node: reconstructing a failure pointer for the target node, the target node including the node whose original failure pointer pointed to the deleted node; stopping the operation until the first non-root node of the first trie is reached.

[0017] In conjunction with the second aspect, in one possible implementation, the method further includes: traversing from the first root node, sequentially serializing and encoding the data associated with each node of the first trie of the first automaton according to the parent-child dependency relationship of each node and the frequency at which each node of the first trie is pointed to by the failure pointers of other nodes, to obtain a first data sequence; compressing the first data sequence to obtain a first compressed file; and saving the first compressed file in the persistent storage medium of the computing node.

[0018] In conjunction with the second aspect, in one possible implementation, the method further includes: reading the first compressed file from the persistent storage medium of the computing node; decompressing the first compressed file to obtain the first data sequence; constructing the first trie based on the first data sequence, and constructing failure pointers for multiple nodes of the first trie to form the first automaton.

[0019] In conjunction with the second aspect, in one possible implementation, any of the at least one first pattern string can be implemented as any of the following: a single pattern string; a multi-pattern string; a pattern string containing wildcard characters.

[0020] Thirdly, embodiments of this application provide an automaton management method applied to a computing node. The method includes: obtaining a first trie of a first automaton and failure pointers of multiple nodes of the first trie, wherein the first automaton is constructed based on first information, the first information including at least one first pattern string, each first pattern string including at least one character, the first trie including multiple nodes, if the at least one first pattern string includes at least one wildcard character, the multiple nodes including a first root node, at least one second root node and multiple non-root nodes, the first root node being empty, one second root node corresponding to one wildcard character, and each non-root node corresponding to one non-wildcard character; traversing from the first root node of the first automaton, and sequentially serializing and encoding the data associated with each node of the first trie according to the parent-child dependency relationship of each node of the first trie and the frequency with which each node of the first trie is pointed to by the failure pointers of other nodes, to obtain a first data sequence; compressing the first data sequence to obtain a first compressed file; and saving the first compressed file in the persistent storage medium of the computing node.

[0021] In conjunction with the third aspect, in one possible implementation, multiple nodes of the first trie satisfy at least one of the following conditions: the failure pointer of the first root node or the at least one second root node points to itself; the multiple non-root nodes further include at least one of the following: a first non-root node, a second non-root node, a third non-root node, or a fourth non-root node, wherein the first non-root node includes at least one of the following of any second root node among the at least one second root node: a parent node, a sibling node, or a child node, and the failure pointer of the first non-root node points to the second root node; the second non-root node includes a child node of the first root node, and the failure pointer of the second non-root node points to the first root node; the third non-root node corresponds to a first pattern string, and the failure pointer of the third non-root node points to the first root node; the failure pointer of the fourth non-root node points to the node with the longest common suffix found by searching upwards along the failure pointer of the parent node, and if the first root node or the second root node is encountered first during the search process, the search stops, and the failure pointer of the fourth non-root node points to the found first root node or the second root node.

[0022] In conjunction with the third aspect, in one possible implementation, the method further includes: reading the first compressed file from the persistent storage medium of the computing node; decompressing the first compressed file to obtain the first data sequence; constructing the first trie based on the first data sequence, and constructing failure pointers for multiple nodes of the first trie to form the first automaton.

[0023] In conjunction with the third aspect, in one possible implementation, any of the at least one first pattern string can be implemented as any of the following: a single pattern string; a multi-pattern string; a pattern string containing wildcard characters.

[0024] Fourthly, embodiments of this application provide a communication device, including at least one processor and an interface circuit. The interface circuit is used to provide data or code instructions to the at least one processor. The at least one processor is used to implement the method described in any one of the first, second, or third aspects and their possible implementations above through logic circuits or executing code instructions.

[0025] Fifthly, embodiments of this application provide a computer-readable storage medium storing program code that, when executed on a computer, causes the computer to perform the methods described in any of the first, second, or third aspects and their possible implementations.

[0026] Sixthly, embodiments of this application provide a computer program product that, when run on a computer, causes the computer to perform the method described in any of the first, second, or third aspects and their possible implementations.

[0027] Based on the implementations provided in the above aspects, the embodiments of this application can be further combined to provide more implementations. Attached Figure Description

[0028] Figure 1 This is a schematic diagram of the chain structure corresponding to the KMP algorithm;

[0029] Figure 2 This is a schematic diagram of the dictionary (prefix) tree structure corresponding to the traditional Aho-Corasick automaton;

[0030] Figure 3 This paper shows a schematic diagram of the dictionary (prefix) tree structure of the fractal automaton according to an embodiment of this application;

[0031] Figure 4 A schematic diagram illustrating the meaning of the state machine elements used in the fractal automata described in the embodiments of this application is shown.

[0032] Figure 5 This paper illustrates a state diagram of the dictionary (prefix) tree of a fractal automaton according to an embodiment of this application.

[0033] Figure 6 A flowchart illustrating the automaton management (construction) method according to an embodiment of this application is shown;

[0034] Figures 7-8A flowchart illustrating the automaton management (incremental update) method according to an embodiment of this application is shown;

[0035] Figure 9 A flowchart illustrating the automaton management (incremental update) method according to an embodiment of this application is shown;

[0036] Figures 10-12 Different example diagrams of automaton management (incremental update) according to embodiments of this application are shown;

[0037] Figure 13 A flowchart illustrating the automaton management (compression) method according to an embodiment of this application is shown;

[0038] Figure 14 A schematic diagram illustrating the principle of automaton management (compression) according to an embodiment of this application is shown;

[0039] Figure 15 A schematic diagram illustrating the principle of a pattern matching method for the vehicle field according to an embodiment of this application is shown;

[0040] Figures 16-18 Different schematic diagrams of the structure of the communication device according to embodiments of this application are shown;

[0041] Figure 19 Another structural schematic diagram of the communication device according to an embodiment of this application is shown. Detailed Implementation

[0042] To facilitate understanding, some of the terms and techniques used in this application will be explained below.

[0043] 1. Pattern string:

[0044] A pattern is a concept in string matching algorithms, referring to a specific substring that needs to be searched for within a main string (such as a string, text string, or data string). This search operation is common in computer science and can be used to find specific subpatterns or substrings within different main strings.

[0045] In pattern matching, the pattern string is used to compare against the main string to determine if a match exists. Typically, the pattern string is shorter than the main string. For example, in searching for string P within string T, T is the main string, and P is the pattern string. Let the length of T be m, and the length of P be n, where m and n are integers, and m is greater than n.

[0046] 2. Single-mode string algorithm:

[0047] Single-pattern string algorithms involve matching one string against another. Common single-pattern string algorithms include: BruteForce (BF) algorithm, Rabin-Karp (RK) algorithm, Robert S. Boyer-J Strother Moore (BM) algorithm, and Knuth-Morris-Pratt (KMP) algorithm.

[0048] Taking the KMP algorithm as an example, also known as the Knut-Maurice-Platz operation, it is an efficient algorithm for string matching, designed to solve the problem of finding the position of a pattern string in the main string (such as a text string). The core idea of ​​the KMP algorithm is to use known information to avoid useless comparison operations, thereby improving the algorithm's efficiency.

[0049] The KMP algorithm has a time complexity of O(n+m), where n is the length of the pattern string and m is the length of the main string. Compared to the naive matching algorithm, when a match fails, the KMP algorithm does not backtrack the main string pointer and the pattern string pointer. Instead, it keeps the main string pointer stationary and modifies the pattern string pointer to try to move it to a valid matching position. This significantly reduces unnecessary comparisons and improves matching speed. This pointer is called the next pointer.

[0050] For example, for a pattern string "aabaaf", the KMP structure is as follows: Figure 1 As shown, a hollow circle represents a node, and the symbol φ represents the root node, which is empty. When constructing the KMP structure, each character in the pattern string "aabaaf" is mapped to a node in the KMP structure. Solid arrows indicate the connection between different nodes. Filled circles (a representation of solid circles) represent the matching position of each pattern string, i.e., the last character of the pattern string. Hollow circles represent the non-last characters of each pattern string. Simultaneously, the lengths of common prefixes and suffixes in each substring of the pattern string are recorded. When a match fails in the text string, the mismatch pointer is moved to the character corresponding to the prefix and suffix of the character preceding the mismatch, i.e., the backtracking position. For example... Figure 1 In the code, the failure pointer for the first character 'a' points to the root node, the failure pointer for the second character 'a' points to the first character 'a', the failure pointer for the character 'b' points to the root node, the failure pointer for the third character 'a' points to the first character 'a', the failure pointer for the fourth character 'a' points to the second character 'a', and the failure pointer for the character 'f' points to the root node. In the event of a mismatch, the code moves to a backtracking position based on the failure pointer and resumes the matching process from that position, reducing unnecessary matching attempts.

[0051] 3. Multi-mode string algorithm:

[0052] Multi-pattern string algorithms refer to algorithms that find matching positions of multiple pattern strings within a main string. Common multi-pattern string algorithms include those based on Trie trees and those based on Aho-Corasick automata.

[0053] (1) A Trie tree, also known as a prefix tree or dictionary tree, is a tree-shaped data structure used to store strings and enable string matching. It is typically used to solve the problem of quickly finding a string in a set of characters.

[0054] The basic idea of ​​a Trie tree is to split a string into individual strings and then construct a tree. The root node contains no characters, and each child node (excluding the root node) contains (or represents, corresponds to) a single character. The characters along the path from the root node to a leaf node, when concatenated, form the string (or keyword) corresponding to that leaf node. All child nodes of each node contain distinct characters. After constructing the Trie tree, a depth-first search-like approach can be used to find all matching strings within the Trie tree.

[0055] (2) The AC automaton is an automaton algorithm that is an improvement on the Trie tree and optimizes the matching process of the Trie tree.

[0056] Specifically, the Trie tree structure of the Aho-Corasick automaton includes a root node and multiple non-root nodes, also called leaf nodes. The root node is null, and each non-root node corresponds to a character in the pattern string. The Aho-Corasick automaton borrows the idea of ​​the KMP algorithm by adding a failure pointer (or matching link point, mismatch pointer) to each node in the Trie tree, pointing to another node in the Aho-Corasick automaton. This allows the system to jump directly to the node pointed to by the failure pointer after a match fails at the current node, avoiding repeated checks. The failure pointer of the root node points to itself. If the failure pointer of node A points to node B, it means that the string moving upwards from node A matches the string from the root node to node B, and the matching length is the longest, meaning the string moving upwards from node A and the string from the root node to node B have the longest common suffix. The KMP algorithm can be considered a special case of the Aho-Corasick automaton. The failure pointer above serves the same purpose as the next pointer in the KMP algorithm.

[0057] Figure 2An example of an Aho-Corasick automaton is shown. The Trie tree structure of this automaton contains multiple pattern strings: she, shes, his, he, here, and hers. Each circle represents a tree node, with an empty root node. Each non-root node corresponds to a character in a pattern string. The root node is represented by the symbol φ. Filled circles (a type of solid circle) indicate the matching position of each pattern string, i.e., the last character of the pattern string. Empty circles represent non-last characters in each pattern string. Specifically, for the pattern string she, the failure pointers of the non-root nodes corresponding to characters s and e point to the root node, and the failure pointers of the nodes corresponding to characters h point to h in the pattern string his. For the pattern string shes, the failure pointers of the nodes corresponding to the non-common character s of the pattern string she point to the root node. For the pattern string his, the failure pointers of the non-root nodes corresponding to characters h, i, and s point to the root node. For the pattern string he, the failure pointers of the non-root nodes corresponding to characters h and e point to the root node. For the pattern string hers, the failure pointers of the non-root nodes corresponding to h, e, r, and s point to the root node. For the pattern string here, the failure pointers of the non-root nodes corresponding to h, e, r, and e point to the root node.

[0058] 4. State Machine:

[0059] A state machine is short for Finite State Machine (FSM). It is a mathematical model that is an abstraction of the rules governing the operation of real-world things. It is a conceptual machine that can take certain actions in response to an external event.

[0060] The components of a state machine may include one or more of the following:

[0061] (1) States (or status): Describes the possible states of the system. A state is a specific condition or condition in the system, which can be represented by a circle.

[0062] (2) Transition: The relationship between states. A transition is a relationship between states that indicates the system changes from one state to another, and can be represented by a line with an arrow.

[0063] (3) Event: An event that triggers a state transition. An event is a condition that causes the system to transition from one state to another, and can be represented by a rectangle.

[0064] (4) Action: The operation performed during state transition. An action is an operation or behavior performed by the system during the transition from one state to another, and can be represented by a label or tag.

[0065] (5) Condition: The condition for state transition. The condition is the condition or restriction that controls the state transition, and it is usually used on the line connecting the transitions.

[0066] (6) Initial state (or start state): This represents the initial state of the state diagram and can be represented by an empty circle.

[0067] (7) Final state (or accept states): This represents the final state of the state diagram. It can be represented by a solid circle or a double circle.

[0068] In this embodiment of the application, the elements of a state machine can be used to describe the relationships between different nodes in the tree structure of the automaton.

[0069] 5. Huffman coding:

[0070] Also known as Huffman coding, it is an encoding method, a type of variable length code (VLC). This method constructs codewords with the shortest average length based entirely on the probability of character occurrence. It is sometimes called the optimal code, but is generally referred to as Huffman coding.

[0071] In practical applications, the AC automaton not only considers pattern matching but also the processing of pattern string data sources (or keywords / rules, etc.). For example, frequent changes to the pattern string data source (such as updating or removing data) require continuous pushing and reconstruction of the AC automaton's Trie tree. For real-time systems with thousands of pattern string data sources and very frequent updates, each time a new pattern string is added, the entire pattern string data source needs to be preprocessed, thus requiring a complete rebuild of the AC automaton. This complete reconstruction of the AC automaton incurs significant performance overhead and is unlikely to meet real-time requirements. Therefore, in the above application scenarios, a solution that supports dynamic and rapid construction / updating of the AC automaton is needed.

[0072] One current optimization approach is to implement real-time updates of the AC automaton using a Directed Acyclic Word Graph (DAWG) (also known as a suffix automaton). For example, when a new pattern string needs to be added, a DAWG is introduced, and the nodes in the DAWG are traversed sequentially to incrementally update the original AC automaton.

[0073] In this process, on the one hand, the AC automaton cannot support wildcard characters and fuzzy search. On the other hand, a DAWG needs to be introduced, making the update method for the AC automaton more complex and cumbersome. Furthermore, additional storage of DAWG-related data is required, doubling the total storage space needed compared to before the update, resulting in a higher overall storage footprint and increased space complexity.

[0074] To address the aforementioned problems, this application proposes a pattern matching method and apparatus. By introducing a generalized automaton (e.g., a fractal automaton), it supports single-pattern matching or multi-pattern matching, as well as fuzzy search and incremental update / deletion. This solution also includes a dedicated compression / decompression method for the fractal automaton, reducing overall debugging and maintenance costs. The method and apparatus are based on the same technical concept. Since the principles underlying the problem-solving are similar, the implementations of the apparatus and method can be mutually referenced, and repeated details will not be elaborated upon. Furthermore, in the various embodiments of this application, unless otherwise specified or logically conflicting, the terminology and / or descriptions between the embodiments are consistent and can be mutually referenced. Technical features in different embodiments can be combined to form new embodiments based on their inherent logical relationships.

[0075] It should be noted that in the embodiments of this application, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, a and b, a and c, b and c, or a and b and c, where a, b, and c can be single or multiple.

[0076] Furthermore, unless otherwise specified, the ordinal numbers such as "first" and "second" mentioned in the embodiments of this application are used to distinguish multiple objects and are not used to limit the priority or importance of multiple objects. For example, "first node" and "second node" are only used to distinguish different nodes, and do not indicate that the priority or importance of these two nodes is different.

[0077] The basic structure of the fractal automata of this application embodiment will now be described in detail with reference to the accompanying drawings.

[0078] In this embodiment, the fractal automaton is a generalized Aho-Corasick automaton, a special type of TrieTree abstract data type. Structurally, it can be divided into root nodes, side root nodes, and ordinary nodes, also known as non-root nodes. In the Trie tree of the fractal automaton, side root nodes correspond to wildcard characters, and ordinary nodes correspond to non-wildcard characters. "Generalized" means that when the Trie tree structure of the fractal automaton has no side root nodes, the fractal automaton is equivalent to the traditional Aho-Corasick automaton, and its structure and failure pointer are as follows: Figure 2 As shown. When the Trie tree structure of the fractal automaton has no side root nodes and no branches, the fractal automaton will degenerate into a single-pattern string structure (or chain structure) corresponding to the KMP algorithm, and its structure and failure pointer are as follows. Figure 1 As shown. The KMP algorithm and the traditional AC automaton can also be regarded as a special case of the fractal automaton in the embodiments of this application.

[0079] It should be understood that the term "fractal automaton" here is merely an example name for a generalized AC automaton and not a limitation thereof. In other embodiments, the fractal automaton may have other names, and this application does not limit this.

[0080] As an example, the wildcard characters supported by the above fractal automata and their meanings / explanations can be shown in Table 1 below:

[0081] Table 1

[0082]

[0083] If a node in the tree structure of a fractal automaton corresponds to a wildcard character as shown in Table 1, then when performing natural language processing, information retrieval, or big data processing based on this fractal automaton, the wildcard character can fuzzily match one or more characters, enabling the fractal automaton to achieve fuzzy processing or fuzzy search functions. Therefore, compared to the traditional Aucma automaton, this fractal automaton can support fuzzy matching and has a wider range of applications or application scenarios.

[0084] To make it easier to understand, let's first combine... Figures 3-5 The basic structure of the fractal automata according to embodiments of this application is described.

[0085] In one example, such as Figure 3 As shown, a wildcard character is represented by "*". In the Trie tree structure of the fractal automaton, the corresponding pattern strings include: she*he, his, heehee, he*she, he*his, he*hee, he*here, and he*hers.

[0086] This Trie tree structure includes multiple nodes, each represented by a circle. These nodes can include a primary root node, at least one secondary root node, and multiple non-root nodes. The primary root node is the root of the entire tree, denoted by the symbol φ. The primary root node is empty, meaning it does not correspond to any character in the pattern strings. Each secondary root node is not empty and corresponds to a wildcard character in the pattern strings, such as *. Each non-root node is not empty and corresponds to a non-wildcard character in the pattern strings, such as h, s, i, e, r, etc. The multiple non-root nodes can also include nodes corresponding to the last character of the pattern string and nodes corresponding to characters in the pattern string that are not the last character and are not wildcard characters. For ease of distinction, Figure 3 In the tree structure, filled circles (a type of solid circle) represent nodes corresponding to the last character of each pattern string. Hollow circles represent non-last characters of each pattern string. Solid black arrows connect parent and child nodes in the tree structure, with the arrow pointing from the parent node to the child node. Different child nodes of the same node are sibling nodes.

[0087] Similar to the Aho-Corasick automaton, in the Trie tree structure of this fractal automaton, each node can have a failure pointer. This pointer is used to move to the node pointed to by the failure pointer when a mismatch occurs, reducing unnecessary judgment processes. Because there are nodes with corresponding wildcard characters, the method for determining the failure pointers of each node in the fractal automaton of this embodiment differs from that of the Aho-Corasick automaton.

[0088] As an example, in this embodiment of the application, the failure pointers of different types of nodes of the fractal automaton can be defined to satisfy at least one of the following conditions:

[0089] The failure pointers of both the primary root node and the secondary root node point to themselves.

[0090] 2. The failure pointers of non-root nodes adjacent to the main root node point to the main root node, and the failure pointers of non-root nodes adjacent to the side root node point to the side root node. Among them, the non-root nodes adjacent to the main root node include the child nodes of the main root node, and the non-root nodes adjacent to the side root node include the parent node, sibling nodes, and child nodes of the side root node.

[0091] 3. The failure pointers of non-root nodes corresponding to the last character of the pattern string all point to the main root node;

[0092] 4. The failure pointer of the non-root node corresponding to the non-last character of the pattern string points to: the node with the greatest common suffix found by searching upwards (or backwards) along the failure pointer of its parent node. If the main root node or side root node is encountered first during the search, the search stops, and its failure pointer points to the found main root node or side root node. Here, the node with the greatest common suffix refers to: the node whose child node, found by searching upwards along the failure pointer of its parent node, has the same character as the current node. "Searching upwards along the failure pointer of its parent node" means searching along the failure path of the current node's parent node. That is, if a node with the greatest common suffix is ​​not found at the node pointed to by the failure pointer of the parent node, and the main root node and side root node are not encountered, then it is necessary to continue searching along the node pointed to by the failure pointer of the parent node's parent node until a node that meets the condition is encountered, or the main root node or side root node is encountered first.

[0093] like Figure 3 As shown, the failure pointers of the primary root node φ and the two side root nodes corresponding to the wildcard character * point to themselves; their failure pointers are not shown in the diagram. The failure pointers of the nodes adjacent to the primary root node corresponding to the characters h and s point to the primary root node. Figure 3 The non-root nodes adjacent to a left-hand root node (corresponding to the character *) are the nodes surrounding it corresponding to the characters e, e, h, s, and their failure pointers point to that left-hand root node. Figure 3 The non-root nodes adjacent to a side root node (corresponding to the character *) on the right are the nodes surrounding it corresponding to the characters 'e' and 'h', and their failure pointers point to that side root node. The failure pointers of the nodes corresponding to the last character of each pattern string point to the main root node. For example, the failure pointers of nodes represented by the filled circle corresponding to the last character of the pattern string all point to the main root node.

[0094] When determining the failure pointer of a non-root node corresponding to a non-last character in the pattern string, the Trie tree is traversed level by level (from left to right) starting from the main root node. For each node corresponding to a non-last character in the pattern string, the node with the greatest common suffix to the current node is found along the failure path of the current node's parent node, as shown in condition ④. This node is the node pointed to by the failure pointer of the current node. If the main root node or a side root node is encountered first during the search, the search is stopped, and its failure pointer is set to point to the found main root node or side root node.

[0095] For example Figure 3In the process, the node corresponding to the character i in the third layer is taken as the current node of the failure pointer to be confirmed. The parent node of the current node is the node corresponding to the character h in the second layer. The failure pointer of the parent node points to the main root node. There is no node with the same character i as the current node among the child nodes of the main root node. That is, no node with the greatest common suffix is ​​found. And the main root node is encountered first. Then the failure pointer of the current node is made to point to the found main root node.

[0096] For example, consider the node corresponding to the character 'h' in the third layer as the current node of the failure pointer to be confirmed. The parent node of the current node is the node corresponding to the character 's' in the second layer. The failure pointer of the parent node points to the root node. Among the child nodes of the root node, there exists a node with the same character 'h' as ​​the current node, and the path from this child node to the root node corresponds to the string 'h', which has the greatest common suffix with 'sh'. Therefore, first find the node with the greatest common suffix, and then make the failure pointer of the current node point to the found child node. That is, the failure pointer of the node corresponding to the character 'h' in the third layer points to the node corresponding to the character 'h' in the second layer.

[0097] For example, take the node corresponding to the first character 'e' in the fourth layer as the current node of the failure pointer to be confirmed. The failure pointer of the parent node of the current node points to the side root node corresponding to the character '*' in the fourth layer. There is no node with the same character 'e' as the current node among the child nodes of the side root node. That is, no node with the greatest common suffix is ​​found. And the side root node is encountered first. Then the failure pointer of the current node points to the found side root node.

[0098] For example, take the node corresponding to the character 'r' in the seventh layer as the current node. The parent node of the current node is the node corresponding to the first character 'e' in the sixth layer. The failure pointer of the parent node points to the side root node. And there is no node with the same character 'h' as ​​the current node among the child nodes of the side root node. That is, no node with the greatest common suffix was found. And the side root node was encountered first. Then the failure pointer of the current node is made to point to the found side root node.

[0099] It should be noted that, in conditions ①-④ above, when traversing and analyzing each node in the trie of the fractal automaton, according to the timing of the traversal operations, if there is a conflict between conditions ② and ④, the failure pointer can be constructed according to condition ④ first. For example, according to the node number, the failure pointer of the sibling node of the side root node has already been set to point to the side root node according to condition ②. However, during subsequent traversal updates, it is necessary to update the failure pointer of the sibling node to the child node of the side root node according to condition ④, which constitutes a conflict. In this case, the failure pointer of the sibling node to the child node of the side root node should be updated according to condition ④ first. See the following section for further details. Figures 10-12 Examples are omitted here.

[0100] In another example, the state diagram of the fractal automaton of this application embodiment can be described using relevant elements of the state machine.

[0101] like Figure 4 As shown, the components of a fractal automaton's state diagram can include: states; transitions; conditions; start states; and termination states. For example, a state is represented by `qi`, where each state corresponds to a node in the fractal automaton's Trie tree. The value of `i` can be 0, 1, 2, ..., m, where `m` is an integer greater than 1. The start state is represented as `q0`, and the last character of each pattern string corresponds to the termination state, indicated by a filled circle. Solid black arrows represent the transition relationships between different states / nodes. The characters next to the solid black arrows represent the conditions for state transitions, such as characters a, b, c, etc. Dashed arrows represent failure pointers added to each node, which also satisfy the conditions described above. Figure 3 The conditions introduced are ①-④.

[0102] Figure 5 In this example, with m=30, the initial state q0 corresponds to the root node and is empty. Starting from the root node, state transitions occur based on the satisfied transition conditions. For example, if the condition is satisfied in q0 (e.g., matching the character 'b'), q0 transitions to q1. If the condition is satisfied in q0 (e.g., matching the character 'a'), q0 transitions to q2. If the condition is satisfied in q1 (e.g., matching the character 'c'), q1 transitions to q3. If the condition is satisfied in q1 (e.g., matching the character 'd'), q1 transitions to q4. If the condition is satisfied in q2 (e.g., matching the character 'b'), q2 transitions to q5. If the condition is satisfied in q3 (e.g., matching the character '*'), q3 transitions to q6, and so on, until the state transitions to q30.

[0103] Using "*" to represent a wildcard character, the tree structure in this state diagram corresponds to multiple pattern strings: abc*ab, bde, bdebc, bcdbcb, bcdbczb, bc*bc, bc*bbdz, bc*abz, bc*abcc, and bc*abcd. The states of different nodes correspond to substrings (prefixes) of these pattern strings, as shown below:

[0104] q1=b, q2=a, q3=bc, q4=bd, q5=ab, q6=bc*, q7=bcd, q8=bde, q9=abc, q10=bc*a, q11=bc*b, q12=bcdb,

[0105] q13=bdeb, q14=abc*, q15=bc*ab, q16=bc*bc, q17=bc*bb, q18=bcdbc, q19=bdebc, q20=abc*a,

[0106] q21=bc*abz, q22=bc*abc, q23=bc*bbd, q24=bcdbcb, q25=bcdbcz, q26=abc*ab,

[0107] q27=bc*abcc, q28=bc*abcd, q29=bc*bbdz, q30=bcdbczb.

[0108] exist Figure 5 In this context, the failure pointers of each node satisfy the conditions described above. Figure 3 The conditions introduced are ①-④.

[0109] For example, the node corresponding to q0 is the main root node, and its failure pointer points to itself (not shown in the diagram). The nodes corresponding to q1 and q2 are ordinary nodes adjacent to the main root node, and their failure pointers point to the main root node. The nodes corresponding to q6 and q14 are side root nodes, and their failure pointers point to themselves (not shown in the diagram). The nodes corresponding to q3, q7, and q10 are adjacent nodes to the side root node (corresponding to q6), and their failure pointers point to the side root node. The nodes corresponding to q9 and q20 are adjacent nodes to the side root node (corresponding to q14), and their failure pointers point to the side root node. q8, q11, q16, q19, q21, q24, q26, q27, q28, q29, and q30 are the last characters of their respective pattern strings, and their failure pointers all point to the main root node. In addition, based on the analysis of condition ④ above, the failure pointer of the node corresponding to q4 points to the root node, the failure pointer of the node corresponding to q5 points to the node corresponding to q1, the failure pointer of the node corresponding to q12 points to the node corresponding to q11, the failure pointer of the node corresponding to q13 points to the node corresponding to q1, the failure pointer of the node corresponding to q15 points to the node corresponding to q11, the failure pointer of the node corresponding to q17 points to the node corresponding to q1, the failure pointer of the node corresponding to q18 points to the node corresponding to q16, the failure pointer of the node corresponding to q22 points to the node corresponding to q16, the failure pointer of the node corresponding to q23 points to the node corresponding to q4, and the failure pointer of the node corresponding to q25 points to the root node.

[0110] Figure 3 and Figure 5 The fractal automaton shown is a generalized AC automaton that supports fuzzy matching and offers higher real-time performance compared to the BM algorithm, AC automaton, and their variants. Furthermore, this fractal automaton supports matching single-pattern strings, multi-pattern strings, and wildcard pattern strings, making it suitable for a wider range of applications.

[0111] The following section uses a flowchart to illustrate the method. Figure 3 or Figure 5 The construction process of the fractal automata shown.

[0112] To make it easier to distinguish, the following will be Figure 3 or Figure 5 The primary root node is represented as the first root node, each of the at least one secondary root node is represented as the second root node, and all nodes other than the first and second root nodes are represented as non-root nodes. These non-root nodes are further divided into first, second, third, and fourth non-root nodes. The first non-root node can be any non-root node adjacent to the second root node, including at least one of the following: parent node, sibling node, or child node of that second root node. The failure pointer of the first non-root node points to the corresponding second root node. The second non-root node can be any non-root node adjacent to the first root node, such as a child node of the first root node. The failure pointer of the second non-root node points to the first node. The third non-root node corresponds to a pattern string, specifically the last character of the pattern string. The failure pointer of the third non-root node points to the primary root node. The failure pointer of the fourth non-root node points to the node with the longest common suffix found along the failure path of the parent node. If the first or second root node is encountered first during the search, the search stops, and the failure pointer of the fourth non-root node points to the found first or second root node.

[0113] like Figure 6 As shown, the construction method may include the following steps:

[0114] S610: The computing node constructs the first trie based on the first information.

[0115] In this embodiment of the application, the first information includes at least one first pattern string, and each first pattern string includes at least one character. When implementing S610, the computing node can construct a pattern string dictionary based on at least one pattern string, and generate a first trie after encoding the input pattern string.

[0116] For example, encoding a pattern string may include merging consecutive wildcards, such as merging consecutive **s into a single *. Alternatively, encoding a pattern string may also include merging different pattern strings with a common prefix. For instance, given strings abc, abd, and abcd, since strings abc and abd share the same prefix 'ab,' strings abc and abd can be merged, with characters c and d becoming child nodes of character ab, i.e., characters c and d are sibling nodes. Since strings abc and abcd share the same prefix 'abc,' the 'd' in string abcd can become a child node of the 'c' in string abc.

[0117] The first trie is a prefix tree, a multi-way tree structure composed of "paths" and "nodes". During the generation of the first trie in S610, starting from the first root node, a corresponding character path is created for each character in at least one pattern string. The "path" records the characters in the pattern string, and the "node" records the number of characters traversed and the ending character's number. For example... Figure 5 In the diagram, different circles represent tree nodes, and black solid arrows represent "paths".

[0118] The first trie may include multiple nodes, each corresponding to a character in at least one first pattern string. If the at least one first pattern string includes at least one wildcard character, then the multiple nodes of the first trie include a first root node, at least one second root node, and multiple non-root nodes. The first root node is empty, each second root node corresponds to a wildcard character, and each non-root node corresponds to a non-wildcard character. If the at least one first pattern string does not include a wildcard character, then the multiple nodes of the first trie include a first root node and multiple non-root nodes. The first root node is empty, and each non-root node corresponds to a non-wildcard character.

[0119] S620: The computing nodes construct the failure pointers of the plurality of nodes to form a first fractal automaton.

[0120] In this embodiment of the application, based on the differences between different nodes, multiple failure pointers can be constructed according to the character type corresponding to the node and the conditions ①-④ described above.

[0121] For example, if a node includes a first root node and at least one second root node, when implementing S620, the computing node can first traverse the first root node and at least one second root node layer by layer and initialize its parent node to itself.

[0122] Then, the compute node can point the failure pointers of non-root nodes adjacent to the first root node to the first root node, and point the failure pointers of each non-root node adjacent to the second root node to the corresponding second root node. Here, the non-root nodes adjacent to the second root node include the parent node, sibling nodes, and child nodes of the second root node, denoted as the first non-root node, and their failure pointers point to the corresponding second root node. Similarly, the non-root nodes adjacent to the first root node include the child nodes of the first root node, denoted as the second non-root nodes, and their failure pointers point to the first root node.

[0123] by Figure 5Taking the fractal automaton shown as an example, multiple tree nodes are distributed layer by layer. q0 corresponds to the principal root node, i.e., the first root node. The non-root nodes adjacent to the first root node include all nodes below the principal root node, i.e., the nodes corresponding to q1 and q2. These nodes are also children of the principal root node. The failure pointers of the nodes corresponding to q1 and q2 point to the first root node. q6 and q14 correspond to the side root nodes, i.e., the second root node. The non-root nodes adjacent to the side root nodes include: the parent node of the side root node, the sibling node of the side root node, and the child nodes of the side root node. For example... Figure 5 As shown, the node corresponding to q3 is the parent node of the node corresponding to q6, the node corresponding to q7 is the sibling node of the node corresponding to q6, and the nodes corresponding to q10 and q11 are the child nodes of the node corresponding to q6. These nodes, as non-root nodes adjacent to the side root node, have their failure pointers pointing to the node corresponding to q6. The node corresponding to q9 is the parent node of the node corresponding to q14, and the node corresponding to q20 is the child node of the node corresponding to q14. These nodes, as non-root nodes adjacent to the side root node, have their failure pointers pointing to the node corresponding to q14.

[0124] Then, starting from the first root node, the main root and side root nodes are enqueued and dequeued sequentially. The child nodes of the main root and side root nodes are traversed, and corresponding failure pointers are constructed. These are then enqueued again, and the process is repeated until the queue is empty. Specifically, the child node is represented as the fourth non-root node. The construction process of the failure pointer for this fourth non-root node is as follows: When the failure pointer of the non-root node is not null, the character corresponding to a child node of the corresponding node is searched along the failure path of the parent node to see if it is the same as the character corresponding to the current non-root node, i.e., whether it has the longest common suffix. This continues until a node that meets the condition is found, or the main root node or side root node is encountered. Then, the failure pointer is pointed to the node corresponding to the point where the search stopped. In other words, the failure pointer of the fourth non-root node points to the node with the longest common suffix found along the failure path of the parent node. If the first root node or the second root node is encountered first during the search, the search stops, and the failure pointer of the fourth non-root node points to the first or second root node found.

[0125] by Figure 5Taking the fractal automaton shown as an example, for the node corresponding to q4, its failure pointer searches along the failure path of its parent node q1. It first encounters the root node, and then the failure pointer of the node corresponding to q4 points to the root node. For the node corresponding to q5, its failure pointer searches along the failure path of its parent node q2. It first encounters a child node q1 with the same character as its parent node, i.e., a node with the greatest common suffix, and then the failure pointer of the node corresponding to q5 points to node q1. Similarly, for the node corresponding to q13, it searches along the failure path of its parent node q8. It first encounters a child node q1 with the same character as its parent node, i.e., a node with the greatest common suffix, and then the failure pointer of the node corresponding to q13 points to node q1. For the node corresponding to q15, it searches along the failure path of its parent node q10. It first encounters a child node q11 with the same character as its parent node, i.e., a node with the greatest common suffix, and then the failure pointer of the node corresponding to q15 points to node q11. For the node corresponding to q17, following the failed path of its parent node q11, the first node encountered is a child node q1 with the same character as its parent node, i.e., a node with the greatest common suffix. Therefore, the failure pointer of the node corresponding to q17 points to node q1. For the node corresponding to q18, following the failed path of its parent node q12, the first node encountered is a child node q16 with the same character as its parent node, i.e., a node with the greatest common suffix. Therefore, the failure pointer of the node corresponding to q18 points to node q16. For the node corresponding to q22, following the failed path of its parent node q15, the first node encountered is a child node q16 with the same character as its parent node, i.e., a node with the greatest common suffix. Therefore, the failure pointer of the node corresponding to q22 points to node q16. For the node corresponding to q23, following the failed path of its parent node q17, the first node encountered is a child node q4 with the same character as its parent node, i.e., a node with the greatest common suffix. Therefore, the failure pointer of the node corresponding to q23 points to node q4. For the node corresponding to q25, follow the failure path of its parent node q18. If the root node q0 is encountered first, the failure pointer of the node corresponding to q25 will point to node q0.

[0126] It should be understood that Figure 6 This is merely an example of the construction method of the fractal automaton in this application and not a limitation thereof. In specific implementations, if at least one first pattern string in the first information serving as the data source of the pattern string does not contain a wildcard character, then the above-described first fractal automaton degenerates into a conventional Austenitic automaton, the structure of which is as follows: Figure 2 As shown. When at least one first pattern string does not contain a wildcard character and there is only one pattern string, the above first fractal automaton degenerates into the KMP algorithm, the structure of which is as follows. Figure 1 As shown.

[0127] Thus, the first fractal automaton is complete. Computational nodes can compress and store the relevant data of the first fractal automaton, and decompress the data when needed, applying the decompressed data to scenarios such as natural language processing, information retrieval, and big data processing. This first fractal automaton supports fuzzy matching and has higher real-time performance compared to the BM algorithm, AC automaton, and their variants. Furthermore, this fractal automaton supports matching single-pattern strings, multi-pattern strings, and wildcard pattern strings, broadening its application scenarios.

[0128] The fractal automata in this embodiment supports incremental updates. That is, when changes occur to the pattern string data source, it is not necessary to rebuild the Trie tree of the first fractal automata. Instead, the existing first fractal automata can be incrementally updated to reduce performance overhead and meet real-time requirements as much as possible.

[0129] In this embodiment of the application, changes to the pattern string data source of the fractal automaton may include at least one of adding, deleting, or updating the pattern string.

[0130] The following section introduces the incremental update principles corresponding to different data source change scenarios.

[0131] Example (1): Adding / updating the pattern string.

[0132] like Figure 7 As shown, for Figure 6 The incremental update process of the constructed first fractal automaton includes the following steps:

[0133] S701: Initialize the first fractal automaton at the compute node.

[0134] In this embodiment of the application, the initialization process may be: Figure 6 The initial construction process described may also refer to the process of obtaining the data of the first fractal automaton from the storage medium and decompressing it to obtain the first fractal automaton. This application does not limit this process.

[0135] S702: Compute nodes acquire target information.

[0136] For example, when a pattern string is added, the target information can be represented as second information, which includes a newly added second pattern string, the second pattern string including at least one character, and the second pattern string being different from the at least one first pattern string.

[0137] Alternatively, for example, in the case of updating the pattern string, the target information may include an updated fourth pattern string, which is used to update the third pattern string in at least one of the first pattern strings. The fourth pattern string does not contain the same characters as the third pattern string, that is, the fourth pattern string and the third pattern string have at least one common character and at least one non-common character.

[0138] S703: The computing node determines whether the pattern string corresponding to the target information already exists in the first fractal automaton. If not, proceed to S740. If yes, end the update process.

[0139] S704: The computing node updates the first trie based on the pattern string corresponding to the target information.

[0140] For example, when adding pattern strings, in implementing S740, one or more new nodes can be added to the first trie to obtain a second trie. Specifically, if at least one character of the second pattern string shares a common prefix with any of the at least one first pattern string, the number of new nodes is less than the number of characters contained in the second pattern string, and the new nodes correspond to non-common characters in the second pattern string. If at least one character of the second pattern string does not share a common prefix with any of the at least one first pattern string, then the number of new nodes is equal to the number of characters contained in the second pattern string.

[0141] Alternatively, for example, in the case of updating the pattern string, when implementing S740, according to the fourth pattern string, the node corresponding to at least one non-common character in the first trie is updated to obtain the third trie.

[0142] S705: The compute node completes the construction of the second / third trie.

[0143] S706: Compute the failure pointers of some nodes in the second / third trie to reconstruct the second or third fractal automaton.

[0144] For example, when adding pattern strings, implementing S760 allows for the reconstruction of failure pointers for some nodes in the second trie based on the relationship between the characters corresponding to one or more newly added nodes and the characters corresponding to other nodes in the second trie, thus forming a second fractal automaton. In the case of adding pattern strings, the "some nodes" include one or more newly added nodes, as well as the original nodes whose failure pointers are associated with the newly added nodes. Whether it's a newly added node or an original node, the update of its failure pointer satisfies conditions ①-④ described above, which will not be repeated here.

[0145] Alternatively, for example, in the case of updating the pattern string, when implementing S760, the failure pointers of some nodes in the third trie can be reconstructed based on the relationship between the at least one non-public character and the characters corresponding to other nodes in the third trie, thus forming a third fractal automaton. In the case of updating the pattern string, the mentioned "some nodes" include nodes corresponding to the updated at least one non-public character, and original nodes whose failure pointers are associated with the nodes corresponding to these characters. Whether it's the updated node or the original node, the update of its failure pointer satisfies conditions ①-④ described above, which will not be repeated here.

[0146] Example (2): Deletion of pattern string.

[0147] like Figure 8 As shown, for Figure 6 The incremental update process of the constructed first fractal automaton includes the following steps:

[0148] S801: Initialize the first fractal automaton at the compute node.

[0149] In this embodiment of the application, the initialization process may be: Figure 6 The initial construction process described may also refer to the process of obtaining the data of the first fractal automaton from the storage medium and decompressing it to obtain the first fractal automaton. This application does not limit this process.

[0150] S802: The computing node determines to delete a fifth pattern string from the at least one first pattern string, the fifth pattern string comprising at least one character.

[0151] S803: The compute node starts from the last character of at least one character in the fifth pattern string, and sequentially deletes the nodes corresponding to at least one character in the fifth pattern string from the first trie. After deleting a node, the following action is performed: reconstruct the failure pointer for the target node, the target node including the node whose original failure pointer pointed to the deleted node.

[0152] S804: Determine if the deletion of the fifth pattern string is complete. If not, return to S803 to traverse until the first non-root node of the first trie is reached, then stop the operation. If yes, end the incremental update process.

[0153] In other words, when deleting the current node, for nodes whose failure pointers point to the current node, it is necessary to reconstruct the failure pointers for them. At this time, according to condition ④ introduced earlier, we can search for the node with the longest common suffix along the failure path of its parent node. If the first or second root node is encountered first during the search, the search is stopped, and its failure pointer is made to point to the first or second root node found.

[0154] It should be understood that, Figure 8 During the deletion of pattern strings, if the fifth pattern string to be deleted has a common prefix with other pattern strings, then the node corresponding to the common prefix does not need to be deleted.

[0155] For ease of understanding, the following will use... Figure 4 The relevant elements of the state machine shown describe the incremental update process of the fractal automaton in this application embodiment and the corresponding state diagram example.

[0156] like Figure 9 As shown, the incremental update process of a fractal automaton includes the following steps:

[0157] S901: Initialize the first fractal automaton at the compute node.

[0158] In this embodiment of the application, the initialization process may be: Figure 6 The initial construction process described may also refer to the process of obtaining the data of the first fractal automaton from the storage medium and decompressing it to obtain the first fractal automaton. This application does not limit this process.

[0159] S902: The compute node obtains the newly added / updated pattern string, which is represented as p = p1, p2, ..., pn, where n is an integer greater than 1.

[0160] S903: The computing node determines whether the newly added / updated pattern string already exists in the first fractal automaton. If yes, the update process ends. If not, proceed to S904.

[0161] S904: The compute node determines whether a state transition of automaton pi exists. The value of i is 1, 2, ..., n. If not, proceed to S905. If yes, proceed to S907.

[0162] S905: The compute node adds transitions and states to the first trie.

[0163] S906: The compute node computes and updates the failure pointer.

[0164] S907: The compute node determines whether the traversal of the newly added / updated pattern string has ended. If yes, proceed to S908. If not, return to S904.

[0165] S908: The compute node completes the automaton update.

[0166] In one example, such as Figure 10 As shown, if the left figure represents the state diagram of the first fractal automaton, including nodes corresponding to the substrings (prefixes) of the following pattern strings: TATAT, ATATAT, AATATATA, ACGATAT, as shown below:

[0167] q1=A, q2=T, q3=AC, q4=AT, q5=TA, q6=ACG, q7=ATA, q8=TAT, q9=ACGA, q10=ATAT, q11=TATA,

[0168] q12=ACGAT, q13=ATATA, q14=TATAT, q15=ACGATA, q16=ATATAT, q17=ACGATA, q18=ATATATA.

[0169] Each node's failure pointer satisfies at least one of the conditions ①-④ described above. Traversing downwards from the root node, the failure pointers are as follows: q1 and q2's failure pointers point to the root node; q14, q16, q17, and q18's failure pointers point to the root node; q3's failure pointer points to the root node; q4's failure pointer points to the node corresponding to q2; q5's failure pointer points to the node corresponding to q1; q6's failure pointer points to the root node; q7's failure pointer points to the node corresponding to q5; q8's failure pointer points to the node corresponding to q4; q9's failure pointer points to the node corresponding to q1; q10's failure pointer points to the node corresponding to q8; q11's failure pointer points to the node corresponding to q7; q12's failure pointer points to the node corresponding to q4; q13's failure pointer points to the node corresponding to q11; and q15's failure pointer points to the node corresponding to q7.

[0170] When in Figure 10 When a new pattern string CGATA is added to the first fractal automaton on the left, the substrings (prefixes) of the pattern string CGATA are represented as: p1 = C, p2 = CG, p3 = CGA, p4 = CGAT, p5 = CGATA. Figure 9 The process shown first executes S903 to analyze whether the pattern string CGATA exists in the first fractal automaton.

[0171] If not, execute S904, starting from the main root node, traverse and analyze layer by layer, and determine in turn whether the state and transition corresponding to each substring of the newly added pattern string CGATA already exist in the first fractal automaton.

[0172] For example, if p1 = C does not exist in q1-q18 of the first fractal automaton, then the transition state corresponding to p1 = C is added to the first trie of the first fractal automaton, such as... Figure 10As shown on the right, the transition is from q0 to q19, represented by the state q19 = C. Then, S906 is executed, adding a failure pointer to the node corresponding to q19, pointing to the main root node according to condition ①. Simultaneously, since a new node corresponding to q19 is added and is a child node of the main root node, among the nodes that originally followed the parent node's failure pointer to the main root node, there exists a node with the same character as the newly added q19 node, such as the node corresponding to q3. Therefore, the failure pointer of the node corresponding to q3 needs to be updated, and according to condition ④, the updated failure pointer of the node corresponding to q3 points to the node corresponding to q19.

[0173] If the update process for the newly added pattern string is not yet complete, the update process of S904-S907 will continue.

[0174] For example, if p2 = CG does not exist in q1-q18 of the first fractal automaton, then the transition state corresponding to p1 = C is added to the first trie of the first fractal automaton, such as... Figure 10 As shown on the right, the transition is from q19 to q20, and the state is represented as q20 = CG. Then, S906 is executed, adding a failure pointer to the node corresponding to q20. Since the node corresponding to q20 is not the root node and its corresponding character is not the last character of the pattern string, the search proceeds according to condition ④, following the parent node's failure path to find the main root node. Therefore, the failure pointer of the node corresponding to q19 points to the main root node. Simultaneously, since a new node corresponding to q20 has been added and is a child node of the node corresponding to q19, it is necessary to recalculate whether a node to point to q20 exists. Through traversal analysis, it is found that among the nodes that originally pointed to q19 along the parent node's failure pointer, there exists a node with the same character as the newly added q20 node, such as the node corresponding to q6. Therefore, the failure pointer of the node corresponding to q6 needs to be updated. According to condition ④, the updated failure pointer of the node corresponding to q6 points to the node corresponding to q20.

[0175] Similarly, if the update process for adding a new pattern string is not yet complete, the update process of S904-S907 continues to be executed to continue adding the remaining transitions and states of the pattern string CGATA to the first trie of the first fractal automaton, for example... Figure 10 In this context, q21-q23 are represented as follows:

[0176] q21=CGA, q22=CGAT, q23=CGATA;

[0177] And update the failure pointers of the relevant nodes until the automaton update is completed, forming the second fractal automaton.

[0178] It should be understood that Figure 10This description uses the addition of a single pattern string as an example to illustrate the incremental update method of this application embodiment, and does not limit the number of pattern strings to be updated. In specific implementations, when incrementally updating the fractal automaton, multiple pattern strings can be added, and the process of adding substrings (prefixes) of each pattern string can only follow the steps outlined in the example. Figure 9 The flowchart shown, and Figure 10 Example implementation. Furthermore, both the first fractal automaton to be updated and the newly added pattern string can include nodes or substrings corresponding to wildcard characters; this application embodiment does not limit this.

[0179] In another example, such as Figure 11 As shown, if the left figure represents the state diagram of the first fractal automaton, including nodes corresponding to the substrings (prefixes) of the following pattern strings: TATAT, ATATAT, ATATATA, ACGATAT, CGATA, as shown below:

[0180] q1=A, q2=T, q3=AC, q4=AT, q5=TA, q6=ACG, q7=ATA, q8=TAT, q9=ACGA, q10=ATAT, q11=TATA,

[0181] q12=ACGAT, q13=ATATA, q14=TATAT, q15=ACGATA, q16=ATATAT, q17=ACGATA, q18=ATATATA, q19=C, q20=CG, q21=CGA, q22=CGAT, q23=CGATA.

[0182] Each node's failure pointer satisfies at least one of the conditions ①-④ described above. Traversing downwards from the root node, the failure pointers are as follows: q1, q2, and q19's failure pointers point to the root node; q14, q16, q17, q18, and q23's failure pointers point to the root node; q3's failure pointer points to the node corresponding to q19; q4's failure pointer points to the node corresponding to q2; q5's failure pointer points to the node corresponding to q1; q6's failure pointer points to the node corresponding to q20; q7's failure pointer points to the node corresponding to q5; and q8's failure pointer points to the node corresponding to q20. The failure pointer of node q4 points to the node corresponding to q9; the failure pointer of node q21 points to the node corresponding to q10; the failure pointer of node q8 points to the node corresponding to q11; the failure pointer of node q7 points to the node corresponding to q12; the failure pointer of node q22 points to the node corresponding to q13; the failure pointer of node q15 points to the node corresponding to q23; the failure pointer of node q20 points to the root node; the failure pointer of node q21 points to the node corresponding to q1; and the failure pointer of node q22 points to the node corresponding to q4.

[0183] When it is necessary to Figure 11 When the pattern string CGATA in the first fractal automaton on the left is changed to the pattern string CGACA, the substrings (prefixes) of the pattern string CGACA are represented as: p1 = C, p2 = CG, p3 = CGA, p4 = CGAC, p5 = CGACA. Figure 9 The process shown first executes S903 to analyze whether the pattern string CGACA exists in the first fractal automaton.

[0184] If not, execute S904, starting from the main root node, traverse and analyze layer by layer, and determine in turn whether the state transitions corresponding to each substring of the newly added pattern string CGACA already exist in the first fractal automaton.

[0185] For example, if p1 = C exists in q19 of the first fractal automaton, then proceed to S907 to analyze whether the traversal has ended. Since there are still remaining substrings to be traversed and analyzed, return to S904 to analyze whether p2 = CG already exists in the first fractal automaton.

[0186] If p2 = CG exists in q20 of the first fractal automaton, then proceed to S907 to analyze whether the traversal has ended. Since there are still remaining substrings that have not been traversed and analyzed, return to S904 to analyze whether p3 = CGA already exists in the first fractal automaton.

[0187] If p3 = CGA exists in q21 of the first fractal automaton, then proceed to S907 to analyze whether the traversal has ended. Since there are still remaining substrings that have not been traversed and analyzed, return to S904 to analyze whether p4 = CGAC already exists in the first fractal automaton.

[0188] If not, proceed to S905 to add a transition and state. The transition is from q21 to q22, and the state is represented as q22 = CGAC, which means modifying the original substring CGAT corresponding to q22 to CGAC. Simultaneously, since the character corresponding to q22 is updated, S906 needs to be executed to calculate and update the failure pointer. At this point, the new q22 is still a non-root node. Therefore, according to condition ④, the failure path of the parent node q21 is searched. It is found that among the child nodes of the node pointed to by the parent node's failure pointer, there is a node with the same character as the character corresponding to q22, such as the node corresponding to q3. Therefore, the failure pointer of q22 is set to the node corresponding to q3. At the same time, the failure pointers of the nodes that originally pointed to q22 need to be reconstructed, such as the node corresponding to q12. According to condition ④, after traversal analysis, q4 is found to meet the requirements along the failure path of q12's parent node. Therefore, the failure pointer of the node corresponding to q12 is updated to point to the node corresponding to q4.

[0189] Since there are still remaining substrings that have not been traversed and analyzed, we return to S904 to analyze whether p5 = CGACA already exists in the first fractal automaton.

[0190] If not, proceed to S905 to add a transition and state. The transition is from q22 to q23, and the state is represented as q23 = CGACA. Simultaneously, S906 needs to be executed to calculate and update the failure pointer. At this point, for the new q23, which is a non-root node corresponding to the last character of the pattern string, its failure pointer is set to the main root node according to condition ③. Also, the nodes whose failure pointers originally pointed to q23 need to have their failure pointers reconstructed, such as the node corresponding to q15. According to condition ④, after traversal analysis, q7 is found to meet the requirements along the failure path of q15's parent node. Therefore, the failure pointer of the node corresponding to q15 is updated to point to the node corresponding to q7.

[0191] It should be understood that Figure 11 This paper only uses the modification of a single pattern string as an example to introduce the incremental update method of this application embodiment, and does not limit the number of pattern strings to be modified. In specific implementation, when performing incremental updates on a fractal automaton, multiple pattern strings can be modified, and the modification process of the substrings (prefixes) of each pattern string can only be carried out according to... Figure 9 The flowchart shown, and Figure 11Example implementation. Furthermore, both the first fractal automaton to be updated and the pattern string to be modified can include nodes or substrings corresponding to wildcard characters; this application embodiment does not limit this.

[0192] In another example, such as Figure 12 As shown, if the left figure represents the state diagram of the first fractal automaton, including nodes corresponding to the substrings (prefixes) of the following pattern strings: TATAT, ATATAT, ATATATA, ACGATAT, CGACA, as detailed below:

[0193] q1=A, q2=T, q3=AC, q4=AT, q5=TA, q6=ACG, q7=ATA, q8=TAT, q9=ACGA, q10=ATAT, q11=TATA,

[0194] q12=ACGAT, q13=ATATA, q14=TATAT, q15=ACGATA, q16=ATATAT, q17=ACGATA, q18=ATATATA, q19=C, q20=CG, q21=CGA, q22=CGAC, q23=CGACA.

[0195] Each node's failure pointer satisfies at least one of the conditions ①-④ described above. Traversing downwards from the root node, the failure pointers are as follows: q1, q2, and q19's failure pointers point to the root node; q14, q16, q17, q18, and q23's failure pointers point to the root node; q3's failure pointer points to the node corresponding to q19; q4's failure pointer points to the node corresponding to q2; q5's failure pointer points to the node corresponding to q1; q6's failure pointer points to the node corresponding to q20; q7's failure pointer points to the node corresponding to q5; and q8's failure pointer points to the node corresponding to q20. The failure pointer of a node points to the node corresponding to q4; the failure pointer of the node corresponding to q9 points to the node corresponding to q21; the failure pointer of the node corresponding to q10 points to the node corresponding to q8; the failure pointer of the node corresponding to q11 points to the node corresponding to q7; the failure pointer of the node corresponding to q12 points to the node corresponding to q4; the failure pointer of the node corresponding to q13 points to the node corresponding to q11; the failure pointer of the node corresponding to q15 points to the node corresponding to q7; the failure pointer of the node corresponding to q20 points to the root node; the failure pointer of the node corresponding to q21 points to the node corresponding to q1; and the failure pointer of the node corresponding to q22 points to the node corresponding to q3.

[0196] When in Figure 12When a new pattern string AC*GATA is added to the first fractal automaton on the left, the substrings (prefixes) of the pattern string AC*GATA are represented as: p1=A, p2=AC, p3=AC*, p4=AC*G, p5=AC*GA, p6=AC*GAT, p7=AC*GATA. Figure 9 The process shown first executes S903 to analyze whether the pattern string AC*GATA exists in the first fractal automaton.

[0197] If not, execute S904, starting from the main root node, traverse and analyze layer by layer, and determine in turn whether the state and transition corresponding to each substring of the newly added pattern string AC*GATA already exist in the first fractal automaton.

[0198] For example, if p1 = A exists in q1 of the first fractal automaton, then proceed to S907 to analyze whether the traversal has ended. Since there are still remaining substrings to be traversed and analyzed, return to S904 to analyze whether p2 = AC already exists in the first fractal automaton.

[0199] For example, if p2 = AC exists in q3 of the first fractal automaton, then proceed to S907 to analyze whether the traversal has ended. Since there are still remaining substrings to be traversed and analyzed, return to S904 to analyze whether p3 = AC* already exists in the first fractal automaton.

[0200] If not, proceed to S905 to add a transition and state. The transition is from q3 to q24, where q24 = AC*. Then execute S906 to add a failure pointer to the node corresponding to q24. Since the node corresponding to q24 is a side root node, according to condition ①, its failure pointer points to itself. Simultaneously, since the nodes corresponding to q3 and q6 are respectively the parent and sibling nodes of the node corresponding to q24, condition ② is satisfied. Therefore, it is necessary to reconstruct the failure pointers for the nodes corresponding to q3 and q6. According to condition ②, the new failure pointers for the nodes corresponding to q3 and q6 point to the node corresponding to q24.

[0201] If the update process for the newly added pattern string is not yet complete, the update process of S904-S907 will continue.

[0202] For example, since p4 = AC*G does not exist in any of q1-q24 of the first fractal automaton, a transition and state corresponding to p4 = AC*G are added to the first trie of the first fractal automaton. The transition is from q24 to q25, and the state is represented as q25 = AC*G. Then, S906 is executed to add a failure pointer to the node corresponding to q25. Since the node corresponding to q25 is a child node of the side root node q24, according to condition ②, the failure pointer of the node corresponding to q25 points to the node corresponding to q24. At the same time, according to condition ④, after traversal analysis, the failure pointer of the node corresponding to q6 is updated to point to the node corresponding to q25.

[0203] If the update process for the newly added pattern string is not yet complete, the update process of S904-S907 will continue.

[0204] For example, since p5 = AC*GA does not exist in any of the q1-q25 nodes of the first fractal automaton, a transition and state corresponding to p5 = AC*GA are added to the first trie of the first fractal automaton. The transition is from q25 to q26, and the state is represented as q26 = AC*GA. Then, S906 is executed to add a failure pointer to the node corresponding to q26. Since the node corresponding to q26 is not a root node, according to condition ④, the failure path along the parent node q25 first encounters the side root node q24. Therefore, the failure pointer of the node corresponding to q26 points to the node corresponding to q24. At the same time, according to condition ④, after traversal analysis, the failure pointer of the node corresponding to q9 is updated to point to the node corresponding to q26.

[0205] If the update process for the newly added pattern string is not yet complete, the update process of S904-S907 will continue.

[0206] For example, since p6 = AC*GAT does not exist in any of q1-q26 of the first fractal automaton, a transition and state corresponding to p6 = AC*GAT are added to the first trie of the first fractal automaton. The transition is from q26 to q27, and the state is represented as q27 = AC*GAT. Then, S906 is executed to add a failure pointer to the node corresponding to q27. Since the node corresponding to q27 is not a root node, according to condition ④, the failure path along the parent node q26 is followed, and the side root node q24 is encountered first. Therefore, the failure pointer of the node corresponding to q27 points to the node corresponding to q24. At the same time, according to condition ④, after traversal analysis, the failure pointer of the node corresponding to q12 is updated to point to the node corresponding to q27.

[0207] If the update process for the newly added pattern string is not yet complete, the update process of S904-S907 will continue.

[0208] For example, since p7 = AC*GATA does not exist in any of q1-q27 of the first fractal automaton, a transition and state corresponding to p7 = AC*GATA are added to the first trie of the first fractal automaton. The transition is from q27 to q28, and the state is represented as q28 = AC*GATA. Then, S906 is executed to add a failure pointer to the node corresponding to q28. Because the node corresponding to q28 corresponds to the last character of the pattern string, according to condition ③, the failure pointer of the node corresponding to q28 is pointed to the root node. At the same time, according to condition ④, after traversal analysis, the failure pointer of the node corresponding to q15 is updated to point to the node corresponding to q28.

[0209] It should be understood that Figure 12 This paper only uses the example of adding a pattern string containing a wildcard character to describe the incremental update method of this application embodiment, and does not limit the number of new pattern strings. In specific implementation, when performing incremental updates on the fractal automaton, multiple pattern strings containing wildcard characters can be added. The process of adding substrings (prefixes) of each pattern string can only follow the steps... Figure 9 The flowchart shown, and Figure 12 Example implementation. Furthermore, both the first fractal automaton to be updated and the newly added pattern string can include nodes or substrings corresponding to non-wildcard characters; this application embodiment does not limit this.

[0210] In another example, when pattern string deletion is required on the pattern string data source of the first fractal automaton, in Figure 10 and Figure 12 In the example shown, the roles of the two fractal automata in the diagram can be interchanged, and the second fractal automaton can be updated to the first fractal automaton. During this update process, firstly, a fifth pattern string is determined to be deleted from the at least one first pattern string. The fifth pattern string includes at least one character. Starting from the last character of the at least one character in the fifth pattern string, nodes corresponding to at least one character in the fifth pattern string are sequentially deleted from the first trie. After each node deletion, the following action is performed: a failure pointer is reconstructed for the target node, the target node including the node whose original failure pointer pointed to the deleted node; the operation stops when the first non-root node of the first trie is reached.

[0211] For example Figure 10 As shown, if we delete the pattern string CGATA from the second fractal automaton as the fifth pattern string, then in the trie of the second fractal automaton, we first delete the node corresponding to q23, and at the same time update the failure pointers of the related nodes. For example, according to condition ④, we update the failure pointer of the node q17, which originally pointed to q23, to point to the node corresponding to q7.

[0212] Then, delete the node corresponding to q22, and update the failure pointers of some related nodes. For example, according to condition ④, update the failure pointer of node q12, which originally pointed to q22, to point to the node corresponding to q4.

[0213] Then, delete the node corresponding to q21, and update the failure pointers of some related nodes. For example, according to condition ④, update the failure pointer of node q9, which originally pointed to q21, to point to the node corresponding to q1.

[0214] Then, delete the node corresponding to q20, and update the failure pointers of some related nodes. For example, according to condition ④, update the failure pointer of node q6, which originally pointed to q20, to point to the root node.

[0215] Then, delete the node corresponding to q19, and update the failure pointers of some related nodes. For example, according to condition ④, update the failure pointer of node q3, which originally pointed to q19, to point to the root node.

[0216] Once the first non-root node q0 is reached, the operation stops.

[0217] Or for example Figure 12 As shown, if we delete the pattern string AC*GATA from the second fractal automaton as the fifth pattern string, then in the trie of the second fractal automaton, we first delete the node corresponding to q28, and at the same time update the failure pointers of the related nodes. For example, according to condition ④, we update the failure pointer of the node q15, which originally pointed to q28, to point to the side root node corresponding to q24.

[0218] Then, delete the node corresponding to q27, and update the failure pointers of some related nodes. For example, according to condition ④, update the failure pointer of node q12, which originally pointed to q27, to point to the node corresponding to q24.

[0219] Then, delete the node corresponding to q26, and update the failure pointers of some related nodes. For example, according to condition ④, update the failure pointer of node q9, which originally pointed to q26, to point to the node corresponding to q24.

[0220] Then, delete the node corresponding to q25, and update the failure pointers of some related nodes. For example, according to condition ④, update the failure pointer of node q6, which originally pointed to q25, to point to the node corresponding to q24.

[0221] Then, delete the node corresponding to q24 and update the failure pointers of some related nodes. For example, according to condition ④, reconstruct the failure pointers of nodes q3, q6, q9, q12, and q15 that originally pointed to q24. After traversal analysis, point the failure pointer of the node corresponding to q3 to the node corresponding to q19, the failure pointer of the node corresponding to q6 to the node corresponding to q20, the failure pointer of the node corresponding to q9 to the node corresponding to q21, the failure pointer of the node corresponding to q12 to the node corresponding to q4, and the failure pointer of the node corresponding to q15 to the node corresponding to q5.

[0222] Since the nodes corresponding to q3 and q1 share a common prefix with other pattern strings, these two nodes are not deleted. The operation stops upon reaching the first non-root node q0.

[0223] Therefore, it has been combined Figures 9-12 This paper describes the incremental update method for fractal automata according to embodiments of the present application, using the elements of a state machine. This update method eliminates the need to rebuild the Trie tree of the fractal automaton even if the data source of the fractal automaton's pattern string changes. Instead, it allows for incremental updates of the existing fractal automaton, reducing performance overhead and maximizing real-time performance. Furthermore, compared to updating via suffix automata, the computation is simpler and requires no additional storage space.

[0224] Furthermore, this application embodiment also provides a dedicated compressed storage scheme for the above-mentioned fractal automata, which will be described in detail below with reference to the accompanying drawings.

[0225] In this embodiment of the application, as an example, the Huffman coding method can be used to compress and decompress the relevant data of the fractal automata.

[0226] The process can begin by traversing from the first root node. Based on the parent-child dependencies of each node in the first trie of the first fractal automaton and the frequency with which each node in the first trie is pointed to by the failure pointers of other nodes, the data associated with each node in the first trie is sequentially serialized and encoded to obtain a first data sequence. The first data sequence is then compressed to obtain a first compressed file. The first compressed file is then saved in the persistent storage medium of the computing node.

[0227] like Figure 13 As shown, the compressed storage method for fractal automata may include the following steps:

[0228] S1310: The computation node traverses each node of the trie of the fractal automaton in a level-order manner, serializes and sorts the relevant data of the nodes.

[0229] For example, Figure 14 Taking the serialization and sorting of the relevant data of each node of the fractal automaton as an example, the following table shows the results:

[0230] Table 2

[0231]

[0232] In Table 2, the first column represents the node number assigned to each node in the hierarchical trie of the fractal automaton, which corresponds to the node identifier number in the third column. The second column is the "Slast" column, indicating whether the node in each row is the last node in its current level (0 for no, 1 for yes). The third column represents the node identifier. The fourth column represents the preceding parent node of each node. The fifth column represents the node pointed to by the failure pointer of each node. The sixth column indicates whether each node itself is a parent node (1 for yes, 0 for no).

[0233] S1320: The compute nodes analyze the parent-child dependencies of each node and the frequency with which each node is pointed to by the failure pointers of other nodes based on the serialized data (e.g., as shown in Table 2).

[0234] For example, analyzing the content shown in Table 2 yields the content shown in Table 3:

[0235] Table 3

[0236] Node identifier Frequency of being pointed to by the failure pointer q0 7 q1 1 q2 3 q3 1

[0237] In Table 3, the first column represents the identifiers of all nodes pointed to by the failure pointers. The second column represents the frequency of being pointed to by the failure pointers.

[0238] S1330: The computing node sequentially serializes and encodes the data associated with each node of the first trie of the first fractal automaton according to the parent-child dependency relationship of each node and the frequency of each node of the first trie being pointed to by the failure pointers of other nodes, to obtain the first data sequence.

[0239] In this embodiment of the application, as an example, the encoding method can specifically be the Huffman method, and the encoded information is in binary format. For example, based on the content shown in Table 3, the encoding can be performed as follows: Figure 14The encoding process shown in the right figure starts with the total frequency (the total number of failed pointers) and analyzes the nodes pointed to by failed pointers from highest to lowest frequency. Each time a node pointed to by a failed pointer is encountered, the frequency of that node is subtracted from the total frequency, until the analysis ends. The numbers represented by the arrows during the analysis are combined to obtain the encoded information of the failed pointers pointing to the corresponding nodes. For example, the encoded information for a failed pointer pointing to q0 is 0, for q1 it is 100, for q2 it is 11, and for q3 it is 101.

[0240] Based on Table 2 and the encoding information corresponding to each failure pointer, the first data sequence shown in Table 4 can be obtained:

[0241] Table 4

[0242] Type Node identifier Encoded information of failure pointer 11 q0 0 01 q1 0 11 q2 0 01 q3 0 11 q4 0 11 q5 100 11 q6 0 10 q7 11 11 q8 101 00 q9 11 10 q10 0 10 q11 11

[0243] In Table 4, the second column represents the node identifier. The first column represents the node type; each row in this column contains two digits, a combination of the second and sixth columns from Table 1. The first digit indicates whether the corresponding node is the last node in its current layer, and the second digit indicates whether the node itself is a parent node. The third column contains the encoded information of the failure pointers pointing to the nodes in that row. For example, the failure pointers of nodes q0-q4, q6, and q10 all point to q0, corresponding to an encoded value of 0. The failure pointer of node q5 points to q1, with an encoded value of 100. The failure pointers of nodes q7, q9, and q11 point to q2, with an encoded value of 11. The failure pointer of node q8 points to q3, with an encoded value of 101.

[0244] S1340: The computing node compresses the first data sequence to obtain the first compressed file. For example, Table 4 is compressed to obtain the corresponding compressed file.

[0245] S1350: The compute node stores the first compressed file in the compute node's persistent storage medium. For example, it stores the compressed file corresponding to Table 4.

[0246] When the fractal automaton is needed, a decompression operation is performed, for example, reading the first compressed file from the persistent storage medium of the computing node; decompressing the first compressed file to obtain the first data sequence; constructing the first trie based on the first data sequence, and constructing failure pointers for multiple nodes of the first trie to form the first fractal automaton.

[0247] This process is... Figure 13The reverse of the process shown, that is, after decompressing to obtain the contents shown in Table 3, the third column of Table 3 is processed according to... Figure 14 The analysis process shown on the right decodes from back to front to obtain the content shown in Table 2. Then, it processes the first and second columns of Tables 2 and 3 in reverse to obtain the content shown in Table 1. Based on the content shown in Table 1, a structure is built as follows: Figure 14 The trie shown on the left is used to add (or fill, construct, etc.) failure pointers to each node of the trie, resulting in the corresponding fractal automaton.

[0248] Furthermore, even after the fractal automata is compressed, the compressed file of the fractal automata can still be used to implement the pattern matching method of the embodiments of this application.

[0249] For example, the search process for compressed files based on automata may include the following steps:

[0250] S1: After inputting the substring to be searched, start traversing from the main root node (the first non-root node), and search for the corresponding child node in reverse according to the serialization process of level traversal, thus realizing dictionary search.

[0251] S2: When S1 fails to find the corresponding node, follow the failure pointer to find the encoded information of the corresponding node, decode it to obtain the index of the corresponding node, calculate the sequence position corresponding to the index, and then repeat S1.

[0252] S3: When the input ends, record the matched pattern string.

[0253] Therefore, through Figures 13-14 The method described herein enables dedicated compressed storage of the fractal automata in the embodiments of this application. This compressed storage method does not cause data distortion and can significantly reduce the storage space occupied by the fractal automata, thereby reducing the difficulty and cost of maintaining the fractal automata. Furthermore, in some application scenarios, decompression can be omitted, and pattern matching can be performed within the compressed file instead.

[0254] In one example, the fractal automata and its construction method, incremental update method, compressed storage method, and decompression method described above can be applied to the vehicle field to inspect the vehicle logs in order to promptly detect problems in the vehicle.

[0255] like Figure 15As shown, different users can report their desired rule files for vehicle log analysis to the server from their terminal devices (referred to as front-ends), and dynamically update the rule files. Users can also manage the rule files, including but not limited to adding, modifying, querying, deleting, or exporting them. Optionally, the server can also support regular expression matching rules, SQL database rules, Python custom rules, or rules specific to other domains; this embodiment does not limit these specific rules.

[0256] When a user needs to trigger an inspection task, the user can issue the inspection task to the server and send operation and maintenance instructions to the server through the operation and maintenance interface displayed on their terminal device. These instructions include, but are not limited to, creating, modifying, querying, deleting, canceling, activating, and deactivating. Furthermore, the user can also manage / view analysis reports and results through the operation and maintenance interface. The user's terminal device can display a web interface or other types of operation and maintenance interfaces to issue inspection tasks or view analysis reports and results. The inspection task can be at least one task type, such as a whole vehicle inspection task or a daily inspection task. This application embodiment does not limit this.

[0257] The server can provide users with inspection task management, inspection service management, and inspection analysis result management functions. The inspection task management function is used to manage inspection tasks triggered by users. The inspection service management function is used to execute and manage received inspection tasks. The inspection analysis result management function is used to analyze and manage inspection results and present corresponding analysis reports and results to users.

[0258] For inspection tasks, after the server receives the inspection task from the terminal device, it can obtain the original log file and the analysis engine can match the corresponding rule file for retrieval and correlation analysis.

[0259] The original log file may be reported to the server and stored on the server after obtaining prior authorization from the vehicle user, or it may be stored on the vehicle manufacturer's server and obtained from the vehicle manufacturer's server after obtaining authorization. This application embodiment does not limit the source of the log file.

[0260] The analysis engine can construct (or incrementally update) fractal automata based on rule files, and use these fractal automata to retrieve original log files. After correlation analysis, the output results, i.e., reports, are fed back to the user's terminal device. The terminal device can also export the results.

[0261] The rule file mentioned above is the pattern string data source described earlier. The analysis engine can convert the rule file into the corresponding pattern string using a preset translator (or other tools). If the server, acting as the computing node described earlier, has historically constructed fractal automata stored in its accessible storage medium, it can incrementally update the fractal automata according to the pattern string corresponding to the rule file, following the incremental update method described earlier. If the server's accessible storage medium does not store a fractal automata, it can construct the required fractal automata according to the pattern string corresponding to the rule file, following the construction method described earlier. Detailed methods can be found in the relevant descriptions above and will not be repeated here.

[0262] Therefore, through the aforementioned fractal automata, in retrieval scenarios involving a large number of rules, such as vehicle inspection, for real-time systems with thousands of rules and very frequent updates, the automata can be dynamically and efficiently updated. Rules can be added, deleted, or modified at a relatively low cost, effectively meeting the needs of real-time systems. Simultaneously, the dedicated compressed storage method for the automata effectively improves system reliability and performance, and the compressed automata also effectively reduces disk space usage. Directly querying the compressed automata sequence also achieves a better balance between time and space.

[0263] This application also provides a communication device for executing the construction method, incremental update method, compression method, decompression method, or pattern matching method executed by the computing node in the above method embodiments. The relevant features can be found in the above method embodiments, and will not be repeated here.

[0264] When the communication device executes the construction method executed by the computing node, such as Figure 16 As shown, the communication device 1600 may include: a processing unit 1601, configured to construct a first trie based on first information, wherein the first information includes at least one first pattern string, each first pattern string includes at least one character, the first trie includes multiple nodes, if the at least one first pattern string includes at least one wildcard character, the multiple nodes include a first root node, at least one second root node and multiple non-root nodes, the first root node is empty, one second root node corresponds to one wildcard character, and the non-root node corresponds to one non-wildcard character; and construct failure pointers of the multiple nodes to form a first fractal automaton, wherein the failure pointer of the first root node or the at least one second root node points to itself, the multiple non-root nodes include the first non-root node, the first non-root node includes at least one of the following of any second root node among the at least one second root node: parent node, sibling node or child node, and the failure pointer of the first non-root node points to the second root node.

[0265] When the communication device executes the update method performed by the computing node, such as Figure 17 As shown, the communication device 1700 may include: an acquisition unit 1701, configured to acquire a first automaton, wherein the first automaton is constructed based on first information, the first information including at least one first pattern string, each first pattern string including at least one character, the first trie of the first automaton including multiple nodes, if the at least one first pattern string includes at least one wildcard character, the multiple nodes including a first root node, at least one second node and multiple non-root nodes, the first root node being empty, one second node corresponding to one wildcard character, and each non-root node corresponding to one non-wildcard character; and acquire second information, the second information including a newly added second pattern string, the second pattern string... The second pattern string includes at least one character, and the second pattern string is different from the at least one first pattern string; the processing unit 1702 is used to add one or more new nodes to the first trie to obtain a second trie, wherein if at least one character of the second pattern string has a common prefix with any of the at least one first pattern string, the number of new nodes is less than the number of characters contained in the second pattern string, and the new node corresponds to a non-common character in the second pattern string; based on the relationship between the characters corresponding to the one or more new nodes and the characters corresponding to other nodes in the second trie, the failure pointers of some nodes in the second trie are reconstructed to form a second automaton.

[0266] When the communication device executes the compression method performed by the computing node, such as Figure 18 As shown, the communication device 1800 may include: an acquisition unit 1801, configured to acquire a first trie of a first automaton and failure pointers of multiple nodes of the first trie, wherein the first automaton is constructed based on first information, the first information including at least one first pattern string, each first pattern string including at least one character, the first trie including multiple nodes, if the at least one first pattern string includes at least one wildcard character, the multiple nodes including a first root node, at least one second root node and multiple non-root nodes, the first root node being empty, one second root node corresponding to one wildcard character, and each non-root node corresponding to one non-wildcard character; a processing unit 1802, configured to traverse from the first root node of the first automaton, and according to the parent-child dependency relationship of each node of the first trie and the frequency of each node of the first trie being pointed to by the failure pointers of other nodes, sequentially serialize and encode the data associated with each node of the first trie to obtain a first data sequence; compress the first data sequence to obtain a first compressed file; and a storage unit 1803, configured to save the first compressed file in the persistent storage medium of the computing node.

[0267] It should be understood that the division of units in the above device is only a logical functional division. In actual implementation, they can be fully or partially integrated into a single physical entity, or they can be physically separated. Furthermore, the units in the device can be implemented by a processor calling software; for example, the device includes a processor connected to a memory containing instructions. The processor calls the instructions stored in the memory to implement any of the above methods or to implement the functions of each unit in the device. The processor can be, for example, a general-purpose processor, such as a Central Processing Unit (CPU) or a microprocessor, and the memory can be internal or external to the device. Alternatively, the units in the device can be implemented as hardware circuits. The functionality of some or all units can be achieved through the design of these hardware circuits, which can be understood as one or more processors. For example, in one implementation, the hardware circuit is an application-specific integrated circuit (ASIC). The functionality of some or all of the above units is achieved through the design of the logical relationships between the components within the circuit. In another implementation, the hardware circuit can be implemented using a programmable logic device (PLD). Taking a field-programmable gate array (FPGA) as an example, it can include a large number of logic gates. The connection relationships between the logic gates are configured through a configuration file, thereby achieving the functionality of some or all of the above units. All units of the above device can be implemented entirely through processor-invoked software, entirely through hardware circuits, or partially through processor-invoked software with the remaining parts implemented through hardware circuits.

[0268] In this application embodiment, the processor is a circuit with signal processing capabilities. In one implementation, the processor can be a circuit with instruction reading and execution capabilities, such as a CPU, microprocessor, graphics processing unit (GPU) (which can be understood as a type of microprocessor), or digital signal processor (DSP). In another implementation, the processor can implement certain functions through the logical relationships of hardware circuits. These logical relationships of hardware circuits are fixed or reconfigurable. For example, the processor is a hardware circuit implemented as an ASIC or PLD, such as an FPGA. In a reconfigurable hardware circuit, the process of the processor loading a configuration document and configuring the hardware circuit can be understood as the process of the processor loading instructions to implement the functions of some or all of the above units. Furthermore, it can also be a hardware circuit designed for artificial intelligence, which can be understood as an ASIC, such as a Neural Network Processing Unit (NPU), Tensor Processing Unit (TPU), or Deep Learning Processing Unit (DPU).

[0269] As can be seen, each unit in the above device can be one or more processors (or processing circuits) configured to implement the above methods, such as: CPU, GPU, NPU, TPU, DPU, microprocessor, DSP, ASIC, FPGA, or a combination of at least two of these processor forms.

[0270] Furthermore, the units in the above devices can be integrated in whole or in part, or they can be implemented independently. In one implementation, these units are integrated together as a system-on-a-chip (SOC). The SOC may include at least one processor for implementing any of the above methods or implementing the functions of the units in the device. The at least one processor may be of different types, such as CPU and FPGA, CPU and artificial intelligence processor, CPU and GPU, etc.

[0271] In a simplified embodiment, those skilled in the art will realize that the communication devices described in the above embodiments can all be employed. Figure 19 As shown in the figure.

[0272] like Figure 19 The illustrated device 1900 includes at least one processor 1910 and a communication interface 1930. In an alternative design, a memory 1920 may also be included.

[0273] The specific connection medium between the processor 1910 and the memory 1920 described above is not limited in the embodiments of this application.

[0274] In such Figure 19 In the device, the processor 1910 can transmit data through the communication interface 1930 when communicating with other devices.

[0275] When the communication device adopts Figure 19 When in the form shown, Figure 19 The processor 1910 can call computer execution instructions stored in the memory 1920, enabling the device 1900 to execute any of the above method embodiments.

[0276] This application also relates to a chip system including a processor for calling a computer program or computer instructions stored in a memory to cause the processor to execute the methods of any of the above embodiments.

[0277] In one possible implementation, the processor can be coupled to the memory via an interface.

[0278] In one possible implementation, the chip system may also directly include a memory in which computer programs or computer instructions are stored.

[0279] For example, the memory can be volatile memory or non-volatile memory, or may include both. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which serves as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (SLDRAM), and direct rambus RAM (DR RAM).

[0280] This application also relates to a processor for calling a computer program or computer instructions stored in a memory to cause the processor to execute the methods described in any of the above embodiments.

[0281] For example, in the embodiments of this application, the processor is an integrated circuit chip with signal processing capabilities. For instance, the processor can be an FPGA, a general-purpose processor, a DSP, an ASIC, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, a system-on-chip (SoC), a CPU, a network processor (NP), a microcontroller unit (MCU), a PLD, or other integrated chips, capable of implementing or executing the methods, steps, and logic block diagrams disclosed in the embodiments of this application. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory; the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above methods.

[0282] It should be understood that embodiments of this application may be provided as methods, systems, or computer program products.

[0283] In one possible implementation, embodiments of this application provide a computer-readable storage medium storing program code that, when executed on a computer, causes the computer to perform the method embodiments described above.

[0284] In one possible implementation, this application provides a computer program product that, when run on a computer, causes the computer to execute the above-described method embodiments.

[0285] Therefore, this application may take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0286] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0287] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0288] Obviously, those skilled in the art can make various modifications and variations to the embodiments of this application without departing from the scope of the embodiments of this application. Therefore, if these modifications and variations to the embodiments of this application fall within the scope of the claims of this application and their equivalents, this application also intends to include these modifications and variations. In the various embodiments of this application, unless otherwise specified or logically conflicting, the terminology and / or descriptions between the various embodiments are consistent and can be mutually referenced. Technical features in different embodiments can be combined to form new embodiments based on their inherent logical relationships.

Claims

1. An automatic machine management method, characterized in that, The method applied to a computing node comprises: constructing a first dictionary tree according to first information, wherein the first information comprises at least one first pattern string, each first pattern string comprises at least one character, the first dictionary tree comprises a plurality of nodes, if the at least one first pattern string comprises at least one wildcard character, the plurality of nodes comprises a first root node, at least one second root node and a plurality of non-root nodes, the first root node is empty, one second root node corresponds to one wildcard character, and the non-root node corresponds to one non-wildcard character; constructing a failure pointer of the plurality of nodes to form a first automaton, wherein the failure pointer of the first root node or the at least one second root node points to itself, the plurality of non-root nodes comprises the first non-root node, the first non-root node comprises at least one of the following: a parent node, a sibling node or a child node of any one of the at least one second root node, and the failure pointer of the first non-root node points to the second root node.

2. The method of claim 1, wherein, The plurality of non-root nodes further comprises at least one of the following: a second non-root node, a third non-root node or a fourth non-root node, wherein the failure pointers of different types of non-root nodes satisfy at least one of the following: the second non-root node comprises a child node of the first root node, and the failure pointer of the second non-root node points to the first root node; the third non-root node corresponds to one first pattern string, and the failure pointer of the third non-root node points to the first root node; the failure pointer of the fourth non-root node points to a node with the longest common suffix found upwards along the failure pointer of the parent node, and if the first root node or the second root node is encountered first during the finding process, the finding is stopped, and the failure pointer of the fourth non-root node points to the found first root node or second root node.

3. The method according to claim 1 or 2, characterized in that, The method further comprises: obtaining second information, wherein the second information comprises a newly added second pattern string, the second pattern string comprises at least one character, and the second pattern string is different from the at least one first pattern string; adding one or more new nodes in the first dictionary tree to obtain a second dictionary tree, wherein if at least one character of the second pattern string has a common prefix with any one of the at least one first pattern string, the number of new nodes is less than the number of characters contained in the second pattern string, and the new nodes correspond to non-common characters in the second pattern string; reconstructing the failure pointers of part of the nodes in the second dictionary tree according to the relationship between the characters corresponding to the one or more new nodes and the characters corresponding to other nodes in the second dictionary tree to form a second automaton.

4. The method according to claim 1 or 2, characterized in that, The method further comprises: determining that a third pattern string in the at least one first pattern string is changed to a fourth pattern string, the third pattern string and the fourth pattern string have at least one common character and at least one non-common character; updating the nodes corresponding to the at least one non-common character in the first dictionary tree according to the fourth pattern string to obtain a third dictionary tree. According to the at least one non-common character, and the relationship between the characters corresponding to other nodes in the third dictionary tree, the failure pointers of part of the nodes in the third dictionary tree are restructured, forming a third automaton.

5. The method according to any one of claims 1-4, characterized in that, The method further comprises: determining to delete a fifth pattern string from the at least one first pattern string, the fifth pattern string comprising at least one character; starting from the last character of the at least one character of the fifth pattern string, sequentially deleting the nodes corresponding to the at least one character in the fifth pattern string from the first dictionary tree, and after each node is deleted, reconfiguring the failure pointer of the target node, the target node comprising the node to which the original failure pointer points to the deleted node; until the first non-root node of the first dictionary tree is reached, the operation is stopped.

6. The method according to any one of claims 1-5, characterized in that, The method further comprises: starting from the first root node, sequentially serializing the data associated with each node of the first dictionary tree of the first automaton according to the parent-child dependency relationship of each node of the first dictionary tree of the first automaton, and the frequency of each node of the first dictionary tree being pointed to by the failure pointer of other nodes, to obtain a first data sequence; compressing the first data sequence to obtain a first compressed file; saving the first compressed file in the persistent storage medium of the computing node.

7. The method according to any one of claims 1 to 6, characterized in that, The method further comprises: reading the first compressed file from the persistent storage medium of the computing node; decompressing the first compressed file to obtain the first data sequence; configuring the first dictionary tree according to the first data sequence, and configuring the failure pointers of the plurality of nodes of the first dictionary tree to form the first automaton.

8. The method according to any one of claims 1-7, characterized in that, Any first pattern string in the at least one first pattern string can be implemented as any of the following: a single pattern string; a multi-pattern string; a pattern string containing a wildcard character.

9. An automatic machine management method, characterized in that, Applied to a computing node, the method comprises: obtaining a first automaton, wherein the first automaton is configured according to first information, the first information comprising at least one first pattern string, each first pattern string comprising at least one character, a first dictionary tree of the first automaton comprising a plurality of nodes, if the at least one first pattern string comprises at least one wildcard character, the plurality of nodes comprising a first root node, at least one second root node, and a plurality of non-root nodes, the first root node being empty, one second root node corresponding to one wildcard character, and the non-root node corresponding to one non-wildcard character; obtaining second information, the second information comprising a newly added second pattern string, the second pattern string comprising at least one character, the second pattern string being different from the at least one first pattern string; adding one or more new nodes in the first dictionary tree to obtain a second dictionary tree, wherein if the at least one character of the second pattern string has a common prefix with any first pattern string in the at least one first pattern string, the number of new nodes is less than the number of characters contained in the second pattern string, and the new nodes correspond to the non-common characters in the second pattern string; According to the relationship between the characters corresponding to the one or more added nodes and the characters corresponding to other nodes in the second dictionary tree, the failure pointers of part of the nodes in the second dictionary tree are restructured to form a second automaton.

10. The method of claim 9, wherein, The plurality of nodes of the first dictionary tree or the second dictionary tree satisfy at least one of the following conditions: The failure pointer of the first root node or the at least one second root node points to itself; The plurality of non-root nodes further include at least one of the following: a first non-root node, a second non-root node, a third non-root node, or a fourth non-root node, wherein The first non-root node includes at least one of the following: a parent node, a sibling node, or a child node of any of the at least one second root node, and the failure pointer of the first non-root node points to the second root node; The second non-root node includes a child node of the first root node, and the failure pointer of the second non-root node points to the first root node; The third non-root node corresponds to a first pattern string, and the failure pointer of the third non-root node points to the first root node; The failure pointer of the fourth non-root node points to a node with the longest common suffix found upwards along the failure pointers of the parent nodes, and if the first root node or the second root node is encountered first during the search, the search is stopped, and the failure pointer of the fourth non-root node is made to point to the found first root node or second root node.

11. The method according to claim 9 or 10, characterized in that, The method further includes: Determining to delete a fifth pattern string from the at least one first pattern string, the fifth pattern string including at least one character; Starting from the last character of the at least one character of the fifth pattern string, sequentially deleting nodes corresponding to the at least one character in the fifth pattern string from the first dictionary tree, and after each node is deleted, reconfiguring the failure pointer of the target node, the target node including a node whose original failure pointer points to the deleted node, until the first non-root node of the first dictionary tree is reached, and the operation is stopped.

12. The method according to any one of claims 9-11, characterized in that, The method further includes: Starting from the first root node, sequentially serializing and encoding the data associated with each node of the first dictionary tree of the first automaton according to the parent-child dependency relationship of each node of the first dictionary tree of the first automaton and the frequency of each node of the first dictionary tree being pointed to by the failure pointers of other nodes, to obtain a first data sequence; Compressing the first data sequence to obtain a first compressed file; Saving the first compressed file in the persistent storage medium of the computing node.

13. The method according to any one of claims 9-12, characterized in that, The method further includes: Reading the first compressed file from the persistent storage medium of the computing node; Decompressing the first compressed file to obtain the first data sequence; According to the first data sequence, the first dictionary tree is constructed, and the failure pointers of the plurality of nodes of the first dictionary tree are constructed to form the first automaton.

14. The method according to any one of claims 9-13, characterized in that, Any of the at least one first pattern string can be implemented as any of the following: A single pattern string; a plurality of pattern strings; a pattern string containing a wildcard character.

15. An automatic machine management method, characterized in that, Applied to a computing node, the method includes: obtaining a first dictionary tree of a first automaton and failure pointers of nodes of the first dictionary tree, wherein the first automaton is constructed according to first information, the first information comprises at least one first pattern string, each first pattern string comprises at least one character, the first dictionary tree comprises nodes, if the at least one first pattern string comprises at least one wildcard character, the nodes comprise a first root node, at least one second root node and a plurality of non-root nodes, the first root node is empty, one second root node corresponds to one wildcard character, and the non-root node corresponds to one non-wildcard character; starting from the first root node of the first automaton, sequentially serializing and encoding data associated with each node of the first dictionary tree according to parent-child dependency relationships of each node of the first dictionary tree and frequencies at which each node of the first dictionary tree is pointed to by failure pointers of other nodes, to obtain a first data sequence; compressing the first data sequence to obtain a first compressed file; storing the first compressed file in a persistent storage medium of the computing node.

16. The method of claim 15, wherein, The nodes of the first dictionary tree satisfy at least one of the following conditions: The failure pointer of the first root node or the at least one second root node points to itself. The plurality of non-root nodes further comprises at least one of the following: a first non-root node, a second non-root node, a third non-root node or a fourth non-root node, wherein, The first non-root node comprises at least one of the following of any second root node in the at least one second root node: a parent node, a sibling node or a child node, and the failure pointer of the first non-root node points to the second root node; The second non-root node comprises a child node of the first root node, and the failure pointer of the second non-root node points to the first root node; The third non-root node corresponds to a first pattern string, and the failure pointer of the third non-root node points to the first root node; The failure pointer of the fourth non-root node points to a node with the longest common suffix found upwards along the failure pointer of the parent node, and if the first root node or the second root node is encountered first during the search, the search is stopped, and the failure pointer of the fourth non-root node points to the found first root node or second root node.

17. The method according to claim 15 or 16, characterized in that The method further comprises: reading the first compressed file from the persistent storage medium of the computing node; decompressing the first compressed file to obtain the first data sequence; constructing the first dictionary tree and the failure pointers of the nodes of the first dictionary tree according to the first data sequence, to form the first automaton.

18. The method according to any one of claims 15-17, characterized by, Any first pattern string in the at least one first pattern string can be implemented as any of the following: single pattern string; multiple pattern strings; pattern string containing wildcard character.

19. A communications device, characterized by An apparatus comprising at least one processor and interface circuitry for providing data or code instructions to the at least one processor for implementing the method of any one of claims 1-8, or the method of any one of claims 9-14, or the method of any one of claims 15-18, by logic circuitry or executing the code instructions.

20. A computer-readable storage medium, characterized in that, The computer readable medium stores program code which, when executed on a computer, causes the computer to perform the method of any one of claims 1-8, or the method of any one of claims 9-14, or the method of any one of claims 15-18.

21. A computer program product, characterised in that, The computer program product, when executed on a computer, causes the computer to perform the method of any one of claims 1-8, or the method of any one of claims 9-14, or the method of any one of claims 15-18.