A message processing method and device
By extracting message characteristics in the switch, determining the target application and generating MQC table entries, the problem that the switch cannot dynamically adjust message processing is solved, and the diversified requirements of different applications are met, improving resource utilization and cost-effectiveness.
Patent Information
- Application Number
- CN202211202500.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-29
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2042-09-29
AI Technical Summary
The prior art is difficult to dynamically adjust the packet processing method in the switch according to the needs of different applications, resulting in the inability to effectively meet the diversified requirements of different applications for network delay, bandwidth and packet loss rate.
By receiving the data stream to be processed, extracting message characteristics, determining target applications, generating session table entries and MQC configuration information, establishing the correspondence between message characteristics and processing information, and realizing local message processing on the switch.
It realizes dynamic processing of different application messages by switches, provides different bandwidth guarantees and priorities, improves resource utilization, saves hardware costs and bandwidth, and is suitable for all switch models.
Smart Images

Figure CN115665055B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a message processing method and device. Background Art
[0002] With the development of technology, various applications emerge in an endless stream. Different applications have different functions and different requirements for network transmission delay, bandwidth, packet loss rate, etc. In order to provide different network services for different applications, switches in the network need to use different actions to process messages of different applications. Therefore, it is necessary to provide a message processing method applied to switches. Summary of the invention
[0003] The purpose of the embodiments of the present invention is to provide a message processing method and device, so that the switch can use different actions, different bandwidth guarantees, and different priorities to process messages of different applications. The specific technical solution is as follows:
[0004] In a first aspect, a message processing method is provided, which is applied to a switch, and the method includes:
[0005] receiving a data stream to be processed;
[0006] Extracting message features of messages in the data stream to be processed;
[0007] Determine a target application for sending or receiving the data stream to be processed based on the message characteristics;
[0008] Generate a session table entry as a target session table entry, wherein the target session table entry records: a correspondence between an application identifier of the target application and the message feature;
[0009] Searching for preset modular quality of service command line interface MQC configuration information containing the same application identifier as the target session table entry, wherein the MQC configuration information records: a correspondence between an application identifier of an application and processing information of the application, the processing information comprising at least one of the following information: an identifier of an action for processing a message sent or received by the application, a message rate limit value for forwarding messages of the application, and a forwarding priority for forwarding messages of the application, and the action comprising: at least one of forwarding a message, discarding a message, and copying a message;
[0010] Generate and issue a first MQC table entry including the message feature in the target session table entry and the processing information in the found preset MQC configuration information;
[0011] The data flow to be processed is processed based on the delivered MQC table entry.
[0012] In a second aspect, a message processing device is provided, which is applied to a switch, and the device includes:
[0013] A receiving module, used for receiving a data stream to be processed;
[0014] An extraction module, used for extracting message features of messages in the data stream to be processed;
[0015] A determination module, used to determine a target application for sending or receiving the data stream to be processed based on the message characteristics;
[0016] A first generating module is used to generate a session table entry as a target session table entry, wherein the target session table entry records: a correspondence between an application identifier of the target application and the message feature;
[0017] A search module, used to search for preset modular quality of service command line interface MQC configuration information containing the same application identifier as the target session table entry, wherein the MQC configuration information records: a correspondence between an application identifier of an application and processing information of the application, the processing information comprising at least one of the following information: an identifier of an action for processing a message sent or received by the application, a message rate limit value for forwarding messages of the application, and a forwarding priority for forwarding messages of the application, and the action comprises: at least one of forwarding a message, discarding a message, and copying a message;
[0018] A second generating module is used to generate and issue a first MQC table entry including the message feature in the target session table entry and the processing information in the found preset MQC configuration information;
[0019] The processing module is used to process the data flow to be processed based on the issued MQC table entry.
[0020] According to a third aspect, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, any method step described in the first aspect is implemented.
[0021] In a fourth aspect, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute any one of the method steps described in the first aspect.
[0022] Beneficial effects of the embodiments of the present invention:
[0023] A message processing method provided by an embodiment of the present invention is applied to a switch, the method comprising: receiving a data stream to be processed; extracting message features of messages in the data stream to be processed; determining a target application for sending or receiving the data stream to be processed based on the message features; generating a session table entry as a target session table entry, wherein the target session table entry records: a correspondence between an application identifier of the target application and the message features; searching for preset modular quality of service command line interface MQC configuration information containing the same application identifier as the target session table entry, wherein the MQC configuration information The information record includes: a correspondence between an application identifier of an application and processing information of the application, the processing information including at least one of the following information: an identifier of an action for processing a message sent or received by the application, a message rate limit value for forwarding messages of the application, and a forwarding priority for forwarding messages of the application, the action including at least one of forwarding messages, discarding messages, and copying messages; generating and issuing a first MQC table item including message features in the target session table item and processing information in the found preset MQC configuration information; and processing the data flow to be processed based on the issued MQC table item.
[0024] By applying the scheme provided by the embodiment of the present invention, after receiving the data stream to be processed, the switch extracts the message features of the messages therein, performs application identification according to the message features, obtains the application identifier of the target application that sends or receives the above-mentioned data stream to be processed, and confirms the target application. A session table item representing the correspondence between the message features and the application identifier is generated as the target session table item. The MQC configuration information containing the same application identifier as the target session table item is searched, that is, the MQC configuration information containing the application identifier of the target application is obtained, and the processing information for processing the message corresponding to the application identifier can be obtained, and the MQC table item is established according to the processing information and the message features, so that the data stream with the same message features of the messages in the data stream to be processed can be directly processed according to the MQC table item. Therefore, this scheme can correspond the message features with the processing information for processing the data stream to be processed sent or received by the application through the application identifiers of different applications, so that the switch can use different actions, different bandwidth guarantees, and different priorities to process the messages in the data stream to be processed sent or received by different applications. In addition, in the embodiment of the present invention, the process of identifying the target application, issuing the MQC table entry and processing the data flow can be completed locally on the switch, and this process does not require the aid of other devices and equipment, thereby saving resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other embodiments can also be obtained based on these drawings.
[0026] Figure 1 A schematic diagram of a flow chart of a first message processing method provided in an embodiment of the present invention;
[0027] Figure 2 A schematic diagram of a flow chart of a second message processing method provided in an embodiment of the present invention;
[0028] Figure 3 A schematic diagram of a flow chart of a third message processing method provided in an embodiment of the present invention;
[0029] Figure 4 A schematic diagram of a fourth message processing method provided in an embodiment of the present invention;
[0030] Figure 5 A schematic diagram of a fifth message processing method provided by an embodiment of the present invention;
[0031] Figure 6 A schematic diagram of a first message forwarding process provided by an embodiment of the present invention;
[0032] Figure 7 A schematic diagram of a process for updating MQC configuration information provided by an embodiment of the present invention;
[0033] Figure 8 A schematic diagram of a second message forwarding process provided by an embodiment of the present invention;
[0034] Fig. 9 A schematic diagram of a third message forwarding process provided by an embodiment of the present invention;
[0035] Fig.10 A schematic diagram of a fourth message forwarding process provided by an embodiment of the present invention;
[0036] Fig.11 A schematic diagram of a fifth message forwarding process provided by an embodiment of the present invention;
[0037] Fig.12 A schematic diagram of a sixth message forwarding process provided by an embodiment of the present invention;
[0038] Fig.13 A schematic diagram of the structure of a first message processing device provided by an embodiment of the present invention;
[0039] Fig.14A schematic diagram of the structure of a second message processing device provided by an embodiment of the present invention;
[0040] Fig.15 A schematic diagram of the structure of a third message processing device provided by an embodiment of the present invention;
[0041] Fig.16 A schematic diagram of the structure of a switch provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0042] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field based on this application belong to the scope of protection of the present invention.
[0043] In order to enable a switch to process messages of different applications using different actions, different bandwidth guarantees, and different priorities, an embodiment of the present invention provides a message processing method and device.
[0044] Figure 1 A flowchart of a first message processing method provided in an embodiment of the present invention is applied to a switch. The method includes the following steps S101-S107.
[0045] Step S101, receiving a data stream to be processed.
[0046] Specifically, the switch as a device in the network receives the data stream from the sender and processes the received data stream. The data stream to be processed may be a data stream generated by different applications and needs to be processed by the switch.
[0047] In one embodiment of the present invention, after receiving the data stream to be processed, the switch can process it through the IPFIX (IPFlow Information Export) functional unit and establish a bidirectional Netstream session. According to the five-tuple of the data stream to be processed, namely, the source IP address, source port, destination IP address, destination port and transport layer protocol, the messages in the data stream to be processed are first classified. For example, it can be determined whether the two data streams are classified as the same by judging whether the source IP address, destination IP address, source port and destination port are the same. Among them, the above-mentioned source port and destination port can be L4 ports. In this solution, the same method can be used to process messages belonging to the same classification.
[0048] Step S102: extracting message features of the messages in the above-mentioned data stream to be processed.
[0049] Specifically, the received data stream to be processed includes messages, and messages sent or received by different applications have different message features. Therefore, messages sent or received by different applications can be distinguished by extracting the message features.
[0050] In addition, the message feature may be composed of one or more of the five-tuples, or may be composed of other information contained in the message, for example, information for distinguishing whether the message is a TCP (Transmission Control Protocol) message or a UDP (User Datagram Protocol) message and the port number of the L4 port.
[0051] In one embodiment of the present invention, the switch can extract the message features of the message locally through a DPI (Deep Packet Inspection) functional unit.
[0052] In another embodiment of the present invention, the above step S102 can be implemented by the following step A.
[0053] Step A: extracting message features of a preset number of messages in the above-mentioned data stream to be processed.
[0054] Specifically, in theory, the message features of the messages in the same data stream to be processed are the same, so only the message features of some messages in the data stream to be processed can be extracted to represent the message features of each message in the data stream to be processed, without extracting the message features of all messages. In addition, the solution provided in the embodiment of the present invention only extracts the message features of the first preset number of messages in the data stream to be processed, so that the message features can be obtained faster, data processing resources can be saved, and the switch itself is adapted to its own lower data processing capability.
[0055] The preset number is the number of messages artificially set according to actual conditions. For example, the preset number can be set to a value between ten and twenty, that is, the message features of the first ten to twenty messages in the above-mentioned data stream to be processed are extracted.
[0056] Step S103: determining a target application for sending or receiving the data flow to be processed based on the message characteristics.
[0057] Since the message features of the messages contained in the data streams sent or received by different applications are different, the switch can identify the target application based on the message features. Specifically, the target application can be identified locally by the DPI functional unit based on the obtained message features. The embodiment of the present invention does not limit the specific method of identifying the target application.
[0058] Furthermore, the target application may be application software, such as social software, chat software, etc., or may not be application software, such as an application running on a television for receiving video data.
[0059] Step S104: Generate a session entry as a target session entry.
[0060] The target session entry records: the corresponding relationship between the application identifier of the target application and the message feature.
[0061] In the embodiment of the present invention, different application identifiers are pre-set for different applications. The application identifier may be represented in the form of an APPID (Application Identity Document) or other pre-set numbers, such as a digital number, a character number, etc.
[0062] In addition, the target session entry is recorded in the session soft table, so that the switch can obtain the corresponding relationship between the message feature and the application identifier by searching the session entry recorded in the session soft table.
[0063] Step S105: searching for preset MQC configuration information containing the same application identifier as the target session entry.
[0064] Among them, the above-mentioned MQC configuration information records: the correspondence between the application identifier of the application and the processing information of the application, and the above-mentioned processing information includes at least one of the following information: the identifier of the action for processing the message sent or received by the application, the message rate limit value for forwarding the message sent or received by the application, and the forwarding priority for forwarding the message sent or received by the application. The above-mentioned message rate limit value indicates the restriction on the message forwarding speed when forwarding the message sent or received by the application, so as to realize different bandwidth guarantee strategies for different messages. The above-mentioned forwarding priority indicates that when forwarding the message sent or received by the application, the message of the application with high forwarding priority is forwarded first.
[0065] Since the data streams sent or received by different applications have different requirements for network transmission, the switch can process the data streams sent or received by different applications through different actions.
[0066] Table 1 is a table showing the correspondence between different application types, priorities and actions.
[0067]
[0068]
[0069] Table 1 shows the priorities and actions of data flows of different application types. As can be seen from Table 1, different actions are used to process data flows of different application types.
[0070] Specifically, the above MQC configuration information records the correspondence between the application identifiers of different applications and the processing information of the action of processing the message sent or received by the application. By searching the MQC configuration information including the application identifier of the target application recorded in the above target session table, the processing information including at least one of the identifier of the action of processing the message sent or received by the target application, the message rate limit value for forwarding the message sent or received by the application, and the forwarding priority for forwarding the message sent or received by the application can be obtained, and then the switch can perform corresponding processing actions on the message sent or received by the target application according to the processing information.
[0071] The above-mentioned action includes: at least one of forwarding a message, discarding a message, and copying a message. The above-mentioned action of forwarding a message indicates that the switch sends the data stream to be processed to the receiving end device, the above-mentioned action of discarding a message indicates that the switch stops sending the data stream to be processed to the receiving end device, and the above-mentioned action of copying a message indicates that the data stream to be processed is copied and sent to the server. For example, when it is necessary to monitor a certain application, the switch can copy the data stream to be processed and send it to the server.
[0072] Step S106: Generate and issue a first MQC entry including the message feature in the target session entry and the processing information in the found preset MQC configuration information.
[0073] Specifically, according to the application identifier of the target application, the MQC configuration information including the application identifier is obtained. The above-mentioned target session table item and the above-mentioned MQC configuration information both include the same application identifier, and the above-mentioned target session table item also includes the corresponding message feature, and the above-mentioned MQC configuration information also includes the corresponding processing information. Therefore, the correspondence between the message feature and the processing information can be established through the application identifier, and the correspondence is recorded through the above-mentioned first MQC table item, and then the first MQC table item is sent to the hardware MQC table.
[0074] Step S107: Process the data flow to be processed based on the delivered MQC entry.
[0075] Specifically, the correspondence between message features and processing information can be obtained through the MQC table entry. During message processing, the data stream to be processed can search for the corresponding MQC table entry through the message features of the messages in the data stream to be processed, directly obtain the corresponding processing information, and process the messages in the data stream according to the processing information.
[0076] In one embodiment of the present invention, the execution of the above steps S103-S106 requires a certain time. During this period of time, the first MQC table item has not been issued, and the switch cannot process the message based on the first MQC table item. The switch can regard the data flow to be processed as a normal data flow and process it normally until the first MQC table item is generated and issued, and then process the message in the data flow to be processed according to the processing information in the first MQC table item.
[0077] By applying the scheme provided by the embodiment of the present invention, after receiving the data stream to be processed, the switch extracts the message features of the messages therein, performs application identification according to the message features, obtains the application identifier of the target application that sends or receives the above-mentioned data stream to be processed, and confirms the target application. A session table item representing the correspondence between the message features and the application identifier is generated as the target session table item. The MQC configuration information containing the same application identifier as the target session table item is searched, that is, the MQC configuration information containing the application identifier of the target application is obtained, and the processing information for processing the message corresponding to the application identifier can be obtained, and the MQC table item is established according to the processing information and the message features, so that the data stream with the same message features of the messages in the data stream to be processed can be directly processed according to the MQC table item. Therefore, this scheme can correspond the message features with the processing information for processing the data stream to be processed sent or received by the application through the application identifiers of different applications, so that the switch can use different actions, different bandwidth guarantees, and different priorities to process the messages in the data stream to be processed sent or received by different applications. In addition, in the embodiment of the present invention, the process of identifying the target application, issuing the MQC table entry and processing the data flow can be completed locally on the switch, and this process does not require the aid of other devices and equipment, thereby saving resources.
[0078] In the prior art, there are several different methods for processing data streams received by a switch.
[0079] The first method is to install a security card on the switch, copy the data stream to the security card to implement application identification, and process the messages in the data stream according to the identification results. This method can only be used on switch models that support security cards, so the hardware cost is high and cannot be universal.
[0080] The second method is to use an independent server, copy the data stream to the server to implement application identification, and process the messages in the data stream according to the identification results. This method requires the use of an additional server and requires a large amount of data stream to be sent to the server, thus occupying bandwidth resources and reducing resource utilization.
[0081] Compared with the first method, the embodiment of the present invention does not require additional hardware cost, can save hardware cost, and can be applied to all switches.
[0082] Compared with the second method, the embodiment of the present invention does not need to send the data stream to the server, so no additional equipment is required, and no additional bandwidth is occupied, thereby improving resource utilization.
[0083] The scheme provided by the embodiment of the present invention is described below with a specific example: the switch receives the data stream to be processed sent by application M, and extracts the message features of the messages in the data stream to be processed. The application identifier of application M is determined according to the message features, and a corresponding relationship between the application identifier of application M and the message features is established to generate a session table entry. The preset MQC configuration information is matched with the session table entry, the MQC configuration information containing the application identifier of application M is searched, the processing information in the MQC configuration information is obtained, and a corresponding relationship is established with the message features in the session table entry to generate the MQC table entry. Therefore, by searching the corresponding MQC table entry according to the message features of the messages in the data stream to be processed sent by application M, the corresponding processing information is obtained, and the messages in the data stream to be processed sent by application M can be processed according to the processing information.
[0084] Figure 2 A flow chart of a second message processing method provided in an embodiment of the present invention, which is similar to the above Figure 1 Compared with the embodiment shown, the step S104 further includes step S108, and the step S106 further includes step S109.
[0085] Step S108: collecting statistics on aging information.
[0086] The aging information indicates: a situation in which the target application sends or receives messages.
[0087] Specifically, after a session entry is generated as a target session entry, aging information of the session entry needs to be counted according to the messages in the data flow to be processed received by the switch, so that the situation of sending or receiving messages by the target application can be obtained in time.
[0088] In one embodiment of the present invention, when the message sent or received by the target application is a TCP message, the aging information is: the synchronization sequence number of the TCP message most recently received by the switch, and the synchronization sequence number includes: a FIN (Finish) flag or a RST (Reset) flag; when the message sent or received by the target application is a UDP message, the aging information is the time interval for the switch to interrupt receiving the UDP message.
[0089] Specifically, different parameters are used as aging information according to the type of messages received by the switch in the data flow to be processed.
[0090] Step S109: If the aging information indicates that the time duration during which the target application stops sending or receiving messages reaches a preset time duration, the session entry and the first MQC entry are deleted.
[0091] Specifically, the situation of the target application sending or receiving messages can be obtained according to the aging information. When the aging information indicates that the target application has stopped sending or receiving messages, it means that the switch no longer receives messages from the target application and no longer sends messages to the target application. Therefore, it is no longer necessary to retain the correspondence between the application identifier of the target application and the message characteristics of the message sent or received by the target application and the processing information of the switch processing the action of the target application sending or receiving the data flow, and the session table entry and the first MQC table entry containing the application identifier can be deleted.
[0092] In one embodiment of the present invention, when receiving a TCP message, if the received TCP message carries a FIN flag or a RST flag, it indicates that the receiving end and the sending end of the TCP message are about to disconnect the TCP link, that is, the target application is about to stop sending or receiving messages, and the session entry can be determined to be aged. When receiving a UDP message, after the time interval of the switch receiving the UDP message interruption reaches a certain threshold, it can be determined that the target application is about to stop sending or receiving UDP messages, and the session entry is confirmed to be aged.
[0093] By applying the solution provided by the embodiment of the present invention, the switch obtains the situation of sending or receiving messages by the target application by counting aging information for the session table item. When the switch no longer receives messages from the target application and no longer sends messages to the target application, the session table item and the first MQC table item are deleted to release the hardware processing table item. Specifically, only the hardware table item that has been sent down on the chip, that is, the first MQC table item, is deleted, but the MQC configuration information configured by the user is retained to reduce resource waste.
[0094] Figure 3 A schematic diagram of a flow chart of a third message processing method provided in an embodiment of the present invention, which is similar to the aforementioned Figure 1 Compared with the embodiment shown, the above method further includes steps S110 - S112 .
[0095] Step S110: obtaining newly added MQC configuration information.
[0096] Specifically, based on specific processing requirements, the user can write new MQC configuration information or update existing MQC configuration information in the switch. The newly written MQC configuration information and the updated MQC configuration information are the newly added MQC configuration information.
[0097] Step S111: if there is a session entry containing the same application identifier as the newly added MQC configuration information, a newly added MQC entry is generated based on the newly added MQC configuration information.
[0098] The newly added MQC table entry includes: the message feature in the session table entry and the processing information in the newly added MQC configuration information.
[0099] Specifically, it is necessary to determine whether the application identifier contained in the existing session entry contains the application identifier contained in the newly added MQC configuration information. If the session entry exists, a newly added MQC entry can be generated so that the switch can process the message based on the newly added MQC entry.
[0100] In one embodiment of the present invention, the processing information included in the newly added MQC configuration information may not be used to process the data stream sent or received by the application, so it is necessary to first determine whether the newly added MQC configuration information is used to process the data stream sent or received by the application. If so, a newly added MQC table entry is generated based on the newly added MQC configuration information. If not, a newly added MQC table entry can be directly generated and issued based on the newly added MQC configuration information without searching for a session table entry.
[0101] Step S112: Replace the second MQC entry with the newly added MQC entry.
[0102] The second MQC table entry is: an already issued MQC table entry that contains the same message feature as the newly added MQC table entry.
[0103] Specifically, there is an MQC table entry containing a message feature corresponding to the application identifier contained in the newly added MQC configuration information, and the MQC table entry is the above-mentioned second MQC table entry. The above-mentioned newly added MQC table entry is an MQC table entry generated based on the newly added MQC configuration, which contains updated processing information, and the second MQC table entry is replaced with the newly added MQC table entry, so that the data flow to be processed with the corresponding message feature can perform message processing according to the new MQC table entry. On the contrary, if the newly added MQC table entry is directly issued, the newly added MQC table entry will conflict with the second MQC table entry, and the switch may continue to process the message based on the original second MQC table entry.
[0104] By applying the solution provided by the embodiment of the present invention, when adding MQC configuration, it is determined whether there is a corresponding MQC table entry, so that the data flow to be processed can be processed according to the new MQC table entry, and the processing method of the switch processing the data flow to be processed can be changed.
[0105] Figure 4 A schematic diagram of a fourth message processing method provided in an embodiment of the present invention, which is similar to the aforementioned Figure 1Compared with the embodiment shown, the above method further includes steps S113-S114.
[0106] Step S113: Determine the deleted MQC configuration information.
[0107] Specifically, the preset MQC configuration information may be deleted, which means that the correspondence between the processing information for processing the data stream sent or received by the target application corresponding to the application identifier contained in the MQC configuration information and the application identifier is deleted. If the corresponding MQC table entry exists, the correspondence between the message feature contained in the MQC table entry and the processing information is also deleted accordingly. Therefore, it is necessary to determine whether the corresponding MQC table entry exists.
[0108] Step S114: If there is a session entry containing the same application identifier as the deleted MQC configuration information, the third MQC entry is deleted.
[0109] The third MQC table entry includes: the message feature in the session table entry and the processing information in the deleted MQC configuration information.
[0110] Specifically, if the MQC configuration information is deleted, it means that the switch no longer needs to provide special message processing services for the application corresponding to the application identifier contained in the deleted MQC configuration information, and it is necessary to determine whether there is a session table entry containing the same application identifier as the deleted MQC configuration information. If it exists, it means that the third MQC table entry containing the same message characteristics as the session table entry also exists, so it is necessary to delete the third MQC table entry. After deletion, the switch will no longer use special actions to process the message of the above application. If it does not exist, it means that the third MQC table entry does not exist.
[0111] In one embodiment of the present invention, the processing information contained in the deleted MQC configuration information may not be used to process the data stream sent or received by the application, so it is necessary to first determine whether the deleted MQC configuration information is used to process the data stream sent or received by the application. If so, continue to execute step S114. If not, the MQC table entry corresponding to the deleted MQC configuration can be directly deleted.
[0112] By applying the solution provided by the embodiment of the present invention, when the MQC configuration information is deleted, it is determined whether there is a third MQC table entry, so as to prevent the switch from continuing to provide a special message processing service for the application corresponding to the application identifier included in the deleted MQC configuration information, and to prevent the switch from continuing to use a special action to process the message of the above application.
[0113] Figure 5 A flowchart of a fifth message processing method provided in an embodiment of the present invention, which is similar to the above Figure 1Compared with the embodiment shown, the above step S101 can be implemented through the following steps S101A, the above step S102 can be implemented through the following steps S102A-S102B, the above step S103 can be implemented through the following steps S103A, the above step S104 can be implemented through the following steps S104A, the above step S105 can be implemented through the following steps S105A, the above step S106 can be implemented through the following steps S106A, and the above step S107 can be implemented through the following steps S107A.
[0114] Step S101A: receiving the data stream to be processed through the driver of the switch.
[0115] Step S102A: duplicating the message in the data stream to be processed through the driver to obtain a copy message, and sending the copy message to the CPU of the switch.
[0116] Specifically, the driver sends a copy of the message in the data stream to be processed to the CPU of the switch, so that the data stream to be processed can be processed normally by the switch without affecting the normal processing of the data stream to be processed due to the extraction of message features and confirmation of target applications.
[0117] Step S102B: extracting message features of the messages in the data stream to be processed by the CPU.
[0118] Step S103A: the CPU determines the target application for sending or receiving the data stream to be processed based on the message characteristics, and sends the application identifier of the target application and the message characteristics of the message in the data stream to be processed to the driver.
[0119] Step S104A: Generate a session entry through the above driver as the target session entry.
[0120] Step S105A: searching, through the driver, for preset MQC configuration information containing the same application identifier as the target session entry.
[0121] Step S106A: Generate and issue a first MQC entry including the message feature in the target session entry and the processing information in the found preset MQC configuration information through the driver.
[0122] Step S107A: Processing the to-be-processed data stream based on the issued MQC entry through the driver.
[0123] With the above Figure 1 Compared with the embodiment shown in the figure, the embodiment of the present invention describes in detail the specific implementation method of the aforementioned embodiment, which can be referred to in the previous text. Figure 1 The contents shown will not be repeated here.
[0124] By applying the solution provided by the embodiment of the present invention, the CPU and the driver in the switch can work together to complete the message processing process.
[0125] When the processing information recorded in the processing information included in the MQC entry indicates forwarding the message, Figure 6 A schematic diagram of the first message forwarding process provided by an embodiment of the present invention.
[0126] Step S601, determining whether the DPI function unit is enabled.
[0127] Specifically, whether the DPI function unit is enabled may be manually configured by the user. When the DPI function unit is enabled, the switch can identify the target application through the DPI function unit and continue to execute subsequent steps.
[0128] Step S602: When the DPI function unit is enabled, the first N messages of the mirrored Netflow are driven to be sent to the DPI function unit.
[0129] Specifically, the messages in the mirrored Netflow (network flow) are duplicate messages.
[0130] Step S603: The DPI functional unit completes application identification.
[0131] Step S604: The DPI function unit sends the APPID and message features to the driver.
[0132] Step S605: The driver binds the APPID and the message features and writes them into the session table entry.
[0133] Step S606, determining whether there is MQC configuration information containing the corresponding APPID.
[0134] Step S607: When it is determined that there is MQC configuration information containing the corresponding APPID, the driver binds the message feature with the processing information to generate an MQC table entry.
[0135] Step S608: The driver sends the MQC entry.
[0136] Step S609: The driver forwards the message according to the processing information in the MQC entry.
[0137] Specifically, the above steps S601-S609 are similar to the various embodiments of the message forwarding method described above, and will not be repeated here.
[0138] When the processing information recorded in the processing information included in the MQC entry indicates forwarding the message, Figure 7 A schematic diagram of a process for updating MQC configuration information provided by an embodiment of the present invention.
[0139] Step S701: The CPU sends MQC configuration information based on a single application or an application group.
[0140] Step S702: The driver traverses the session table entries to find the message features corresponding to the APPID.
[0141] Step S703: Based on the message characteristics, the driver forwards the message according to the processing information.
[0142] Specifically, the above steps S701-S703 are similar to the various embodiments of the message forwarding method described above, and will not be repeated here.
[0143] When the processing information recorded in the processing information included in the MQC entry indicates forwarding the message, Figure 8 A schematic diagram of the second message forwarding process provided by an embodiment of the present invention.
[0144] Step B1, the driver receives the first packet, mirrors the first N messages, and obtains a copy message.
[0145] Specifically, the first packet includes the first N messages of the data stream to be processed.
[0146] Step B2: The driver sends the obtained copy message to the CPU.
[0147] Step B3: The CPU extracts the message features of the duplicate message.
[0148] Step B4: The CPU identifies the APPID through the DPI functional unit according to the message characteristics.
[0149] Step B5: The CPU binds the APPID and the message features and sends them to the driver.
[0150] Step B6: The driver generates a session table entry according to the message characteristics and APPID.
[0151] Step B7, driving statistical aging information.
[0152] Step B8: When no aging phenomenon occurs, the driver forwards the message normally.
[0153] Specifically, the above steps B1-B8 are similar to the various embodiments of the message forwarding method described above, and will not be repeated here.
[0154] When the processing information recorded in the processing information included in the MQC entry indicates forwarding the message, Fig. 9 A schematic diagram of the third message forwarding process provided by an embodiment of the present invention.
[0155] Step C1, the driver receives the subsequent packet.
[0156] Specifically, the subsequent packets include the messages after the first N messages in the data stream to be processed.
[0157] Step C2: The driver continues to send the copy message to the CPU.
[0158] Step C3: The CPU continues to extract message features of the duplicate message.
[0159] Step C4, the CPU continues to identify the APPID through the DPI functional unit according to the message characteristics.
[0160] Step C5: The CPU binds the APPID and the message features and sends them to the driver.
[0161] Step C6: The driver generates a session table entry according to the message characteristics and APPID.
[0162] Step C7, driving and updating aging information.
[0163] Step C8: When no aging phenomenon occurs, the driver forwards the message normally.
[0164] Specifically, the above steps C1-C8 are similar to the various embodiments of the message forwarding method described above, and will not be repeated here.
[0165] When the processing information recorded in the processing information included in the MQC entry indicates forwarding the message, Fig.10 A schematic diagram of the fourth message forwarding process provided by an embodiment of the present invention.
[0166] Step D1: The CPU sends the MQC configuration information to the driver.
[0167] In step D2, the driver distinguishes and processes the MQC configuration information. If the MQC configuration information matches an application, step D3 is executed; if the MQC configuration information matches a non-application, step D5 is executed.
[0168] Specifically, the MQC configuration information matching the application indicates that the processing information included in the MQC configuration information is used to process the data stream sent or received by the application, and the MQC configuration information matching the non-application indicates that the processing information included in the MQC configuration information is used to process the data stream sent or received by the non-application.
[0169] Step D3: The driver searches for a session entry containing the APPID.
[0170] Step D4: when the session entry is found, the MQC entry is updated according to the MQC configuration information.
[0171] Step D5: The driver directly updates the MQC entry.
[0172] Step D6: The driver receives the message to be forwarded.
[0173] Step D7: When no aging occurs, the driver forwards the message according to the MQC entry.
[0174] Specifically, the above steps D1-D7 are similar to the various embodiments of the message forwarding method described above, and will not be repeated here.
[0175] When the processing information recorded in the processing information included in the MQC entry indicates forwarding the message, Fig.11 A schematic diagram of the fifth message forwarding process provided by an embodiment of the present invention.
[0176] Step E1: The CPU binds the APPID and message features and sends them to the driver.
[0177] Step E2: The driver generates a session table entry according to the message characteristics and APPID.
[0178] Step E3, the driver searches for MQC configuration information corresponding to the APPID.
[0179] Step E4: The driver generates an MQC entry according to the message characteristics and processing information.
[0180] Step E5: When no aging phenomenon occurs, the driver forwards the message according to the MQC entry.
[0181] Specifically, the above steps E1-E5 are similar to the various embodiments of the message forwarding method described above, and will not be repeated here.
[0182] When the processing information recorded in the processing information included in the MQC entry indicates forwarding the message, Fig.12 A schematic diagram of the sixth message forwarding process provided by an embodiment of the present invention.
[0183] Step F1: According to the aging information, the session entry ages.
[0184] Step F2: The driver sends the session entry aging information to the CPU.
[0185] Step F3, the driver searches for MQC configuration information corresponding to the APPID.
[0186] Step F4: The driver deletes the MQC entry according to the message characteristics and processing information.
[0187] Step F5: When no aging phenomenon occurs, the driver forwards the message normally.
[0188] Specifically, the above steps F1-F5 are similar to the various embodiments of the message forwarding method described above, and will not be repeated here.
[0189] Based on the same inventive concept, corresponding to the above-mentioned message processing method, the embodiment of the present invention further provides a message processing device, such as Fig.13 As shown, it is a structural schematic diagram of a first message processing device provided by an embodiment of the present invention, including:
[0190] The receiving module 1301 is used to receive a data stream to be processed;
[0191] An extraction module 1302, configured to extract message features of messages in the data stream to be processed;
[0192] A determination module 1303, configured to determine a target application for sending or receiving the data stream to be processed based on the message characteristics;
[0193] The first generating module 1304 is used to generate a session table entry as a target session table entry, wherein the target session table entry records: a correspondence between an application identifier of the target application and the message feature;
[0194] The search module 1305 is used to search for preset modular quality of service command line interface MQC configuration information containing the same application identifier as the target session table entry, wherein the MQC configuration information records: a correspondence between an application identifier of an application and processing information of the application, the processing information comprising at least one of the following information: an identifier of an action for processing a message sent or received by the application, a message rate limit value for forwarding a message of the application, and a forwarding priority for forwarding a message of the application, and the action comprises: at least one of forwarding a message, discarding a message, and copying a message;
[0195] The second generating module 1306 is configured to generate and issue a first MQC table entry including the message feature in the target session table entry and the processing information in the found preset MQC configuration information;
[0196] The processing module 1307 is configured to process the data flow to be processed based on the delivered MQC entry.
[0197] By applying the scheme provided by the embodiment of the present invention, after receiving the data stream to be processed, the switch extracts the message features of the messages therein, performs application identification according to the message features, obtains the application identifier of the target application that sends or receives the above-mentioned data stream to be processed, and confirms the target application. A session table item representing the correspondence between the message features and the application identifier is generated as the target session table item. The MQC configuration information containing the same application identifier as the target session table item is searched, that is, the MQC configuration information containing the application identifier of the target application is obtained, and the processing information for processing the message corresponding to the application identifier can be obtained, and the MQC table item is established according to the processing information and the message features, so that the data stream with the same message features of the messages in the data stream to be processed can be directly processed according to the MQC table item. Therefore, this scheme can correspond the message features with the processing information for processing the data stream to be processed sent or received by the application through the application identifiers of different applications, so that the switch can use different actions, different bandwidth guarantees, and different priorities to process the messages in the data stream to be processed sent or received by different applications. In addition, in the embodiment of the present invention, the process of identifying the target application, issuing the MQC table entry and processing the data flow can be completed locally on the switch, and this process does not require the aid of other devices and equipment, thereby saving resources.
[0198] In one embodiment of the present invention, the first generating module 1304 is further configured to:
[0199] Counting aging information, wherein the aging information indicates: a situation in which the target application sends or receives a message;
[0200] The second generating module 1306 is further configured to:
[0201] If the aging information indicates that the duration for which the target application stops sending or receiving messages reaches a preset duration, the session entry and the first MQC entry are deleted.
[0202] By applying the solution provided by the embodiment of the present invention, the switch obtains the situation of sending or receiving messages by the target application by counting aging information for the session table item. When the switch no longer receives messages from the target application and no longer sends messages to the target application, the session table item and the first MQC table item are deleted to release the hardware processing table item. Specifically, only the hardware table item that has been sent down on the chip, that is, the first MQC table item, is deleted, but the MQC configuration information configured by the user is retained to reduce resource waste.
[0203] In one embodiment of the present invention, when the message sent or received by the target application is a Transmission Control Protocol TCP message, the aging information is: a synchronization sequence number of a TCP message recently received by the switch, and the synchronization sequence number includes: an end FIN flag or a reset RST flag;
[0204] and / or
[0205] In the case where the message sent or received by the target application is a User Datagram Protocol (UDP) message, the aging information is a time interval for interrupting the switch from receiving UDP messages.
[0206] By applying the solution provided by the embodiment of the present invention, different parameters can be used as aging information according to the type of messages received by the switch in the data flow to be processed.
[0207] In one embodiment of the present invention, Fig.14 FIG. 1 is a schematic diagram of the structure of a second message processing device provided by an embodiment of the present invention, which is similar to the aforementioned Fig.13 Compared to the embodiment shown, the device further comprises:
[0208] A first obtaining module 1308 is used to obtain newly added MQC configuration information;
[0209] The third generating module 1309 is configured to generate a new MQC table entry based on the new MQC configuration information if there is a session table entry containing the same application identifier as the new MQC configuration information, wherein the new MQC table entry contains: the message feature in the session table entry and the processing information in the new MQC configuration information;
[0210] The replacement module 1310 is configured to replace the second MQC table entry with the newly added MQC table entry, wherein the second MQC table entry is: an already issued MQC table entry that contains the same message feature as the newly added MQC table entry.
[0211] By applying the solution provided by the embodiment of the present invention, when adding MQC configuration, it is determined whether there is a corresponding MQC table entry, so that the data flow to be processed can be processed according to the new MQC table entry, and the processing method of the switch processing the data flow to be processed can be changed.
[0212] In one embodiment of the present invention, Fig.15 FIG. 1 is a schematic diagram of the structure of a third message processing device provided in an embodiment of the present invention, which is similar to the aforementioned Fig.13 Compared to the embodiment shown, the device further comprises:
[0213] The second obtaining module 1311 is used to determine the deleted MQC configuration information;
[0214] The deleting module 1312 is configured to delete a third MQC table entry if there is a session table entry containing the same application identifier as the deleted MQC configuration information, wherein the third MQC table entry contains: the message feature in the session table entry and the processing information in the deleted MQC configuration information.
[0215] By applying the solution provided by the embodiment of the present invention, when the MQC configuration information is deleted, it is determined whether there is a third MQC table entry, so as to prevent the switch from continuing to provide a special message processing service for the application corresponding to the application identifier included in the deleted MQC configuration information, and to prevent the switch from continuing to use a special action to process the message of the above application.
[0216] In one embodiment of the present invention, the receiving module 1301 is specifically used for:
[0217] Receiving a data stream to be processed through a driver of the switch;
[0218] The extraction module 1302 is specifically used for:
[0219] duplicating the message in the data stream to be processed by the driver to obtain a copy message, and sending the copy message to the CPU of the switch;
[0220] Extracting message features of messages in the data stream to be processed by the CPU;
[0221] The determining module 1303 is specifically used for:
[0222] Determining, by the CPU based on the message features, a target application for sending or receiving the data stream to be processed, and sending an application identifier of the target application and message features of the messages in the data stream to be processed to the driver;
[0223] The first generating module 1304 is specifically used for:
[0224] Generate a session table entry through the driver as a target session table entry;
[0225] The search module 1305 is specifically used for:
[0226] Searching, by the driver, for preset MQC configuration information containing the same application identifier as the target session entry;
[0227] The second generating module 1306 is specifically used for:
[0228] Generate and issue a first MQC table entry including the message feature in the target session table entry and the processing information in the found preset MQC configuration information through the driver;
[0229] The processing module 1307 is specifically used for:
[0230] The driver processes the data stream to be processed based on the issued MQC table entry.
[0231] By applying the solution provided by the embodiment of the present invention, the CPU and the driver in the switch can work together to complete the message processing process.
[0232] In one embodiment of the present invention, the extraction module 1302 is specifically used for:
[0233] Extract message features of a first preset number of messages in the data stream to be processed.
[0234] The solution provided by the embodiment of the present invention only extracts the message features of the first preset number of messages in the data flow to be processed, so that the message features can be obtained more quickly, data processing resources can be saved, and the switch itself is adapted to its own lower data processing capability.
[0235] Based on the same inventive concept, corresponding to the above-mentioned message processing method, the embodiment of the present invention further provides a switch, such as Fig.16 As shown, it is a schematic diagram of the structure of a switch provided by an embodiment of the present invention, including a processor 1601, a communication interface 1602, a memory 1603 and a communication bus 1604, wherein the processor 1601, the communication interface 1602, and the memory 1603 communicate with each other through the communication bus 1604.
[0236] Memory 1603, used for storing computer programs;
[0237] The processor 1601 is used to implement the following steps when executing the program stored in the memory 1603:
[0238] receiving a data stream to be processed;
[0239] Extracting message features of messages in the data stream to be processed;
[0240] Determine a target application for sending or receiving the data stream to be processed based on the message characteristics;
[0241] Generate a session table entry as a target session table entry, wherein the target session table entry records: a correspondence between an application identifier of the target application and the message feature;
[0242] Searching for preset modular quality of service command line interface MQC configuration information containing the same application identifier as the target session table entry, wherein the MQC configuration information records: a correspondence between an application identifier of an application and processing information of the application, the processing information comprising at least one of the following information: an identifier of an action for processing a message sent or received by the application, a message rate limit value for forwarding messages of the application, and a forwarding priority for forwarding messages of the application, and the action comprising: at least one of forwarding a message, discarding a message, and copying a message;
[0243] Generate and issue a first MQC table entry including the message feature in the target session table entry and the processing information in the found preset MQC configuration information;
[0244] The data flow to be processed is processed based on the delivered MQC table entry.
[0245] By applying the scheme provided by the embodiment of the present invention, after receiving the data stream to be processed, the switch extracts the message features of the messages therein, performs application identification according to the message features, obtains the application identifier of the target application that sends or receives the above-mentioned data stream to be processed, and confirms the target application. A session table item representing the correspondence between the message features and the application identifier is generated as the target session table item. The MQC configuration information containing the same application identifier as the target session table item is searched, that is, the MQC configuration information containing the application identifier of the target application is obtained, and the processing information for processing the message corresponding to the application identifier can be obtained, and the MQC table item is established according to the processing information and the message features, so that the data stream with the same message features of the messages in the data stream to be processed can be directly processed according to the MQC table item. Therefore, this scheme can correspond the message features with the processing information for processing the data stream to be processed sent or received by the application through the application identifiers of different applications, so that the switch can use different actions, different bandwidth guarantees, and different priorities to process the messages in the data stream to be processed sent or received by different applications. In addition, in the embodiment of the present invention, the process of identifying the target application, issuing the MQC table entry and processing the data flow can be completed locally on the switch, and this process does not require the aid of other devices and equipment, thereby saving resources.
[0246] Based on the same inventive concept, corresponding to the above-mentioned message processing method, an embodiment of the present invention also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned message processing methods are implemented.
[0247] By applying the scheme provided by the embodiment of the present invention, after receiving the data stream to be processed, the switch extracts the message features of the messages therein, performs application identification according to the message features, obtains the application identifier of the target application that sends or receives the above-mentioned data stream to be processed, and confirms the target application. A session table item representing the correspondence between the message features and the application identifier is generated as the target session table item. The MQC configuration information containing the same application identifier as the target session table item is searched, that is, the MQC configuration information containing the application identifier of the target application is obtained, and the processing information for processing the message corresponding to the application identifier can be obtained, and the MQC table item is established according to the processing information and the message features, so that the data stream with the same message features of the messages in the data stream to be processed can be directly processed according to the MQC table item. Therefore, this scheme can correspond the message features with the processing information for processing the data stream to be processed sent or received by the application through the application identifiers of different applications, so that the switch can use different actions, different bandwidth guarantees, and different priorities to process the messages in the data stream to be processed sent or received by different applications. In addition, in the embodiment of the present invention, the process of identifying the target application, issuing the MQC table entry and processing the data flow can be completed locally on the switch, and this process does not require the aid of other devices and equipment, thereby saving resources.
[0248] Based on the same inventive concept, corresponding to the above-mentioned message processing method, an embodiment of the present invention also provides a computer program product containing instructions, which, when running on a computer, enables the computer to execute the steps of any message processing method in the above-mentioned embodiments.
[0249] By applying the scheme provided by the embodiment of the present invention, after receiving the data stream to be processed, the switch extracts the message features of the messages therein, performs application identification according to the message features, obtains the application identifier of the target application that sends or receives the above-mentioned data stream to be processed, and confirms the target application. A session table item representing the correspondence between the message features and the application identifier is generated as the target session table item. The MQC configuration information containing the same application identifier as the target session table item is searched, that is, the MQC configuration information containing the application identifier of the target application is obtained, and the processing information for processing the message corresponding to the application identifier can be obtained, and the MQC table item is established according to the processing information and the message features, so that the data stream with the same message features of the messages in the data stream to be processed can be directly processed according to the MQC table item. Therefore, this scheme can correspond the message features with the processing information for processing the data stream to be processed sent or received by the application through the application identifiers of different applications, so that the switch can use different actions, different bandwidth guarantees, and different priorities to process the messages in the data stream to be processed sent or received by different applications. In addition, in the embodiment of the present invention, the process of identifying the target application, issuing the MQC table entry and processing the data flow can be completed locally on the switch, and this process does not require the aid of other devices and equipment, thereby saving resources.
[0250] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0251] The communication interface is used for communication between the above electronic device and other devices.
[0252] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0253] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims
1. A message processing method, characterized in that: Applied to a switch, the method comprises: receiving a data stream to be processed; Extracting message features of messages in the data stream to be processed; Determine a target application for sending or receiving the data stream to be processed based on the message characteristics; Generate a session table entry as a target session table entry, wherein the target session table entry records: a correspondence between an application identifier of the target application and the message feature; Searching for preset modular quality of service command line interface MQC configuration information containing the same application identifier as the target session table entry, wherein the MQC configuration information records: a correspondence between an application identifier of an application and processing information of the application, the processing information comprising at least one of the following information: an identifier of an action for processing a message sent or received by the application, a message rate limit value for forwarding messages of the application, and a forwarding priority for forwarding messages of the application, and the action comprising: at least one of forwarding a message, discarding a message, and copying a message; Generate and issue a first MQC table entry including the message feature in the target session table entry and the processing information in the found preset MQC configuration information; The data flow to be processed is processed based on the delivered MQC table entry.
2. The method according to claim 1, characterized in that After the session table entry is generated as the target session table entry, the method further includes: Counting aging information, wherein the aging information indicates: a situation in which the target application sends or receives a message; After the first MQC table entry including the message feature in the target session table entry and the processing information in the found preset MQC configuration information is generated and issued, the method further includes: If the aging information indicates that the duration for which the target application stops sending or receiving messages reaches a preset duration, the session entry and the first MQC entry are deleted.
3. The method according to claim 2, characterized in that In the case where the message sent or received by the target application is a Transmission Control Protocol TCP message, the aging information is: a synchronization sequence number of the TCP message most recently received by the switch, the synchronization sequence number including: an end FIN flag or a reset RST flag; and / or In the case where the message sent or received by the target application is a User Datagram Protocol (UDP) message, the aging information is a time interval of interruption of the switch in receiving the UDP message.
4. The method according to claim 1, characterized in that: The method further comprises: Get the newly added MQC configuration information; If there is a session table entry containing the same application identifier as the newly added MQC configuration information, a newly added MQC table entry is generated based on the newly added MQC configuration information, wherein the newly added MQC table entry contains: the message feature in the session table entry and the processing information in the newly added MQC configuration information; The second MQC table entry is replaced with the newly added MQC table entry, wherein the second MQC table entry is: an already issued MQC table entry that contains the same message feature as the newly added MQC table entry.
5. The method according to claim 1, characterized in that The method further comprises: Confirm the deleted MQC configuration information; If there is a session table entry containing the same application identifier as the deleted MQC configuration information, delete the third MQC table entry, wherein the third MQC table entry contains: the message feature in the session table entry and the processing information in the deleted MQC configuration information.
6. The method according to claim 1, characterized in that The receiving of the data stream to be processed comprises: Receiving a data stream to be processed through a driver of the switch; The extracting message features of the messages in the data stream to be processed includes: duplicating the message in the data stream to be processed by the driver to obtain a copy message, and sending the copy message to the CPU of the switch; Extracting message features of messages in the data stream to be processed by the CPU; The determining, based on the message feature, a target application for sending or receiving the data stream to be processed includes: Determining, by the CPU, a target application for sending or receiving the data stream to be processed based on the message features, and sending an application identifier of the target application and message features of the messages in the data stream to be processed to the driver; The generating of the session table entry as the target session table entry includes: Generate a session table entry through the driver as a target session table entry; The searching for preset modular quality of service command line interface MQC configuration information containing the same application identifier as the target session table entry includes: Searching, by the driver, for preset MQC configuration information containing the same application identifier as the target session entry; The generating and issuing a first MQC table entry including the message feature in the target session table entry and the processing information in the found preset MQC configuration information includes: Generate and issue a first MQC table entry including the message feature in the target session table entry and the processing information in the found preset MQC configuration information through the driver; The processing of the data flow to be processed based on the issued MQC table entry includes: The driver processes the data stream to be processed based on the issued MQC table entry.
7. The method according to any one of claims 1 to 5, characterized in that The extracting message features of the messages in the data stream to be processed includes: Extract message features of a first preset number of messages in the data stream to be processed.
8. A message processing device, characterized in that: Applied to a switch, the device comprises: A receiving module, used for receiving a data stream to be processed; An extraction module, used for extracting message features of messages in the data stream to be processed; A determination module, used to determine a target application for sending or receiving the data stream to be processed based on the message characteristics; A first generating module is used to generate a session table entry as a target session table entry, wherein the target session table entry records: a correspondence between an application identifier of the target application and the message feature; A search module, used to search for preset modular quality of service command line interface MQC configuration information containing the same application identifier as the target session table entry, wherein the MQC configuration information records: a correspondence between an application identifier of an application and processing information of the application, the processing information comprising at least one of the following information: an identifier of an action for processing a message sent or received by the application, a message rate limit value for forwarding messages of the application, and a forwarding priority for forwarding messages of the application, and the action comprises: at least one of forwarding a message, discarding a message, and copying a message; A second generating module is used to generate and issue a first MQC table entry including the message feature in the target session table entry and the processing information in the found preset MQC configuration information; The processing module is used to process the data flow to be processed based on the issued MQC table entry.
9. The device according to claim 8, characterized in that The first generating module is further used for: Counting aging information, wherein the aging information indicates: a situation in which the target application sends or receives a message; The second generating module is further used for: If the aging information indicates that the duration for which the target application stops sending or receiving messages reaches a preset duration, the session entry and the first MQC entry are deleted.
10. The device according to claim 9, characterized in that In the case where the message sent or received by the target application is a Transmission Control Protocol TCP message, the aging information is: a synchronization sequence number of the TCP message most recently received by the switch, the synchronization sequence number including: an end FIN flag or a reset RST flag; and / or In the case where the message sent or received by the target application is a User Datagram Protocol (UDP) message, the aging information is a time interval of interruption of the switch in receiving the UDP message.
11. The device according to claim 8, characterized in that The device also includes: The first obtaining module is used to obtain the newly added MQC configuration information; a third generating module, configured to generate a new MQC table entry based on the newly added MQC configuration information if there is a session table entry containing the same application identifier as the newly added MQC configuration information, wherein the newly added MQC table entry contains: a message feature in the session table entry and processing information in the newly added MQC configuration information; The replacement module is configured to replace the second MQC table entry with the newly added MQC table entry, wherein the second MQC table entry is: an already issued MQC table entry that contains the same message feature as the newly added MQC table entry.
12. The device according to claim 8, characterized in that The device also includes: A second obtaining module is used to determine the deleted MQC configuration information; The deleting module is configured to delete a third MQC table entry if there is a session table entry containing the same application identifier as the deleted MQC configuration information, wherein the third MQC table entry contains: the message feature in the session table entry and the processing information in the deleted MQC configuration information.
13. The device according to claim 8, characterized in that The receiving module is specifically used for: Receiving a data stream to be processed through a driver of the switch; The extraction module is specifically used for: duplicating the message in the data stream to be processed by the driver to obtain a copy message, and sending the copy message to the CPU of the switch; Extracting message features of messages in the data stream to be processed by the CPU; The determination module is specifically used for: Determining, by the CPU, a target application for sending or receiving the data stream to be processed based on the message features, and sending an application identifier of the target application and message features of the messages in the data stream to be processed to the driver; The first generating module is specifically used for: Generate a session table entry through the driver as a target session table entry; The search module is specifically used for: Searching, by the driver, for preset MQC configuration information containing the same application identifier as the target session entry; The second generating module is specifically used for: Generate and issue a first MQC table entry including the message feature in the target session table entry and the processing information in the found preset MQC configuration information through the driver; The processing module is specifically used for: The driver processes the data stream to be processed based on the issued MQC table entry.
14. The device according to any one of claims 8 to 12, characterized in that The extraction module is specifically used for: Extract message features of a first preset number of messages in the data stream to be processed.
Citation Information
Patent Citations
Message processing method, message processing device and electronic equipment
CN108063718A
Load balance-based message forwarding method and device, storage medium and equipment
CN108667730A
