A message processing method and device, electronic equipment and storage medium
By intercepting and generating key field information in the message processing chip, the online update problem was solved, and the adaptation and processing efficiency of message processing were improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-09
- Publication Date
- 2026-03-10
AI Technical Summary
Existing message processing chips cannot be updated online, requiring offline updates when the format changes, which affects adaptation and processing efficiency.
By acquiring the original message input data, extracting key target field information, and generating target result message data based on this information, online processing can be achieved.
This improves the adaptability of the message processing chip, ensuring continuous subsequent processing even when the format changes, thus enhancing the overall efficiency of message processing.
Smart Images

Figure CN116668385B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of data processing technology, specifically to message data processing technology and network equipment technology, and can be applied to intelligent cloud scenarios. Background Technology
[0002] With the development of networks, network devices such as gateways generally use two methods to forward packets: software forwarding and hardware forwarding. In software forwarding, the processor executes software algorithms to process and forward packets; in hardware forwarding, logic chips such as packet processing chips process and forward packets. Software forwarding enables richer functionality, while hardware forwarding offers higher forwarding speeds. In intelligent cloud scenarios, improving packet processing efficiency has a significant impact on intelligent cloud services. Summary of the Invention
[0003] This disclosure provides a message processing method, apparatus, electronic device, and storage medium that can improve the adaptation efficiency of message processing chips, thereby improving the efficiency of message processing.
[0004] In a first aspect, embodiments of this disclosure provide a message processing method, including:
[0005] Obtain the raw message input data;
[0006] Extract target key field information from the original message input data; wherein, the target key field information includes the original target field information;
[0007] Generate target result message data based on the target key field information;
[0008] The original message output data is generated based on the original message input data and the target result message data.
[0009] Secondly, embodiments of this disclosure provide a message processing apparatus, including:
[0010] The raw message input data acquisition module is used to acquire raw message input data;
[0011] The target key field information interception module is used to intercept target key field information from the original message input data; wherein, the target key field information includes the original target field information;
[0012] The target result message data generation module is used to generate target result message data based on the target key field information.
[0013] The raw message output data generation module is used to generate raw message output data based on the raw message input data and the target result message data.
[0014] Thirdly, embodiments of this disclosure provide an electronic device, including:
[0015] At least one processor; and
[0016] A memory communicatively connected to the at least one processor; wherein,
[0017] The memory stores instructions that can be executed by the at least one processor, which, when executed, enable the at least one processor to perform the message processing method provided in the first aspect embodiment.
[0018] Fourthly, embodiments of this disclosure also provide a non-transitory computer-readable storage medium storing computer instructions for causing the computer to execute the message processing method provided in the first aspect embodiment.
[0019] Fifthly, this disclosure also provides a computer program product, including a computer program that, when executed by a processor, implements the message processing method provided in the first aspect embodiment.
[0020] This disclosure embodiment acquires original message input data, then extracts target key field information, including target original field information, from the original message input data. Based on the target key field information, target result message data is generated, and thus original message output data is generated based on the original message input data and the target result message data. Online message processing of the original message input data based on the target key field information extracted from the original message input data solves the problem of message processing chips needing to update information extraction functions offline, improving the adaptation efficiency of message processing chips and consequently increasing message processing efficiency.
[0021] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0022] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:
[0023] Figure 1 This is a flowchart of a message processing method provided in an embodiment of this disclosure;
[0024] Figure 2 This is a flowchart of a message processing method provided in an embodiment of this disclosure;
[0025] Figure 3 This is a schematic flowchart of a message processing method provided in an embodiment of this disclosure;
[0026] Figure 4 This is a schematic diagram of a process for extracting key field information applicable to an embodiment of this disclosure;
[0027] Figure 5 This is a schematic diagram of a configurable switching network to which embodiments of this disclosure apply;
[0028] Figure 6 This is a flowchart illustrating a method for replacing key field information applicable to an embodiment of this disclosure;
[0029] Figure 7 This is a schematic diagram of another configurable switching network to which the embodiments of this disclosure apply;
[0030] Figure 8 This is a structural diagram of a message processing apparatus provided in an embodiment of this disclosure;
[0031] Figure 9 This is a schematic diagram of the structure of an electronic device used to implement the message processing method of the embodiments of this disclosure. Detailed Implementation
[0032] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0033] As network bandwidth demands continue to grow, the processing capabilities required of gateway devices are also increasing, steadily moving towards Tbps (gigabits per second). Traditional software-based bandwidth processing via x86 CPUs (Central Processing Units) reaches the hundreds of Gbps (gigabits per second) level, facing significant challenges in performance, cost, and maintenance. The emergence of programmable switching chips can meet the high throughput requirements of gateways at the Tbps level and the high flexibility required to define forwarding behavior according to service needs. However, due to the limitations of ASIC (Application Specific Integrated Circuit) resources, gateways face bottlenecks in supporting concurrent sessions. Introducing additional packet processing chips, such as FPGAs (Field Programmable Gate Arrays), to expand the lookup table size of programmable switching chips can meet the needs of high-capacity scenarios. Combined with a high-performance CPU to handle the creation and distribution of table entries, this heterogeneous converged gateway solution can effectively address the diverse needs of future gateway scenarios.
[0034] The programmable switch chip (PSC), acting as an external lookup engine for the gateway device, sends the keywords to be searched to the packet processing chip. The packet processing chip then performs the lookup and returns the result to the PSC. Typically, the PSC inserts the search keywords into the header of the entire packet, called metadata. That is, metadata is the header data generated by the device where the packet processing chip resides, including key field information such as the search keywords. The packet processing chip extracts the search keywords from the metadata according to a preset format, then replaces the search keywords in the metadata with the search results and returns them to the PSC. Since most services are complex, the PSC may need to meet service requirements through pipeline folding. In this case, the packet processing chip needs to be embedded as a lookup table in the pipeline processing, so that the metadata contains not only the search keywords but also information required by subsequent pipeline stages. Furthermore, due to continuous changes in services and the compilation limitations and constraints of the PSC, the length, format, and keyword information position of the metadata agreed upon by the PSC and the packet processing chip may need continuous adjustment to ultimately meet service requirements. However, since the message processing chip cannot be updated online, when the metadata changes, the preset format for extracting keywords also changes. Message processing chips that cannot be updated online need to be re-integrated, re-laid out, and re-routed. In other words, the message processing chip needs to be updated offline before it can rejoin the message processing flow, which undoubtedly affects the adaptation efficiency of the message processing chip in the gateway device, thereby reducing the overall efficiency of message processing.
[0035] In one example Figure 1 This is a flowchart of a message processing method provided in an embodiment of this disclosure. This embodiment is applicable to situations where original message input data is processed on demand based on field information extracted from the original message input data. This method is applied to a message processing chip and can be executed by a message processing device. This device can be implemented in software and / or hardware and is generally integrated into an electronic device. The electronic device can be a terminal device or a server device. For example, the electronic device can be a gateway device or a switch device, or other network devices with message processing and forwarding functions. This disclosure does not limit the specific type of electronic device. Correspondingly, as... Figure 1 As shown, the method includes the following operations:
[0036] S110. Obtain the raw message input data.
[0037] The raw message input data can be the message data input to the message processing chip, and may include, but is not limited to, raw message data and message data such as processed key information. Raw message data can be understood as message data that has not undergone any processing, that is, the message data initially received by the network device.
[0038] In this embodiment, the message processing chip can acquire raw message input data as its message input. It is understood that the raw message input data received by the message processing chip may differ from the raw message data received by the device in which the message processing chip resides. The raw message input data received by the message processing chip can be message data obtained after the raw message data has undergone a certain processing procedure. Optionally, the message processing chip may include an FPGA or other chip type capable of processing message data that cannot achieve online functional updates.
[0039] For example, the raw message input data may include, but is not limited to, raw message data and message data such as metadata containing a key.
[0040] S120. Extract target key field information from the original message input data; wherein, the target key field information may include the original target field information, etc.
[0041] The target key field information can be understood as the key field information that needs to be extracted from the original message input data. The target original field information may include all preprocessed field information in the original message input data, which needs to be further searched and replaced by the message processing chip. For example, the target original field information may be metadata field information from the original message input data.
[0042] Correspondingly, after acquiring the original message input data, the message processing chip can extract the target key field information containing the target original field information from the original message input data.
[0043] It is understandable that if the target key field information is extracted from the original message input data according to the preset format using the existing message processing method, the preset format may change due to the change in the original message input data format, which in turn requires re-encoding, synthesis, placement and routing of the message processing chip.
[0044] This embodiment of the disclosure obtains the target key field information by truncating the original message input data. Therefore, regardless of the format of the original message input data, the target key field information truncated by the message processing chip can include all the original target field information. Accordingly, the message processing chip can subsequently obtain the key field information to be processed from all the original target field information and continue processing.
[0045] Therefore, it can be seen that when the format of the original message input data changes, even if the message processing chip cannot perform online function updates, it can still obtain the complete target original field information. Then, based on the obtained complete target original field information, the subsequent message processing process can be carried out continuously, which improves the adaptation efficiency of the message processing chip and thus ensures the efficiency of message processing.
[0046] S130. Generate target result message data based on target key field information.
[0047] The target result message data can be the result data generated by the message processing chip processing the target key field information according to the expected message processing method.
[0048] Correspondingly, the message processing chip can process the target key field information extracted from the original message input data according to the expected message processing method, such as finding and replacing fields and replacing them, thereby generating the target result message data.
[0049] S140. Generate original message output data based on the original message input data and the target result message data.
[0050] The original message output data can be the message data obtained after the original message data has been processed by the message processing chip through a complete message processing flow.
[0051] Correspondingly, the message processing chip can generate original message output data based on the original message input data and the target result message data. For example, the message processing chip can combine or splice the original message input data and the target result message data to generate the original message output data.
[0052] This disclosure embodiment acquires original message input data, then extracts target key field information, including target original field information, from the original message input data. Based on the target key field information, target result message data is generated, and thus original message output data is generated based on the original message input data and the target result message data. Online message processing of the original message input data based on the target key field information extracted from the original message input data solves the problem of message processing chips needing to update information extraction functions offline, improving the adaptation efficiency of message processing chips and consequently increasing message processing efficiency.
[0053] In one example Figure 2 This is a flowchart of a message processing method provided in this embodiment. Based on the technical solutions of the above embodiments, this embodiment has been optimized and improved, and provides various specific implementation methods for extracting target key field information from the original message input data, generating target result message data based on the target key field information, and generating original message output data based on the original message input data and the target result message data.
[0054] like Figure 2 The message processing method shown includes:
[0055] S210. Obtain the raw message input data.
[0056] S220. Determine the preset message truncation direction and message truncation length of the original message input data.
[0057] The preset message truncation direction can be a pre-defined direction for trunculating message data, such as truncation from the header, middle, or tail of the original message input data. The message truncation length can be the length of the truncated message data.
[0058] In this embodiment of the disclosure, after acquiring the original message input data, the message processing chip can determine the preset message truncation direction and message truncation length of the original message input data based on the original message input data. It can be understood that the preset message truncation direction can be determined based on the position of the target original field information in the original message input data. The message truncation length can be determined based on the length of the target original field information.
[0059] In one optional embodiment of this disclosure, determining the preset message interception direction of the original message input data may include: determining the start interception field and the end interception field of the original message input data; and taking the direction between the position of the start interception field and the position of the end interception field as the preset message interception direction.
[0060] The start truncation field can be the first field in the header of the original message input data, the last field in the header of the original message input data, or any field in the middle of the original message input data. The end truncation field can be, but is not limited to, a field in the header, middle, or tail. It is understood that the start truncation field and the end truncation field are not the same field. This disclosure does not limit the position of the start truncation field and the end truncation field in the original message input data.
[0061] Correspondingly, the message processing chip can determine the start and end intercept fields of the original message input data, and use the direction between the position of the start intercept field and the position of the end intercept field as the preset message intercept direction.
[0062] The above technical solution improves the flexibility of the message interception direction by using the direction from the start interception field to the end interception field of the original message input data as the preset message interception direction, thus meeting the interception requirements of target original field information with various location distributions.
[0063] In one optional embodiment of this disclosure, determining the message truncation length of the original message input data may include: determining the overall length of the key field information of the original message input data; and calculating the sum of the overall field length and the reserved length as the message truncation length.
[0064] The key field information can be the crucial field information that needs to be extracted, such as the fields related to the key that need to be extracted from the original message input data. The total length of the key field information can be the total length of the field information that needs to be replaced.
[0065] Optionally, the message processing chip can determine the total length of the key field information of the original message input data, and then calculate the sum of the total field length and the reserved length as the message truncation length.
[0066] Optionally, to improve the accuracy of field information truncation, i.e., to capture all the original target field information, the overall length of the key field information can be set to the length of the metadata. Correspondingly, the message truncation length can be the sum of the metadata length and the reserved length, ensuring that all metadata field information can be captured.
[0067] The above technical solution ensures the integrity of the truncated field information by using the sum of the total length of the key field information of the original message input data and the reserved length as the message truncation length.
[0068] S230. Extract the message truncation length information from the original message input data according to the preset message truncation direction to obtain the truncated message field information.
[0069] Among them, the intercepted message field information can be partial message field information obtained by intercepting the original message input data according to the preset message interception direction and extracting the message interception length.
[0070] Correspondingly, the message processing chip can extract the message length information from the original message input data according to the preset message extraction direction in order to obtain the extracted message field information.
[0071] S240. Obtain the target key field information based on the intercepted message field information.
[0072] Correspondingly, the message processing chip can locate and extract information from the intercepted message fields in order to obtain the target key field information.
[0073] The above technical solution, by presetting the message interception direction and message interception length, intercepts the target key field information of the original message input data, which can ensure that the intercepted target key field information includes the complete target original field information, thereby ensuring the reliability and accuracy of message processing.
[0074] In one optional embodiment of this disclosure, obtaining target key field information based on intercepted message field information may include: when it is determined that the key field information in the intercepted message field information is discrete field information, performing aggregation processing on the key field information in the intercepted message field information; extracting the key field information from the aggregated intercepted message field information to obtain the target key field information.
[0075] Discrete field information can be understood as discretely distributed field information. Aggregation processing can be understood as the process of aggregating discrete field information to obtain a segment of continuously distributed field information.
[0076] Understandably, the key information that the message processing chip needs to extract can be either discretely distributed or centrally distributed in the intercepted message field information. Optionally, when obtaining target key field information based on the intercepted message field information, the message processing chip can determine whether the key field information in the intercepted message field information is discrete. If the message processing chip determines that the key field information in the intercepted message field information is discrete, in order to facilitate the information extraction process, it can perform aggregation processing on the key field information in the intercepted message field information, that is, aggregate the discretely distributed key field information into continuously distributed key field information, thereby extracting the continuously distributed key field information to obtain the target key field information. If the message processing chip determines that the key field information in the intercepted message field information is continuously distributed, it indicates that the key field information in the intercepted message field information is already in an aggregated state, then there is no need to perform aggregation processing on the key field information, and the target key field information can be directly extracted from the key field information.
[0077] The above technical solution, by aggregating discrete field information, can combine key field information from the intercepted message field information into continuous key field information, thereby improving the processing efficiency of key field information.
[0078] S250. Search the preset table data based on the target key field information to obtain the result of the target key field information matching and replace the field information.
[0079] The preset table data can be pre-set table data that can be used to find key field information. The result replacement field information can be understood as the field information that needs to be replaced with the target key field information.
[0080] Correspondingly, after the message processing chip extracts the target key field information, it can search the preset table data based on the target key field information to obtain the matching result of the target key field information to replace the field information.
[0081] S260. Replace the target field information in the original target field information with the result replacement field information to obtain the target result message data.
[0082] The target field information can be understood as the field information in the original target field information that needs to be replaced.
[0083] Correspondingly, after the message processing chip obtains the result replacement field information of the target key field information matching, it can replace the target field information in the original target field information according to the result replacement field information to obtain the target result message data.
[0084] The above technical solution, by searching the preset table data, can replace the target field information in the original target field information with the result replacement field information that matches the target key field information, thereby obtaining the target result message data, improving the processing efficiency of the result replacement field information, and thus improving the efficiency of message processing.
[0085] In one optional embodiment of this disclosure, replacing the target field information in the original target field information with the result replacement field information to obtain target result message data may include: extending the length of the result replacement field information to a target length to obtain extended replacement field information; wherein the target length may be the length of the original target field information; generating replacement result message data based on the extended replacement field information and the original target field information; and replacing the target field information in the original target field information with the replacement result message data to obtain target result message data.
[0086] The target length can be the length that the result replacement field information needs to reach after expansion. Optionally, when the target original field information is used as the processing object of the message processing chip, the target length can be the length of the metadata. The expanded replacement field information can be the field information obtained by expanding the length of the result replacement field information to the target length. The replacement result message data can be the reference message data that needs to replace part of the message data in the original message input data. The target field information can be understood as the field information in the target original field information that currently needs to be replaced.
[0087] Before generating the target result message data, the message processing chip can first extend the length of the result replacement field information to the length of the target original field information to obtain extended replacement field information. This ensures that the extended replacement field information maintains the same length as the target original field information in the original message input data, facilitating subsequent comparison between the extended replacement field information and the target original field information in the original message input data. Furthermore, the message processing chip can generate the final usable replacement result message data based on the comparison result between the extended replacement field information and the target original field information, and use the replacement result message data to replace the target field information in the target original field information to obtain the target result message data. It can be understood that the target result message data can be a portion of the message data obtained by the message processing chip after processing the target field information in the target original field information; for example, it can be metadata including replacement information.
[0088] The above technical solution obtains the target result message data by replacing the target field information in the original target field information according to the replacement result message data. This enables online real-time replacement of the target field information and can improve the adaptation efficiency of the message processing chip.
[0089] In one optional embodiment of this disclosure, generating replacement result message data based on extended replacement field information and target original field information may include: determining the information insertion position of the extended replacement field information in the target original field information; adjusting the data in the extended replacement field information according to the information insertion position to obtain replacement result message data.
[0090] The information insertion position can be the current location where extended replacement field information needs to be inserted.
[0091] Specifically, when generating replacement result message data, the message processing chip can determine the insertion position of the extended replacement field information in the target original field information, and then adjust the data in the extended replacement field information according to the insertion position to obtain the replacement result message data. For example, if the insertion position of result0 in the extended replacement field information in the target original field information is the second byte, then result0 can be adjusted to be the second byte of data in the extended replacement field information.
[0092] The above technical solution, by determining the insertion position of the extended replacement field information in the target original field information and adjusting the data in the extended replacement field information according to the insertion position, can ensure the accuracy and rationality of the field data in the obtained replacement result message data.
[0093] In one optional embodiment of this disclosure, replacing the target field information in the target original field information with the replacement result message data to obtain the target result message data may include: generating a valid bit vector based on the replacement result message data; determining valid replacement field data from the replacement result message data based on the valid bit vector, and determining valid original message data from the target original field information; and combining the valid replacement field data and the valid original message data to obtain the target result message data.
[0094] The valid bit vector can be used as a reference base to combine the replacement result message data and the target original field information. Optionally, the valid bit vector can consist of a number of 0s and a number of 1s. Valid replacement field data can be the field data that needs to be retained in the replacement result message data. Valid original message data can be the field data that needs to be retained in the target original field information.
[0095] Correspondingly, the message processing chip can generate a valid bit vector based on the replacement result message data, thereby determining the valid replacement field data from the replacement result message data based on the valid bit vector, and determining the valid original message data from the target original field information. Then, the valid replacement field data and the valid original message data are combined to obtain the target result message data.
[0096] The above technical solution, by introducing the application of effective bit vectors, can improve the efficiency of determining effective replacement field data from the replacement result message data.
[0097] In one optional embodiment of this disclosure, generating a valid bit vector based on the replacement result message data may include: generating an initial bit vector based on the length of the replacement result message data; wherein the values of each bit in the initial bit vector may be initial default values; and updating the values of each bit in the initial bit vector based on the distribution of the replacement field information in the replacement result message data to obtain a valid bit vector.
[0098] The initial bit vector is the effective bit vector in the initial state. The initial default value can be an initially set value, such as 0 or 1. Replacement field information can be understood as the field information in the replacement result message data that can be used to replace the field information in the target original field information.
[0099] Specifically, the message processing chip can generate an initial bit vector with each bit set to its initial default value based on the length of the replacement result message data. Then, it can update the values of each bit in the initial bit vector according to the distribution of the replacement field information in the replacement result message data to obtain a valid bit vector.
[0100] Optionally, the length of the initial bit vector can be the same as the length of the replacement result message data, meaning the number of bits in the initial bit vector is the same as the number of bits in the replacement result message data, a one-to-one relationship (one bit corresponds to one bit). That is, when the number of bits in the replacement result message data is n, the number of bits in the initial bit vector is also n. Alternatively, the length of the initial bit vector can be different from the length of the replacement result message data, such as the number of bits in the initial bit vector being the same as the number of bytes in the replacement result message data, a one-to-many relationship (one bit corresponds to one byte, or one bit corresponds to multiple bits). That is, when the number of bytes in the replacement result message data is n, the number of bits in the initial bit vector is also n. It is understood that the length of the effective bit vector is the same as the length of the initial bit vector.
[0101] The above technical solution generates an initial bit vector based on the length of the replacement result message data, and then updates the value of each bit of the initial bit vector according to the distribution of the replacement field information in the replacement result message data to obtain an effective bit vector, which can ensure the accuracy of the effective bit vector.
[0102] In one optional embodiment of this disclosure, determining valid replacement field data from the replacement result message data based on the valid bit vector and determining valid original message data from the target original field information may include: determining the current relative position of the current bit in the valid bit vector; if the value of the current bit in the valid bit vector is a first value, obtaining the bit data at the current relative position from the replacement result message data as valid replacement field data; if the value of the current bit in the valid bit vector is a second value, obtaining the bit data at the current relative position from the target original field information as valid original message data.
[0103] Here, the current relative position can be understood as the relative position of the current bit within the effective bit vector. The first value can be used to determine whether the bit data at the current relative position needs to be obtained from the replacement result message data as valid replacement field data. The second value can be used to determine whether the bit data at the current relative position needs to be obtained from the target original field information as valid original message data.
[0104] Correspondingly, the message processing chip can determine the current relative position of the current bit in the valid bit vector. If the current bit value of the valid bit vector is the first value, it indicates that data at the corresponding position in the replacement result message data needs to be retained at the current position in the target result message data. In this case, the bit data at the current relative position can be obtained from the replacement result message data as the valid replacement field data. If the current bit value of the valid bit vector is the second value, it indicates that data at the corresponding position in the target original field information needs to be retained at the current position in the target result message data. In this case, the bit data at the current relative position can be obtained from the target original field information as the valid original message data.
[0105] The above technical solution improves the efficiency and accuracy of determining valid replacement field data and valid original message data by determining the specific value of each bit in the valid bit vector.
[0106] S270. Obtain the original message data included in the original message input data, combine the original message data with the target result message data to obtain the original message output data.
[0107] Correspondingly, after the message processing chip generates the target result message data, it can obtain the original message data included in the original message input data, and concatenate the original message data with the target result message data, such as concatenating the target result message data with the original message data to obtain the original message output data.
[0108] The above technical solution combines the original message data included in the original message input data with the target result message data to obtain the original message output data. This enables online updating of the original message output data of the message processing chip, improving the adaptation efficiency of the message processing chip and thus improving the efficiency of message processing.
[0109] In an optional embodiment of this disclosure, based on the above embodiments, the original message input data can be message data generated by the associated message processing chip after processing the original message data; the above message processing method may further include: sending the original message output data to the associated message processing chip, so that the associated message processing chip can generate a forwarding message based on the original message output data.
[0110] The associated message processing chip can be a chip that works in conjunction with the message processing chip to process messages, such as, but not limited to, a programmable switching chip. The forwarded message can be message data that has been processed by the associated message processing chip after the original message output data has been processed and can then be used for forwarding.
[0111] In this embodiment, the associated message processing chip can receive raw message data, process it to generate raw message input data, and send the generated raw message input data to the message processing chip. The message processing chip processes the raw message input data using the above process to obtain raw message output data, and sends the obtained raw message output data to the associated message processing chip. The associated message processing chip can then generate a forwarding message based on the raw message output data and send the forwarding message outward, completing the overall message processing flow.
[0112] The technical solution of this disclosure embodiment obtains the original message input data, thereby determining the preset message truncation direction and message truncation length of the original message input data. The message truncation length information is then extracted from the original message input data according to the preset message truncation direction to obtain truncated message field information. Target key field information is then obtained based on the truncated message field information. Preset table data is then searched based on the target key field information to obtain the result of the target key field information matching and replacement field information. Finally, the target field information in the original target field information is replaced based on the result of the replacement field information to obtain the target result message data. This allows for real-time online updating of the key field information of the message processing chip. Key information can be extracted and inserted from any position in the message header, improving the adaptation efficiency of the message processing chip and thus improving the efficiency of message processing.
[0113] Figure 3This is a flowchart illustrating a message processing method provided in an embodiment of this disclosure. In a specific example, an FPGA is used as the message processing chip, and a programmable switch chip is used as the associated message processing chip for illustration. Figure 3 As shown, the message processing method provided in this embodiment may include the following steps:
[0114] Step ①: The raw message data can be input through the network port A of the programmable switch chip, and the processing pipeline 1 inside the programmable switch chip will perform message parsing, message header extraction and metadata generation, etc.
[0115] Step 2: The programmable switch chip extracts the key and other information required for subsequent table lookup in the FPGA through processing pipeline 1, adds it to the header of the original message as metadata, and sends it to the FPGA through network port B of the programmable switch chip.
[0116] Step 3: After the FPGA receives the metadata and raw message data from network port C, the message input module extracts the key from the metadata.
[0117] Figure 4 This is a flowchart illustrating a process for extracting key field information applicable to embodiments of this disclosure. In a specific example, such as... Figure 4 As shown, the extraction process for extracting keys from metadata can include the following steps:
[0118] Step 1: Input the metadata containing the key and the original message into the FPGA as the original message input data.
[0119] Step 2: Extract a fixed-length header. Before extraction, the length of the key in the metadata needs to be estimated, and then a fixed length is set to ensure that all fields related to the key are included in the fixed-length metadata. The fixed length should not be too short.
[0120] Step 3: The extracted metadata and other message data are input into the configurable switching network of the message input module.
[0121] Step 4: The configurable switching network of the message input module aggregates fragments of keys distributed in different locations in the metadata into the high bits of the message data to form a continuous key that can be used for table lookup.
[0122] Step 5: The FPGA sends a series of keys that can be used for table lookup to the lookup module for table lookup.
[0123] It should be noted that the parameters of the configurable switching network of the message input module can be sent online and dynamically to the management module by the host CPU through PCIe (peripheral component interconnect express, high-speed serial computer expansion bus standard) or other means, and the management module can change the corresponding parameters in real time online.
[0124] Optionally, the configurable switching network in the message input module can use an inverse butterfly network. An inverse butterfly network can aggregate data even when the output node number of any valid data is less than or equal to its input node number. This means it can extract keys according to their sequence number, sort them, and display them prominently at the beginning of the header or in other areas where they need to be displayed. In a specific example… Figure 5 This is a schematic diagram of a configurable switching network to which embodiments of this disclosure apply, such as... Figure 5 As shown, the message data sequence of the configurable switching network of the input message module is metadata-p0, key-p0, metadata-p1, key-p1, metadata-p2, key-p2, metadata-p3, and key-p3. After passing through the configurable switching network, key-p0, key-p1, key-p2, and key-p3 can be aggregated into the message data header, and metadata-p0, metadata-p1, metadata-p2, and metadata-p3 are displayed sequentially after key-p3.
[0125] Step 4: Output the key extracted from the metadata to the table lookup module.
[0126] Step 5: Store the metadata and raw message data in the cache module.
[0127] Step 6: The table lookup module obtains the table lookup result by reading data from the external memory and outputs the table lookup result to the message output module.
[0128] Step 7: The message output module replaces the fields in the metadata that need to be replaced with the result in the table lookup result.
[0129] Figure 6 This is a flowchart illustrating a process for replacing key field information applicable to embodiments of this disclosure. In a specific example, such as... Figure 6As shown, the process of replacing field information in metadata can include the following steps:
[0130] Step 1: After inputting the result obtained from the table lookup into the message output module, expand the table lookup result to the same length as the data intercepted by the message input module.
[0131] Step 2: Input the expanded message data into the configurable switching network of the message output module.
[0132] Step 3: The configurable switching network of the message output module splits the result into different locations in the metadata according to the desired format, thereby generating replacement result message data.
[0133] Step 4: Input the replacement result message data into the Valid bitmap module. The valid bit vector consists of several 0s and 1s, and the length of the valid bit vector is the same as that of the target result message data.
[0134] Step 5: Replace the fields in the replacement result message data that need to be replaced. For example, the replacement method can be that a bit that is 1 in the valid bit vector indicates that the bit data at the corresponding position in the replacement result message data (i.e., valid replacement field data) is used at that position in the final output metadata, and a bit that is 0 in the valid bit vector indicates that the bit data at the corresponding position in the original metadata (i.e., valid original message data) is used at that position in the final output metadata.
[0135] Step Six: The configurable switching network parameters and valid bitmap of the message output module can be dynamically sent online by the host CPU via PCIe or other means to the management module, and the management module can change the corresponding parameters in real time online.
[0136] Optionally, the configurable switching network in the message output module can be a butterfly network. A butterfly network can separate continuous message data and place the split message data into pre-defined locations. In a specific example, Figure 7 This is a schematic diagram of another configurable switching network to which the embodiments of this disclosure apply, such as... Figure 7As shown, the message data input to the butterfly network is in the order of result-p0, result-p1, result-p2, and result-p3, and the length of the input message data is the same as the length of the truncated data. After passing through the butterfly network, the continuous result data is separated. Then, after the separated message data is processed by origin metadata, the data with 1 in the effective bit vector is replaced with the corresponding result data, and the data with 0 in the effective bit vector is not replaced, keeping the original metadata data unchanged.
[0137] Step 8: Send the replaced metadata and the original message data from the FPGA's network port C to the programmable switch chip's network port B.
[0138] Step 9: The message processing pipeline 2 of the programmable switch chip encapsulates and modifies the message according to the result and other information in the metadata, and finally generates a forwarding message, which is output through the network port A of the programmable switch chip.
[0139] The above technical solution, based on a parameter-configurable switching network, can extract and insert key information from any position in the message header, avoiding the problem of FPGA needing to re-encode, synthesize, place, and route after the message header format changes between the programmable switching chip and the FPGA. This reduces the FPGA's adaptation workload after application requirements change, improves the FPGA's adaptation efficiency, and thus enhances the ease of use of the heterogeneous converged gateway.
[0140] It should be noted that any arrangement or combination of the technical features in the above embodiments also falls within the protection scope of this disclosure.
[0141] In one example Figure 8 This is a structural diagram of a message processing device provided in an embodiment of this disclosure. This embodiment is applicable to situations where original message input data is processed on demand based on field information extracted from the original message input data. The device is configured in a message processing chip and can be implemented through software and / or hardware, specifically configured within an electronic device. This electronic device can be a terminal device or a server device. For example, the electronic device can be a gateway device or a switch device, etc., devices with message processing and forwarding functions. This embodiment does not limit the specific device type of the electronic device.
[0142] like Figure 8The message processing device 300 shown includes: a raw message input data acquisition module 310, a target key field information interception module 320, a target result message data generation module 330, and a raw message output data generation module 340.
[0143] The system includes: a raw message input data acquisition module 310 for acquiring raw message input data; a target key field information extraction module 320 for extracting target key field information from the raw message input data, wherein the target key field information includes target raw field information; a target result message data generation module 330 for generating target result message data based on the target key field information; and a raw message output data generation module 340 for generating raw message output data based on the raw message input data and the target result message data.
[0144] This disclosure embodiment acquires original message input data, then extracts target key field information, including target original field information, from the original message input data. Based on the target key field information, target result message data is generated, and thus original message output data is generated based on the original message input data and the target result message data. Online message processing of the original message input data based on the target key field information extracted from the original message input data solves the problem of message processing chips needing to update information extraction functions offline, improving the adaptation efficiency of message processing chips and consequently increasing message processing efficiency.
[0145] Optionally, the target key field information interception module 320 is specifically used to: determine the preset message interception direction and message interception length of the original message input data; intercept the message interception length information of the original message input data according to the preset message interception direction to obtain the intercepted message field information; and obtain the target key field information based on the intercepted message field information.
[0146] Optionally, the target key field information interception module 320 is specifically used to: determine the starting interception field and the ending interception field of the original message input data; and use the direction between the position of the starting interception field and the position of the ending interception field as the preset message interception direction.
[0147] Optionally, the target key field information interception module 320 is specifically used to: determine the overall length of the key field information of the original message input data; calculate the sum of the overall field length and the reserved length as the message interception length.
[0148] Optionally, the target key field information interception module 320 is specifically used to: when it is determined that the key field information in the intercepted message field information is discrete field information, perform aggregation processing on the key field information in the intercepted message field information; extract the key field information in the intercepted message field information after aggregation processing to obtain the target key field information.
[0149] Optionally, the target result message data generation module 330 is specifically used to: search for preset table data based on the target key field information to obtain the result replacement field information matching the target key field information; and replace the target field information in the original target field information based on the result replacement field information to obtain the target result message data.
[0150] Optionally, the target result message data generation module 330 is specifically used for: extending the length of the result replacement field information to the target length to obtain extended replacement field information; wherein, the target length is the length of the target original field information; generating replacement result message data based on the extended replacement field information and the target original field information; and replacing the target field information in the target original field information with the replacement result message data to obtain the target result message data.
[0151] Optionally, the target result message data generation module 330 is specifically used to: determine the information insertion position of the extended replacement field information in the target original field information; adjust the data in the extended replacement field information according to the information insertion position to obtain the replacement result message data.
[0152] Optionally, the target result message data generation module 330 is specifically used for: generating a valid bit vector based on the replacement result message data; determining valid replacement field data from the replacement result message data based on the valid bit vector, and determining valid original message data from the target original field information; and combining the valid replacement field data and the valid original message data to obtain the target result message data.
[0153] Optionally, the target result message data generation module 330 is specifically used to: generate an initial bit vector based on the length of the replacement result message data; wherein each bit of the initial bit vector takes an initial default value; and update each bit value of the initial bit vector according to the distribution of the replacement field information in the replacement result message data to obtain a valid bit vector.
[0154] Optionally, the target result message data generation module 330 is specifically used to: determine the current relative position of the current bit in the valid bit vector; if the value of the current bit in the valid bit vector is a first value, obtain the bit data at the current relative position from the replacement result message data as valid replacement field data; if the value of the current bit in the valid bit vector is a second value, obtain the bit data at the current relative position from the target original field information as valid original message data.
[0155] Optionally, the original message input data is message data generated after the associated message processing chip processes the original message data. The original message output data generation module 340 is specifically used to: obtain the original message data included in the original message input data; and combine the original message data with the target result message data to obtain the original message output data. The device also includes a forwarding message generation module, used to: send the original message output data to the associated message processing chip so that the associated message processing chip can generate a forwarding message based on the original message output data.
[0156] Optionally, based on the above embodiments, the message processing chip may include an FPGA.
[0157] The above-described message processing apparatus can execute the message processing method provided in any embodiment of this disclosure, and has the corresponding functional modules and beneficial effects for executing the method. Technical details not described in detail in this embodiment can be found in the message processing method provided in any embodiment of this disclosure.
[0158] Since the message processing apparatus described above is capable of executing the message processing method in the embodiments of this disclosure, those skilled in the art can understand the specific implementation methods and various variations of the message processing apparatus in this embodiment based on the message processing method described in the embodiments of this disclosure. Therefore, how the message processing apparatus implements the message processing method in the embodiments of this disclosure will not be described in detail here. Any apparatus used by those skilled in the art to implement the message processing method in the embodiments of this disclosure falls within the scope of protection intended by this disclosure.
[0159] In one example, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0160] Figure 9A schematic block diagram of an example electronic device 400 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0161] like Figure 9 As shown, device 400 includes a computing unit 401, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 402 or a computer program loaded from storage unit 408 into random access memory (RAM) 403. RAM 403 may also store various programs and data required for the operation of device 400. The computing unit 401, ROM 402, and RAM 403 are interconnected via bus 404. Input / output (I / O) interface 405 is also connected to bus 404.
[0162] Multiple components in device 400 are connected to I / O interface 405, including: input unit 406, such as keyboard, mouse, etc.; output unit 407, such as various types of monitors, speakers, etc.; storage unit 408, such as disk, optical disk, etc.; and communication unit 409, such as network card, modem, wireless transceiver, etc. Communication unit 409 allows device 400 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0163] The computing unit 401 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 401 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 401 performs the various methods and processes described above, such as message processing methods.
[0164] For example, in some embodiments, the message processing method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 408. In some embodiments, part or all of the computer program may be loaded and / or installed on device 400 via ROM 402 and / or communication unit 409. When the computer program is loaded into RAM 403 and executed by computing unit 401, one or more steps of the message processing method described above may be performed. Alternatively, in other embodiments, computing unit 401 may be configured to perform the message processing method by any other suitable means (e.g., by means of firmware).
[0165] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0166] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0167] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0168] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0169] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0170] Computer systems can include clients and servers. Clients and servers are generally geographically separated and typically interact via communication networks. The client-server relationship is established by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, also known as cloud computing servers or cloud hosts, which are hosting products within the cloud computing service ecosystem to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability. Servers can also be servers for distributed systems or servers integrated with blockchain technology.
[0171] This disclosure embodiment acquires original message input data, then extracts target key field information, including target original field information, from the original message input data. Based on the target key field information, target result message data is generated, and thus original message output data is generated based on the original message input data and the target result message data. Online message processing of the original message input data based on the target key field information extracted from the original message input data solves the problem of message processing chips needing to update information extraction functions offline, improving the adaptation efficiency of message processing chips and consequently increasing message processing efficiency.
[0172] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.
[0173] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A message processing method applied to a message processing chip, comprising: obtaining original message input data; extracting target key field information from the original message input data; wherein the target key field information comprises target original field information; generating target result message data according to the target key field information; generating original message output data according to the original message input data and the target result message data; wherein generating target result message data according to the target key field information comprises: looking up preset table data according to the target key field information to obtain result replacement field information matched with the target key field information; extending the length of the result replacement field information to a target length to obtain extended replacement field information; wherein the target length is the length of the target original field information; generating replacement result message data according to the extended replacement field information and the target original field information; replacing target field information in the target original field information with the replacement result message data to obtain the target result message data.
2. The method of claim 1, wherein, extracting target key field information from the original message input data comprises: determining a preset message extraction direction and a message extraction length of the original message input data; extracting the message extraction length of information from the original message input data according to the preset message extraction direction to obtain extracted message field information; obtaining the target key field information according to the extracted message field information.
3. The method of claim 2, wherein, determining the preset message extraction direction of the original message input data comprises: determining a start extraction field and an end extraction field of the original message input data; taking the direction between the position of the start extraction field and the position of the end extraction field as the preset message extraction direction.
4. The method of claim 2 or 3, wherein, determining the message extraction length of the original message input data comprises: determining the total field length of key field information of the original message input data; calculating the sum of the total field length and a reserved length as the message extraction length.
5. The method of claim 2, wherein, obtaining the target key field information according to the extracted message field information comprises: in a case where it is determined that the key field information in the extracted message field information is discrete field information, performing aggregation processing on the key field information in the extracted message field information; extracting the key field information in the aggregated extracted message field information to obtain the target key field information.
6. The method of claim 1, wherein, generating replacement result message data according to the extended replacement field information and the target original field information comprises: determining an information insertion position of the extended replacement field information in the target original field information; adjusting the data in the extended replacement field information according to the information insertion position to obtain the replacement result message data.
7. The method of claim 1, wherein, replacing target field information in the target original field information with the replacement result message data to obtain the target result message data comprises: generating a valid bit vector according to the replacement result message data; determining valid replacement field data from the replacement result message data according to the valid bit vector, and determining valid original message data from the target original field information; combining the valid replacement field data and the valid original message data to obtain the target result message data.
8. The method of claim 7, wherein, generating a valid bit vector according to the replacement result message data, including: generating an initial bit vector according to the length of the replacement result message data; wherein each bit of the initial bit vector takes an initial default value; updating each bit value of the initial bit vector according to the distribution of the replacement field information in the replacement result message data to obtain the valid bit vector.
9. The method of claim 7 or 8, wherein, determining valid replacement field data from the replacement result message data according to the valid bit vector, and determining valid original message data from the target original field information, including: determining a current relative position of a current bit in the valid bit vector; in a case where it is determined that the value of the current bit of the valid bit vector is a first numerical value, obtaining bit data at the current relative position from the replacement result message data as the valid replacement field data; in a case where it is determined that the value of the current bit of the valid bit vector is a second numerical value, obtaining bit data at the current relative position from the target original field information as the valid original message data.
10. The method of claim 1, wherein, the original message input data is message data generated after an original message data is processed by an associated message processing chip; generating original message output data according to the original message input data and the target result message data, including: obtaining original message data included in the original message input data; combining the original message data and the target result message data to obtain the original message output data; the method further includes: sending the original message output data to the associated message processing chip, so that the associated message processing chip generates a forwarding message according to the original message output data.
11. The method of claim 1, wherein, The message processing chip includes a field programmable gate array (FPGA).
12. A message processing device configured in a message processing chip, comprising: an original message input data obtaining module configured to obtain original message input data; a target key field information intercepting module configured to intercept target key field information from the original message input data; wherein the target key field information includes target original field information; a target result message data generating module configured to generate target result message data according to the target key field information; an original message output data generating module configured to generate original message output data according to the original message input data and the target result message data; wherein the target result message data generating module is specifically configured to: find preset table data according to the target key field information to obtain result replacement field information matched with the target key field information; extend the length of the result replacement field information to a target length to obtain extended replacement field information; wherein the target length is the length of the target original field information; generating replacement result packet data according to the extension replacement field information and the target original field information; replacing target field information in the target original field information according to the replacement result packet data to obtain the target result packet data.
13. The apparatus of claim 12, wherein, The target key field information interception module is specifically configured to: determine a preset packet interception direction and a packet interception length of the original packet input data; intercept information of the packet interception length from the original packet input data according to the preset packet interception direction to obtain intercepted packet field information; obtain the target key field information according to the intercepted packet field information.
14. The apparatus of claim 13, wherein, The target key field information interception module is specifically configured to: determine a start interception field and an end interception field of the original packet input data; take a direction from a position of the start interception field to a position of the end interception field as the preset packet interception direction.
15. The apparatus of claim 13 or 14, wherein, The target key field information interception module is specifically configured to: determine a total field length of key field information of the original packet input data; calculate a sum of the total field length and a reserved length as the packet interception length.
16. The apparatus of claim 13, wherein, The target key field information interception module is specifically configured to: in a case where key field information in the intercepted packet field information is discrete field information, perform aggregation processing on the key field information in the intercepted packet field information; extract the key field information in the aggregated intercepted packet field information to obtain the target key field information.
17. The apparatus of claim 12, wherein, The target result packet data generation module is specifically configured to: determine an information insertion position of the extension replacement field information in the target original field information; adjust data in the extension replacement field information according to the information insertion position to obtain the replacement result packet data.
18. The apparatus of claim 12, wherein, The target result packet data generation module is specifically configured to: generate an effective bit vector according to the replacement result packet data; determine effective replacement field data from the replacement result packet data and effective original packet data from the target original field information according to the effective bit vector; combine the effective replacement field data and the effective original packet data to obtain the target result packet data.
19. The apparatus of claim 18, wherein, The target result packet data generation module is specifically configured to: generate an initial bit vector according to a length of the replacement result packet data; wherein each bit of the initial bit vector takes an initial default value; update each bit value of the initial bit vector according to a distribution of replacement field information in the replacement result packet data to obtain the effective bit vector.
20. The apparatus of claim 18 or 19, wherein, The target result packet data generation module is specifically configured to: determine a current relative position of a current bit in the effective bit vector; in a case where a value of the current bit of the effective bit vector is a first numerical value, obtain bit data at the current relative position from the replacement result packet data as the effective replacement field data; In a case where the value of the current bit of the effective bit vector is determined as the second value, bit data at the current relative position is obtained from the target original field information as the effective original packet data.
21. The apparatus of claim 12, wherein, The original packet input data is packet data generated after original packet data is processed by an associated packet processing chip; and the original packet output data generation module is specifically configured to: obtain original packet data included in the original packet input data; combine the original packet data and the target result packet data to obtain the original packet output data; The packet processing apparatus further includes a forwarding packet generation module configured to send the original packet output data to the associated packet processing chip, so that the associated packet processing chip generates a forwarding packet according to the original packet output data.
22. The apparatus of claim 12, wherein, The packet processing chip includes an FPGA. 23.An electronic device, comprising: at least one processor; and a memory connected with the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the packet processing method of any one of claims 1-11. 24.A non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the packet processing method of any one of claims 1-11.
25. A computer program product comprising computer programs / instructions, wherein, The computer program / instructions are executed by the processor to implement the packet processing method of any one of claims 1-11.
Citation Information
Patent Citations
Message processing equipment and method
CN108055202A
Resolver supporting RMT, inverse resolver, parsing method and switch
CN116156026A