DPU-based string multi-mode matching method, device, system and storage medium

By performing multi-mode matching on the DPU processor and utilizing the hardware acceleration capability of the DPU, the problems of high resource consumption and long response time of multi-mode matching methods in the existing technology are solved, and the problem of high load and high-speed network environment is achieved. Efficient message processing.

CN118277629BActive Publication Date: 2024-09-27CORE YUNSHENG (HANGZHOU) ELECTRONIC TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410704754.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-03
Publication Date
2024-09-27
Estimated Expiration
2044-06-03

AI Technical Summary

Technical Problem

Existing multi-pattern matching methods consume large amounts of CPU resources and have long response times when processing a large number of strings, and cannot be effectively applied to high-load, high-speed network environments.

Method used

Using the DPU-based string multi-mode matching method, the DPU processor receives the original data packet and control information packet, extracts the message feature information for multi-mode matching, and generates the message information packet, and uses the DPU's mode hardware library to accelerate the matching process. , to avoid multi-mode matching operations of CPU software algorithms.

Benefits of technology

It improves the efficiency of multi-mode matching, reduces resource consumption and storage space requirements, and can effectively handle high-load, high-speed network environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118277629B
    Figure CN118277629B
Patent Text Reader

Abstract

The present application provides a DPU-based string multi-mode matching method, device, system and storage medium. First, the DPU's cache capability is used to cache the data message received by the network device in the DPU chip storage module; at the same time, the DPU's flexible programming capability and high-speed search engine are combined to execute the same logic as the HOST side; and multi-mode matching is performed on the message, and finally the matching result is directly returned to the HOST together with the message itself. The present invention avoids the multi-mode matching search operation of the message in the CPU's software algorithm, gives full play to the characteristics of the DPU chip, and greatly improves the process efficiency. At the same time, it solves the problems of high computing power consumption, large storage space consumption, message processing delay, and inability to be applied to high-load, high-speed network environments in the multi-mode matching method in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of domain data feature matching, and in particular to a DPU-based string multi-mode matching method, device, system and storage medium. Background Art

[0002] Multi-mode matching, also known as multi-pattern matching, is a method of matching multiple pattern strings (key strings) from one string at the same time. It is widely used in many application scenarios, including keyword filtering, intrusion detection, virus detection, word segmentation, etc. At present, multi-mode matching is usually implemented with software algorithms. This method can work normally when the number of patterns is limited, but when the number of strings reaches more than 10K, it will consume a lot of CPU resources and the search response time will be longer.

[0003] Specifically, Figure 1 The method of multi-mode matching of network messages in the prior art is demonstrated. The whole process requires multiple modules to work together, including: pattern library, search logic, business logic, etc. First, the network data message is sent directly to the HOST host through the DPU, and the HOST host determines whether to perform multi-mode matching. If the matching process is triggered, the pattern library is called and the multi-mode matching operation is performed. Finally, the result of the multi-mode matching is handed over to the business logic for unified processing.

[0004] In summary, the existing technologies for multi-mode matching have the following defects: 1) High resource consumption: The CPU requires a large amount of computing resources to process messages, resulting in excessive CPU load and affecting the overall performance of the system. 2) Slow execution speed: The CPU is a general-purpose computing device that needs to compare each position of the message one by one in sequence, resulting in a longer response time for the matching process. 3) Insufficient storage space: The CPU has limited cache capacity and cannot store a large amount of message data at the same time, which may lead to frequent memory accesses and further reduce processing efficiency. These shortcomings limit the CPU's ability to process messages in a high-load, high-speed network environment.

[0005] As one of the three major chips for future computing, DPU has become the hottest and fastest-growing field in the industry in recent years, forming a new pattern of "CPU+GPU+DPU", in which CPU is responsible for general computing, GPU is used for accelerated computing, and DPU is used for data processing. Among them, DPU's advantages lie in virtualization, network, storage and security. At the same time, as a basic network device in the information age, DPU is more focused on serving the processing of network messages, with built-in hardware acceleration units for multiple message processing, which has a natural advantage in improving message processing performance, including multi-mode matching of messages. Summary of the invention

[0006] In view of the shortcomings of the prior art described above, the purpose of the present application is to provide a DPU-based string multi-mode matching method, device, system and storage medium to solve the problems of high computing power consumption, large storage space consumption, message processing delay, and inability to be applied to high-load, high-speed network environments in the multi-mode matching method in the prior art.

[0007] To achieve the above-mentioned purpose and other related purposes, the first aspect of the present application provides a DPU-based string multi-mode matching method, which is applied to a DPU processor, and the DPU processor is used to establish a communication connection with a CPU processor. The method includes: receiving an original data packet and a control information packet; extracting message feature information from the original data packet to perform a multi-mode matching operation based on the message feature information and generate a message information packet; performing a library management operation on the mode hardware library of the DPU processor based on the received control information packet; and sending the message information packet and the control information packet to the CPU processor.

[0008] In some embodiments of the first aspect of the present application, the process of extracting message feature information from the original data packet and performing a multi-mode matching operation based on the message feature information includes: based on the difference in the length of the original data packet, dividing the data packet message body content contained in the original data packet into multiple segments for a multi-mode matching operation; matching the current message body segment with the to-be-matched pattern stored in the pattern hardware library; if the match with any pattern is successful, generating a single matching result information, and after the matching operation is performed on all messages, packaging one or more matching result information to generate a matching result data packet.

[0009] In some embodiments of the first aspect of the present application, the process of generating a message information packet includes: performing a multi-mode matching operation based on the message feature information; if a matching result data packet is generated, the matching result data packet and the message feature information are packaged in a preset manner, and the message information packet is generated together with the original data packet; otherwise, the message feature information is packaged in a preset manner to generate the message information packet.

[0010] To achieve the above-mentioned purpose and other related purposes, the second aspect of the present application provides a DPU-based string multi-mode matching method, which is applied to a CPU processor, and the CPU processor is used to establish a communication connection with the DPU processor. The method includes: receiving a message information packet and a control information packet sent by the DPU processor; performing library management operations on the pattern library of the CPU processor based on the control information packet; based on the message information packet, judging whether the message in the message information packet contains a matching result data packet, if the message information packet contains the matching result data packet, reading the matching result; otherwise, performing a multi-mode matching operation on the message in the message information packet.

[0011] In some embodiments of the second aspect of the present application, the acquisition of message information packets and control information packets sent by the DPU processor includes the following processes: receiving original data packets and control information packets; acquiring message body data from the original data packets to perform multi-mode matching operations based on the message body data information and generate message information packets; performing library management operations on the mode hardware library of the DPU processor based on the received control information packets; and sending the message information packets and the control information packets to the CPU processor.

[0012] To achieve the above-mentioned purpose and other related purposes, the third aspect of the present application provides a DPU-based string multi-mode matching system, wherein the CPU processor establishes a communication connection with the DPU processor, and the system includes the following interaction process:

[0013] The DPU processor receives an original data packet and a control information packet; and obtains message body data from the original data packet to perform a multi-mode matching operation based on the message body data and generate a message information packet; the DPU processor performs a library management operation on a mode hardware library of the DPU processor based on the received control information packet; and sends the message information packet and the control information packet to the CPU processor; the CPU processor receives the message information packet and the control information packet sent by the DPU processor; if the control information packet is received, the library management operation is performed on the mode library of the CPU processor based on the control information packet; based on the message information packet, it is determined whether a message in the message information packet contains a matching result data packet, and if the message information packet contains the matching result data packet, the matching result is read; otherwise, a multi-mode matching operation is performed on the message in the message information packet.

[0014] To achieve the above-mentioned purpose and other related purposes, the fourth aspect of the present application provides a DPU processor for multi-mode matching of strings based on DPU, wherein the DPU processor is used to establish a communication connection with a CPU processor, including: a communication storage module: used to receive original data packets and control information packets; a multi-mode matching module: used to obtain message body data in message feature information from the original data packet, so as to perform multi-mode matching operations based on the message feature information and generate message information packets; a library management module: used to perform library management operations on the mode hardware library of the DPU processor based on the received control information packet; and send the message information packet and the control information packet to the CPU processor.

[0015] To achieve the above-mentioned purpose and other related purposes, the fifth aspect of the present application provides a CPU processor for multi-mode matching of strings based on DPU, including: a communication module: used to receive message information packets and control information packets sent by the DPU processor; a multi-mode matching module: used to perform library management operations on the pattern library of the CPU processor based on the control information packet; a library management module: used to determine whether the message in the message information packet contains a matching result data packet based on the message information packet, and if the message information packet contains the matching result data packet, read the matching result; otherwise, perform a multi-mode matching operation on the message in the message information packet.

[0016] To achieve the above-mentioned purpose and other related purposes, the sixth aspect of the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the DPU-based string multi-mode matching method is implemented.

[0017] To achieve the above-mentioned purpose and other related purposes, the seventh aspect of the present application provides an electronic terminal, including: a processor and a memory; the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the terminal executes the DPU-based string multi-mode matching method.

[0018] As described above, the DPU-based string multi-mode matching method, device, system and storage medium of the present application have the following beneficial effects: the present invention gives full play to the characteristics of the DPU chip and can greatly improve the process efficiency. Utilizing the caching capability of the DPU, the network device caches the received data message in the DPU chip storage module, and combines the flexible programming capability of the DPU and the high-speed search engine, while also executing the same logic as the HOST side, and finally performs multi-mode matching on the message, and then directly returns the matching result together with the message itself to the HOST. The present invention avoids the multi-mode matching search operation of the message in the software algorithm of the CPU, and solves the problems of high computing power consumption, large storage space consumption, message processing delay, and inability to be applied to high-load, high-speed network environments in the multi-mode matching method in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 The flowchart of the prior art of DPU-based string multi-mode matching of the present application is shown.

[0020] Figure 2 A flow chart of an embodiment of a DPU-based string multi-mode matching method of the present application is shown.

[0021] Figure 3 A flow chart of an embodiment of a DPU-based string multi-mode matching method of the present application is shown.

[0022] Figure 4 A flow chart of an embodiment of a DPU-based string multi-mode matching method of the present application is shown.

[0023] Figure 5 A flow chart of an embodiment of a DPU-based string multi-mode matching method of the present application is shown.

[0024] Figure 6 The figure shows a flowchart of the interaction process between the DPU processor and the CPU processor in an embodiment of the DPU-based string multi-mode matching system of the present application.

[0025] Figure 7 A structural diagram of an embodiment of a DPU processor for multi-mode string matching based on a DPU in the present application is shown.

[0026] Figure 8 A structural diagram of an embodiment of a CPU processor for multi-mode string matching based on a DPU of the present application is shown.

[0027] Fig. 9 A structural schematic diagram of an embodiment of an electronic terminal for DPU-based string multi-mode matching of the present application is shown. DETAILED DESCRIPTION

[0028] The following describes the embodiments of the present application through specific examples, and those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.

[0029] It should be noted that in the following description, with reference to the accompanying drawings, several embodiments of the present application are described in the accompanying drawings. It should be understood that other embodiments may also be used, and mechanical composition, structure, electrical and operational changes may be made without departing from the spirit and scope of the present application. The following detailed description should not be considered restrictive, and the scope of the embodiments of the present application is limited only by the claims of the published patents. The terms used here are only for describing specific embodiments and are not intended to limit the present application. Spatially related terms, such as "upper", "lower", "left", "right", "below", "below", "lower", "above", "upper", etc., may be used in the text to facilitate the description of the relationship between an element or feature shown in the figure and another element or feature.

[0030] In this application, unless otherwise clearly specified and limited, the terms "install", "connect", "connect", "fix", "hold" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be an indirect connection through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood according to specific circumstances.

[0031] Furthermore, as used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless there is an indication to the contrary in the context. It should be further understood that the terms "comprise", "include" indicate the presence of the described features, operations, elements, components, items, kinds, and / or groups, but do not exclude the presence, occurrence or addition of one or more other features, operations, elements, components, items, kinds, and / or groups. The terms "or" and "and / or" used herein are interpreted as inclusive, or mean any one or any combination. Therefore, "A, B or C" or "A, B and / or C" means "any of the following: A; B; C; A and B; A and C; B and C; A, B and C". Exceptions to this definition will only occur when the combination of elements, functions or operations is inherently mutually exclusive in some way.

[0032] In order to solve the problems in the above-mentioned background technology, the present invention provides a DPU-based string multi-mode matching method, device, system and storage medium, aiming at DPU-based string multi-mode matching. At the same time, in order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution in the embodiment of the present invention is further described in detail through the following embodiments and in combination with the accompanying drawings. It should be understood that the specific embodiments described here are only used to explain the present invention and are not used to limit the invention.

[0033] Before further describing the present invention in detail, the nouns and terms involved in the embodiments of the present invention are explained. The nouns and terms involved in the embodiments of the present invention are applicable to the following interpretations:

[0034] <1> Multimode matching: Multimode string matching is a process of finding multiple patterns (strings) in a text at the same time. Its goal is to find all the locations in the text that match the pattern. The process of multimode string matching can be accelerated by building a data structure.

[0035] <2> Pattern library: The pattern library is a data structure that stores all the patterns (strings) to be matched. It can be an array, hash table, Trie tree, AC automaton, etc. The pattern library is used to store all the patterns that need to be found in the text to be matched.

[0036] <3> Pattern hardware library: A pattern hardware library is a hardware accelerator used to accelerate the execution of multi-pattern matching algorithms. It usually contains specially designed hardware circuits that can efficiently process pattern matching operations in the pattern library.

[0037] <4> Pattern Control Library: A pattern control library is a database or data structure that stores a set of patterns for matching. The pattern control library contains information such as the patterns to be matched, the corresponding actions, and the matching rules. The pattern control library is usually managed and used by the DPU or other dedicated hardware in the network device. It can contain multiple types of patterns, such as regular expressions, fixed strings, wildcards, etc., which are used to match the content or features in the network message.

[0038] <5> Pattern-related messages: Pattern-related messages refer to messages or events related to pattern matching. When the DPU or hardware in a network device matches a certain pattern, the corresponding pattern-related messages are triggered. These messages can be used to trigger specific actions, execute policies, record logs, etc.

[0039] <6> DPU (Data Processing Unit): A data processing unit is a coprocessor specifically designed for processing data. It can be used to accelerate the execution of multi-mode matching algorithms, especially when processing large-scale data. DPU can increase the speed of multi-mode matching through parallel computing.

[0040] <7> Absolute mapping: Absolute mapping refers to software development where there is a one-to-one relationship between the interface provided by one library and the interface provided by another library, without any information being lost or mismatched.

[0041] The embodiments of the present invention provide a DPU-based string multi-mode matching method, a DPU-based string multi-mode matching method system, and a storage medium storing an executable program for implementing the DPU-based string multi-mode matching method. As far as the implementation of the DPU-based string multi-mode matching method is concerned, the embodiments of the present invention will describe an exemplary implementation scenario of the DPU-based string multi-mode matching method.

[0042] In one embodiment of the present invention, Figure 2 As shown, after receiving the original data packet and the control information packet, the DPU processor stores the original data packet and the control information packet in the cache space. If the message needs to perform a multi-mode matching operation, the message information is sent to the search logic module, and the search logic module performs a multi-mode matching operation on the message information in the original data packet with the support of the hardware mode library, and then sends the matching result to the CPU processor, and performs a multi-mode matching operation in the CPU processor for the message information that has not passed through the DPU processor.

[0043] The following will combine Figure 3 and Figure 4 The principle and implementation process of the present invention are explained in detail.

[0044] like Figure 3 As shown, a flow chart of a DPU-based string multi-mode matching method in an embodiment of the present invention is shown. Applied to a DPU processor, the DPU processor is used to establish a communication connection with a CPU processor. The DPU-based string multi-mode matching method in this embodiment mainly includes the following steps:

[0045] Step S31: Receive original data packets and control information packets.

[0046] In one embodiment of the present invention, before the DPU processor receives the original data packet, the DPU processor needs to configure the mode hardware library of the DPU processor based on its programmable characteristics and the control logic and search logic on the CPU processor by receiving the control information packet. The control logic and search logic of the CPU processor refer to the control logic and search logic used in the multi-mode matching process. This realizes the logical mapping of the CPU processor's mode library to the DPU processor's mode hardware library, so that the DPU processor has the same multi-mode matching search function as the CPU processor.

[0047] It should be noted that it is not required to establish an absolute mapping relationship between the pattern library of the CPU processor and the pattern hardware library of the DPU processor. Among them, absolute mapping refers to the existence of a strict one-to-one logical mapping relationship between the pattern library of the CPU processing and the pattern hardware library of the DPU processor, and there is no pattern mismatch. The reason is that the DPU-based string multi-mode matching method provided by the present invention can forward library management data through the DPU processor to realize a way in which a dynamic mapping relationship can be established between the pattern hardware library of the DPU processor and the pattern library of the CPU processor, while being compatible with the situation of incomplete matching between the pattern libraries.

[0048] In one embodiment of the present invention, at the physical level, a complete interface is established between the DPU processor and the CPU processor for forwarding control packets. The control packets are used to implement library management operations of the DPU processor and the CPU processor. The library management operations include but are not limited to adding, deleting, destroying, reporting of matching results, and querying and actively reporting library management information of the pattern library.

[0049] Furthermore, the DPU processor receives the control information packet through the control interface, and distributes the control information packet through the message distribution module. If the received control information packet contains a mode-related message for library management operations (such as adding, deleting, and destroying the mode library), the information in the control information packet is sent to the mode hardware library for corresponding processing. In addition, the DPU processor also receives network messages through the message receiving module and stores them in the message storage module.

[0050] Step S32: extracting message feature information from the original data packet, performing a multi-mode matching operation based on the message feature information, and generating a message information packet.

[0051] In one embodiment of the present invention, the message characteristic information extracted from the original data packet includes but is not limited to metadata information such as port, protocol type, source and destination IP addresses, message storage address, and message length. Depending on the specific application, the message characteristic information extracted from the original data packet may be different. The above is only the information extracted in one embodiment of the present invention. The types of the above message characteristic information are only used to explain the present invention and are not limiting.

[0052] Further, based on the extracted metadata information (including port, protocol type, IP address, etc.), it is identified whether the received message information needs to be subjected to a multi-mode matching search operation. If a multi-mode matching search operation is required, the multi-mode matching search operation is triggered by the search engine module, and the triggering form includes but is not limited to sending the metadata information to the message classification module through the message storage module.

[0053] In one embodiment of the present invention, the process of performing a multi-mode matching operation based on message feature information includes extracting message body data from the message feature information. The message body data includes data that actually needs to be transmitted, including but not limited to text, images, audio, and video. The message body data is extracted by parsing the message header, locating the message body data, and extracting the message body data based on the message feature information.

[0054] In one embodiment of the present invention, the process of extracting message feature information from the original data packet and performing a multi-mode matching operation based on the message feature information includes: based on the difference in the length of the original data packet, dividing the data packet message body content into multiple segments and matching them with a plurality of to-be-matched patterns stored in the pattern hardware library respectively; if the match with any pattern is successful, generating a single matching result information, and after the matching operation is performed on all messages, packaging one or more matching result information to generate a matching result data packet.

[0055] Specifically, in the process of the message storage module sending the message feature information to the search engine module for search execution, the search engine module continuously obtains the message feature information multiple times, and performs a search operation in the pattern hardware library module until all the message feature information is processed. It is worth noting that the technical problem to be solved by the present invention is that the method of using CPU for multi-mode matching in the prior art has the problems of large computing power consumption, large storage space consumption, message processing delay, and inability to be applied to high-load, high-speed network environments. Therefore, the present invention uses the pattern hardware library of the DPU processor to accelerate the multi-mode matching process, thereby giving full play to the hardware acceleration advantages of the DPU processor, improving the efficiency of multi-mode matching, and optimizing the storage space of multi-mode matching operations.

[0056] In one embodiment of the present invention, during the multi-mode matching process, a corresponding matching result is generated for each message feature information, and the DPU processor analyzes the generated matching result. The information in the matching result includes, but is not limited to: the ID of the matched string, the pattern position information matched with the message, etc.

[0057] In one embodiment of the present invention, the process of generating a message information packet includes: performing a multi-mode matching operation based on the message feature information; if a matching result data packet is generated, the matching result data packet and the message feature information are packaged in a preset manner to generate the message information packet; otherwise, the message feature information is packaged in a preset manner to generate the message information packet.

[0058] Specifically, the result analysis module in the DPU processor packages the matching results of all messages in a preset format and sends them to the sending control module for sending to the CPU processor. The above message information packet contains the number of pattern matches, detailed information of each pattern match, etc. It is worth noting that in order to prevent the DPU server's pattern hardware library from being equipped with a pattern that matches the received message information, the present invention deliberately sends the message feature information stored in the message storage module together with the matching result data packet to the CPU processor, so that the CPU processor can perform a more comprehensive multi-mode matching operation on the message that has not been processed by the DPU processor.

[0059] Furthermore, the preset packaging method for the matching results includes but is not limited to ZIP format, TAR format, JSON format, Protocol Buffers format and XML format. Exemplarily, JSON (JavaScript Object Notation) is used for packaging because JSON is a lightweight data exchange format that is easy to read and parse. The matching results can be converted into JSON strings using Python's json module and then sent to the CPU processor. The CPU processor can parse the matching results according to the JSON format and perform corresponding processing. In addition, if more structured information needs to be retained, XML or other data formats can also be considered for packaging and sending. According to specific needs and system requirements, select a suitable data format for packaging.

[0060] Step S33: performing library management operations on the mode hardware library of the DPU processor based on the received control information packet; and sending the message information packet and the control information packet to the CPU processor.

[0061] In one embodiment of the present invention, the sending control module of the DPU processor sends the received message information packet containing the multi-mode matching result to the message storage module for sending. The message storage module sends the message information packet and the control information packet to the CPU processor through a data interface. The data interface includes but is not limited to a PCIe interface, an Ethernet interface, a USB interface, and a SATA interface.

[0062] like Figure 4 As shown, a flow chart of the DPU processor in one embodiment of the present invention is shown. The dotted box shown in the figure represents the logic diagram of the DPU processor when performing data processing. The implementation logic in this embodiment includes control processing logic and data processing logic. Among them, the dotted line represents the processing flow in the control processing logic, and the thick solid line represents the transmission flow of the network message in the DPU processor in the data processing logic. The dotted and solid lines in this embodiment represent the flow chart of the DPU processor performing multi-mode matching.

[0063] Furthermore, in the present embodiment, the process of multi-mode matching by the DPU processor includes sending the stored network message from the message storage module to the message classification module to extract message feature information. Subsequently, the message classification module sends the extracted message feature information to the search engine module for multi-mode matching operation. In this process, the search engine module extracts messages from the message storage module in multiple times according to the length of the network message during the search process, and uses the pattern library control instructions in the control processing logic to perform multi-mode matching search operations. After the multi-mode matching search operation is completed, the search engine module sends the matching results to the result analysis module for packaging. After receiving the matching results packaged in a preset manner sent by the result analysis module, the sending control module returns to the message storage module, and finally the message storage module sends it to the CPU processor through the data interface.

[0064] The above describes in detail the embodiment of the DPU-based string multi-mode matching method provided by the present invention when applied to a DPU processor. Figure 5 The embodiment of the DPU-based string multi-mode matching method provided by the present invention when applied to a CPU processor is described. When applied to a CPU processor, the method in this embodiment mainly includes the following steps:

[0065] Step S51: receiving the message information packet and the control information packet sent by the DPU processor.

[0066] In one embodiment of the present invention, the acquisition of the message information packet and the control information packet sent by the DPU processor includes the following process: acquiring the message body data from the original data packet to perform a multi-mode matching operation based on the message body data and generate a message information packet; performing a library management operation on the mode hardware library of the DPU processor based on the received control information packet; and sending the message information packet and the control information packet to the CPU processor.

[0067] Step S52: performing library management operations on the mode library of the CPU processor based on the control information packet.

[0068] In one embodiment of the present invention, the library management operation includes but is not limited to compression storage management, index management, and dynamic update management of the pattern library. The dynamic update management means that the CPU processor dynamically updates the patterns in the pattern library as needed, provides corresponding interfaces or commands, and allows users to add, delete or modify patterns in the pattern library.

[0069] Step S53: Based on the message information packet, determine whether the message in the message information packet contains a matching result data packet. If the message information packet contains the matching result data packet, read the matching result; otherwise, perform a multi-mode matching operation on the message in the message information packet.

[0070] In one embodiment of the present invention, the CPU processor performs multi-mode matching operations including first loading the received message information file sent by the DPU processor into the memory of the CPU, then reading the index information contained in the message information, and storing the parsed index information in the memory of the CPU. The CPU processor retrieves the corresponding mode or keyword from the mode library according to the position and attribute information in the index information, and outputs the matching result to the user end.

[0071] The above describes in detail the DPU-based string multi-mode matching method provided in the present invention. Figure 6 A character string multi-mode matching system based on DPU in one embodiment of the present invention is described.

[0072] like Figure 6 As shown, a schematic diagram of the process of using the DPU-based string multi-mode matching system in one embodiment of the present invention is shown, and the interaction of the system includes the following processes:

[0073] S601: The DPU processor establishes a communication connection with the CPU processor.

[0074] In one embodiment of the present invention, the DPU processor establishes a communication connection with the CPU processor via a PCIe interface, an Ethernet interface, a USB interface, and a SATA interface.

[0075] S602: The DPU processor establishes a control logic mapping with the CPU processor.

[0076] In one embodiment of the present invention, a complete interface is established between the DPU processor and the CPU processor for forwarding control packets. The control packets are used to implement library management operations of the DPU processor and the CPU processor. The library management operations include but are not limited to adding, deleting, destroying, reporting of matching results, and other library management information queries and active reporting of pattern libraries.

[0077] S603: The DPU processor receives a network message.

[0078] In one embodiment of the present invention, the DPU processor receives an original data packet and a control information packet; and extracts message feature information from the original data packet to perform a multi-mode matching operation based on message body data in the message feature information, and generates a message information packet.

[0079] S604: The DPU processor performs multi-mode matching operations and library management operations.

[0080] In one embodiment of the present invention, the DPU processor performs library management operations on the mode hardware library of the DPU processor based on the received control information packet; and sends the message information packet and the control information packet to the CPU processor.

[0081] S605: The DPU processor sends the message and the matching result to the CPU processor.

[0082] In one embodiment of the present invention, the DPU processor sends the message and the matching result to the CPU processor through the PCIe interface, Ethernet interface, USB interface and SATA interface.

[0083] S606: The CPU processor executes a multi-mode matching operation and a library management operation.

[0084] In one embodiment of the present invention, the CPU processor receives the message information packet and the control information packet sent by the DPU processor; if the control information packet is received, the pattern library of the CPU processor is managed based on the control information packet; based on the message information packet, it is determined whether the message in the message information packet contains a matching result data packet, and if the message information packet contains the matching result data packet, the matching result is read; otherwise, a multi-mode matching operation is performed on the message in the message information packet.

[0085] like Figure 7 As shown, a structural diagram of a DPU processor for multi-mode matching of strings based on DPU in an embodiment of the present invention is shown. In this embodiment, the DPU processor 700 for multi-mode matching of strings based on DPU includes:

[0086] Communication storage module 701: used to receive original data packets and control information packets;

[0087] The multi-mode matching module 702 is used to extract the message body data in the message feature information from the original data packet, perform a multi-mode matching operation based on the message body data, and generate a message information packet;

[0088] The library management module 703 is used to perform library management operations on the mode hardware library of the DPU processor based on the received control information packet; and send the message information packet and the control information packet to the CPU processor.

[0089] In one embodiment of the present invention, the multi-mode matching module 702 extracts message feature information from the original data packet, and the process of performing a multi-mode matching operation based on the message feature information includes: extracting corresponding single message feature information from each message data in the original data packet in multiple times based on the length of each message data; matching the extracted multiple single message feature information with the multiple to-be-matched patterns stored in the pattern hardware library respectively; if the match with any pattern is successful, generating a single matching result information, and after the matching operation is performed on all messages, packaging one or more matching result information to generate a matching result data packet.

[0090] Furthermore, the process of generating a message information packet includes: the multi-mode matching module 602 performs a multi-mode matching operation based on the message feature information; if a matching result data packet is generated, the matching result data packet and the message feature information are packaged in a preset manner to generate the message information packet; otherwise, the message feature information is packaged in a preset manner to generate the message information packet.

[0091] It should be noted that: the DPU processor for string multi-mode matching based on DPU provided in the above embodiment only uses the division of the above program modules as an example when performing DPU-based string multi-mode matching. In actual applications, the above processing can be assigned to different program modules as needed, that is, the internal structure of the DPU processor for string multi-mode matching based on DPU is divided into different program modules to complete all or part of the processing described above. In addition, the DPU processor for string multi-mode matching based on DPU provided in the above embodiment and the DPU-based string multi-mode matching method embodiment belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.

[0092] like Figure 8 As shown, a schematic diagram of the structure of a CPU processor for multi-mode matching of strings based on DPU in an embodiment of the present invention is shown. In this embodiment, the CPU processor 800 for multi-mode matching of strings based on DPU includes:

[0093] Communication module 801: used to receive message information packets and control information packets sent by the DPU processor;

[0094] Multi-mode matching module 802: used for performing library management operation on the mode library of the CPU processor based on the control information packet;

[0095] Library management module 803: used to determine whether the message in the message information packet contains a matching result data packet based on the message information packet, and if the message information packet contains the matching result data packet, read the matching result; otherwise, perform a multi-mode matching operation on the message in the message information packet.

[0096] In one embodiment of the present invention, the acquisition of the message information packet and the control information packet sent by the DPU processor includes the following processes: receiving the original data packet and the control information packet; extracting the message feature information from the original data packet to perform a multi-mode matching operation based on the message feature information and generate a message information packet; performing a library management operation on the mode hardware library of the DPU processor based on the received control information packet; and sending the message information packet and the control information packet to the CPU processor.

[0097] It should be noted that: the CPU processor for string multi-mode matching based on DPU provided in the above embodiment only uses the division of the above program modules as an example when performing string multi-mode matching based on DPU. In actual applications, the above processing can be assigned to different program modules as needed, that is, the internal structure of the CPU processor for string multi-mode matching based on DPU is divided into different program modules to complete all or part of the processing described above. In addition, the CPU processor for string multi-mode matching based on DPU provided in the above embodiment and the string multi-mode matching method embodiment based on DPU belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.

[0098] The DPU-based string multi-mode matching method provided in the embodiment of the present invention can be implemented on the terminal side or the server side. As for the hardware structure of the DPU-based string multi-mode matching terminal, please refer to Fig. 9 , which is an optional hardware structure diagram of a DPU-based string multi-mode matching terminal 900 provided in an embodiment of the present invention. The terminal 900 may be a mobile phone, a computer device, a tablet device, a personal digital processing device, a factory background processing device, etc. The DPU-based string multi-mode matching terminal 900 includes: at least one processor 901, a memory 902, at least one network interface 904 and a user interface 906. The various components in the device are coupled together through a bus system 905. It can be understood that the bus system 905 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 905 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, in Fig. 9 In the specification, various buses are labeled as bus systems.

[0099] The user interface 906 may include a display, a keyboard, a mouse, a trackball, a click gun, keys, buttons, a touch pad or a touch screen.

[0100] It is understood that the memory 902 can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM). The memory described in the embodiments of the present invention is intended to include but is not limited to these and any other suitable categories of memory.

[0101] The memory 902 in the embodiment of the present invention is used to store various categories of data to support the operation of the DPU-based string multi-mode matching terminal 900. Examples of these data include: any executable program used to operate on the DPU-based string multi-mode matching terminal 900, such as an operating system 9021 and an application 9022; the operating system 9021 includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks. The application 9022 may include various applications, such as a media player (Media Player), a browser (Browser), etc., for implementing various application services. The DPU-based string multi-mode matching method provided in the embodiment of the present invention may be included in the application 9022.

[0102] The method disclosed in the above embodiment of the present invention can be applied to the processor 901, or implemented by the processor 901. The processor 901 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit in the processor 901 or the instruction in the form of software. The above processor 901 may be a general processor, a digital signal processor (DSP, Digital Signal Processor), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The processor 901 can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiment of the present invention. The general processor 901 may be a microprocessor or any conventional processor, etc. In combination with the steps of the accessory optimization method provided in the embodiment of the present invention, it can be directly embodied as a hardware decoding processor to execute, or it can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium, which is located in a memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.

[0103] In an exemplary embodiment, the DPU-based string multi-mode matching terminal 900 can be used by one or more application-specific integrated circuits (ASIC), DSP, programmable logic device (PLD), complex programmable logic device (CPLD) to execute the aforementioned DPU-based string multi-mode matching method.

[0104] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to the computer program. The aforementioned computer program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk and other media that can store program codes.

[0105] In the embodiments provided in the present application, the computer readable and writable storage medium may include a read-only memory, a random access memory, an EEPROM, a CD-ROM or other optical disk storage device, a disk storage device or other magnetic storage device, a flash memory, a USB flash drive, a mobile hard disk, or any other medium that can be used to store the desired program code in the form of an instruction or data structure and can be accessed by a computer. In addition, any connection can be appropriately referred to as a computer-readable medium. For example, if the instruction is sent from a website, a server or other remote source using a coaxial cable, an optical fiber cable, a twisted pair, a digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwaves, the coaxial cable, optical fiber cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwaves are included in the definition of the medium. However, it should be understood that computer readable and writable storage media and data storage media do not include connections, carriers, signals, or other temporary media, but are intended to be non-temporary, tangible storage media. Disk and disc, as used in this application, includes compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk and Blu-ray disc where disks usually reproduce data magnetically, while discs reproduce data optically with lasers.

[0106] In summary, the present application provides a DPU-based string multi-mode matching method, device, system and storage medium. The present invention gives full play to the characteristics of the DPU chip and greatly improves the process efficiency. First, the DPU's cache capability is used to cache the data message received by the network device in the DPU chip storage module; at the same time, the DPU's flexible programming capability and high-speed search engine are combined to execute the same logic as the HOST side; and multi-mode matching is performed on the message, and finally the matching result is directly returned to the HOST together with the message itself. The present invention avoids the multi-mode matching search operation of the message in the CPU's software algorithm, and solves the problems of high computing power consumption, large storage space consumption, message processing delay, and inability to be applied to high-load, high-speed network environments in the multi-mode matching method in the prior art. Therefore, the present application effectively overcomes the various shortcomings in the prior art and has a high industrial utilization value.

[0107] The above embodiments are merely illustrative of the principles and effects of the present application and are not intended to limit the present application. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed in the present application shall still be covered by the claims of the present application.

Claims

1. A DPU-based string multi-mode matching method, characterized in that: Applied to a DPU processor, the DPU processor establishes a communication connection with a CPU processor, and the method includes: Receive original data packets and control information packets; Extracting message feature information from the original data packet, performing a multi-mode matching operation based on the message feature information, and generating a message information packet; Based on the received control information packet, a library management operation is performed on the mode hardware library of the DPU processor; and the message information packet and the control information packet are sent to the CPU processor, so that the CPU processor receives the message information packet and the control information packet sent by the DPU processor; if the CPU processor receives the control information packet, a library management operation is performed on the mode library of the CPU processor based on the control information packet; based on the message information packet, the CPU processor determines whether the message in the message information packet contains a matching result data packet, and if the message information packet contains the matching result data packet, the matching result is read; otherwise, the CPU processor performs a multi-mode matching operation on the message in the message information packet; wherein the control information packet includes instructions for adding, deleting, destroying, reporting matching results, and querying and actively reporting other library management information to the mode hardware library, and the mode hardware library is used to receive the instructions of the control information packet, and add, delete or destroy the to-be-matched patterns stored in the mode hardware library according to the instructions of the control information packet.

2. The DPU-based string multi-mode matching method according to claim 1, characterized in that: The process of extracting message feature information from the original data packet and performing a multi-mode matching operation based on the message feature information includes: Based on the difference in the length of the original data packets, the data packet message body content contained in the original data packets is divided into multiple segments for multi-mode matching operation; The current message body is matched with the to-be-matched pattern stored in the pattern hardware library; if the match with any pattern is successful, a single matching result information is generated, and after the matching operation is performed on all messages, one or more matching result information are packaged to generate a matching result data packet.

3. The DPU-based string multi-mode matching method according to claim 2, characterized in that: The process of generating a message information packet includes: A multi-mode matching operation is performed based on the message characteristic information. If a matching result data packet is generated, the matching result data packet and the message characteristic information are packaged in a preset manner and the message information packet is generated together with the original data packet; otherwise, the message characteristic information is packaged in a preset manner to generate the message information packet.

4. A DPU-based string multi-mode matching method, characterized in that: Applied to a CPU processor, the CPU processor establishes a communication connection with a DPU processor, and the method includes: Receive the message information packet and control information packet sent by the DPU processor; wherein, the sending process of the message information packet and the control information packet includes: the DPU processor receives the original data packet and the control information packet; and obtains the message body data from the original data packet to perform a multi-mode matching operation based on the message body data, and generates a message information packet; the DPU processor performs a library management operation on the mode hardware library of the DPU processor based on the received control information packet; and sends the message information packet and the control information packet to the CPU processor; wherein, the control information packet includes instructions for adding, deleting, destroying, reporting matching results, and querying and actively reporting other library management information on the mode hardware library, and the mode hardware library is used to receive the instructions of the control information packet, and add, delete or destroy the to-be-matched mode stored in the mode hardware library according to the instructions of the control information packet; Performing library management operations on the mode library of the CPU processor based on the control information packet; Based on the message information packet, determine whether the message in the message information packet contains a matching result data packet; if the message information packet contains the matching result data packet, read the matching result; otherwise, perform a multi-mode matching operation on the message in the message information packet.

5. The DPU-based string multi-mode matching method according to claim 4, characterized in that: The acquisition of the message information packet and the control information packet sent by the DPU processor includes the following process: Receive original data packets and control information packets; Acquire message body data from the original data packet, perform a multi-mode matching operation based on the message body data, and generate a message information packet; performing a library management operation on a mode hardware library of the DPU processor based on the received control information packet; And send the message information packet and the control information packet to the CPU processor.

6. A DPU-based string multi-mode matching system, characterized in that: The system includes a CPU processor and a DPU processor, the CPU processor establishes a communication connection with the DPU processor, and the system includes the following interaction process: The DPU processor receives an original data packet and a control information packet; and obtains message body data from the original data packet, performs a multi-mode matching operation based on the message body data, and generates a message information packet; The DPU processor performs a library management operation on a mode hardware library of the DPU processor based on the received control information packet; and sending the message information packet and the control information packet to the CPU processor; The CPU processor receives the message information packet and the control information packet sent by the DPU processor; if the control information packet is received, the CPU processor performs a library management operation on the mode library based on the control information packet; Based on the message information packet, determine whether the message in the message information packet contains a matching result data packet; if the message information packet contains the matching result data packet, read the matching result; otherwise, perform a multi-mode matching operation on the message in the message information packet.

7. A DPU processor for multi-mode string matching based on DPU, wherein the DPU processor establishes a communication connection with a CPU processor, characterized in that: include: Communication storage module: used to receive original data packets and control information packets; Multimode matching module: used for obtaining message body data in message feature information from the original data packet, performing multimode matching operation based on the message body data, and generating a message information packet; A library management module: configured to perform a library management operation on the mode hardware library of the DPU processor based on the received control information packet; And the message information packet and the control information packet are sent to the CPU processor, so that the CPU processor receives the message information packet and the control information packet sent by the DPU processor; if the CPU processor receives the control information packet, the CPU processor performs library management operations on the pattern library of the CPU processor based on the control information packet; the CPU processor determines whether the message in the message information packet contains a matching result data packet based on the message information packet, and if the message information packet contains the matching result data packet, the matching result is read; otherwise, the CPU processor performs a multi-mode matching operation on the message in the message information packet; wherein the control information packet includes instructions for adding, deleting, destroying, reporting matching results, and querying and actively reporting other library management information to the pattern hardware library, and the pattern hardware library is used to receive the instructions of the control information packet, and add, delete or destroy the to-be-matched patterns stored in the pattern hardware library according to the instructions of the control information packet.

8. A CPU processor for multi-mode string matching based on DPU, characterized in that: include: Communication module: used for receiving message information packets and control information packets sent by the DPU processor; wherein, the sending process of the message information packets and the control information packets includes: the DPU processor receives the original data packet and the control information packet; and obtains the message body data from the original data packet to perform a multi-mode matching operation based on the message body data, and generates a message information packet; the DPU processor performs a library management operation on the mode hardware library of the DPU processor based on the received control information packet; and sends the message information packet and the control information packet to the CPU processor; wherein, the control information packet includes instructions for adding, deleting, destroying, reporting matching results, and querying and actively reporting other library management information on the mode hardware library, and the mode hardware library is used to receive the instructions of the control information packet, and add, delete or destroy the to-be-matched mode stored in the mode hardware library according to the instructions of the control information packet; Multi-mode matching module: used for performing library management operation on the mode library of the CPU processor based on the control information packet; Library management module: used for judging whether the message in the message information packet contains a matching result data packet based on the message information packet, and if the message information packet contains the matching result data packet, reading the matching result; otherwise, performing a multi-mode matching operation on the message in the message information packet.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method described in any one of claims 1 to 3 is implemented; or when the computer program is executed by a processor, the method described in any one of claims 4 to 5 is implemented.

10. An electronic terminal, characterized in that: include: Processor and memory; The memory is used to store computer programs; The processor is configured to execute the computer program stored in the memory, so that the terminal executes the method according to any one of claims 1 to 3, or so that the terminal executes the method according to any one of claims 4 to 5.