A method, system, device, equipment and medium for processing network messages

By using FPGA in the smart network card to perform bit-width grouping and parallel verification processing of network message data, the difficulty in increasing network bandwidth caused by CPU resource occupation is solved, and efficient data processing and bandwidth improvement are achieved.

CN118445088BActive Publication Date: 2024-10-29LANGCHAO ELECTRONIC INFORMATION IND CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410895786.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-05
Publication Date
2024-10-29
Estimated Expiration
2044-07-05

AI Technical Summary

Technical Problem

Data processing in traditional smart network cards takes a long time to operate on the CPU and occupies CPU resources. As a result, the network bandwidth of the network data processing process cannot be improved and the data processing efficiency is reduced.

Method used

By receiving network message data and performing bit-width packet processing, field programmable gate arrays (FPGAs) are used for parallel checksum processing, and pipeline processing is adopted to reduce CPU resource usage and improve data processing efficiency.

Benefits of technology

Regardless of the input data bit width, bit width grouping processing can be performed based on the checksum bit width, improving network bandwidth processing capabilities, meeting the needs of hundreds of G network cards, improving data processing efficiency, and saving CPU resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118445088B_ABST
    Figure CN118445088B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, system, device, equipment and medium for processing network messages, and relates to the field of communication technology. Whether it is large bit width data greater than the checksum bit width or small bit width data less than the checksum bit width under the first network message data, bit width grouping processing can be performed based on the checksum bit width to improve the bit width processing capability and meet the needs of hundreds of G network cards. After grouping, the first network message data after grouping is parallel checked and processed based on the calculation unit and the grouped data to obtain each check data, and the parallel processing characteristics of FPGA are utilized to adopt the checksum processing method of parallel processing, which improves the data processing efficiency compared with the serial processing of CPU. The checksum processing method adopts a pipeline processing method, which further improves the data processing efficiency compared with the cumulative processing of the traditional checksum serial method. Processing based on FPGA saves CPU resources and improves network bandwidth.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technology, and in particular to a method, system, device, equipment and medium for processing network messages. Background Art

[0002] Smart NIC is a high-performance network card dedicated to network data processing. It uses customized chips, high-speed network interfaces and powerful software support to provide faster, safer and more reliable network connection and data transmission services for data centers and enterprise networks.

[0003] Traditional smart network cards are mostly implemented with data processing by using a central processing unit (CPU) + field programmable gate array (FPGA). All operations in the data center are mainly completed on the CPU, including computing tasks and various infrastructure tasks. However, in the face of the growth of data processing needs, the CPU's computing power has reached a bottleneck, and Moore's Law is gradually becoming invalid. CPU calculations take a lot of time and occupy CPU resources, resulting in the inability to increase network bandwidth during network data processing, reducing data processing efficiency.

[0004] Therefore, how to save CPU resources while improving the network bandwidth and efficiency of network data processing is a technical problem that technical personnel in this field urgently need to solve. Summary of the invention

[0005] The purpose of the present invention is to provide a method, system, device, equipment and medium for processing network messages to solve the problem that data processing in traditional smart network cards takes a long time to operate on the CPU, occupies CPU resources, and thus causes the network bandwidth of the network data processing process to be unable to improve and reduces the data processing efficiency.

[0006] In order to solve the above technical problems, the present invention provides a method for processing network messages, comprising:

[0007] Receiving first network message data and input data bit width;

[0008] Performing bit width grouping processing on the first network message data according to the input data bit width and the checksum bit width to obtain the number of calculation units and group data; wherein the group data is the number of groups in which the network message data in the calculation unit is located;

[0009] According to the computing units and the grouping data, the first network message data after grouping is checked and processed in parallel to obtain each verification data corresponding to the first network message data; wherein the parallel checking and processing method is to check and process the network message data in each computing unit by using the parallel processing characteristics of the field programmable gate array, and the processing method of the verification data obtained in the pipeline processing method between the computing units;

[0010] Each verification data is accumulated to obtain the final verification data corresponding to the first network message data.

[0011] On the one hand, when the input data bit width is greater than or equal to the checksum bit width, the first network message data is subjected to bit width grouping processing according to the input data bit width and the checksum bit width to obtain the number of calculation units and grouping data, including:

[0012] Dividing the first network message data according to the input data bit width to obtain processed second network message data;

[0013] Determine the number of divisions of the first computing unit according to the checksum bit width and the current second network message data;

[0014] The number of groups obtained by dividing the number of divisions of the first computing unit into two groups of data is used as the grouping data of the first computing unit;

[0015] The grouped data of the first calculation unit is divided into two groups of data to obtain the number of groups, which is used as the grouped data of the second calculation unit;

[0016] This is deduced in this way until the grouped data of the Nth computing unit is 2 groups, so as to obtain the number of each computing unit and the corresponding grouped data, where N is a positive integer.

[0017] On the other hand, when the input data bit width is smaller than the checksum bit width, performing bit width grouping processing on the first network message data according to the input data bit width and the checksum bit width to obtain the number of calculation units and grouping data includes:

[0018] Dividing the first network message data according to the input data bit width to obtain processed second network message data;

[0019] Determine the number of merged second network message data according to the relationship between the checksum bit width and the input data bit width, so that the bit width data of the merged second network message data is the same as the checksum bit width;

[0020] Determine the number of divisions of the first computing unit according to the checksum bit width and the currently merged second network message data;

[0021] The number of groups obtained by dividing the number of divisions of the first computing unit into two groups of data is used as the grouping data of the first computing unit;

[0022] The grouped data of the first calculation unit is divided into two groups of data to obtain the number of groups, which is used as the grouped data of the second calculation unit;

[0023] This is deduced in this way until the grouped data of the Nth computing unit is 2 groups, so as to obtain the number of each computing unit and the corresponding grouped data, where N is a positive integer.

[0024] On the other hand, the relationship between the input data bit width and the number of computing units is as follows:

[0025] Dividing the input data bit width and the checksum bit width to obtain first data;

[0026] Processing the first data by a power-of-2 algorithm to obtain second data;

[0027] The second data is used as the number of calculation units.

[0028] On the other hand, the grouped first network message data is verified and processed in parallel according to the calculation unit and the grouping data to obtain each verification data corresponding to the first network message data, including:

[0029] Using the grouped data of the first computing unit as the unit number of the first computing subunit of the first computing unit;

[0030] Verify and process the two sets of data in each first computing subunit to obtain first intermediate data corresponding to each first computing subunit;

[0031] placing the first intermediate data corresponding to each first computing subunit in the second computing unit;

[0032] The number of groups obtained by dividing the number of the first intermediate data into two groups of data is used as the grouping data of the second calculation unit;

[0033] Using the grouped data of the second computing unit as the unit number of the second computing sub-unit of the second computing unit;

[0034] Verify and process the two sets of data in each second computing subunit to obtain second intermediate data corresponding to each second computing subunit;

[0035] And so on, until the number of the Nth computing subunit in the Nth computing unit is two, the Nth intermediate data of the corresponding Nth computing subunit is used as the verification data of the current second network message data, wherein the verification data of each second network message data is the verification data obtained by processing the first network message data after grouping according to the input data bit width.

[0036] On the other hand, the verification and processing process of the Nth intermediate data of the Nth computing subunit includes:

[0037] Adding two sets of data of the Nth computing subunit to obtain first initial data; wherein the bit width of the first initial data is greater than the bit width of the input data;

[0038] Taking the most significant bit of the first initial data as carry data;

[0039] The carry data and the data corresponding to the preset number of bits of the first initial data are added to obtain the Nth intermediate data; wherein the preset number of bits is the number of bits obtained by reverse deduction starting from the last bit of the first initial data according to the input data bit width.

[0040] On the other hand, the first network message data is obtained by filtering the first initial network message data, and specifically includes:

[0041] Get the current bus protocol;

[0042] Splitting the first initial network message data according to the current bus protocol to obtain two paths of first initial network message data;

[0043] Outputting the first initial network message data of one of the routes;

[0044] Perform signal generation processing on the first initial network message data of another path according to the current bus protocol to obtain a detection packet start mark;

[0045] Data selection processing is performed on the first initial network message data of another path corresponding to the detection packet start mark to obtain the first network message data.

[0046] On the other hand, when the current bus protocol is a multi-channel transmission bus protocol, a signal generation process is performed on the first initial network message data of another channel according to the current bus protocol to obtain a detection packet start mark, including:

[0047] Obtaining a valid signal for receiving the first initial network message data, a back-end receiving ready signal, and a register last beat signal;

[0048] Determine the level signal of the next clock rising edge according to the level signal relationship between the valid signal, the back-end receiving ready signal and the register last beat signal;

[0049] Perform non-logical processing on the level signal of the next clock rising edge to obtain a first level signal;

[0050] The first level signal and the valid signal are subjected to logical AND processing to obtain the detection packet start mark.

[0051] On the other hand, the detection packet start flag is also carried by a private signal, specifically including:

[0052] Preliminarily performing private signal processing on the first network message data to obtain a carrying flag corresponding to the first network message data;

[0053] The carrying mark is used as the start mark of the detection package.

[0054] On the other hand, performing data selection processing on the first initial network message data of another path corresponding to the detection packet start mark to obtain the first network message data includes:

[0055] When the detection packet start flag of the first initial network message data of another path is 1, obtaining message data corresponding to the first initial network message data of another path that does not participate in the parallel verification and processing;

[0056] The message data not participating in the parallel checksum processing is set to 0, so as to be combined with the first initial network message data of another path, so as to complete the data selection processing and obtain the first network message data;

[0057] When the detection packet start flag of the first initial network message data of the other path is not 1, the first initial network message data of the other path is not processed to obtain the first network message data.

[0058] On the other hand, before accumulating the verification data to obtain the final verification data corresponding to the first network message data, the method further includes:

[0059] Obtaining an output signal of a control subunit corresponding to the computing unit;

[0060] When the output signal of each control subunit is valid, the intermediate data of each corresponding calculation unit is output to obtain the current verification data;

[0061] When the output signal of each control subunit is invalid, the intermediate data of each calculation subunit is stored, and the control register is controlled to delay a preset number of clock cycles before outputting the intermediate data of each calculation subunit.

[0062] On the other hand, the output signal output process of the control subunit is determined by a combinational logic circuit; wherein the combinational logic circuit includes a first NOR gate circuit, a second NOR gate circuit, an AND gate circuit and a register;

[0063] Acquire an input valid signal, an output valid signal, an input backend receiving ready signal and an output backend receiving ready signal for receiving the first initial network message data;

[0064] Using the port for inputting the valid signal as the input terminal of the OR gate of the first NOR gate circuit and as the first input terminal of the AND gate circuit;

[0065] The port outputting the valid signal is used as the NOT gate input terminal of the second NOT-OR gate circuit and as the output terminal of the register;

[0066] The port of the output back-end receiving the ready signal is used as the OR gate input of the second NOR gate circuit; the output end of the second NOR gate circuit is used as the NOR gate input of the first NOR gate circuit and as the second input of the AND gate circuit, and the output input back-end receives the ready signal;

[0067] Using the output terminal of the first NOR gate circuit as the input terminal of the register;

[0068] The output end of the AND gate circuit is used to output the output signal of the control subunit.

[0069] On the other hand, each verification data is accumulated to obtain the final verification data corresponding to the first network message data, including:

[0070] Obtaining a detection packet start flag corresponding to the first network message data;

[0071] If the detection packet start flag is 1, the verification data corresponding to the plurality of second network message data are saved until the frame end flag of the first network message data is 1, and the saving is terminated;

[0072] The saved verification data are accumulated to obtain the final verification data.

[0073] On the other hand, after accumulating the verification data to obtain the final verification data corresponding to the first network message data, the method further includes:

[0074] The first initial network message data of one of the routes and the final verification data are synchronously processed and sent to the host computer.

[0075] In order to solve the above technical problems, the present invention also provides a method for processing network messages, comprising:

[0076] Obtaining third network message data, input data bit width, and message command information sent by the host computer;

[0077] Synchronizing the third network message data with the message command information to obtain synchronized third network message data;

[0078] Performing bit width grouping processing on the synchronized third network message data according to the input data bit width and the checksum bit width to obtain the number of calculation units and group data; wherein the group data is the number of groups in which the network message data in the calculation unit is located;

[0079] The grouped third network message data is checked and processed in parallel according to the computing units and the grouping data to obtain each verification data corresponding to the third network message data; wherein the parallel checking and processing method is to check and process the network message data in each computing unit by utilizing the parallel processing characteristics of the field programmable gate array, and the processing method of the verification data obtained in the pipeline processing method between the computing units;

[0080] Each verification data is accumulated to obtain the final verification data corresponding to the third network message data; and the final verification data is inserted and replaced to obtain the replaced verification data.

[0081] On the one hand, synchronizing the third network message data with the message command information to obtain synchronized third network message data includes:

[0082] Obtain the enable signal flag, the start checksum flag, and the checksum position information of the message command information;

[0083] The enable signal flag, the start checksum flag, the checksum position information and the third network message data are synchronously processed to be converted into the sideband information of the bus protocol to obtain the synchronized third network message data.

[0084] On the other hand, inserting and replacing the final verification data to obtain replaced verification data includes:

[0085] If the enable signal flag is valid, the initial verification data corresponding to the third network message data is replaced with the final verification data according to the verification and position information.

[0086] In order to solve the above technical problems, the present invention also provides a network message processing system, the processing system includes a first terminal device, a switch and a second terminal device;

[0087] A first terminal device, used for controlling the sending end to process the fourth network message data to obtain corresponding verification data, wherein the processing process of the fourth network message data is obtained by the above-mentioned network message processing method;

[0088] The switch is used to receive the fourth network message data and the corresponding verification data for transmission to the second terminal device;

[0089] The second terminal device is used to control the receiving end to receive the fourth network message data, and process the fourth network message data to obtain corresponding new verification data for sending to the host computer; wherein, the fourth network message data received by the switch is processed in the second terminal device by the network message processing method described above.

[0090] In order to solve the above technical problems, the present invention further provides a network message processing device, comprising:

[0091] A first receiving module, used for receiving first network message data and inputting data bit width;

[0092] A first processing module is used to perform bit width grouping processing on the first network message data according to the input data bit width and the checksum bit width to obtain the number of calculation units and group data; wherein the group data is the number of groups in which the network message data in the calculation unit is located;

[0093] A second processing module is used to perform parallel verification and processing on the grouped first network message data according to the computing units and the grouping data to obtain each verification data corresponding to the first network message data; wherein the parallel verification and processing method is to use the parallel processing characteristics of the field programmable gate array to verify and process the network message data in each computing unit, and the verification data is obtained in the pipeline processing method between the computing units.

[0094] The third processing module is used to accumulate the verification data to obtain the final verification data corresponding to the first network message data.

[0095] In order to solve the above technical problems, the present invention further provides a network message processing device, comprising:

[0096] An acquisition module, used for acquiring third network message data, input data bit width and message command information sent by the host computer;

[0097] A fourth processing module, used for synchronously processing the third network message data and the message command information to obtain synchronized third network message data;

[0098] A fifth processing module, configured to perform bit width grouping processing on the synchronized third network message data according to the input data bit width and the checksum bit width to obtain the number of calculation units and group data; wherein the group data is the number of groups in which the network message data in the calculation unit is located;

[0099] a sixth processing module, configured to perform parallel verification and processing on the grouped third network message data according to the computing units and the grouping data to obtain verification data corresponding to the third network message data; wherein the parallel verification and processing method is to utilize the parallel processing characteristics of the field programmable gate array to verify and process the network message data in each computing unit, and to process the verification data obtained in a pipeline processing method between the computing units;

[0100] The seventh processing module is used to perform accumulation processing on each verification data to obtain final verification data corresponding to the third network message data; and perform insertion and replacement processing on the final verification data to obtain replaced verification data.

[0101] In order to solve the above technical problems, the present invention further provides a network message processing device, comprising:

[0102] Memory for storing computer programs;

[0103] A processor is used to implement the steps of the method for processing network messages as described above when executing the computer program.

[0104] In order to solve the above technical problem, the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for processing network messages as described above are implemented.

[0105] The present invention provides a method for processing network messages, comprising receiving first network message data and input data bit width; performing bit width grouping processing on the first network message data according to the input data bit width and the checksum bit width to obtain the number of computing units and group data; wherein the group data is the number of groups in which the network message data in the computing unit is located; performing parallel check and processing on the grouped first network message data according to the computing unit and the group data to obtain each check data corresponding to the first network message data; wherein the parallel check and processing method is a method for processing the check data obtained in the pipeline processing method between the computing units by using the parallel processing characteristics of a field programmable gate array to check and process the network message data in each computing unit; and performing cumulative processing on each check data to obtain the final check data corresponding to the first network message data.

[0106] The beneficial effect of the present invention is that whether it is large bit width data greater than the checksum bit width or small bit width data less than the checksum bit width under the first network message data, bit width grouping processing can be performed based on the checksum bit width to improve the bit width processing capability, meet the network card requirements of hundreds of G, and at the same time, improve the flexibility of bit width processing. After grouping, the first network message data after grouping is processed in parallel based on the calculation unit and the grouped data to obtain each verification data. Here, the parallel processing characteristics of FPGA are utilized, and the checksum processing method of parallel processing is adopted, which improves the data processing efficiency compared to the serial processing of CPU. In addition, the checksum processing method here adopts a pipeline processing method, which further improves the data processing efficiency compared to the cumulative processing of the serial method of the traditional checksum processing. Processing based on FPGA saves CPU resources and improves network bandwidth.

[0107] Secondly, the bit width grouping processing performed under the different size relationship between the checksum bit width and the input data bit width provided in this embodiment reduces the network message data with larger bit width data to the same as the checksum bit width before performing subsequent data check and processing, or merges the network message data with smaller bit width data to the same as the checksum bit width. At the same time, the number of computing units in the pipeline calculation mode is determined, so that the check data obtained by the subsequent check and processing is more accurate, and at the same time, the flexibility of the bit width processing process is also improved; the relationship between the number of computing units and the input data bit width can clearly know the number of computing units corresponding to the pipeline calculation mode in the data processing process, so that each second network message data can be accurately connected; the parallel check and processing process is based on the parallel processing of each computing sub-unit in the computing unit, and the check and processing performed in a computing sub-unit obtains the corresponding result data. In order to facilitate the verification data obtained by the pipeline processing of each computing unit. Improve the use of FPGA's parallel processing characteristics and adopt parallel processing verification and processing methods to improve data processing efficiency compared to CPU serial processing. At the same time, it also takes into account the pipeline processing method used when longer network message data cannot be processed simultaneously, which also improves the accuracy of verification data.

[0108] In addition, the present invention also provides a network message processing system, a network message processing method, an apparatus, a device and a medium, which have the same beneficial effects as the above-mentioned network message processing method. BRIEF DESCRIPTION OF THE DRAWINGS

[0109] In order to more clearly illustrate the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0110] Figure 1 A flowchart of a method for processing network messages applied to a receiving-end field programmable gate array module provided by an embodiment of the present invention;

[0111] Figure 2 A schematic diagram of the structure of a receiving-end field programmable gate array module provided by an embodiment of the present invention;

[0112] Figure 3 A schematic diagram of the structure of another receiving-end field programmable gate array module provided by an embodiment of the present invention;

[0113] Figure 4 A structural diagram of a combinational logic circuit of a control subunit provided by an embodiment of the present invention;

[0114] Figure 5A flowchart of a method for processing network messages applied to a field programmable gate array module at a sending end provided by an embodiment of the present invention;

[0115] Figure 6 A structural diagram of a field programmable gate array module at a transmitting end provided by an embodiment of the present invention;

[0116] Figure 7 A schematic diagram of another parallel checksum processing module of a sending-end field programmable gate array module provided by an embodiment of the present invention;

[0117] Figure 8 A structural diagram of a network message processing system provided by an embodiment of the present invention;

[0118] Fig. 9 A port diagram of a receiving-end field programmable gate array module provided by an embodiment of the present invention;

[0119] Fig.10 A port diagram of a field programmable gate array module at a transmitting end provided by an embodiment of the present invention;

[0120] Fig.11 A structural diagram of a network message processing device applied to a receiving-end field programmable gate array module provided by an embodiment of the present invention;

[0121] Fig.12 A structural diagram of a network message processing device applied to a field programmable gate array module at a sending end provided by an embodiment of the present invention;

[0122] Fig.13 A structural diagram of a network message processing device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0123] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0124] The core of the present invention is to provide a method, system, device, equipment and medium for processing network messages to solve the problem that data processing in traditional smart network cards takes a long time to operate on the CPU, occupies CPU resources, and thus leads to the inability to improve the network bandwidth of the network data processing process and reduces the data processing efficiency.

[0125] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0126] In the traditional smart network card, an acceleration engine for the corresponding business corresponding to the data processing will be added to release the CPU computing power of the server, provide more CPU computing power for computing tasks, or implement specific functions through accelerators and ensure the line speed of data forwarding. It still does not solve the problem that the CPU plays the role of the main calculation, resulting in the occupation of CPU resources. In addition, with regard to network bandwidth, since the higher the CPU occupancy rate, the faster the running speed of the corresponding data processing process, the running data processing may have no CPU resources available, resulting in the CPU having no resources to process the transmission processing of network data, and the speed of connecting to the network will slow down, resulting in the inability to improve the network bandwidth, and also reducing the data processing efficiency. Therefore, the method for processing network data provided by the present invention can solve the above technical problems.

[0127] Figure 1 A flowchart of a method for processing network messages applied to a receiving-end field programmable gate array module provided by an embodiment of the present invention is shown in FIG. Figure 1 As shown, the method includes:

[0128] S11: receiving first network message data and inputting data bit width;

[0129] Specifically, the receiving end field programmable gate array module is based on the FPGA module receiving end, and the serial port module of the FPGA module uses the receiving end interface to receive the first network message data. The function of the receiving end is to output the original data and the check value based on the received network message data, so as to send it to the host computer with the CPU for processing. Here, the data processing process is mainly completed based on the FPGA, that is, the data processing work of the CPU is unloaded to the FPGA to relieve the CPU's computing power and save CPU resources.

[0130] It should be noted that the FPGA at the receiving end corresponding to the present invention can also be a data processor (DataProcessing Unit, DPU), smart network card, ordinary network card, switch and other devices or chips, and the corresponding use scenarios are not limited. The receiving end field programmable gate array module and the sending end field programmable gate array module mentioned in the embodiments of the present invention are only how to implement the processing process of network messages in this scenario, and can also be applied to the above-mentioned scene components, which are not limited here. In addition, the inspection and unloading processing mentioned in this embodiment can also be the unloading processing of other data processing, which is not limited here.

[0131] The receiving end in this embodiment is a module for receiving network message data set in the FPGA chip. The receiving end and the sending end can be based on the same FPGA chip, or based on the receiving end and the sending end corresponding to each of the two FPGA chips on the terminal device. There is no limitation here and it can be set according to actual conditions.

[0132] The first network message data can be data sent by the FPGA module sending end of another end-to-end terminal device, or data sent by the host computer, which is not limited here. In addition, the first network message data can be unprocessed data sent directly by the FPGA module sending end of other terminal devices or sent by the host computer, or it can be network message data after data processing based on the above, which is not limited here and can be set and processed according to actual conditions.

[0133] The input data bit width is based on the number of bits that can be transmitted in one clock cycle of the smart network card. The larger the number of bits, the larger the amount of data that can be transmitted at the same moment. Currently, there are 8bit, 16bit, 64bit, 128bit, 256bit, 512bit, etc., which are obtained through the input network message data. In this embodiment, it is not limited to the specific number of bit width data, and it can be set and obtained according to the actual situation.

[0134] S12: performing bit width grouping processing on the first network message data according to the input data bit width and the checksum bit width to obtain the number of calculation units and grouping data;

[0135] The group data is the number of groups to which the network message data in the computing unit belongs;

[0136] It can be understood that the checksum bit width is set based on the checksum processing. Checksum processing is a technology for detecting errors in the data packet transmission process. The sending end calculates the sum of all bytes in the data packet and then adds the result to the end of the data packet. The receiving end uses the same algorithm to recalculate the sum of all bytes of the data packet and compares the result with the checksum at the end of the data packet. In this embodiment, the checksums obtained by the sending end and the receiving end are sent to the host computer, and finally the host computer determines and checks whether there is a transmission error.

[0137] The step of the checksum processing is to treat the data to be checked as digital components in units of 16 bits and perform binary data summation. The 16-bit unit here is the checksum bit width mentioned in this embodiment.

[0138] The first network message data is processed by bit width grouping according to the input data bit width and the checksum bit width to obtain the number of calculation units and group data. The bit width grouping here is to divide the first network message data into multiple network message fields in consideration of the relationship between the input data bit width and the checksum bit width.

[0139] The data length of the first network message data is relatively long, and is first divided based on the input data bit width to obtain multiple grouped network message data, where the data length bit width of the grouped network message data is the input data bit width; among the multiple grouped network message data, grouping is performed based on the input data bit width and the checksum bit width to obtain multiple computing units and the number of groups in which the network message data in a computing unit is located.

[0140] For the grouping of input data bit width and checksum bit width, if the input data bit width is larger than the checksum bit width, the corresponding bit width data is larger, and the network message data corresponding to the input data bit width needs to be split a second time to obtain data with the same checksum bit width. If the input data bit width is smaller than the checksum bit width, the corresponding bit width data is smaller, and the network message data corresponding to multiple input data bit widths need to be combined to obtain data with the same checksum bit width.

[0141] The calculation unit in this embodiment is based on the consideration that although FPGA can realize parallel processing, it is impossible to calculate more data at the same time, so a step-by-step pipeline method is adopted. Multiple calculation units are used to process the network message data after bit width processing. The first step belongs to the first calculation unit. In the first calculation unit, all the network message data after bit width grouping processing are processed once, and the processed data is transmitted to the second calculation unit of the second step until 1 data is obtained in the Nth calculation unit. The grouped data in this embodiment is based on the consideration of the parallel processing characteristics of FPGA. The network message data after bit width grouping processing is divided into multiple groups in the first calculation unit, and the network message data of multiple groups are processed in parallel during the subsequent verification and processing, which improves the data processing process to a certain extent.

[0142] For example, the input data bit width is 512 bits, the checksum bit width is 16 bits, and the first network message data is 1024 bits. The first network message data is grouped according to the input data bit width to obtain two groups, that is, both groups of data cannot be processed at a time, and the data is processed one group at a time. When processing the current group of network messages, according to the checksum bit width of 16 bits, a group of network message data (512 bits) is grouped to obtain 32 groups, that is, there are 32 16-bit data. The 32 groups of 16-bit data are placed in the first calculation unit. When the checksum is used for processing, the 32 groups will be checked in pairs to obtain 16 groups, that is, 16 result data are obtained in the first calculation unit, and then the 16 result data are placed in the second calculation unit, and 8 groups are checked in pairs, that is, 8 result data are obtained in the second calculation unit, and so on, and finally 1 result data is obtained, which is used as the check data of the current group of network message data (512 bits).

[0143] S13: performing parallel verification and processing on the grouped first network message data according to the calculation unit and the grouping data to obtain verification data corresponding to the first network message data;

[0144] The parallel checksum processing method is to use the parallel processing characteristics of the field programmable gate array to check and process the network message data in each computing unit, and the checksum data is processed in a pipeline processing mode between the computing units;

[0145] It should be noted that the grouped first network message data is a general term for the network message data in each computing unit, and the grouped first network message data is verified and processed in parallel in combination with the computing unit and the grouped data to obtain corresponding verification data.

[0146] Take a group of network message data as an example, and explain it with a first computing unit. In the first computing unit, 32 16-bit data are included, which are divided into 16 groups of data through two-by-two checksum processing, that is, the grouped data is 16. Parallel processing is to use the parallel processing characteristics of FPGA to process 16 groups of data in parallel to obtain 16 result data. In the parallel processing process, a checksum processing method is adopted to add two data in each group of 16 groups of data to obtain 16 result data. Then the 16 result data are placed in the second computing unit to achieve pipeline processing. In the second computing unit, two-by-two checksum processing is divided into 8 groups of data, that is, the grouped data is 8. These 8 groups of data are processed in parallel to obtain 8 result data. The first computing unit to the second computing unit implements a pipeline processing method, and so on to obtain 1 result data.

[0147] The traditional checksum processing is to add the previous 16-bit data and the next 16-bit data, and then add the superimposed data obtained after the addition to the next 16-bit data, so that the whole process is a serial accumulation process, and the data processing cycle is relatively long. In the pipeline processing mode of parallel processing, the parallel processing mode of the pipeline calculation mode is adopted in this embodiment, considering that the chip cannot process all the data at the same time, to improve the data processing efficiency.

[0148] The checksum is a sum check code. In the field of data processing and data communication, it is the sum of a group of data items for verification purposes. The specific form is data or other strings that are regarded as numbers in the process of calculating the checksum, so as to ensure the integrity and accuracy of the data. The checksum processing in this embodiment can be the same as the commonly used checksum algorithm, such as parity check, Hamming code check, cyclic redundancy check code (Cyclic Redundancy Check, CRC) 16 check or CRC32 check, etc., and other checksum algorithms can also be used, which are not limited here.

[0149] In addition, the checksum process processes the current 16-bit integer of each pair of characters. If the checksum is greater than 16 bits of data, the carry data needs to be added to the result data in the checksum process.

[0150] S14: Accumulate each verification data to obtain final verification data corresponding to the first network message data.

[0151] It is understandable that each check data is accumulated, and the accumulation here is the accumulation of the check data corresponding to the multiple network message data obtained by splitting the first network message data according to the input data bit width. For example, two groups of network messages obtained by 1024 bits are checked and processed in parallel one by one to obtain two check data. The two check data are accumulated to obtain the final check data of the first network message data.

[0152] Specifically, the accumulation process may be direct addition, or the validity of the verification data may be determined first and then accumulated, which is not limited here.

[0153] The embodiment of the present invention provides a method for processing a network message, including receiving first network message data and input data bit width; performing bit width grouping processing on the first network message data according to the input data bit width and the checksum bit width to obtain the number of computing units and group data; wherein the group data is the number of groups in which the network message data in the computing unit is located; performing parallel checksum processing on the grouped first network message data according to the computing unit and the group data to obtain each check data corresponding to the first network message data; wherein the parallel checksum processing method is to use the parallel processing characteristics of the field programmable gate array to check and process the network message data in each computing unit, and the processing method of the check data obtained under the pipeline processing method between the computing units; each check data is accumulated and processed to obtain the final check data corresponding to the first network message data. Whether the large bit width data greater than the checksum bit width or the small bit width data less than the checksum bit width under the first network message data can be processed by bit width grouping based on the checksum bit width, so as to improve the bit width processing capability and meet the requirements of hundreds of G network cards, and at the same time, improve the flexibility of bit width processing. After grouping, the first network message data after grouping is checked and processed in parallel based on the calculation unit and the grouping data to obtain each check data. Here, the parallel processing characteristics of FPGA are utilized, and the checksum processing method of parallel processing is adopted to improve the data processing efficiency compared with the serial processing of CPU. In addition, the checksum processing method here adopts a pipeline processing method, which further improves the data processing efficiency compared with the traditional checksum processing serial method of accumulation processing. Processing based on FPGA saves CPU resources and improves network bandwidth.

[0154] In some embodiments, different input data bit widths result in different bit width grouping processing methods. When the input data bit width is greater than or equal to the checksum bit width, the first network message data is subjected to bit width grouping processing according to the input data bit width and the checksum bit width to obtain the number of computing units and grouping data, including:

[0155] Dividing the first network message data according to the input data bit width to obtain processed second network message data;

[0156] Determine the number of divisions of the first computing unit according to the checksum bit width and the current second network message data;

[0157] The number of groups obtained by dividing the number of divisions of the first computing unit into two groups of data is used as the grouping data of the first computing unit;

[0158] The grouped data of the first calculation unit is divided into two groups of data to obtain the number of groups, which is used as the grouped data of the second calculation unit;

[0159] This is deduced in this way until the grouped data of the Nth computing unit is 2 groups, so as to obtain the number of each computing unit and the corresponding grouped data, where N is a positive integer.

[0160] Specifically, the first network message data is divided in combination with the input data bit width to obtain a plurality of second network message data. Since the input data bit width is limited, the longer first network message data cannot be processed at one time, so it is necessary to divide it according to the input data bit width to obtain a plurality of second network message data, that is, the bit width data of the second network message data is set according to the input data bit width. Then, after processing based on a second network message data, the next second network message data is processed. Taking a second network message data as an example, the current second network message is processed according to the checksum bit width to obtain the number of divisions of the first calculation unit, and the corresponding number of divisions can be obtained by dividing the bit width data of the second network message data by the checksum bit width, and the second network message data is placed in the first calculation unit for subsequent checksum processing. Before the checksum processing, because the checksum processing is based on the addition processing of two network message data, the number of groups obtained by dividing again according to the number of divisions of the first calculation unit, that is, the grouped data of the first calculation unit obtained by dividing into two groups of data.

[0161] Combined with the example in the above embodiment, the bit width of the current second network message data is 512 bits, the checksum bit width is 16 bits, and the number of divisions of the first calculation unit is 32, that is, 32 16-bit data obtained based on the 512-bit network message data. Then divide 32 into two groups to obtain 16 groups, which also realizes the subsequent checksum processing of two second network message data in the 16 groups of data, 16 groups, that is, as the grouped data of the first calculation unit. The 16 result data obtained in the first calculation unit will be put into the second calculation unit to obtain the number of divisions of the second calculation unit, and then the number of groups obtained by dividing the number of divisions into two groups is used as the grouped data of the second calculation unit (8 groups), and so on. After the grouped data of the Nth calculation unit is obtained as 2 groups, the 1 result data obtained by the checksum processing here is used as the check data of the current second network message data, where N is a positive integer.

[0162] Figure 2 A schematic diagram of the structure of a receiving-end field programmable gate array module provided by an embodiment of the present invention is shown in FIG. Figure 2As shown, it can be seen that after receiving the first network message data, multiple second network message data are obtained. In the subsequent calculation unit, the current second network message data is first divided into the first calculation unit, and the result data obtained by verification and calculation in the first calculation unit is put into the second calculation unit for verification and calculation, and so on. Finally, the result data obtained in the Nth calculation unit is put as verification data and stored in the accumulation unit to facilitate the next second network message data to be calculated and realized. The final accumulation obtains the final verification data of the first network message data.

[0163] Combination Figure 2 For example, the interfaces on the left and right sides of the receiving end are used to interact with other modules. The corresponding pins of the five interfaces on the upper left side are data, byte modifier (keep), register last beat signal (last), valid signal (valid) and back-end receiving ready signal (ready) from top to bottom. Based on the receiving end transmitted from other modules, in order to distinguish the signals sent from the host to the slave, the pin names correspond to s_tdata, s_tkeep, s_tlast, s_tvalid and s_tready from top to bottom. The signal transmission between the signal generation module inside the receiving end and the data selection module, from top to bottom, are the start of packet (sop), data, byte modifier, register last beat signal, valid signal and back-end receiving ready signal. There is no need to distinguish the sending direction of the host and the slave. Therefore, the corresponding pin names are sop, data, keep, last, valid and ready. There is no need to distinguish the sending direction of the host and the slave in the transmission between the data selection module and the computing unit and the transmission pins between the transmission units. In addition, Figure 2 The input data width is 512 bits, and the corresponding number of computing units is N=5, the number of control subunits is N+1=5, the number of first computing subunits of the first computing unit is 16, the number of second computing subunits of the second computing unit is 8, and so on. The number of Nth computing subunits of the Nth computing unit is 1.

[0164] The pins corresponding to the four interfaces on the upper right side of the right side of the receiving end are data (data), byte modifier (keep), register last beat signal (last), valid signal (valid) and back-end receiving ready signal (ready) from top to bottom. Based on the sending of the receiving end, in order to distinguish the sending and receiving directions, the pin names here correspond to m_tdata, m_tkeep, m_tlast, m_tvalid and m_tready from top to bottom.

[0165] The pins corresponding to the three interfaces on the lower right side of the receiving end are check data (value), valid signal (valid) and back-end receiving ready signal (ready) from top to bottom. The pin names of the parallel checksum and processed result data sent by the receiving end are csum_value, csum_tvalid and csum_tready from top to bottom.

[0166] The present embodiment provides an input data bit width that is greater than or equal to the checksum bit width, performs bit width grouping processing, reduces network message data with a larger bit width to the same as the checksum bit width, and then performs subsequent data check and processing. At the same time, the number of computing units in the pipeline computing mode is determined, so that the check data obtained by the subsequent check and processing is more accurate, and at the same time, the flexibility of the bit width processing process is also improved.

[0167] In some embodiments, when the input data bit width is smaller than the checksum bit width, performing bit width grouping processing on the first network message data according to the input data bit width and the checksum bit width to obtain the number of computing units and grouping data includes:

[0168] Dividing the first network message data according to the input data bit width to obtain processed second network message data;

[0169] Determine the number of merged second network message data according to the relationship between the checksum bit width and the input data bit width, so that the bit width data of the merged second network message data is the same as the checksum bit width;

[0170] Determine the number of divisions of the first computing unit according to the checksum bit width and the currently merged second network message data;

[0171] The number of groups obtained by dividing the number of divisions of the first computing unit into two groups of data is used as the grouping data of the first computing unit;

[0172] The grouped data of the first calculation unit is divided into two groups of data to obtain the number of groups, which is used as the grouped data of the second calculation unit;

[0173] This is deduced in this way until the grouped data of the Nth computing unit is 2 groups, so as to obtain the number of each computing unit and the corresponding grouped data, where N is a positive integer.

[0174] Specifically, considering that the input data bit width is smaller than the checksum bit width, the second network message data corresponding to the input data bit width needs to be merged to obtain network message data with the same bit width as the checksum bit width.

[0175] Taking the input data bit width of 8 bits and the checksum bit width of 16 bits as an example, the first network message data is 1024 bits, and the corresponding second network message data after the division is 8 bits. Based on the relationship between the checksum bit width and the input data bit width, the number of second network messages to be merged is determined, that is, how many second network message data are merged to be the same as the checksum bit width. Combined with the data exemplified in this paragraph, that is, two second network message data are merged, and each two second network message data are merged to obtain the current merged second network message data.

[0176] The subsequent process of determining the number of divisions of the first computing unit, the number of computing units, and the grouped data corresponding to each computing unit is the same as the above embodiment, which will not be repeated here. Please refer to the above embodiment.

[0177] Figure 3 A schematic diagram of the structure of another receiving-end field programmable gate array module provided by an embodiment of the present invention is shown in FIG. Figure 3 As shown, it can be seen that after receiving the first network message data, multiple second network message data are obtained, and the multiple second network message data are merged and processed (merging processing module) to obtain the merged second network message data. In the subsequent calculation unit, the current merged second network message data is first divided into the first calculation unit, and the result data obtained by verification and calculation in the first calculation unit is put into the second calculation unit for verification and calculation, and so on. Finally, the result data obtained in the Nth calculation unit is put into the accumulation unit as verification data, and stored in the accumulation unit to facilitate the next second network message data to be calculated and realized. The final accumulation obtains the final verification data of the first network message data. It can be understood that only when the merging processing module is added after the data selection module, the others and the above-mentioned Figure 2 The content is the same as in.

[0178] In the merging process of this embodiment, Figure 3 It can be after the signal is generated and before the calculation unit is determined; it can also be after the data selection module and before the calculation unit is determined. There is no limitation and it can be set according to actual conditions.

[0179] The present embodiment provides a bit width merging process for input data bit widths that are smaller than the checksum bit width, expands network message data with a smaller bit width to the same as the checksum bit width, and then performs subsequent data check and processing, and at the same time determines the number of computing units in the pipeline computing mode, so that the check data obtained by the subsequent check and processing is more accurate, and at the same time, the flexibility of the bit width processing process is also improved.

[0180] In some embodiments, the relationship between the input data bit width and the number of computing units is as follows:

[0181] Dividing the input data bit width and the checksum bit width to obtain first data;

[0182] Processing the first data by a power-of-2 algorithm to obtain second data;

[0183] The second data is used as the number of calculation units.

[0184] Specifically, the relationship between the number of computing units and the input data bit width is as follows: taking the checksum bit width of 16 bits and the input data bit width of 512 bits as an example, the corresponding computing units are 5; when the input data bit width is 256 bits, the corresponding computing units are 4; when the input data bit width is 128 bits, the corresponding computing units are 3; when the input data bit width is 1024 bits, the corresponding computing units are 6.

[0185] Accordingly, the formula is as follows:

[0186] 512bit=2 5 *16bit;

[0187] 256bit=2 4 *16bit;

[0188] 128bit=2 3 *16bit;

[0189] 1024bit=2 6 *16bit.

[0190] Combined with the above formula, the input data bit width and the checksum bit width are divided to obtain the first data (taking 512 bits as an example, 512 bits / 16 bits=32), and then the first data is processed by the power of 2 algorithm to obtain the second data (32=2 5 ), that is, the second data is used as the number of calculation units.

[0191] The relationship between the number of computing units and the input data bit width provided in this embodiment can clearly know the number of computing units corresponding to the pipeline computing mode in the data processing process, so as to achieve accurate connection between each second network message data.

[0192] In some embodiments, the step S13 of performing parallel verification and processing on the grouped first network message data according to the calculation unit and the grouping data to obtain each verification data corresponding to the first network message data includes:

[0193] Using the grouped data of the first computing unit as the unit number of the first computing subunit of the first computing unit;

[0194] Verify and process the two sets of data in each first computing subunit to obtain first intermediate data corresponding to each first computing subunit;

[0195] placing the first intermediate data corresponding to each first computing subunit in the second computing unit;

[0196] The number of groups obtained by dividing the number of the first intermediate data into two groups of data is used as the grouping data of the second calculation unit;

[0197] Using the grouped data of the second computing unit as the unit number of the second computing sub-unit of the second computing unit;

[0198] Verify and process the two sets of data in each second computing subunit to obtain second intermediate data corresponding to each second computing subunit;

[0199] And so on, until the number of the Nth computing subunit in the Nth computing unit is two, the Nth intermediate data of the corresponding Nth computing subunit is used as the verification data of the current second network message data, wherein the verification data of each second network message data is the verification data obtained by processing the first network message data after grouping according to the input data bit width.

[0200] It can be understood that the parallel checksum processing is performed based on the network message data in the computing unit. In combination with the above-mentioned embodiment, taking the first computing unit as an example, the grouped data of the first computing unit is clearly known, so the grouped data (such as 16 groups) is used as the number of units (16) of the first computing subunit of the first computing unit; in the 16 first computing subunits, two groups of data are stored in one first computing subunit, and the output data of each first computing subunit can be obtained as the corresponding intermediate data, and 16 first intermediate data are obtained. The first intermediate data corresponding to each first computing subunit is placed in the second computing unit, and the number of groups obtained by dividing the number of the first intermediate data into two groups of data is used as the grouped data (8 groups) of the second computing unit; the grouped data of the second computing unit is used as the number of units (8) of the second computing subunit of the second computing unit, and then the two groups of data in each second computing subunit are checked and processed to obtain the second intermediate data corresponding to each second computing subunit, that is, 8 second intermediate data are obtained, and so on, until the number of the Nth computing subunit of the Nth computing unit is two, and the number of the Nth intermediate data obtained is one, which is used as the verification data of the current second network message data.

[0201] It should be noted that the Nth intermediate data, the Nth computing subunit, and the Nth computing unit in this embodiment are only a mark, and do not correspond to the number of the corresponding data. In addition, the check data of each second network message data is the check data obtained after the first network message data is grouped according to the input data bit width.

[0202] The parallel checksum processing process of this embodiment is based on the parallel processing of each computing subunit in the computing unit, and the checksum processing performed in one computing subunit obtains the corresponding result data. In order to facilitate the various check data obtained by the pipeline processing of each computing unit. By improving the parallel processing characteristics of FPGA and adopting the checksum processing method of parallel processing, the data processing efficiency is improved compared with the serial processing of CPU. At the same time, it also takes into account the pipeline processing method used when the longer network message data cannot be processed simultaneously, and also improves the accuracy of the check data.

[0203] In some embodiments, the checksum processing process of the Nth intermediate data of the Nth computing subunit includes:

[0204] Adding two sets of data of the Nth computing subunit to obtain first initial data; wherein the bit width of the first initial data is greater than the bit width of the input data;

[0205] Taking the most significant bit of the first initial data as carry data;

[0206] The carry data and the data corresponding to the preset number of bits of the first initial data are added to obtain the Nth intermediate data; wherein the preset number of bits is the number of bits obtained by reverse deduction starting from the last bit of the first initial data according to the input data bit width.

[0207] Specifically, taking a computing subunit as an example, two sets of data in the computing subunit are added to obtain the first initial data, and both sets of data are 16 bits. When two data are added, there will be an excess carry problem, so the highest bit data of the first initial data is used as the carry data, such as the bit width of the first initial data is 17 bits. The carry data is added to the first initial data to obtain the corresponding intermediate data to ensure that the intermediate data is also 16 bits.

[0208] Define input data a and b, both of which are 16 bits. Add the input data a and b to obtain the first initial data c, the bit width of the data c is 17 bits, and the data c=a+b; the output intermediate data is c[15:0]+c

[16] , that is, the carry data c

[16] is added to the data c[15:0] corresponding to the preset number of bits of the first initial data to obtain the intermediate data of the calculation subunit.

[0209] For example, the decimal data 3+3=6 is converted to binary data as 11+11=110, but the final result needs to be the same as the number of digits of the addend. Therefore, the data obtained by taking the highest digit "1" of 110 and adding the last two digits "10" is "11", which is the final intermediate data.

[0210] The specific process of the checksum processing provided in this embodiment takes the carry problem into consideration and adds it to the corresponding intermediate data to retain valid information and avoid loss.

[0211] In some embodiments, the first network message data in step S11 is obtained by filtering the first initial network message data, specifically including:

[0212] Get the current bus protocol;

[0213] Splitting the first initial network message data according to the current bus protocol to obtain two paths of first initial network message data;

[0214] Outputting the first initial network message data of one of the routes;

[0215] Perform signal generation processing on the first initial network message data of another path according to the current bus protocol to obtain a detection packet start mark;

[0216] Data selection processing is performed on the first initial network message data of another path corresponding to the detection packet start mark to obtain the first network message data.

[0217] It is understandable that if Figure 2 As shown, the first network message data is located before the calculation unit and after the data selection module, that is, the first network message data is obtained by filtering the first initial network message data. The specific screening process needs to be combined with the bus protocol. First, the first initial network message data is split according to the current bus protocol to obtain two paths of the first initial network message data. That is to say, the splitting process in this embodiment is actually a copying process. Figure 2 The fork module in the implementation splits the standard data into two identical data streams. This can be achieved by writing data to the First In First Out (FIFO) module on one path, and directly outputting the other data. For the specific splitting process, the fork function can be used, which first allocates resources to the new process, such as space for storing data and code, and then copies all values ​​of the original process to the new process. This part of the splitting process is implemented in the fork module (Fork). Based on the fork module, the first initial network message data of one path is directly output, and the first initial network message data of the other path is subsequently checked and processed in parallel. It should be noted that the fork module completes the data replication, but the valid and ready of the control data are processed asynchronously.

[0218] Further, the first initial network message of another path is subjected to signal generation processing according to the current bus protocol to obtain a detection packet start flag. The signal generation process here can be carried and generated for private signals in addition to being based on the current bus protocol. The sop flag is a flag for subsequent data selection and accumulation processing, so as to accurately process the data.

[0219] The first network message data is obtained by performing data selection processing according to the first initial network message data of another path corresponding to the sop flag. The data selection in this embodiment takes into account that some data in the first initial network message data does not need to be checked and processed, so it can be shielded to reduce the amount of calculation.

[0220] In this embodiment, data selection processing is performed on the first initial network message data to obtain the first network message data. Under the premise that the sop flag is generated, data selection processing is performed on part of the first initial network message data based on the sop flag to facilitate calculation in subsequent verification and processing and improve computing power.

[0221] In some embodiments, considering the generation process of the sop flag, when the current bus protocol is a multi-channel transmission bus protocol, a signal generation process is performed on the first initial network message data of another channel according to the current bus protocol to obtain a detection packet start flag, including:

[0222] Obtaining a valid signal for receiving the first initial network message data, a back-end receiving ready signal, and a register last beat signal;

[0223] Determine the level signal of the next clock rising edge according to the level signal relationship between the valid signal, the back-end receiving ready signal and the register last beat signal;

[0224] Perform non-logical processing on the level signal of the next clock rising edge to obtain a first level signal;

[0225] The first level signal and the valid signal are subjected to logical AND processing to obtain a detection packet start mark.

[0226] Specifically, Figure 2 As shown in the figure, the current bus protocol is a multi-channel transmission bus protocol (Advanced eXtensibleInterface, AXI), which is an on-chip bus for high performance, high bandwidth, and low latency. Its address / control and data phases are separated, supporting unaligned data transmission. At the same time, in burst transmission, only the first address is needed, and the separate read and write data channels support Outstanding transmission access and out-of-order access, making it easier to perform timing convergence.

[0227] This embodiment is based on the valid signal (tvalid), the back-end reception preparation signal (tready) and the register last beat signal (tlast) corresponding to the first initial network message data reception, and the handshake mechanism of the AXI bus protocol. The tvalid signal is the master telling the slave that the data transmitted this time is valid data, the tready is the slave telling the master to prepare for transmission, and the tlast signal is the master telling the slave that the transmission is the end of a burst transmission, that is, the register last beat signal.

[0228] The level signal of the next clock rising edge is determined according to the level signal relationship between the above three signals, specifically:

[0229] When the above three signals are all high, the sop's data packet signal (in_packet) is set to 0 at the next clock rising edge. When the sop flag is high and the tready signal is high, the sop's data packet signal (in_packet) is set to 1 at the next clock rising edge.

[0230] The level signal of the next clock rising edge is processed non-logically to obtain the first level signal, and then the first level signal and the valid signal (tvalid) are processed logically to obtain the detection packet start flag (sop). The specific formula is as follows:

[0231] sop = !in_packet_q&&tvalid;

[0232] Among them, in_packet is the detection packet of sop, in_packet_q represents the qth corresponding clock signal, tvalid is the valid signal; the first level signal is represented by !in_packet_q; "!" represents non-logic; "&&" represents AND logic.

[0233] In some embodiments, the detection packet start flag is also carried by a private signal, specifically including:

[0234] Preliminarily performing private signal processing on the first network message data to obtain a carrying flag corresponding to the first network message data;

[0235] The carry flag is used as the start flag of the detection package.

[0236] It can be understood that in addition to the sop signal obtained based on the AXI bus protocol mentioned above, it can also be obtained through private signals. Private signals are a marking method for user-defined signals. They can be obtained through other bus marks and can also be carried separately when processing the first network message data. The flag here can be obtained through the register flag or other methods. There is no limitation here, and the carried flag is used as the sop signal.

[0237] The sop flag generation process provided in this embodiment facilitates the parallel verification and processing process of the subsequent computing units, and also provides data marking processing for data selection to save computing power.

[0238] In some embodiments, the frame header portion of the network message data does not need to participate in the parallel verification and processing process, so it is necessary to shield this portion to reduce the processing process of this portion. The first network message data is obtained by performing data selection processing on the first initial network message data of another path corresponding to the detection packet start flag, including:

[0239] When the detection packet start flag of the first initial network message data of another path is 1, obtaining message data corresponding to the first initial network message data of another path that does not participate in the parallel verification and processing;

[0240] The message data not participating in the parallel checksum processing is set to 0, so as to be combined with the first initial network message data of another path, so as to complete the data selection processing and obtain the first network message data;

[0241] When the detection packet start flag of the first initial network message data of the other path is not 1, the first initial network message data of the other path is not processed to obtain the first network message data.

[0242] Specifically, when the sop flag is 1, the first initial network message data of another path is obtained, and the message data corresponding to the checksum processing is not involved, and the data of this part is set to 0. In fact, 0 is used to participate in the subsequent calculation, but it will not affect the result, and the data of this part will be guaranteed to be output intact. It can be understood that the network message data corresponding to the parallel checksum processing can be obtained based on the data in the computing subunit corresponding to the computing unit, or it can be obtained by using a preset data address, which is not limited here. Of course, the network message data corresponding to the entire input data bit width in the computing subunit is set to 0, and there is no need to perform subsequent processing on it. On the other hand, if the network message data corresponding to the entire input data bit width in the computing subunit is not set to 0, the network message data corresponding to the preset data address is processed by the data of setting 0 at will, and the result data will not be affected.

[0243] When the detection packet start flag of the first initial network message data of another path is not 1, the first initial network message data of another path is not processed to obtain the first network message data. The data is not changed and can be output intact.

[0244] This embodiment provides shielding of network message data that does not need to participate in the parallel verification processing process, so as to improve data processing efficiency and FPGA computing power.

[0245] In some embodiments, considering that there may be conflicts in data processing caused by the speed of the computing unit in the pipeline computing mode, that is, the calculation of the computing unit corresponding to the current second network message data has not yet ended, and the next second network message data starts to be processed in the first computing unit, this situation occurs. Therefore, before accumulating the verification data to obtain the final verification data corresponding to the first network message data, it also includes:

[0246] Obtaining an output signal of a control subunit corresponding to the computing unit;

[0247] When the output signal of each control subunit is valid, the intermediate data of each corresponding calculation unit is output to obtain the current verification data;

[0248] When the output signal of each control subunit is invalid, the intermediate data of each calculation subunit is stored, and the control register is controlled to delay a preset number of clock cycles before outputting the intermediate data of each calculation subunit.

[0249] Specifically, the output signal of the control subunit corresponding to the computing unit is obtained, such as Figure 2 As shown, each computing unit corresponds to a control subunit. When the output signal of the control subunit is valid, it means that the current pipeline mode is normal, and the intermediate data of the computing unit can be directly output. If the output signal of the control subunit is valid, it means that the current pipeline mode is abnormal, and the data processing process is relatively crowded, so it is necessary to delay the register for a preset number of clock cycles before outputting. The number of control subunits is one more than the number of computing units, considering that the accumulation unit also corresponds to a control subunit, that is, the number of control subunits is N+1.

[0250] The generation of the output signal of the control subunit may be achieved through software or through a hardware logic circuit. The corresponding logic circuit is not limited and may be based on one logic circuit or a combination of multiple logic circuits.

[0251] In some embodiments, the output signal output process of the control subunit is determined by a combinational logic circuit, which includes a first NOR gate circuit, a second NOR gate circuit, an AND gate circuit and a register;

[0252] Acquire an input valid signal, an output valid signal, an input backend receiving ready signal and an output backend receiving ready signal for receiving the first initial network message data;

[0253] Using the port for inputting the valid signal as the input terminal of the OR gate of the first NOR gate circuit and as the first input terminal of the AND gate circuit;

[0254] The port outputting the valid signal is used as the NOT gate input terminal of the second NOT-OR gate circuit and as the output terminal of the register;

[0255] The port of the output back-end receiving the ready signal is used as the OR gate input of the second NOR gate circuit; the output end of the second NOR gate circuit is used as the NOR gate input of the first NOR gate circuit and as the second input of the AND gate circuit, and the output input back-end receives the ready signal;

[0256] Using the output terminal of the first NOR gate circuit as the input terminal of the register;

[0257] The output end of the AND gate circuit is used to output the output signal of the control subunit.

[0258] The control subunit determines whether it is valid based on the level signal calculation of the combination logic circuit of the four signals: the input valid signal, the output valid signal, the input rear-end reception ready signal and the output rear-end reception ready signal.

[0259] The input valid signal of the first control subunit corresponding to the first calculation unit is obtained through the data selection module, and the receiving preparation signal is generated based on the control subunit itself so as to be transmitted to the data selection module.

[0260] Figure 4 A structural diagram of a combinational logic circuit of a control subunit provided by an embodiment of the present invention, such as Figure 4 As shown, it includes a first NOR gate circuit 1, a second NOR gate circuit 3, an AND gate circuit 4 and a register 2, and the port for inputting a valid signal (in_valid) is used as the OR gate input terminal of the first NOR gate circuit 1, and as the first input terminal of the AND gate circuit 4; the port for outputting a valid signal (out_valid) is used as the NOR gate input terminal of the second NOR gate circuit 3, and as the output terminal of the register 2; the port for outputting a back-end receiving a ready signal (out_ready) is used as the OR gate input terminal of the second NOR gate circuit 3; the output terminal of the second NOR gate circuit 3 is used as the NOR gate input terminal of the first NOR gate circuit 1, and as the second input terminal of the AND gate circuit 4, and the output input back-end receives the ready signal (in_ready); the output terminal of the first NOR gate circuit 1 is used as the input terminal of the register 2; the output terminal of the AND gate circuit 4 is used to output the output signal of the control subunit.

[0261] The specific formula of the combinational logic circuit is as follows:

[0262] in_valid = (~out_valid) | out_ready; this means that the intermediate data is directly output after the combinational logic calculation;

[0263] out_valid<=(in_ready)|in_valid;Here it means the register is output after the combinational logic calculation.

[0264] The output signal of the control subunit = in_ready & in_valid; this represents AND logic.

[0265] The output process of the output signal under the logic combination circuit of the control subunit provided in this embodiment makes the processing of network message data in the pipeline computing mode not congested, and ensures orderliness.

[0266] In some embodiments, each verification data is accumulated to obtain the final verification data corresponding to the first network message data, including:

[0267] Obtaining a detection packet start flag corresponding to the first network message data;

[0268] If the detection packet start flag is 1, the verification data corresponding to the plurality of second network message data are saved until the frame end flag of the first network message data is 1, and the saving is terminated;

[0269] The saved verification data are accumulated to obtain the final verification data.

[0270] Specifically, Figure 2 As shown, the calculation unit in front of the accumulation unit has calculated the checksum verification data corresponding to the input data bit width, and it is necessary to perform cumulative calculation on the checksum corresponding to each input data bit width in parallel, that is, to obtain the first network message data after the checksum data of multiple second network message data are accumulated. When it is necessary to accumulate, when the sop flag is 1, the checksum data corresponding to the multiple second network message data are saved, that is, each calculation result is saved until the frame end flag is 1, and the saving is ended. The saved check data are accumulated to obtain the final check data. The final check data is output to the FIFO module for caching.

[0271] In this embodiment, accumulation processing is performed to ensure the integrity and accuracy of the first network message data.

[0272] In some embodiments, Figure 2 As shown, after the FIFO module caches the final verification data, that is, after each verification data is accumulated to obtain the final verification data corresponding to the first network message data, it also includes:

[0273] The first initial network message data and the final verification data of one of the routes are synchronously processed and sent to the host computer.

[0274] That is to say, in the final output work of the corresponding receiving end in this embodiment, the first initial network message data and the final verification data are synchronously processed to be sent to the host computer. The synchronous processing here can carry a binding relationship to facilitate sending to the host computer, and the host computer performs subsequent data processing work.

[0275] Furthermore, the present invention also provides a method for processing network messages applied to a field programmable gate array module at a sending end. Figure 5 A flowchart of a method for processing network messages applied to a field programmable gate array module at a sending end is provided in an embodiment of the present invention, such as Figure 5 As shown, the method includes:

[0276] S21: Obtain third network message data, input data bit width, and message command information sent by the host computer;

[0277] S22: Synchronizing the third network message data with the message command information to obtain synchronized third network message data;

[0278] S23: performing bit width grouping processing on the synchronized third network message data according to the input data bit width and the checksum bit width to obtain the number of calculation units and grouping data;

[0279] The group data is the number of groups to which the network message data in the computing unit belongs;

[0280] S24: performing parallel verification and processing on the grouped third network message data according to the calculation unit and the grouping data to obtain verification data corresponding to the third network message data;

[0281] The parallel checksum processing method is to use the parallel processing characteristics of the field programmable gate array to check and process the network message data in each computing unit, and the checksum data is processed in a pipeline processing mode between the computing units;

[0282] S25: Accumulate each verification data to obtain final verification data corresponding to the third network message data; and insert and replace the final verification data to obtain replaced verification data.

[0283] Specifically, the third network message data is obtained, which is mainly the original network message data sent by the host computer. The input data bit width is mentioned in the above embodiment. Please refer to the embodiment of the network message processing method applied to the receiving end field programmable gate array module, which will not be repeated here. Message command information sent by the host computer. The message command information here refers to the command information on how to process the network message data, such as enable signal, start signal, end signal and instruction valid signal. Figure 6A structural diagram of a field programmable gate array module at a transmitting end provided by an embodiment of the present invention, such as Figure 6 As shown, the information corresponding to the lower left foot of the synchronization module is all message command information.

[0284] Combination Figure 6 For example, the interfaces on the left and right sides of the transmitter are used to interact with other modules. The corresponding pins of the five interfaces on the upper left side are data, byte modifier, register last beat signal, valid signal and back-end reception ready signal from top to bottom. Based on the transmitter transmitted from other modules, the pin names here correspond to s_tdata, s_tkeep, s_tlast, s_tvalid and s_tready from top to bottom. The signal transmission between the synchronization module and the fork module (Fork) inside the transmitter is data, byte modifier, register last beat signal, enable signal flag, start checksum flag, checksum position signal, valid signal and back-end reception ready signal from top to bottom. There is no need to distinguish the transmission direction here, so the corresponding pin names are data, keep, last, enable, start, offset, valid and ready. The fork module transmits one data path to the first-in-first-out module, and the other data path to the parallel check processing module. The signal transmission between the first-in-first-out module and the insertion and replacement module is data, byte modifier, register last beat signal, enable signal flag, start checksum flag, checksum position signal, valid signal and back-end reception preparation signal from top to bottom, and the corresponding pin names are data, keep, last, enable, start, offset, valid and ready. The signal transmission between the parallel checksum processing module and the insertion and replacement module is check data, valid signal and back-end reception preparation signal from top to bottom, and the corresponding pin names are csum_value, valid and ready. The data output by the insertion and replacement module corresponds to the interface signals from top to bottom: data (data), byte modifier (keep), register last beat signal (last), valid signal (valid) and back-end reception preparation signal (ready). Based on the sending end, in order to distinguish the sending and receiving directions, the pin names correspond to m_tdata, m_tkeep, m_tlast, m_tvalid and m_tready from top to bottom.

[0285] In addition, the message command information is input in the lower left corner on the left side of the transmitting end, which are respectively the enable signal flag, the start checksum flag, the checksum position signal, the valid signal and the back-end receiving preparation signal from top to bottom. In order to distinguish from other interface signals, the corresponding pin names are: cmd_enable, cmd_start, cmd_offset, cmd_valid and cmd_ready. The synchronization processing module synchronizes the third network message data with the message command information to facilitate the subsequent parallel verification and processing of the data. In addition, after the third network message data is synchronized, a fork module (Fork) is required to split it into two identical data, one way to the FIFO module (first-in-first-out module), and the other way to the parallel verification and processing module. The splitting process of the Fork module, the FIFO module and the parallel verification and processing module are the same as the embodiment of the network message processing method applied to the receiving end field programmable gate array module, and will not be repeated here.

[0286] Figure 7 A schematic diagram of another parallel checksum processing module of a sending-end field programmable gate array module provided by an embodiment of the present invention is shown in FIG. Figure 7 As shown, the verification data needs to be obtained through the signal generation module, the data selection module and the calculation unit, and the control sub-unit controls the flow of the calculation unit. Finally, the verification data is accumulated by the accumulation unit. The whole process is the same as the embodiment of the network message processing method applied to the receiving end field programmable gate array module, and will not be repeated here. In addition, the input signal of the parallel verification and processing module also includes an enable signal flag bit (enable), and its input data bit width is 512 bits.

[0287] It should be noted that after obtaining the final verification data, a synchronization mechanism is adopted in this embodiment to perform insertion and replacement processing. The insertion and replacement module is responsible for replacing the calculated final verification data according to the valid signal of the message command information to realize the network message data of the replacement verification value, which is subsequently sent to other terminal devices or switches via optical fiber.

[0288] The method for processing network messages applied to the field programmable gate array module at the sending end provided by the embodiment of the present invention synchronizes the third network message data with the message command information to obtain the synchronized third network message data; performs bit width grouping processing on the synchronized third network message data according to the input data bit width and the checksum bit width to obtain the number of calculation units and group data; performs parallel check and processing on the grouped third network message data according to the calculation units and the group data to obtain each check data corresponding to the third network message data; performs cumulative processing on each check data to obtain the final check data corresponding to the third network message data; and performs insertion and replacement processing on the final check data to obtain the replaced check data. Whether the large bit width data greater than the checksum bit width or the small bit width data less than the checksum bit width under the first network message data can be processed by bit width grouping based on the checksum bit width to improve the bit width processing capability and meet the requirements of hundreds of G network cards. At the same time, the flexibility of bit width processing is also improved. After grouping, the first network message data after grouping is checked and processed in parallel based on the calculation unit and the grouping data to obtain each check data. Here, the parallel processing characteristics of the FPGA are utilized, and the checksum processing method of parallel processing is adopted to improve the data processing efficiency compared with the serial processing of the CPU. In addition, the checksum processing method here adopts a pipeline processing method, which further improves the data processing efficiency compared with the cumulative processing of the traditional checksum serial method. Processing based on FPGA saves CPU resources and improves network bandwidth. In addition, the sending end also adopts a synchronous-asynchronous-synchronous mechanism to realize the sending architecture of the sending end and the data processing architecture.

[0289] In some embodiments, synchronizing the third network message data with the message command information to obtain synchronized third network message data includes:

[0290] Obtain the enable signal flag, the start checksum flag, and the checksum position information of the message command information;

[0291] The enable signal flag, the start checksum flag, the checksum position information and the third network message data are synchronously processed to be converted into the sideband information of the bus protocol to obtain the synchronized third network message data.

[0292] like Figure 6As shown, the enable signal flag (enable), the start checksum flag (start), and the checksum position information (offset) are synchronized with the third network message data to convert them into the sideband information of the bus protocol, and the synchronized third network message data is obtained. Enable represents whether the calculated checksum checksum data (checksum, transmitted using the csum interface in the figure) replaces the checksum in the original message. Start represents the starting position of the checksum calculated from the frame header. Offset represents the location of the checksum in the original message. The command transmission is a standard handshake protocol, but the network data packet is an axis protocol. One packet of data corresponds to one command, and the two need to be synchronized. The result of the synchronization is to convert the command information into the sideband information of the axis protocol.

[0293] The synchronous processing process provided by the embodiment of the present invention facilitates the subsequent parallel verification and processing process.

[0294] In some embodiments, inserting and replacing the final verification data to obtain replaced verification data includes:

[0295] If the enable signal flag is valid, the initial verification data corresponding to the third network message data is replaced with the final verification data according to the verification and position information.

[0296] It can be understood that according to the enable and offset replacement, if enable is 1, the initial checksum in the original message is replaced with the final check data; if it is 0, it is not replaced. The replacement position is determined by the offset value. The original message data in this module is obtained from the FIFO module, and each packet of network data message corresponds to a calculated checksum value.

[0297] The insertion and replacement processing provided in this embodiment is used to achieve synchronization between the verification data and the third network message data.

[0298] Furthermore, the present invention also provides a network message processing system, Figure 8 A structural diagram of a network message processing system provided by an embodiment of the present invention, such as Figure 8 As shown, the processing system includes a first terminal device 5, a switch 6 and a second terminal device 7;

[0299] The first terminal device 5 is used to control the sending end to process the fourth network message data to obtain corresponding verification data, wherein the processing process of the fourth network message data is obtained by the above-mentioned network message processing method applied to the sending end field programmable gate array module;

[0300] The switch 6 is used to receive the fourth network message data and the corresponding verification data for transmission to the second terminal device 7;

[0301] The second terminal device 7 is used to control the receiving end to receive the fourth network message data, and process the fourth network message data to obtain corresponding new inspection data for sending to the host computer; wherein, the processing process of the fourth network message data received by the switch 6 in the second terminal device 7 is obtained by the above-mentioned network message processing method applied to the receiving end field programmable gate array module.

[0302] It is understandable that the application scenario in this embodiment is not limited to the message data transmission between two terminal devices and the switch, but can also be an end-to-end data transmission process, which requires maintaining the same processing bit width capability between the transmission objects. In addition, regarding the sending end field programmable gate array module of the first terminal device and the receiving end field programmable gate array module of the second terminal device, it does not mean that the first terminal device only includes the sending end field programmable gate array module and the second terminal device only includes the receiving end field programmable gate array module. Currently, there is only one method in which the sending end of the first terminal device is sent to the receiving end of the second terminal device via the switch. In fact, both the first terminal device and the second terminal device have a sending end field programmable gate array module and a receiving end field programmable gate array module.

[0303] For an introduction to a network message processing system provided by the present invention, please refer to the above method embodiment, and the present invention will not be repeated here. It has the same beneficial effects as the above network message processing method.

[0304] Fig. 9 A port diagram of a receiving-end field programmable gate array module provided by an embodiment of the present invention, such as Fig. 9 As shown in the figure, the data interface uses the standard AIX-stream protocol for transmission, and the command interface uses the standard valid-ready handshake protocol for transmission. For the receiving end, the received network message data is input, and the original data and check value are output. These two parts are subsequently sent to the host computer with CPU for processing. Figure 3 The interfaces on the left and right have the same meanings. Figure 3 The embodiments of the present invention will not be described in detail here. Fig.10 A port diagram of a field programmable gate array module at a transmitting end provided by an embodiment of the present invention is shown in FIG. Fig.10 As shown in the figure, for the sending end, the original network message data and calculation related commands (all from the host computer with CPU) are input, and the network message data with calculated replacement check value is output. The calculated data will be sent through optical fiber later. Figure 6 The interfaces on the left and right have the same meanings. Figure 6 The embodiments of the present invention will not be described in detail here.

[0305] The above detailed descriptions of various embodiments corresponding to the method for processing network messages applied to a receiving-end field programmable gate array module are described above. On this basis, the present invention also discloses a network message processing device applied to a receiving-end field programmable gate array module corresponding to the above method. Fig.11 The structure diagram of a network message processing device applied to a receiving-end field programmable gate array module provided by an embodiment of the present invention. Fig.11 As shown, the device comprises:

[0306] A first receiving module 11, used for receiving first network message data and inputting data bit width;

[0307] The first processing module 12 is used to perform bit width grouping processing on the first network message data according to the input data bit width and the checksum bit width to obtain the number of calculation units and group data; wherein the group data is the number of groups in which the network message data in the calculation unit is located;

[0308] The second processing module 13 is used to perform parallel verification and processing on the grouped first network message data according to the computing units and the grouping data to obtain each verification data corresponding to the first network message data; wherein the parallel verification and processing method is to use the parallel processing characteristics of the field programmable gate array to verify and process the network message data in each computing unit, and the verification data is obtained in the pipeline processing method between the computing units.

[0309] The third processing module 14 is used to accumulate the verification data to obtain the final verification data corresponding to the first network message data.

[0310] Since the embodiments of the device part correspond to the above embodiments, please refer to the description of the embodiments of the method part for the embodiments of the device part, and will not be repeated here.

[0311] For an introduction to a network message processing device applied to a receiving-end field programmable gate array module provided by the present invention, please refer to the above-mentioned method embodiment. The present invention will not be repeated here. It has the same beneficial effects as the above-mentioned network message processing method applied to the receiving-end field programmable gate array module.

[0312] The above detailed descriptions correspond to various embodiments of the method for processing network messages applied to the sending end field programmable gate array module. On this basis, the present invention also discloses a network message processing device applied to the sending end field programmable gate array module corresponding to the above method. Fig.12The structure diagram of a network message processing device applied to a field programmable gate array module at a sending end provided by an embodiment of the present invention. Fig.12 As shown, the device comprises:

[0313] An acquisition module 15, used to acquire third network message data, input data bit width and message command information sent by the host computer;

[0314] The fourth processing module 16 is used to synchronize the third network message data with the message command information to obtain synchronized third network message data;

[0315] The fifth processing module 17 is used to perform bit width grouping processing on the synchronized third network message data according to the input data bit width and the checksum bit width to obtain the number of calculation units and group data; wherein the group data is the number of groups in which the network message data in the calculation unit is located;

[0316] The sixth processing module 18 is used to perform parallel verification and processing on the grouped third network message data according to the computing units and the grouping data to obtain each verification data corresponding to the third network message data; wherein the parallel verification and processing method is to use the parallel processing characteristics of the field programmable gate array to verify and process the network message data in each computing unit, and the verification data is obtained in the pipeline processing method between the computing units.

[0317] The seventh processing module 19 is used to perform accumulation processing on each verification data to obtain final verification data corresponding to the third network message data; and perform insertion and replacement processing on the final verification data to obtain replaced verification data.

[0318] Since the embodiments of the device part correspond to the above embodiments, please refer to the description of the embodiments of the method part for the embodiments of the device part, and will not be repeated here.

[0319] For an introduction to a network message processing device applied to a sending-end field programmable gate array module provided by the present invention, please refer to the above-mentioned method embodiment, and the present invention will not be repeated here. It has the same beneficial effects as the above-mentioned network message processing method applied to the sending-end field programmable gate array module.

[0320] Fig.13 A structural diagram of a network message processing device provided by an embodiment of the present invention, such as Fig.13 As shown, the network message processing device includes:

[0321] A memory 21, used for storing computer programs;

[0322] The processor 22 is used to implement the steps of the above-mentioned method for processing network messages applied to the receiving-end field programmable gate array module and the above-mentioned method for processing network messages applied to the sending-end field programmable gate array module when executing the computer program.

[0323] The network message processing device provided in this embodiment may include but is not limited to a tablet computer, a laptop computer, or a desktop computer.

[0324] Among them, the processor 22 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 22 can be implemented in at least one hardware form of a digital signal processor (DSP), an FPGA, and a programmable logic array (PLA). The processor 22 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU; the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 22 may be integrated with a graphics processing unit (GPU), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 22 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.

[0325] The memory 21 may include one or more computer-readable storage media, which may be non-transitory. The memory 21 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 21 is at least used to store the following computer program 211, wherein, after the computer program is loaded and executed by the processor 22, it can implement the relevant steps of the above-mentioned method for processing network messages applied to the receiving end field programmable gate array module and the above-mentioned method for processing network messages applied to the sending end field programmable gate array module disclosed in any of the above-mentioned embodiments. In addition, the resources stored in the memory 21 may also include an operating system 212 and data 213, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 212 may include Windows, Unix, Linux, etc. The data 213 may include but is not limited to the data involved in the above-mentioned method for processing network messages applied to the receiving end field programmable gate array module and the above-mentioned method for processing network messages applied to the sending end field programmable gate array module, etc.

[0326] In some embodiments, the network message processing device may further include a display screen 23 , an input / output interface 24 , a communication interface 25 , a power supply 26 , and a communication bus 27 .

[0327] Those skilled in the art can understand that Fig.13 The structure shown in the figure does not constitute a limitation on the network message processing device, and may include more or fewer components than those shown in the figure.

[0328] The processor 22 calls the instructions stored in the memory 21 to implement the network message processing method applied to the receiving-end field programmable gate array module and the network message processing method applied to the sending-end field programmable gate array module provided in any of the above embodiments.

[0329] For an introduction to a network message processing device provided by the present invention, please refer to the above-mentioned method embodiment, and the present invention will not be repeated here. It has the same beneficial effects as the above-mentioned network message processing method applied to the receiving-end field programmable gate array module and the network message processing method applied to the sending-end field programmable gate array module.

[0330] Furthermore, the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by the processor 22, the steps of the method for processing network messages applied to the receiving-end field programmable gate array module and the method for processing network messages applied to the sending-end field programmable gate array module are implemented.

[0331] It is understandable that if the method in the above embodiment is implemented in the form of a 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 solution of the present invention is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium to execute all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program codes.

[0332] For an introduction to a computer-readable storage medium provided by the present invention, please refer to the above-mentioned method embodiment, and the present invention will not be repeated here. It has the same beneficial effects as the above-mentioned method for processing network messages applied to the receiving-end field programmable gate array module and the method for processing network messages applied to the sending-end field programmable gate array module.

[0333] The above is a detailed introduction to a network message processing method, system, device, equipment and medium provided by the present invention. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the embodiments can be referenced to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principle of the present invention, the present invention can also be improved and modified in several ways, and these improvements and modifications also fall within the scope of protection of the present invention.

[0334] It should also be noted that, in this specification, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprises", "comprising" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.

Claims

1. A method for processing network messages, characterized in that: include: Receiving first network message data and input data bit width; The first network message data is processed by bit width grouping according to the input data bit width and the checksum bit width to obtain the number of calculation units and group data; wherein the group data is the number of groups in which the network message data in the calculation unit is located; the bit width grouping is to divide the first network message data according to the relationship between the input data bit width and the checksum bit width to obtain multiple network message fields; the relationship between the input data bit width and the number of calculation units is as follows: the input data bit width and the checksum bit width are divided to obtain the first data; the first data is processed by a power of 2 algorithm to obtain the second data; the second data is used as the number of calculation units; According to the computing units and the grouping data, the first network message data after grouping is checked and processed in parallel to obtain each verification data corresponding to the first network message data; wherein the parallel checking and processing method is to check and process the network message data in each computing unit by using the parallel processing characteristics of the field programmable gate array, and the processing method of the verification data obtained in the pipeline processing method between the computing units; Each verification data is accumulated to obtain the final verification data corresponding to the first network message data.

2. The method for processing network messages according to claim 1, characterized in that: When the input data bit width is greater than or equal to the checksum bit width, performing bit width grouping processing on the first network message data according to the input data bit width and the checksum bit width to obtain the number of calculation units and grouping data, including: Dividing the first network message data according to the input data bit width to obtain processed second network message data; Determine the number of divisions of the first computing unit according to the checksum bit width and the current second network message data; The number of groups obtained by dividing the number of divisions of the first computing unit into two groups of data is used as the grouping data of the first computing unit; The grouped data of the first calculation unit is divided into two groups of data to obtain the number of groups, which is used as the grouped data of the second calculation unit; This is deduced in this way until the grouped data of the Nth computing unit is one group, so as to obtain the number of each computing unit and the corresponding grouped data, where N is a positive integer.

3. The method for processing network messages according to claim 1, characterized in that: When the input data bit width is smaller than the checksum bit width, performing bit width grouping processing on the first network message data according to the input data bit width and the checksum bit width to obtain the number of calculation units and grouping data, including: Dividing the first network message data according to the input data bit width to obtain processed second network message data; Determine the number of merged second network message data according to the relationship between the checksum bit width and the input data bit width, so that the bit width data of the merged second network message data is the same as the checksum bit width; Determine the number of divisions of the first computing unit according to the checksum bit width and the currently merged second network message data; The number of groups obtained by dividing the number of divisions of the first computing unit into two groups of data is used as the grouping data of the first computing unit; The grouped data of the first calculation unit is divided into two groups of data to obtain the number of groups, which is used as the grouped data of the second calculation unit; This is deduced in this way until the grouped data of the Nth computing unit is one group, so as to obtain the number of each computing unit and the corresponding grouped data, where N is a positive integer.

4. The method for processing network messages according to claim 2 or 3, characterized in that: The grouped first network message data is verified and processed in parallel according to the calculation unit and the grouping data to obtain each verification data corresponding to the first network message data, including: Using the grouped data of the first computing unit as the unit number of the first computing subunit of the first computing unit; Verify and process the two sets of data in each first computing subunit to obtain first intermediate data corresponding to each first computing subunit; placing the first intermediate data corresponding to each first computing subunit in the second computing unit; The number of groups obtained by dividing the number of the first intermediate data into two groups of data is used as the grouping data of the second calculation unit; Using the grouped data of the second computing unit as the unit number of the second computing sub-unit of the second computing unit; Verify and process the two sets of data in each second computing subunit to obtain second intermediate data corresponding to each second computing subunit; And so on, until the number of the Nth computing subunit in the Nth computing unit is one, the Nth intermediate data of the corresponding Nth computing subunit is used as the verification data of the current second network message data, wherein the verification data of each second network message data is the verification data obtained by processing the first network message data after grouping according to the input data bit width.

5. The method for processing network messages according to claim 4, characterized in that: The verification and processing process of the Nth intermediate data of the Nth computing subunit includes: Adding two sets of data of the Nth computing subunit to obtain first initial data; wherein the bit width of the first initial data is greater than the bit width of the input data; Taking the most significant bit of the first initial data as carry data; The carry data and the data corresponding to the preset number of bits of the first initial data are added to obtain the Nth intermediate data; wherein the preset number of bits is the number of bits obtained by reverse deduction starting from the last bit of the first initial data according to the input data bit width.

6. The method for processing network messages according to claim 5, characterized in that: The first network message data is obtained by filtering the first initial network message data, and specifically includes: Get the current bus protocol; Splitting the first initial network message data according to the current bus protocol to obtain two paths of first initial network message data; wherein the splitting process is a copying process, and the copying process is to split the first initial network message data into two identical data streams, and use them as the first initial network message data of the two paths; Outputting the first initial network message data of one of the routes; Perform signal generation processing on the first initial network message data of another path according to the current bus protocol to obtain a detection packet start mark; Data selection processing is performed on the first initial network message data of another path corresponding to the detection packet start mark to obtain the first network message data.

7. The method for processing network messages according to claim 6, characterized in that: When the current bus protocol is a multi-channel transmission bus protocol, a signal generation process is performed on the first initial network message data of another channel according to the current bus protocol to obtain a detection packet start mark, including: Obtaining a valid signal for receiving the first initial network message data, a back-end receiving ready signal, and a register last beat signal; Determine the level signal of the next clock rising edge according to the level signal relationship between the valid signal, the back-end receiving ready signal and the register last beat signal; Perform non-logical processing on the level signal of the next clock rising edge to obtain a first level signal; The first level signal and the valid signal are subjected to logical AND processing to obtain the detection packet start mark.

8. The method for processing network messages according to claim 6, characterized in that: The detection packet start flag is also carried by a private signal, specifically including: Preliminarily performing private signal processing on the first network message data to obtain a carrying mark corresponding to the first network message data; wherein the private signal is a marking method of a user-defined signal; and the private signal processing is carried out through the private signal; The carrying mark is used as the start mark of the detection package.

9. The method for processing network messages according to claim 7, characterized in that: The first network message data is obtained by performing data selection processing according to the first initial network message data of another path corresponding to the detection packet start mark, including: When the detection packet start flag of the first initial network message data of another path is 1, obtaining message data corresponding to the first initial network message data of another path that does not participate in the parallel verification and processing; The message data not participating in the parallel checksum processing is set to 0, so as to be combined with the first initial network message data of another path, so as to complete the data selection processing and obtain the first network message data; When the detection packet start flag of the first initial network message data of the other path is not 1, the first initial network message data of the other path is not processed to obtain the first network message data.

10. The method for processing network messages according to claim 9, characterized in that: Before accumulating the verification data to obtain the final verification data corresponding to the first network message data, the method further includes: Obtaining an output signal of a control subunit corresponding to the computing unit; When the output signal of each control subunit is valid, the intermediate data of each corresponding calculation unit is output to obtain the current verification data; When the output signal of each control subunit is invalid, the intermediate data of each calculation subunit is stored, and the control register is controlled to delay a preset number of clock cycles before outputting the intermediate data of each calculation subunit.

11. The method for processing network messages according to claim 10, characterized in that: The output signal output process of the control subunit is determined by a combinational logic circuit; wherein the combinational logic circuit includes a first NOR gate circuit, a second NOR gate circuit, an AND gate circuit and a register; Acquire an input valid signal, an output valid signal, an input backend receiving ready signal and an output backend receiving ready signal for receiving the first initial network message data; Using the port for inputting the valid signal as the input terminal of the OR gate of the first NOR gate circuit and as the first input terminal of the AND gate circuit; The port outputting the valid signal is used as the NOT gate input terminal of the second NOT-OR gate circuit and as the output terminal of the register; The port of the output back-end receiving the ready signal is used as the OR gate input of the second NOR gate circuit; the output end of the second NOR gate circuit is used as the NOR gate input of the first NOR gate circuit and as the second input of the AND gate circuit, and the output input back-end receives the ready signal; Using the output terminal of the first NOR gate circuit as the input terminal of the register; The output end of the AND gate circuit is used to output the output signal of the control subunit.

12. The method for processing network messages according to claim 9, characterized in that: The final verification data corresponding to the first network message data is obtained by accumulating the verification data, including: Obtaining a detection packet start flag corresponding to the first network message data; If the detection packet start flag is 1, the verification data corresponding to the plurality of second network message data are saved until the frame end flag of the first network message data is 1, and the saving is terminated; The saved verification data are accumulated to obtain the final verification data.

13. The method for processing network messages according to claim 12, characterized in that: After accumulating the verification data to obtain the final verification data corresponding to the first network message data, the method further includes: The first initial network message data of one path and the final verification data are synchronously processed to be sent to the host computer; wherein the synchronization processing is to send the first initial network message data of one path and the final verification data with a binding relationship.

14. A method for processing network messages, characterized in that: include: Obtaining third network message data, input data bit width, and message command information sent by the host computer; Synchronizing the third network message data with the message command information to obtain synchronized third network message data; The synchronized third network message data is subjected to bit width grouping processing according to the input data bit width and the checksum bit width to obtain the number of computing units and group data; wherein the group data is the number of groups in which the network message data in the computing unit is located; the bit width grouping processing is to divide the synchronized third network message data according to the relationship between the input data bit width and the checksum bit width to obtain multiple network message fields; The grouped third network message data is checked and processed in parallel according to the computing units and the grouping data to obtain each verification data corresponding to the third network message data; wherein the parallel checking and processing method is to check and process the network message data in each computing unit by utilizing the parallel processing characteristics of the field programmable gate array, and the processing method of the verification data obtained in the pipeline processing method between the computing units; Accumulating each verification data to obtain final verification data corresponding to the third network message data; and inserting and replacing the final verification data to obtain replaced verification data; The step of synchronizing the third network message data with the message command information to obtain synchronized third network message data includes: Obtain the enable signal flag, the start checksum flag, and the checksum position information of the message command information; Synchronize the enable signal flag, the start checksum flag, the checksum position information and the third network message data to convert them into sideband information of the bus protocol, and obtain synchronized third network message data; Correspondingly, the final verification data is subjected to insertion and replacement processing to obtain replaced verification data, including: If the enable signal flag is valid, the initial verification data corresponding to the third network message data is replaced with the final verification data according to the verification and position information.

15. A network message processing system, characterized in that: The processing system includes a first terminal device, a switch, and a second terminal device; A first terminal device, used for controlling the sending end to process the fourth network message data to obtain corresponding verification data, wherein the processing process of the fourth network message data is obtained by the network message processing method according to any one of claims 14; The switch is used to receive the fourth network message data and the corresponding verification data for transmission to the second terminal device; The second terminal device is used to control the receiving end to receive the fourth network message data, and process the fourth network message data to obtain corresponding new verification data for sending to the host computer; wherein, the processing process of the fourth network message data received by the switch in the second terminal device is obtained by the network message processing method described in any one of claims 1 to 13.

16. A network message processing device, characterized in that: include: A first receiving module, used for receiving first network message data and inputting data bit width; The first processing module is used to perform bit width grouping processing on the first network message data according to the input data bit width and the checksum bit width to obtain the number of calculation units and group data; wherein the group data is the number of groups in which the network message data in the calculation unit is located; the bit width grouping processing is to divide the first network message data according to the relationship between the input data bit width and the checksum bit width to obtain multiple network message fields; the relationship between the input data bit width and the number of calculation units is as follows: the input data bit width and the checksum bit width are divided to obtain the first data; the first data is processed by a power of 2 algorithm to obtain the second data; the second data is used as the number of calculation units; A second processing module is used to perform parallel verification and processing on the grouped first network message data according to the computing units and the grouping data to obtain each verification data corresponding to the first network message data; wherein the parallel verification and processing method is to use the parallel processing characteristics of the field programmable gate array to verify and process the network message data in each computing unit, and the verification data is obtained in the pipeline processing method between the computing units. The third processing module is used to accumulate the verification data to obtain the final verification data corresponding to the first network message data.

17. A network message processing device, characterized in that: include: An acquisition module, used for acquiring third network message data, input data bit width and message command information sent by the host computer; A fourth processing module, used for synchronously processing the third network message data and the message command information to obtain synchronized third network message data; A fifth processing module, configured to perform bit width grouping processing on the synchronized third network message data according to the input data bit width and the checksum bit width to obtain the number of calculation units and group data; wherein the group data is the number of groups in which the network message data in the calculation unit is located; the bit width grouping processing is to divide the synchronized third network message data according to the relationship between the input data bit width and the checksum bit width to obtain multiple network message fields; a sixth processing module, configured to perform parallel verification and processing on the grouped third network message data according to the computing units and the grouping data to obtain verification data corresponding to the third network message data; wherein the parallel verification and processing method is to utilize the parallel processing characteristics of the field programmable gate array to verify and process the network message data in each computing unit, and to process the verification data obtained in a pipeline processing method between the computing units; A seventh processing module is used to perform accumulation processing on each verification data to obtain final verification data corresponding to the third network message data; and perform insertion and replacement processing on the final verification data to obtain replaced verification data; The step of synchronizing the third network message data with the message command information to obtain synchronized third network message data includes: Obtain the enable signal flag, the start checksum flag, and the checksum position information of the message command information; Synchronize the enable signal flag, the start checksum flag, the checksum position information and the third network message data to convert them into sideband information of the bus protocol, and obtain synchronized third network message data; Correspondingly, the final verification data is subjected to insertion and replacement processing to obtain replaced verification data, including: If the enable signal flag is valid, the initial verification data corresponding to the third network message data is replaced with the final verification data according to the verification and position information.

18. A network message processing device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the method for processing network messages as described in any one of claims 1 to 14 when executing the computer program.

19. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for processing network messages according to any one of claims 1 to 14 are implemented.

Citation Information

Patent Citations

  • Network message checksum unloading method based on FPGA

    CN115052055A

  • Message processing method and network security equipment

    CN116318529A