Message processing method, message processing device, electronic equipment and storage medium
Patent Information
- Application Number
- CN202310227855.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-07
- Publication Date
- 2026-09-04
- Estimated Expiration
- 2043-03-07
AI Technical Summary
在相关技术中,在网络路由设备或数据交换设备中,报文传输过程拥塞发生率较高,导致报文处理效率低下,当前亟待改善这一状况
[0031] The message processing method provided in this application determines the message type of each message to be processed based on multiple preset fields and the correspondence between the preset fields and message types. It then obtains a parsing order queue of the messages to be processed according to the determined message type and preset priority rules, and parses the messages to be processed according to the message arrangement order in the parsing order queue. This significantly reduces the congestion rate during message transmission, improves message processing efficiency, and addresses the following situation in related technologies: in network routing devices or data switching devices, the congestion rate during message transmission is high, leading to low message processing efficiency.
Smart Images

Figure CN116320087B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, specifically to a message processing method, message processing device, electronic device, and storage medium. Background Technology
[0002] A message is a data unit used for data exchange and transmission in a network. Typically, when a station wants to send a message, it appends a destination address to the message. Network nodes then forward the message to the next node based on the destination address information, and so on, node by node, until it reaches its destination. Each node, after receiving and verifying the entire message, temporarily stores it, then uses routing information to find the address of the next node and forwards the entire message to that node. In related technologies, the message transmission process in network routing devices or data switching devices experiences a high congestion rate, leading to low message processing efficiency, a situation that urgently needs improvement. Summary of the Invention
[0003] The purpose of this application is to provide a message processing method, message processing apparatus, electronic device, and storage medium to improve the following situation in related technologies: in network routing devices or data switching devices, the message transmission process has a high congestion rate, resulting in low message processing efficiency. To provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. This summary is not intended as a general description, nor is it intended to identify key / important components or describe the scope of protection of these embodiments. Its sole purpose is to present some concepts in a simple form as a prelude to the detailed description that follows.
[0004] According to one aspect of the embodiments of this application, a message processing method is provided, including:
[0005] The message type of each message to be processed is determined based on multiple preset fields and the correspondence between the preset fields and message types.
[0006] Based on the determined message type and preset priority rules, obtain the parsing order queue of the messages to be processed;
[0007] The messages to be processed are parsed according to the message order of the parsing order queue.
[0008] In some embodiments of this application, determining the message type of each message to be processed based on multiple preset fields and the correspondence between the preset fields and message types includes:
[0009] The fields of the message to be processed are compared with the plurality of preset fields to determine the preset fields contained in the message to be processed;
[0010] The type of each message to be processed is determined based on the correspondence between the preset fields and the message types, as well as the preset fields contained in the message to be processed.
[0011] In some embodiments of this application, determining the message type of each message to be processed based on multiple preset fields and the correspondence between the preset fields and message types further includes:
[0012] If the preset field is not included in the message to be processed, the message to be processed is determined to be a message to be discarded.
[0013] In some embodiments of this application, obtaining the parsing order queue of the messages to be processed based on the determined message type and preset priority rules includes:
[0014] Discard the message to be discarded;
[0015] Based on the determined message type and preset priority rules, determine the processing priority order of the remaining messages to be processed;
[0016] The remaining messages to be processed are arranged into the parsing order queue according to the processing priority order.
[0017] In some embodiments of this application, comparing the fields of the message to be processed with the plurality of preset fields includes:
[0018] Obtain the fields from the header of the message to be processed;
[0019] The fields in the header are compared with the plurality of preset fields.
[0020] According to another aspect of the embodiments of this application, a message processing apparatus is provided, comprising:
[0021] The message type determination module is used to determine the message type of each message to be processed based on multiple preset fields and the correspondence between the preset fields and message types.
[0022] The parsing order queue acquisition module is used to acquire the parsing order queue of the message to be processed according to the determined message type and preset priority rules;
[0023] The message parsing module is used to parse the message to be processed according to the message arrangement order in the parsing order queue.
[0024] In some embodiments of this application, the message type determination module includes:
[0025] The comparison unit is used to compare the fields of the message to be processed with the plurality of preset fields to determine the preset fields contained in the message to be processed.
[0026] The determining unit is used to determine the type of each message to be processed based on the correspondence between the preset fields and the message type, and the preset fields contained in the message to be processed.
[0027] In some embodiments of this application, the determining unit is further configured to determine that the type of the message to be processed is a message to be discarded when the preset field is not included in the message to be processed.
[0028] According to another aspect of the embodiments of this application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the message processing method described in any of the preceding claims.
[0029] According to another aspect of the embodiments of this application, a computer-readable storage medium is provided, on which a computer program is stored, the computer program being executed by a processor to implement the message processing method described in any of the preceding claims.
[0030] One aspect of the technical solution provided in this application embodiment may include the following beneficial effects:
[0031] The message processing method provided in this application determines the message type of each message to be processed based on multiple preset fields and the correspondence between the preset fields and message types. It then obtains a parsing order queue of the messages to be processed according to the determined message type and preset priority rules, and parses the messages to be processed according to the message arrangement order in the parsing order queue. This significantly reduces the congestion rate during message transmission, improves message processing efficiency, and addresses the following situation in related technologies: in network routing devices or data switching devices, the congestion rate during message transmission is high, leading to low message processing efficiency.
[0032] Other features and advantages of this application will be set forth in the following description and will be apparent in part from the description, or some features and advantages may be inferred from the description or determined without doubt, or may be learned by practicing embodiments of this application. Attached Figure Description
[0033] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0034] Figure 1 A flowchart of a message processing method according to an embodiment of this application is shown.
[0035] Figure 2 The flowchart illustrates the steps in this embodiment of the application to determine the message type of each message to be processed based on multiple preset fields and the correspondence between the preset fields and message types.
[0036] Figure 3 A block diagram of a message processing apparatus according to an embodiment of this application is shown.
[0037] Figure 4 A block diagram of an electronic device structure according to an embodiment of this application is shown.
[0038] Figure 5 A schematic diagram of a computer-readable storage medium according to an embodiment of this application is shown.
[0039] The purpose, functional features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0040] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application. All other embodiments obtained by those skilled in the art based on the embodiments in this application without inventive effort are within the scope of protection of this application.
[0041] It will be understood by those skilled in the art that, unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains. It should also be understood that terms such as those defined in general dictionaries should be understood to have a meaning consistent with their meaning in the context of the prior art, and should not be interpreted in an idealized or overly formal sense unless specifically defined as herein.
[0042] A message is a data unit exchanged and transmitted in a network, and also a unit of network transmission. A message contains complete data information to be sent, and its length does not need to be consistent. During transmission, messages are continuously encapsulated into packets, frames, and groups for transmission. Encapsulation is achieved by adding a header composed of control information; this header is the message header. In related technologies, congestion rates are high in network routing devices or data switching devices, leading to low message processing efficiency.
[0043] To address the technical problems existing in related technologies, this application provides a message processing method. Based on multiple preset fields and the correspondence between these preset fields and message types, the message type of each message to be processed is determined. According to the determined message type and preset priority rules, a parsing order queue of the messages to be processed is obtained. The messages to be processed are parsed according to the message arrangement order in the parsing order queue. This significantly reduces the congestion rate during message transmission, improves message processing efficiency, and addresses the following situation in related technologies: In network routing devices or data switching devices, the congestion rate during message transmission is high, leading to low message processing efficiency.
[0044] refer to Figure 1 As shown, one embodiment of this application provides a message processing method, including steps S10 to S30:
[0045] S10. Determine the message type of each message to be processed based on multiple preset fields and the correspondence between the preset fields and message types.
[0046] refer to Figure 2 As shown, in one embodiment, determining the message type of each message to be processed based on multiple preset fields and the correspondence between the preset fields and message types may include steps S101 to S102:
[0047] S101. Compare the fields of the message to be processed with multiple preset fields to determine the preset fields contained in the message to be processed.
[0048] Comparing the fields of the message to be processed with multiple preset fields can include: obtaining the fields in the header of the message to be processed; and comparing the fields in the header with multiple preset fields.
[0049] S102. Determine the message type of each message to be processed based on the correspondence between preset fields and message types, and the preset fields contained in the message to be processed.
[0050] Based on multiple preset fields and the correspondence between preset fields and message types, the message type of each message to be processed is determined. This may also include: S103, if the message to be processed does not contain preset fields, the type of the message to be processed is determined to be a message to be discarded.
[0051] Packets to be discarded mainly include illegal packets, erroneous packets, and non-target packets that do not meet preset requirements. In typical network routing / switching devices, incoming data / packets may pass through several queuing layers before being processed by the parsing engine. Due to congestion downstream in the queuing / processing chain, some packets may need to be discarded.
[0052] Performing basic classification and giving these packets higher priority in regular network traffic before discarding certain control packets can improve packet processing efficiency. Control packets can provide useful information in managing network flows.
[0053] For general classification purposes, messages can be divided into L2 and L3+ control messages. L2 control messages are identified by information in the L2 header (e.g., Ethernet type (ARP 16'h0806) and destination address (BPDU / STP 48'h0180_c200_0002)). In this embodiment, messages can be divided into two main categories: L2 messages and L3+ messages.
[0054] For example, an L2 message may include:
[0055] ARP (Address Resolution Protocol) messages, BPDU / STP messages, LACP (Link Aggregation Control Protocol) messages, LLDP (Link Layer Discovery Protocol) messages, GARP (Ghost Address Resolution Protocol) messages, ITU-T OAM (CCM IEEE 802.1ag) messages, MRP (Media Redundancy Protocol) messages, and VSRP (Virtual Service Redundancy Protocol) messages, etc.
[0056] ARP (Address Resolution Protocol) is a TCP / IP protocol that retrieves the physical address from the IP address. When a host sends information, it broadcasts an ARP request containing the target IP address to all hosts on the local area network and receives a response message to determine the target's physical address. After receiving the response message, the host stores the IP address and physical address in its local ARP cache for a certain period of time. Subsequent requests directly query the ARP cache to save resources. ARP relies on mutual trust among hosts on the network. Hosts on the local area network can send ARP reply messages independently, and other hosts receiving the reply messages do not verify their authenticity but simply record them in their local ARP cache. ARP commands can be used to query the mapping between IP addresses and MAC addresses in the local ARP cache, add or delete static mappings, etc. Related protocols include RARP and Proxy ARP. NDP is used to replace ARP in IPv6.
[0057] LACP (Link Aggregation Control Protocol) is a protocol based on the IEEE 802.3ad standard that enables dynamic aggregation and deaggregation of links. It is a commonly used protocol in link aggregation. Member ports in a link aggregation group that have enabled the LACP protocol interact by sending LACPDU messages. The two sides agree on which ports can send and receive messages, thus determining the links that will handle the service traffic.
[0058] Link Layer Discovery Protocol (LLDP) is a data link layer protocol. Network devices can send LLDPDUs (Link Layer Discovery Protocol DataUnits) within their local network to announce their own status to other devices. It is a protocol that enables devices in a network to discover each other, announce their status, and exchange information.
[0059] Gratuitous ARP, also known as gratuitous ARP or unsolicited ARP, differs from regular ARP requests. It doesn't seek the MAC address of an IP address; instead, it sends a Gratuitous ARP request upon startup, requesting the MAC address of its own IP address.
[0060] ITU-T stands for the Telecommunication Standardization Sector of the International Telecommunication Union. It is a branch of the International Telecommunication Union (ITU) that specializes in developing telecommunications standards. Operation Administration and Maintenance (OAM) refers to the management work of a network, typically divided into three categories based on the actual needs of network operation: Operation, Administration, and Maintenance. Operation primarily involves the analysis, forecasting, planning, and configuration of the network and its services. Maintenance mainly involves routine operational activities such as testing and fault management of the network and its services.
[0061] For example, an L3+ message (including L3 and L4 messages, etc.) may include:
[0062] IP-based BGP messages, IP-based OSPF v3 messages, IPv6-based PIM messages, IPv6-based ND6 messages, GRE-based ISIS messages, and GRE keep-alive messages, etc.
[0063] Table 1 lists the preset fields corresponding to various L2 messages, showing the preset fields used to identify L2 control messages. Table 2 lists the preset fields corresponding to various L3+ messages, showing the preset fields used to identify L3+ control messages.
[0064] Table 1
[0065]
[0066] Table 2
[0067]
[0068]
[0069] For example, the byte position required to identify a V4RteAlert message is L4 header word 1, corresponding to bytes 58-61, as follows:
[0070] ||L2 header-B[0:13]||IPV6-B[14:53]||L4-B[54+]|.
[0071] To support the SNAP header and two VLANs, the first word of L4 will be shifted by 14 bits (6 bits for SNAP and 8 bits for the two VLANs).
[0072] Therefore, in order to be able to identify messages with complexity up to V4 RteAlert (with SNAP headers and 2 VLANs), the control message classifier must be able to acquire the first 76 bytes of the message.
[0073] To identify and match L2 destinations (for messages such as BPDU / STP), only one comparator pool is needed (one 48-bit comparator for each message type that needs to identify the L2 destination address).
[0074] The mask is used to identify address ranges. When matching fields such as L2 ethertype, the implicit VLAN and SNAP headers are identified first. Similarly, for L3 (IP) headers and higher-level headers, the correct location of the required fields is identified first. The parsing and identification process is relatively simple and requires minimal latency. This latency may be hidden by the packet queuing process (executed in parallel), thus allowing control packets to be identified before any packet loss occurs.
[0075] The information generated by the classifier is a single bit (control packet or non-control packet), which can be easily extended to multiple bits for service priority.
[0076] The logic for interpreting information from the comparator pool (the comparator used to identify each field of the control group) is simply to perform an AND operation on the results of the comparators from different grouping layers (such as those set by the control register) and an OR operation on the results of all pool combinations.
[0077] When certain packets need to be dropped, the queuing logic can use the classifier's result to give control packets a higher priority.
[0078] S20. Based on the determined message type and preset priority rules, obtain the parsing order queue of the messages to be processed.
[0079] Based on the determined message type and preset priority rules, obtain the parsing order queue of messages to be processed, which may include: discarding messages to be discarded; determining the processing priority order of the remaining messages to be processed based on the determined message type and preset priority rules; and arranging the remaining messages to be processed into a parsing order queue according to the processing priority order.
[0080] The preset priority rules for various messages can be set according to the needs of actual applications. For example, the preset priority rules can be set so that L2 messages have a higher priority than L3+ messages, and the processing priority of various L2 messages, from highest to lowest, is arranged as follows:
[0081] ARP messages, BPDU / STP messages, LACP messages, LLDP messages, GARP messages, ITU-T OAM, MRP messages, and VSRP messages.
[0082] The processing priority of various L3+ packets, from highest to lowest, is as follows: IP-based BGP packets, IP-based OSPF v3 packets, IPv6-based PIM packets, IPv6-based ND6 packets, GRE-based ISIS packets, and GRE keep-alive packets.
[0083] S30. Parse the messages to be processed according to the message order of the parsing order queue.
[0084] Specifically, the parsing engine can process the packets in the parsing order queue according to their order of arrangement.
[0085] The message processing method provided in this application significantly reduces the congestion rate during message transmission, improves message processing efficiency, and improves the situation in related technologies where the high congestion rate during message transmission leads to low message processing efficiency.
[0086] refer to Figure 3 As shown, another embodiment of this application provides a message processing apparatus, including:
[0087] The message type determination module is used to determine the message type of each message to be processed based on multiple preset fields and the correspondence between the preset fields and message types.
[0088] The parsing order queue acquisition module is used to obtain the parsing order queue of the packets to be processed based on the determined packet type and preset priority rules.
[0089] The message parsing module is used to parse messages to be processed according to the message order in the parsing order queue.
[0090] In one implementation, the message type determination module includes:
[0091] The comparison unit is used to compare the fields of the message to be processed with multiple preset fields to determine the preset fields contained in the message to be processed.
[0092] The determining unit is used to determine the message type of each message to be processed based on the correspondence between preset fields and message types, as well as the preset fields contained in the message to be processed.
[0093] In one embodiment, the determining unit is further configured to determine that the type of the message to be processed is a message to be discarded if the message to be processed does not contain a preset field.
[0094] In one implementation, the parsing order queue of messages to be processed is obtained according to the determined message type and preset priority rules, including: discarding messages to be discarded; determining the processing priority order of the remaining messages to be processed according to the determined message type and preset priority rules; and arranging the remaining messages to be processed into a parsing order queue according to the processing priority order.
[0095] In one implementation, comparing the fields of the message to be processed with multiple preset fields includes: obtaining the fields in the header of the message to be processed; and comparing the fields in the header with multiple preset fields.
[0096] The message processing apparatus provided in this application determines the message type of each message to be processed based on multiple preset fields and the correspondence between the preset fields and message types. Based on the determined message type and preset priority rules, it obtains the parsing order queue of the messages to be processed and parses the messages to be processed according to the message arrangement order in the parsing order queue. This significantly reduces the congestion rate during message transmission, improves message processing efficiency, and improves the following situation in related technologies: In network routing devices or data switching devices, the congestion rate during message transmission is high, resulting in low message processing efficiency.
[0097] Another embodiment of this application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. The processor executes the computer program to implement the message processing method of any of the above embodiments.
[0098] refer to Figure 4 As shown, the electronic device 10 may include: a processor 100, a memory 101, a bus 102 and a communication interface 103. The processor 100, the communication interface 103 and the memory 101 are connected through the bus 102. The memory 101 stores a computer program that can run on the processor 100. When the processor 100 runs the computer program, it executes the method provided in any of the foregoing embodiments of this application.
[0099] The memory 101 may include high-speed random access memory (RAM), and may also include non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 103 (which can be wired or wireless), such as the Internet, wide area network, local area network, metropolitan area network, etc.
[0100] Bus 102 can be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. Memory 101 is used to store programs. After receiving an execution instruction, processor 100 executes the program. The methods disclosed in any of the foregoing embodiments of this application can be applied to processor 100, or implemented by processor 100.
[0101] Processor 100 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of processor 100 or by instructions in software form. The processor 100 may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application-Specific Integrated Circuit (ASIC), an Off-the-shelf Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules may reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory 101. The processor 100 reads the information in memory 101 and, in conjunction with its hardware, completes the steps of the above method.
[0102] The electronic devices and methods provided in the embodiments of this application are based on the same inventive concept and have the same beneficial effects as the methods they employ, operate, or implement.
[0103] Another embodiment of this application provides a computer-readable storage medium having a computer program stored thereon, the computer program being executed by a processor to implement the message processing method of any of the above embodiments. Reference Figure 5 As shown, the computer-readable storage medium is an optical disc 20, on which a computer program (i.e., a program product) is stored. When the computer program is run by a processor, it executes the methods provided in any of the aforementioned embodiments.
[0104] It should be noted that examples of computer-readable storage media may also include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other optical and magnetic storage media, which will not be elaborated here.
[0105] The computer-readable storage medium provided in the above embodiments of this application and the method provided in the embodiments of this application are based on the same inventive concept and have the same beneficial effects as the methods adopted, run or implemented by the applications stored therein.
[0106] It should be noted that:
[0107] The term "module" is not intended to be limited to a specific physical form. Depending on the application, a module can be implemented as hardware, firmware, software, and / or a combination thereof. Furthermore, different modules may share common components or even be implemented using the same components. Clear boundaries may or may not exist between different modules.
[0108] The algorithms and displays provided herein are not inherently related to any particular computer, virtual device, or other equipment. Various general-purpose devices can also be used with the examples based on this. The required structure for constructing such devices is obvious from the above description. Furthermore, this application is not directed to any particular programming language. It should be understood that the content of this application described herein can be implemented using various programming languages, and the above description of specific languages is for the purpose of disclosing the best mode of implementation of this application.
[0109] It should be understood that although the steps in the flowcharts of the accompanying figures are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the accompanying figures may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.
[0110] The above embodiments merely illustrate the implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A message processing method, characterized in that, include: The message type of each message to be processed is determined based on multiple preset fields and the correspondence between the preset fields and message types. Based on the determined message type and preset priority rules, obtain the parsing order queue of the messages to be processed; The messages to be processed are parsed according to the message arrangement order of the parsing order queue; The message types of the messages to be processed include L2 control messages and L3+ control messages; The step of determining the message type of each message to be processed based on multiple preset fields and the correspondence between the preset fields and message types includes: The fields of the message to be processed are compared with the plurality of preset fields to determine the preset fields contained in the message to be processed; Based on the correspondence between the preset fields and the message types, and the preset fields contained in the message to be processed, the type of each message to be processed is determined; When matching fields in L2 control packets, the implicit VLAN and SNAP headers are first identified. For L3 headers and higher-level headers, the correct positions of the required fields are first parsed and identified. The L2 destination is identified and matched through a comparator pool, which includes comparators for identifying each field of the control packet. Each packet type of the L2 destination address is identified through a 48-bit comparator. The position of the bytes required to identify the V4RteAlert packet is L4 header word 1, with the first word of L4 shifted by 14 bits to support the SNAP header and two VLANs, where 6 bits are used for SNAP and 8 bits are used for the two VLANs. The control packet classifier obtains the first 76 bytes of the packet to identify packets of V4RteAlert complexity. The logic for interpreting information from the comparator pool is to perform an AND operation on the results of comparators at different packet layers and an OR operation on the results of all pool combinations.
2. The method according to claim 1, characterized in that, The step of determining the message type of each message to be processed based on multiple preset fields and the correspondence between the preset fields and message types further includes: If the preset field is not included in the message to be processed, the message to be processed is determined to be a message to be discarded.
3. The method according to claim 2, characterized in that, The step of obtaining the parsing order queue of the messages to be processed based on the determined message type and preset priority rules includes: Discard the message to be discarded; Based on the determined message type and preset priority rules, determine the processing priority order of the remaining messages to be processed; The remaining messages to be processed are arranged into the parsing order queue according to the processing priority order.
4. The method according to claim 1, characterized in that, The step of comparing the fields of the message to be processed with the plurality of preset fields includes: Obtain the fields from the header of the message to be processed; The fields in the header are compared with the plurality of preset fields.
5. A message processing apparatus, characterized in that, include: The message type determination module is used to determine the message type of each message to be processed based on multiple preset fields and the correspondence between the preset fields and message types. The parsing order queue acquisition module is used to acquire the parsing order queue of the message to be processed according to the determined message type and preset priority rules; The message parsing module is used to parse the message to be processed according to the message arrangement order in the parsing order queue; The message types of the messages to be processed include L2 control messages and L3+ control messages; The message type determination module includes: The comparison unit is used to compare the fields of the message to be processed with the plurality of preset fields to determine the preset fields contained in the message to be processed. The determining unit is used to determine the type of each message to be processed based on the correspondence between the preset fields and the message types, and the preset fields contained in the message to be processed. When matching fields in L2 control messages, the implicit VLAN and SNAP headers are first identified. For L3 headers and higher-level headers, the correct positions of the required fields are first parsed and identified. The L2 destination is identified and matched using a comparator pool. Each message type of the L2 destination address is identified using a 48-bit comparator. The position of the bytes required to identify V4RteAlert messages is L4 header word 1. The first word of L4 is shifted by 14 bits to support the SNAP header and two VLANs, with 6 bits for SNAP and 8 bits for the two VLANs. The control message classifier obtains the first 76 bytes of the message to identify messages of V4RteAlert complexity. The logic for interpreting information from the comparator pool is to perform an AND operation on the results of comparators from different packet layers and an OR operation on the results of all pool combinations.
6. The apparatus according to claim 5, characterized in that, The determining unit is further configured to determine that the type of the message to be processed is a message to be discarded when the preset field is not included in the message to be processed.
7. An electronic device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the message processing method as described in any one of claims 1-4.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, The computer program is executed by a processor to implement the message processing method as described in any one of claims 1-4.
Citation Information
Patent Citations
Message processing method and device
CN101631077A
Method and device for strengthening safety of protocol message
CN1913486A