Data query method, system, and computer-readable storage medium
By combining hardware and software in a hash calculation method that integrates processing chips and processors, the problem of high switch resource consumption is solved, and the efficiency and performance of querying and forwarding information are improved.
Patent Information
- Application Number
- CN202211733587.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-30
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2042-12-30
AI Technical Summary
In routing and forwarding networks, switches consume significant resources when processing packets, especially due to complex hardware logic and high CPU computational costs, leading to poor performance.
By offloading some CPU computations to the processing chip, and leveraging the collaborative work of the processing chip and the processor, the long field normalization field is first calculated in hardware, and then incremental computation is performed in software, reducing the computational burden on the processor.
It improves the efficiency of querying and forwarding information, reduces the consumption of processor computing resources, and enhances query performance.
Smart Images

Figure CN116150091B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of data query, in particular to a data query method, system and computer readable storage medium. BACKGROUND
[0002] In a routing forwarding network, there are various kinds of messages, and it is very difficult for a switch to use hardware logic to process these messages completely. Routing messages can be divided into two categories: protocol messages and data messages. Protocol messages are used for inter-device interaction connection and establishment of related tasks. For a switch, relevant fields in the message need to be parsed and processed according to the protocol. For a single protocol message, a large amount of logic is needed to implement the processing flow. Using hardware to process numerous protocols will make the hardware logic very complex. Data messages need to be transferred on the switch. For example, a routing table needs to store Internet Protocol Address (IP Address) in a memory for lookup, and also needs to store corresponding forwarding behaviors in the memory for indexing after the IP address is looked up. To support a larger forwarding table, a larger memory specification is needed, resulting in large resource consumption.
[0003] At present, no effective solution has been proposed for the above problems. SUMMARY
[0004] Embodiments of the present application provide a data query method, system and computer readable storage medium to at least solve the technical problem of large resource consumption in query forwarding information in the related art.
[0005] According to an aspect of an embodiment of the present application, a data query system is provided, comprising: a processing chip configured to generate first index information and target message data according to received message data and configuration information, and forward the first index information and the target message data to a processor; the processor is configured to generate second index information according to the first index information and the target message data, and query the second index information by using a preset forwarding table to obtain forwarding information of the message data, wherein the preset forwarding table is used to record a plurality of index information and a plurality of index information corresponding forwarding information, and the forwarding information is used to record information required for forwarding the message data.
[0006] Optionally, the processing chip comprises: a first parsing module, configured to parse the packet data to obtain a first packet field, and send the first packet field to a first index calculation module, wherein the first packet field is used to represent a general field of a packet type corresponding to the packet data; the first index calculation module, configured to generate first index information according to the first packet field, and send the first index information to the processor; and a flow module, configured to parse the packet data according to configuration information to obtain target packet data, and send the target packet data to the processor.
[0007] Optionally, the target packet data comprises packet original data and packet annotation data, and the flow module is further configured to parse the packet data according to the configuration information to obtain the packet original data and the packet annotation data, wherein the packet original data is used to represent data associated with the target task in the packet data, and the packet annotation data is used to represent annotation data in a packet forwarding process.
[0008] Optionally, the processor comprises: a second parsing module, configured to parse the packet original data to obtain a second packet field, and send the second packet field to a second index calculation module; the second index calculation module, configured to generate second index information according to the second packet field, the packet annotation data and the first index information, and send the second index information to a query module; and the query module, configured to query the second index information based on a preset forwarding table to obtain forwarding information of the packet data.
[0009] According to an aspect of an embodiment of the present application, a data query method is provided, comprising: in response to received packet data, generating first index information and target packet data according to the packet data and configuration information; and sending the first index information and the target packet data to a processor, wherein the processor is configured to generate second index information according to the first index information and the target packet data, and query the second index information by using a preset forwarding table to obtain forwarding information of the packet data, wherein the preset forwarding table is used to record a plurality of index information and forwarding information corresponding to the plurality of index information, and the forwarding information is used to record information required for forwarding the packet data.
[0010] Optionally, the generating of the first index information and the target packet data according to the packet data and the configuration information comprises: parsing the packet data by using the first parsing module to obtain a first packet field; generating the first index information according to the first packet field by using the first index calculation module; and parsing the packet data according to the configuration information by using the flow module to obtain the target packet data.
[0011] Optionally, the target message data comprises: message original data and message annotation data, and the target message data is obtained by parsing the message data according to the configuration information by using the flow module.
[0012] According to an aspect of the embodiment of the present application, a data query method is provided, comprising: obtaining first index information and target message data sent by a processing chip, wherein the first index information and the target message data are generated by the processing chip according to message data and configuration information; generating second index information based on the first index information and the target message data; and querying the second index information by using a preset forwarding table to obtain forwarding information of the message data, wherein the preset forwarding table is used to record a plurality of index information and forwarding information corresponding to the plurality of index information, and the forwarding information is used to record information required for forwarding the message data.
[0013] Optionally, the target message data comprises: message original data and message annotation data, and the second index information is generated based on the first index information and the target message data, comprising: parsing the message original data to obtain a second message field; and generating the second index information according to the second message field, the message annotation data and the first index information.
[0014] In the embodiment of the present application, the processing chip is used to generate the first index information and the target message data according to the received message data and the configuration information, and to forward the first index information and the target message data to the processor; the processor is used to generate the second index information according to the first index information and the target message data, and to query the second index information by using the preset forwarding table to obtain the forwarding information of the message data, wherein the preset forwarding table is used to record a plurality of index information and forwarding information corresponding to the plurality of index information, and the forwarding information is used to record information required for forwarding the message data, the part of the computation required by the processor can be placed in the processing chip to perform, the computation resource of the processor is reduced, the efficiency of the query is improved, and the technical problem of large resource consumption in the related art for querying the forwarding information is solved. BRIEF DESCRIPTION OF DRAWINGS
[0015] The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and serve to explain the principles of the application. In the drawings:
[0016] Figure 1 is a schematic diagram of a data query system according to an embodiment of the present application;
[0017] Figure 2 is a schematic diagram of another data query system according to an embodiment of the application;
[0018] Figure 3 is a flow chart of a data query method according to an embodiment of the application;
[0019] Figure 4 is a flow chart of a data query method according to an embodiment of the application;
[0020] Figure 5 is a schematic diagram of a data query device according to an embodiment of the application;
[0021] Figure 6 is a schematic diagram of a data query device according to an embodiment of the application. DETAILED DESCRIPTION
[0022] In order to make the personnel in the art better understand the application scheme, the technical solutions in the embodiments of the application will be clearly and completely described below in conjunction with the drawings in the embodiments of the application. Obviously, the described embodiments are only a part of the embodiments of the application, rather than all the embodiments. Based on the embodiments in the application, all other embodiments obtained by those of ordinary skill in the art without creative labor should belong to the scope of protection of the application.
[0023] It should be noted that the terms "first", "second", etc. in the specification and claims of the application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily describe a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0024] Embodiment 1
[0025] According to an embodiment of the application, an embodiment of a data query system is provided, Figure 1 is a schematic diagram of a data query system according to an embodiment of the application, as Figure 1 shown, comprising message data 102, processing chip 104, processor 106.
[0026] The processing chip 104 is configured to generate first index information and target packet data according to the received packet data and configuration information, and forward the first index information and the target packet data to the processor; the processor 106 is configured to generate second index information according to the first index information and the target packet data, and query the second index information by using a preset forwarding table to obtain forwarding information of the packet data, wherein the preset forwarding table is configured to record a plurality of index information and forwarding information corresponding to the plurality of index information, and the forwarding information is configured to record information required for forwarding the packet data.
[0027] The first index information can be Hash.
[0028] The processing chip can be a hardware processing device, and the processor can be a software processing device.
[0029] Optionally, the processing chip comprises: a first parsing module configured to parse the packet data to obtain a first packet field, and send the first packet field to a first index calculation module, wherein the first packet field is configured to represent a general field of a packet type corresponding to the packet data; the first index calculation module is configured to generate first index information according to the first packet field, and send the first index information to the processor; and a flow module is configured to parse the packet data according to the configuration information to obtain target packet data, and send the target packet data to the processor.
[0030] The first parsing module is configured to parse information contained in the packet data.
[0031] Optionally, the target packet data comprises packet original data and packet annotation data, and the flow module is further configured to parse the packet data according to the configuration information to obtain the packet original data and the packet annotation data, wherein the packet original data is configured to represent data associated with a target task in the packet data, and the packet annotation data is configured to represent annotation data in a packet data forwarding process.
[0032] The packet annotation data is configured to represent annotation data annotated to the packet data by a related device in a packet data forwarding process.
[0033] Optionally, the processor comprises: a second parsing module configured to parse the packet original data to obtain a second packet field, and send the second packet field to a second index calculation module; the second index calculation module is configured to generate second index information according to the second packet field, the packet annotation data and the first index information, and send the second index information to a query module; and the query module is configured to query the second index information based on the preset forwarding table to obtain the forwarding information of the packet data.
[0034] In the embodiment of the present application, the processing chip is configured to generate first index information and target packet data according to received packet data and configuration information, and forward the first index information and the target packet data to the processor; the processor is configured to generate second index information according to the first index information and the target packet data, and query the second index information by using a preset forwarding table to obtain forwarding information of the packet data, wherein the preset forwarding table is configured to record a plurality of index information and forwarding information corresponding to the plurality of index information, and the forwarding information is configured to record information required for forwarding the packet data. The part of the calculation required by the processor can be placed in the processing chip to reduce the calculation resources of the processor, and the efficiency of the query can be improved, thereby solving the technical problem of large resource consumption in the related art for querying the forwarding information.
[0035] Currently, a Hash value is generally calculated by hardware based on IP quintuple and the like, and the Hash value is uploaded to a Central Processing Unit (CPU) for software forwarding lookup table. The specific processing manner is that after the hardware receives an Ethernet packet, the packet field information such as IP quintuple, differentiated services, fragmentation information, layer 2 type, layer 3 type, layer 4 type and the like is parsed. Then, after the packet enters the switch, the packet information such as the entry direction port number, forwarding domain identifier, load sharing information and the like is parsed. According to the task configured on the switch, the corresponding field is selected to calculate a Hash value by using a Cyclic Redundancy Check (CRC) algorithm. The Hash value is uploaded to the CPU. The CPU uses the Hash value to index the forwarding table to find the forwarding information.
[0036] The disadvantage of the above method is that the network has many traffic tasks, different tasks calculate Hash values based on different field information, and the logic implemented by hardware is relatively complex. Moreover, the hardware fixed logic cannot finely divide and select the field information, and lacks flexibility.
[0037] Currently, there is another method for calculating a Hash value by software based on IP quintuple and the like for software forwarding lookup table. Specifically, the hardware uploads the packet and the related packet information after the packet enters the switch to the CPU. The CPU parses the packet field information, selects the field in combination with the task, calculates a Hash value by using the CRC to index the forwarding table, and finds the forwarding information.
[0038] The disadvantage of the above method is that the Hash value is completely calculated by software, which occupies the CPU resources, and the performance is much lower than that of hardware, thereby increasing the packet forwarding delay.
[0039] In view of the above method in flexibility and performance has some shortcomings, the present application proposes a combination of software and hardware Hash computing method, which can provide more accurate and fast soft forwarding. The basic idea of the present application is that the long field normalization field is calculated in hardware, and the optional implementation of the field set is realized. The software combines the calculation results of the hardware, and further performs incremental calculation on the additional fields required by different task stages.
[0040] The CPU needs to calculate an index value to find the soft forwarding table. In order to distinguish different tasks and different forwarding behaviors, the index value needs to be related to the characteristic message field of the task and the related forwarding information. That is, the index value is calculated by combining the characteristic message field and the related forwarding information. The calculation of this index value usually uses CRC calculation. A good polynomial is selected, and a long template composed of the characteristic message field and the related forwarding information is calculated to obtain a short Hash value. This Hash value is the index value.
[0041] In order to improve performance, part of the calculation in the original CPU is offloaded to the hardware in the present application. Figure 2 is a schematic diagram of another data query system according to an embodiment of the present application, as shown in Figure 2 The processing of the message data can be divided into two parts, chip processing and CPU processing. After the message data enters the switch, the chip is parsed by the first parsing module. Based on the message three-layer type, four-layer type, and whether it is a tunnel message, the field information parsing result (ParserResult) in the message is obtained.
[0042] In other module processes, such as the above-mentioned process module, the switch will analyze according to the current configuration whether the message data belongs to a task and whether it needs to use soft forwarding, collect the forwarding information (PacketInfo) of the message in the switch, that is, obtain the above-mentioned message original data and message labeled data.
[0043] Part of the calculation in the CPU is offloaded to the Hash calculation module of the chip. Mainly to calculate the long field normalization field in the routing task, that is, to calculate the optional configuration. For example, the IP five tuple is a general field in the routing message. For IPv4 messages, the five tuple has the source IP address (IPDA) + the destination IP address (IPSA) + the source port number (Protocol) + the destination port number (L4SrcPort) + the protocol number (L4DstPort), a total of 104 bits. And the IPv6 message has 296 bits. In the Hash calculation module, the parsed five tuple information is taken out from the ParserResult, and a 32-bit Hash value is calculated through CRC. The Hash value is sent to the CPU through the PacketHeader to replace the IP five tuple used when calculating the Hash value in software forwarding. It should be noted that for tunnel messages, the outer Hash and the inner Hash need to be calculated, and the CPU determines which one to use for calculation.
[0044] The chip will send the message data that needs to be soft forwarded and the required PacketInfo (message annotation data) to the CPU through the PacketHeader for software processing.
[0045] After the CPU receives the message data, the second parsing module of the CPU parses the original message data to obtain the second message field, for example, the information outside the five tuple such as the fragmentation information, the service type, etc., and transmits the second message field to the second index calculation module of the CPU.
[0046] The Hash calculation module of the CPU obtains the first index information (HashValue) calculated by the chip and the message annotation data (PacketInfo) used to distinguish tasks from the PacketHeader. According to different tasks, the fields parsed by the CPU parsing module (i.e., the second message field described above) are selected to combine the second message field and then do CRC calculation to obtain the second index information of the soft forwarding table.
[0047] In the lookup module of the CPU, the preset forwarding table corresponding to the configuration / learning is found from the Memory according to the second index information, so as to obtain the forwarding information according to the preset forwarding table. According to the forwarding information, the message editing mode and the forwarding outlet can be known. Then it is sent to the chip and forwarded out.
[0048] Through the above content of the present application, the software lookup Hash value is realized by the optional implementation of the field set to calculate the long field normalization field in hardware. The software combines the calculation results of hardware, and further performs incremental calculation on the additional fields required by different business stages. The software directly uses the final result to query the Hash table.
[0049] Embodiment 2
[0050] According to an embodiment of the present application, an embodiment of a data query method is provided. It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0051] Figure 3 is a flowchart of a data query method according to an embodiment of the present application, as shown in Figure 3 the method comprises the following steps:
[0052] Step S302, in response to the received packet data, generating first index information and target packet data according to the packet data and configuration information.
[0053] Step S304, sending the first index information and the target packet data to the processor.
[0054] The processor is configured to generate second index information according to the first index information and the target packet data, and query the second index information using a preset forwarding table to obtain forwarding information of the packet data. The preset forwarding table is configured to record a plurality of index information and a plurality of index information corresponding forwarding information. The forwarding information is configured to record information required for forwarding the packet data.
[0055] Optionally, generating the first index information and the target packet data according to the packet data and the configuration information comprises: parsing the packet data using a first parsing module to obtain a first packet field; generating the first index information according to the first packet field using a first index calculation module; and parsing the packet data according to the configuration information using a flow module to obtain the target packet data.
[0056] Optionally, the target packet data comprises packet original data and packet annotation data. Parsing the packet data according to the configuration information using the flow module to obtain the target packet data comprises: parsing the packet data according to the configuration information using the flow module to obtain the packet original data and the packet annotation data. The packet original data is configured to represent data associated with a target task in the packet data. The packet annotation data is configured to represent annotation data in a packet forwarding process.
[0057] Embodiment 3
[0058] According to an embodiment of the present application, an embodiment of a data query method is provided. It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0059] Figure 4 is a flow chart of a data query method according to an embodiment of the application, as shown in the figure, the method comprises the following steps: Figure 4
[0060] In step S402, first index information and target packet data sent by a processing chip are acquired.
[0061] The first index information and the target packet data are generated by the processing chip according to packet data and configuration information.
[0062] In step S404, second index information is generated based on the first index information and the target packet data.
[0063] In step S406, the second index information is queried by using a preset forwarding table to obtain forwarding information of the packet data.
[0064] The preset forwarding table is used to record a plurality of index information and forwarding information corresponding to the plurality of index information, and the forwarding information is used to record information required for forwarding the packet data.
[0065] Optionally, the target packet data comprises packet original data and packet annotation data, the second index information is generated based on the first index information and the target packet data, and the generating comprises: analyzing the packet original data to obtain second packet fields; and generating the second index information according to the second packet fields, the packet annotation data and the first index information.
[0066] Embodiment 4
[0067] According to the embodiments of the present application, a data query device is also provided, which can execute the data query method in the above embodiments, and the specific implementation manner and preferred application scenarios are the same as those of the above embodiments, which will not be repeated here.
[0068] Figure 5 is a schematic diagram of a data query device according to an embodiment of the present application, as shown in the figure, the device comprises a generating module 502 and a sending module 504. Figure 5
[0069] The generating module 502 is configured to generate first index information and target packet data according to packet data and configuration information in response to the received packet data; and the sending module 504 is configured to send the first index information and the target packet data to a processor, wherein the processor is configured to generate second index information according to the first index information and the target packet data, and to query the second index information by using a preset forwarding table to obtain forwarding information of the packet data, the preset forwarding table is used to record a plurality of index information and forwarding information corresponding to the plurality of index information, and the forwarding information is used to record information required for forwarding the packet data.
[0070] Optionally, the generating module is further configured to parse the packet data by using the first parsing module to obtain first packet fields, and generate the first index information according to the first packet fields by using the first index calculation module, and parse the packet data according to the configuration information by using the flow module to obtain the target packet data.
[0071] Optionally, the target packet data includes packet original data and packet annotation data, and the generating module is further configured to parse the packet original data by using the flow module according to the configuration information to obtain the packet original data and the packet annotation data, where the packet original data is used to represent data associated with the target task in the packet data, and the packet annotation data is used to represent annotation data in the packet data forwarding process.
[0072] Embodiment 5
[0073] According to the embodiments of the present application, a data query device is also provided, which can execute the data query method in the above embodiments, and the specific implementation and preferred application scenarios are the same as those of the above embodiments, which will not be repeated here.
[0074] Figure 6 is a schematic diagram of a data query device according to an embodiment of the present application, as shown in Figure 6 the device includes an obtaining module 602, a generating module 604, and a querying module 606.
[0075] The obtaining module is configured to obtain the first index information and the target packet data sent by the processing chip, where the first index information and the target packet data are generated by the processing chip according to the packet data and the configuration information; the generating module is configured to generate the second index information based on the first index information and the target packet data; and the querying module is configured to query the second index information by using a preset forwarding table to obtain the forwarding information of the packet data, where the preset forwarding table is used to record a plurality of index information and forwarding information corresponding to the plurality of index information, and the forwarding information is used to record information required for forwarding the packet data.
[0076] Optionally, the target packet data includes packet original data and packet annotation data, and the generating module is further configured to parse the packet original data to obtain second packet fields, and generate the second index information according to the second packet fields, the packet annotation data, and the first index information.
[0077] Embodiment 6
[0078] According to the embodiments of the present application, a computer readable storage medium is also provided, which includes a stored program, where the program controls the device where the computer readable storage medium is located to execute the data query method in the above embodiment 1 when the program is running.
[0079] The above-mentioned embodiment numbers of the present application are only for description, and do not represent the advantages or disadvantages of the embodiments.
[0080] In the above-mentioned embodiments of the present application, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the relevant description of other embodiments.
[0081] In several embodiments provided in the present application, it should be understood that the disclosed technical contents can be implemented by other ways. Among them, the above-mentioned device embodiments are only schematic, for example, the division of the units can be a logical function division, and actual implementation can have another division way, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units or modules shown or discussed can be indirect coupling or communication connection through some interfaces, units or modules, which can be electrical or other forms.
[0082] The units described as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, that is, they can be located in one place or distributed to multiple units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment scheme.
[0083] In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be realized in the form of hardware or in the form of software functional unit.
[0084] When the integrated unit is realized in the form of software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application or the whole or part of the technical solutions that essentially contribute to the prior art can be embodied in the form of software product, which is stored in a storage medium and includes a plurality of instructions for making a computer device (which can be a personal computer, a server or a network device, etc.) execute all or part of the steps of the method described in each embodiment of the present application. The above-mentioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and various program code storage media.
[0085] The above merely describes the preferred embodiments of the present application, and it should be pointed out that, for those skilled in the art, several improvements and refinements can be made without departing from the principles of the present application, and these improvements and refinements should also be considered as falling within the protection scope of the present application.
Claims
1. A data query system, characterized by, The application relates to a processing chip and a processor. The processing chip is used for generating first index information and target packet data according to received packet data and configuration information, and forwarding the first index information and the target packet data to the processor, wherein the target packet data comprises packet original data and packet marking data, the packet original data is used for representing data associated with a target task in the packet data, and the packet marking data is used for representing marking data in a packet forwarding process. The processor is used for analyzing the packet original data to obtain second packet fields, generating second index information according to the second packet fields, the packet marking data and the first index information, and querying the second index information by using a preset forwarding table to obtain forwarding information of the packet data, wherein the preset forwarding table is used for recording a plurality of index information and forwarding information corresponding to the plurality of index information, and the forwarding information is used for recording information required for forwarding the packet data.
2. The data query system of claim 1, wherein, The processing chip comprises: A first analysis module is used for analyzing the packet data to obtain first packet fields, and sending the first packet fields to a first index calculation module, wherein the first packet fields are used for representing general fields of a packet type corresponding to the packet data. The first index calculation module is used for generating the first index information according to the first packet fields, and sending the first index information to the processor. A flow module is used for analyzing the packet data according to the configuration information to obtain the target packet data, and sending the target packet data to the processor.
3. The data query system of claim 2, wherein, The flow module is also used for analyzing the packet data according to the configuration information to obtain the packet original data and the packet marking data.
4. The data query system of claim 3, wherein, The processor comprises: A second analysis module is used for analyzing the packet original data to obtain second packet fields, and sending the second packet fields to a second index calculation module. The second index calculation module is used for generating second index information according to the second packet fields, the packet marking data and the first index information, and sending the second index information to a query module. The query module is used for querying the second index information based on the preset forwarding table to obtain the forwarding information of the packet data.
5. A data query method, characterized by, The application relates to a processing chip and a processor. In response to received packet data, first index information and target packet data are generated according to the packet data and configuration information, wherein the target packet data comprises packet original data and packet marking data, the packet original data is used for representing data associated with a target task in the packet data, and the packet marking data is used for representing marking data in a packet forwarding process. Send the first index information and the target message data to a processor, wherein the processor is configured to parse the message original data to obtain second message fields, generate second index information according to the second message fields, the message annotation data and the first index information, and query the second index information by using a preset forwarding table to obtain forwarding information of the message data, wherein the preset forwarding table is configured to record a plurality of index information and forwarding information corresponding to the plurality of index information, and the forwarding information is configured to record information required for forwarding the message data.
6. The data query method of claim 5, wherein, According to the message data and configuration information, generate first index information and target message data, comprising: Using a first parsing module to parse the message data to obtain first message fields; Using a first index calculation module to generate the first index information according to the first message fields; Using a flow module to parse the message data according to the configuration information to obtain the target message data.
7. The data query method of claim 6, wherein, The target message data includes message original data and message annotation data, and the flow module is used to parse the message data according to the configuration information to obtain the target message data, comprising: Using the flow module to parse the message data according to the configuration information to obtain the message original data and the message annotation data, wherein the message original data is used to represent data associated with a target task in the message data, and the message annotation data is used to represent annotation data in a forwarding process of the message data.
8. A data query method, characterized by, Comprising: Obtain first index information and target message data sent by a processing chip, wherein the first index information and the target message data are generated by the processing chip according to message data and configuration information, the target message data includes message original data and message annotation data, the message original data is used to represent data associated with a target task in the message data, and the message annotation data is used to represent annotation data in a forwarding process of the message data; Parse the message original data to obtain second message fields, and generate second index information according to the second message fields, the message annotation data and the first index information; Query the second index information by using a preset forwarding table to obtain forwarding information of the message data, wherein the preset forwarding table is configured to record a plurality of index information and forwarding information corresponding to the plurality of index information, and the forwarding information is configured to record information required for forwarding the message data.
9. A computer-readable storage medium, characterized in that, The computer readable storage medium includes a stored program, wherein when the program runs, the computer readable storage medium controls the device where the computer readable storage medium is located to execute the method of any one of claims 5 to 8.
Citation Information
Patent Citations
Message processing method and forwarding device
CN103905310A
Method and device for sending multicast messages, and method and device for acquiring forwarding table entries
CN114079583A