Message processing method and device, equipment and storage medium
By comparing the hash values of data packets, the transmission direction, delay time and discard factor are determined, which solves the problem of low efficiency of OVS packet processing, realizes efficient correlation analysis and delay analysis of multi-interface data packets, and improves the performance of OVS. Monitoring and processing efficiency.
Patent Information
- Application Number
- CN202311350177.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-18
- Publication Date
- 2024-10-18
AI Technical Summary
The existing OVS packet processing method is inefficient in correlation analysis and comparison of data packets on multiple interfaces, resulting in low data packet processing efficiency and lack of delay analysis and packet loss analysis capabilities.
By comparing the hash values of received data packets, the transmission direction, delay time and discard factor are determined, and data packets carrying this information are sent to the target end to achieve integrated processing of data packets and improve the processing of data packets. efficiency.
It improves the monitoring efficiency and processing efficiency of OVS messages, realizes the correlation analysis and comparison of multi-interface data messages, and enhances the delay and packet loss analysis capabilities.
Smart Images

Figure CN118802414A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a message processing method, device, equipment and storage medium. Background Art
[0002] VXLAN (Virtual eXtensible Local Area Network) is an overlay technology that builds a virtual Layer 2 network through a three-layer network. VTEP (VXLAN Tunnel Endpoints) is an edge device of the VXLAN network, which is used to process VXLAN messages. Currently, OVS (Open vSwitch, open source distributed virtual multilayer switch) is used as a VTEP endpoint on the virtualization host of the data center. Most of the existing OVS message processing methods analyze the data messages of a single interface, lacking data correlation analysis and comparison of multiple interfaces, resulting in low data message processing efficiency. Summary of the invention
[0003] Embodiments of the present application provide a message processing method, apparatus, device and storage medium to solve the problem of low efficiency in data message processing.
[0004] In a first aspect, an embodiment of the present application provides a message processing method, including:
[0005] Receive a first data message, and determine a first hash value of the first data message;
[0006] If the first hash value is the same as the second hash value of the historical data message, determining the transmission direction, delay time, and discard factor of the first data message;
[0007] A second data packet is sent to the target end, where the second data packet carries the transmission direction, the delay time, and the discard factor.
[0008] In one embodiment, determining the transmission direction of the first data message includes:
[0009] If the first data message carries virtual extended LAN information and the target data message does not carry virtual extended LAN information, determining that the transmission direction is an unsealing direction; the target data message is a historical data message corresponding to a second hash value that is the same as the first hash value;
[0010] If the first data message does not carry the virtual extended local area network information, and the target data message carries the virtual extended local area network information, determining that the transmission direction is the encapsulation direction;
[0011] If neither the first data message nor the target data message carries virtual extended local area network information, it is determined that the transmission direction is an internal access direction.
[0012] In one embodiment, determining the delay time of the first data message includes:
[0013] Obtaining a first receiving timestamp of the first data message and a second receiving timestamp of the target data message;
[0014] The difference between the first receiving timestamp and the second receiving timestamp is used as the delay time.
[0015] In one embodiment, determining the discard factor of the first data message includes:
[0016] If the first Hash value is the same as the second Hash value of the historical data message, the discard factor is determined to be a first set value; the first set value indicates that the first data message is not discarded.
[0017] In one embodiment, after receiving the first data message and determining the first hash value of the first data message, the method further includes:
[0018] If the first hash value is different from the second hash value, storing the first data message in a message library, and obtaining a storage duration of the first data message;
[0019] If the storage duration is greater than the set duration, the discard factor of the first data message is determined to be a second set value; the second set value indicates discarding the first data message.
[0020] In one embodiment, before sending the second data message to the target end, the method further includes:
[0021] If the first data message carries virtual extended local area network information, or the target data message carries virtual extended local area network information, the virtual extended local area network information is supplemented at the end of the second data message.
[0022] In one embodiment, after determining that the first Hash value is the same as the second Hash value of the historical data message, the method further includes:
[0023] Delete the second hash value corresponding to the target data message in the hash table.
[0024] In a second aspect, an embodiment of the present application provides a message processing device, including:
[0025] A receiving module, configured to receive a first data message and determine a first hash value of the first data message;
[0026] a determination module, configured to determine a transmission direction, a delay time, and a discard factor of the first data message if the first hash value is the same as a second hash value of the historical data message;
[0027] The sending module is used to send a second data message to the target end, wherein the second data message carries the transmission direction, the delay time and the discard factor.
[0028] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor and a memory storing a computer program, wherein the processor implements the steps of the message processing method described in the first aspect when executing the program.
[0029] In a fourth aspect, an embodiment of the present application provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the message processing method described in the first aspect are implemented.
[0030] The message processing method, apparatus, device and storage medium provided in the embodiment of the present application receive a first data message and determine the first hash value of the first data message; if the first hash value is the same as the second hash value of the historical data message, determine the transmission direction, delay time and discard factor of the first data message; send a second data message to the target end, and the second data message carries the transmission direction, delay time and discard factor. The present application performs hash processing on the original message and performs integrated data message processing based on hash comparison to add the transmission direction, delay time and discard factor to the data message, thereby improving the processing efficiency of the data message. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the technical solutions in the present application or the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0032] Figure 1 It is a flowchart of a message processing method provided in an embodiment of the present application;
[0033] Figure 2 This is a schematic diagram of the VXLAN network topology provided in an embodiment of the present application;
[0034] Figure 3 is a schematic diagram of the second data message structure provided in an embodiment of the present application;
[0035] Figure 4 It is a structural diagram of a message processing device provided in an embodiment of the present application;
[0036] Figure 5 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0037] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0038] Figure 1 Schematic diagram of the message processing method provided in the embodiment of the present application. Figure 1 , the present application embodiment provides a message processing method, which may include:
[0039] S100, receiving a first data message, and determining a first hash value of the first data message;
[0040] It should be noted that the embodiment of the present application specifically provides an OVS message processing method in a VXLAN environment. Figure 2 As shown in the figure, VM is a virtual machine, Hypervisor is a virtualization manager, VNID is the identifier of each VXLAN segment, and VTEP is the edge device of the VXLAN network, which can be a physical device or a virtual device. Among them, the OVS device can be used as a VTEP endpoint, supporting both north-south interconnection, and using VXLAN encapsulation technology to communicate between virtual machines across the physical network in the south, and using original messages to interconnect with the external network in the north. In the southbound direction, OVS encapsulates the virtual machine data traffic into VXLAN messages through VXLAN encapsulation, and adds VNI to the VXLAN message header for identification, thereby creating a virtual isolated network on the underlying network and realizing communication between virtual machines. In the northbound direction, OVS can directly send the original data frame to the physical network and interconnect with the external network. OVS will match and forward the flow table according to the configuration rules of the switch, so that the virtual machine can communicate with the external network.
[0041] The embodiment of the present application uses an OVS device (such as an OVS switch) as a VTEP edge device and uses the OVS device as the execution subject. The external network can access the virtual machine through the OVS device, and the virtual machine can also access the external network through the OVS device. At the same time, the virtual machines also communicate through the OVS device.
[0042] Due to the large amount of access to network data and the short interval between data packets, such as the interval at the nanosecond or microsecond level, based on this, the embodiment of the present application performs HASH processing on the original packet and performs HASH comparison to implement delayed analysis and processing of the data packet. Specifically, the OVS device receives a first data packet sent from a virtual machine or an external network, and then performs HASH processing on the first data packet, mapping it to a hash value of a fixed length (i.e., the first hash value), for example, using a hash function such as MD5, SHA-1, or SHA-256 to map the first data packet to a hash value of a fixed length.
[0043] S200, if the first hash value is the same as the second hash value of the historical data message, determining the transmission direction, delay time and discard factor of the first data message;
[0044] It should be noted that the memory of the OVS device includes a hash table for storing the second hash value of the historical data message, which refers to the data message received in the previous period of time (such as within the previous 1-2 seconds). By using the hash table to store the second hash value of the historical data message, the message hash value can be quickly compared, reducing the time for parsing and processing the message content, thereby improving the efficiency of message processing.
[0045] When a new first data message arrives, its first hash value is calculated, and then the first hash value is compared with the second hash value stored in the hash table. If there is a second hash value that matches the first hash value, that is, the match is successful, indicating that the new first data message is a duplicate message. At this time, it is necessary to determine the transmission direction, delay time, and discard factor of the first data message. Among them, the transmission direction is determined according to the source and destination of the data message. The transmission direction can be divided into the decapsulation direction, encapsulation direction, and internal access direction. The description of each transmission direction is as follows:
[0046] Decapsulation direction: When a data packet enters the VXLAN interface and is decapsulated, the original packet is used to access the VM. This direction is set to the decapsulation direction.
[0047] Encapsulation direction: When a data packet enters the VM interface and is encapsulated, and then the encapsulated packet is used for VXLAN access, it is set to the encapsulation direction.
[0048] Internal access: When data packets enter from the virtual machine interface and direct communication is performed between virtual machines, original packets are used for internal access with other virtual machines.
[0049] Delay time: The time it takes for a data packet to enter from one interface and be sent from another interface through OVS is called OVS delay time. This delay time includes the time consumed by packet processing, forwarding, and other operations on OVS.
[0050] Discard factor: When a data packet enters from one interface but is not sent out from another interface, OVS discards the data. The reasons for data discard include OVS configuration errors, buffer overflow, network congestion, etc.
[0051] S300, sending a second data message to the target end.
[0052] The embodiment of the present application adopts a data message integration method to add the transmission direction, delay time and discard factor to the message. Specifically, OVS sends a second data message carrying the transmission direction, delay time and discard factor to the target end (such as a virtual machine or an external network). For example, refer to Figure 3 , reassemble the data message, uniformly use the key original message information, add the transmission direction, delay time and discard factor, and if it contains VXLAN encapsulation information, place the original VXLAN encapsulation information at the end of the message. Among them, the original message information includes source IP message information (IP header), source TCP / UDP message information (transport layer header), source application layer message information (application layer data) and other information; VXLAN encapsulation information includes VNI number, VXLAN header information, original encapsulated data message information and other information. After the data message is integrated, the data that is exactly the same as the original message is integrated, and the original two data in and out information are merged into one data message information after processing.
[0053] For example, assuming that the hash values of the first data message A and the historical data message B are the same, it means that the original messages of the two are the same. The first data message A and the historical data message B are processed in an integrated manner, that is, the two messages are merged into a second data message carrying the transmission direction, delay time and discard factor. Based on this, the interception analysis from the perspective of the device becomes a point analysis. After the original message passes through OVS, the OVS message carrying the transmission direction, delay time and discard factor is output.
[0054] The existing OVS message monitoring uses the method of data message interception and analysis, which has the following problems: low efficiency of data message correlation comparison, too large number of data messages, resulting in difficulty in packet loss analysis and lack of delay analysis, which leads to low efficiency of OVS message monitoring. However, the embodiment of the present application uses HASH message comparison to monitor message transmission direction, message delay, and message discard, thereby improving the monitoring efficiency and processing efficiency of OVS messages.
[0055] The message processing method provided in the embodiment of the present application receives a first data message and determines the first hash value of the first data message; if the first hash value is the same as the second hash value of the historical data message, the transmission direction, delay time and discard factor of the first data message are determined; and a second data message is sent to the target end, and the second data message carries the transmission direction, delay time and discard factor. The present application performs hash processing on the original message and performs integrated data message processing based on hash comparison to add the transmission direction, delay time and discard factor to the data message, thereby improving the processing efficiency of the data message.
[0056] Based on the above embodiment, determining the transmission direction of the first data message includes:
[0057] S210, if the first data message does not carry virtual extended LAN information, and the target data message carries virtual extended LAN information, determining that the transmission direction is an unsealing direction; the target data message is a historical data message corresponding to a second hash value that is the same as the first hash value;
[0058] S220, if the first data message carries virtual extended LAN information, and the target data message does not carry virtual extended LAN information, determining that the transmission direction is an encapsulation direction;
[0059] S230: If neither the first data message nor the target data message carries virtual extended local area network information, determining that the transmission direction is an internal access direction.
[0060] After hash comparison, if there is a second hash value that is the same as the first hash value, the historical data message corresponding to the second hash value is used as the target data message, and the data message is assembled based on the first data message and the target data message. Before assembling the data message, the transmission direction, delay time and delay factor need to be determined.
[0061] (1) The transmission direction is determined as follows:
[0062] It should be noted that the traditional data message interception and analysis method uses a single interface to independently form a data flow analysis. When only one interface is intercepted and analyzed, the source address, destination address, source port, destination port, timestamp and other information are used for comparison. The same source address, destination address, source port and destination port represent the same data flow. When multiple interfaces are intercepted and analyzed, the identification of the IP layer is used as the only value for confirmation, and the source address, destination address and identification value of the IP layer are used as confirmation of the same data message. When the VXLAN message and the original message are intercepted and analyzed at the same time, the source address, destination address and identification value of the IP layer in the encapsulated original message are used as confirmation of the same data message. Based on this, there are various different situations in the data message comparison. The current data message analysis is based on the data message of a single interface for analysis, lacking the data association analysis and comparison of multiple interfaces. When the association analysis and comparison are required, a large amount of data is required for selection and matching, resulting in low processing efficiency. Based on this, the embodiment of the present application implements the data association analysis and comparison of multiple interfaces based on the transmission direction, thereby improving the processing efficiency of the data message.
[0063] Specifically, if the first data packet does not carry virtual extended LAN information, and the target data packet carries virtual extended LAN information, the transmission direction is determined to be the unpacking direction; the target data packet is the historical data packet corresponding to the second hash value that is the same as the first hash value; if the first data packet carries virtual extended LAN information, and the target data packet does not carry virtual extended LAN information, the transmission direction is determined to be the encapsulation direction; if neither the first data packet nor the target data packet carries virtual extended LAN information, the transmission direction is determined to be the internal access direction.
[0064] (2) The delay time is determined as follows:
[0065] At present, there is a lack of correlation analysis and comparison methods for multiple interface interception analysis, and there is no OVS delay analysis method. The delay of data messages is manually compared, resulting in low processing efficiency. Based on this, the embodiment of the present application processes the message by determining the delay time of the message. Specifically, the first reception timestamp of the first data message and the second reception timestamp of the target data message are obtained, and the difference between the first reception timestamp and the second reception timestamp is used as the delay time, that is, the delay time = the first reception timestamp - the second reception timestamp.
[0066] (3) The delay factor is determined as follows:
[0067] Due to the large amount of network access data, among a large number of data packets, if data packet loss occurs on OVS, due to the difficulty of association, it is necessary to use the elimination method in a similar time period to compare the data one by one, resulting in low data packet processing efficiency. Based on this, the embodiment of the present application can determine whether a packet is lost by determining a delay factor to improve the data packet processing efficiency. Specifically, if the first hash value is the same as the second hash value of the historical data packet, the discard factor is determined to be a first set value (such as 0), wherein the first set value indicates that the first data packet is not discarded.
[0068] Furthermore, if the first data message carries virtual extended LAN information, or the target data message carries virtual extended LAN information, the virtual extended LAN information is added to the end of the second data message; if neither the first data message nor the target data message carries virtual extended LAN information, the virtual extended LAN information in the second data message is cleared.
[0069] For example, assemble a datagram based on the following assembly method:
[0070] 1) The old message HASH (i.e., the second hash value) contains VXLAN information, but the new message HASH (i.e., the first hash value) does not contain VXLAN information.
[0071] In this case, it means that the data packet enters from the VXLAN interface, and the external network accesses the virtual machine through the OVS device. Therefore, the transmission direction is set to the decapsulation direction, the delay time is equal to the new timestamp minus the old timestamp, and the discard factor is set to 0 (indicating that the packet is not discarded). At the same time, VXLAN information is added to the end of the data packet.
[0072] 2) The old message HASH does not contain VXLAN information, but the new message HASH does.
[0073] In this case, the data packet enters from the virtual machine interface, and the virtual machine accesses the external network through the OVS device. Therefore, the transmission direction is set to encapsulation, the delay time is equal to the new timestamp minus the old timestamp, the discard factor is set to 0, and the VXLAN information is added to the end of the data packet.
[0074] 3) The old message HASH does not contain VXLAN information, and the new message HASH does not contain VXLAN information.
[0075] In this case, the data packet enters from the virtual machine interface, and the virtual machines communicate with each other through the OVS device. Therefore, the transmission direction is set to the internal access direction, the delay time is equal to the new timestamp minus the old timestamp, the discard factor is set to 0, and the data packet VXLAN information is set to blank.
[0076] The embodiment of the present application assembles messages by transmission direction, delay time and delay factor, solves the problems of OVS data message association analysis, OVS delay analysis and OVS packet loss analysis in a VXLAN environment, and improves the monitoring efficiency and processing efficiency of OVS.
[0077] Based on the above embodiment, after receiving the first data message and determining the first hash value of the first data message, the method further includes:
[0078] S110: If the first hash value is different from the second hash value, the first data message is stored in a message library, and a storage time of the first data message is obtained;
[0079] S120: If the storage duration is greater than the set duration, determine that the discard factor of the first data message is a second set value; the second set value indicates discarding the first data message.
[0080] When a new first data message is received, the first hash value of the first data message is matched with the second hash value. If the match is successful, the second hash value corresponding to the target data message in the hash table is deleted. If the match is unsuccessful, that is, the first hash value is different from the second hash value, the first data message is stored in the message library, and the storage time of the first data message is obtained. If the storage time is greater than the set time, the discard factor of the first data message is determined to be the second set value (such as 1), that is, the first data message is discarded.
[0081] For example, if the match is unsuccessful, the message HASH is added to the HASH list and associated with a timer, and the time interval of the timer is set to 1 second. When the timer is triggered, it means that the message has not been processed in time, the message is discarded, and the HASH of the message is deleted from the HASH list and the discard factor is set to 1.
[0082] By regularly cleaning up expired hash values, memory space can be freed up to prevent hash table overflow. The cleaning strategy can be adjusted according to actual conditions, such as limiting by time, number of messages, and other dimensions.
[0083] Optionally, updating the hash table based on message quantity limit includes: setting an upper limit on the number of messages, and when the number of messages in the hash table exceeds the upper limit, triggering a cleanup operation, such as deleting a certain number of oldest hash values according to first-in-first-out to keep the hash table size within a controllable range.
[0084] Optionally, the hash table may be updated in combination with a time limit and a message quantity limit, for example, cleanup may be performed at regular time intervals, but at the same time, it is also necessary to ensure that the number of messages in the hash table is within a controllable range.
[0085] The embodiment of the present application can reduce redundant data in the hash table by regularly updating the hash table. At the same time, expired hash values stored in the hash table occupy the memory resources of OVS. By regularly clearing expired hash values, the memory space occupied by expired messages can be released, reducing the risk of memory leakage or memory overflow, thereby improving the stability and reliability of OVS. On the other hand, regularly updating the hash table can improve the processing efficiency of data messages.
[0086] The message processing device provided in an embodiment of the present application is described below. The message processing device described below and the message processing method described above can be referenced to each other.
[0087] refer to Figure 4 , Figure 4 It is a structural diagram of a message processing device provided in an embodiment of the present application. The message processing device provided in an embodiment of the present application includes a receiving module 401, a determining module 402 and a sending module 403.
[0088] The receiving module 401 is used to receive a first data message and determine a first hash value of the first data message;
[0089] A determination module 402, configured to determine a transmission direction, a delay time, and a discard factor of the first data message if the first hash value is the same as a second hash value of the historical data message;
[0090] The sending module 403 is used to send a second data message to the target end, where the second data message carries the transmission direction, the delay time and the discard factor.
[0091] The message processing device provided in the embodiment of the present application receives a first data message and determines the first hash value of the first data message; if the first hash value is the same as the second hash value of the historical data message, the transmission direction, delay time and discard factor of the first data message are determined; and a second data message is sent to the target end, and the second data message carries the transmission direction, delay time and discard factor. The present application performs hash processing on the original message and performs integrated data message processing based on hash comparison to add the transmission direction, delay time and discard factor to the data message, thereby improving the processing efficiency of the data message.
[0092] In one embodiment, the determination module 402 is specifically configured to:
[0093] If the first data message carries virtual extended LAN information and the target data message does not carry virtual extended LAN information, determining that the transmission direction is an unsealing direction; the target data message is a historical data message corresponding to a second hash value that is the same as the first hash value;
[0094] If the first data message does not carry the virtual extended local area network information, and the target data message carries the virtual extended local area network information, determining that the transmission direction is the encapsulation direction;
[0095] If neither the first data message nor the target data message carries virtual extended local area network information, it is determined that the transmission direction is an internal access direction.
[0096] In one embodiment, the determination module 402 is specifically configured to:
[0097] Obtaining a first receiving timestamp of the first data message and a second receiving timestamp of the target data message;
[0098] The difference between the first receiving timestamp and the second receiving timestamp is used as the delay time.
[0099] In one embodiment, the determination module 402 is specifically configured to:
[0100] If the first Hash value is the same as the second Hash value of the historical data message, the discard factor is determined to be a first set value; the first set value indicates that the first data message is not discarded.
[0101] In one embodiment, the receiving module 401 is further configured to:
[0102] If the first hash value is different from the second hash value, storing the first data message in a message library, and obtaining a storage duration of the first data message;
[0103] If the storage duration is greater than the set duration, the discard factor of the first data message is determined to be a second set value; the second set value indicates discarding the first data message.
[0104] In one embodiment, the sending module 403 is further configured to:
[0105] If the first data message carries virtual extended local area network information, or the target data message carries virtual extended local area network information, the virtual extended local area network information is supplemented at the end of the second data message.
[0106] In one embodiment, the determination module 402 is further configured to:
[0107] Delete the second hash value corresponding to the target data message in the hash table.
[0108] Figure 5 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 5As shown, the electronic device may include: a processor 510, a communication interface 520, a memory 530 and a communication bus 540, wherein the processor 510, the communication interface 520, and the memory 530 communicate with each other through the communication bus 540. The processor 510 may call a computer program in the memory 530 to execute the steps of the message processing method, for example, including:
[0109] Receive a first data message, and determine a first hash value of the first data message;
[0110] If the first hash value is the same as the second hash value of the historical data message, determining the transmission direction, delay time, and discard factor of the first data message;
[0111] A second data packet is sent to the target end, where the second data packet carries the transmission direction, the delay time, and the discard factor.
[0112] In addition, the logic instructions in the above-mentioned memory 530 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art, and the computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0113] On the other hand, an embodiment of the present application further provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the message processing method provided in the above embodiments are implemented, for example, including:
[0114] Receive a first data message, and determine a first hash value of the first data message;
[0115] If the first hash value is the same as the second hash value of the historical data message, determining the transmission direction, delay time, and discard factor of the first data message;
[0116] A second data packet is sent to the target end, where the second data packet carries the transmission direction, the delay time, and the discard factor.
[0117] On the other hand, an embodiment of the present application further provides a computer program product, the computer program product including a computer program, the computer program may be stored on a non-transitory computer-readable storage medium, and when the computer program is executed by a processor, the computer can perform the steps of the message processing method provided in the above embodiments, for example, including:
[0118] Receive a first data message, and determine a first hash value of the first data message;
[0119] If the first hash value is the same as the second hash value of the historical data message, determining the transmission direction, delay time, and discard factor of the first data message;
[0120] A second data packet is sent to the target end, where the second data packet carries the transmission direction, the delay time, and the discard factor.
[0121] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative effort.
[0122] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0123] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A message processing method, characterized in that: include: Receive a first data message, and determine a first hash value of the first data message; If the first hash value is the same as the second hash value of the historical data message, determining the transmission direction, delay time, and discard factor of the first data message; A second data packet is sent to the target end, where the second data packet carries the transmission direction, the delay time, and the discard factor.
2. The message processing method according to claim 1, characterized in that: Determining a transmission direction of the first data message includes: If the first data message carries virtual extended LAN information and the target data message does not carry virtual extended LAN information, determining that the transmission direction is an unsealing direction; the target data message is a historical data message corresponding to a second hash value that is the same as the first hash value; If the first data message does not carry the virtual extended local area network information, and the target data message carries the virtual extended local area network information, determining that the transmission direction is the encapsulation direction; If neither the first data message nor the target data message carries virtual extended local area network information, it is determined that the transmission direction is an internal access direction.
3. The message processing method according to claim 2, characterized in that: Determining a delay time of the first data message includes: Obtaining a first receiving timestamp of the first data message and a second receiving timestamp of the target data message; The difference between the first receiving timestamp and the second receiving timestamp is used as the delay time.
4. The message processing method according to claim 1, characterized in that: Determining a discard factor of the first data message includes: If the first Hash value is the same as the second Hash value of the historical data message, the discard factor is determined to be a first set value; the first set value indicates that the first data message is not discarded.
5. The message processing method according to claim 1, characterized in that: After receiving the first data message and determining the first hash value of the first data message, the method further includes: If the first hash value is different from the second hash value, storing the first data message in a message library, and obtaining a storage duration of the first data message; If the storage duration is greater than the set duration, the discard factor of the first data message is determined to be a second set value; the second set value indicates discarding the first data message.
6. The message processing method according to claim 2, characterized in that: Before sending the second data message to the target end, the method further includes: If the first data message carries virtual extended local area network information, or the target data message carries virtual extended local area network information, the virtual extended local area network information is added to the end of the second data message.
7. The message processing method according to claim 2, characterized in that: After determining that the first Hash value is the same as the second Hash value of the historical data message, the method further includes: Delete the second hash value corresponding to the target data message in the hash table.
8. A message processing device, characterized in that: include: A receiving module, configured to receive a first data message and determine a first hash value of the first data message; a determination module, configured to determine a transmission direction, a delay time, and a discard factor of the first data message if the first hash value is the same as a second hash value of the historical data message; The sending module is used to send a second data message to the target end, wherein the second data message carries the transmission direction, the delay time and the discard factor.
9. An electronic device comprising a processor and a memory storing a computer program, characterized in that: When the processor executes the computer program, the steps of the message processing method according to any one of claims 1 to 7 are implemented.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the message processing method according to any one of claims 1 to 7 are implemented.
