Message processing method and electronic equipment

By obtaining the 5-tuple information and labels of the message in the virtual private cloud, it ensures that the message contains the corresponding label during transmission, solving the problem of virtual switch session table query delay and achieving efficient message forwarding and security. sex.

CN115065735BActive Publication Date: 2024-08-30ALIBABA (CHINA) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210220453.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-08
Publication Date
2024-08-30
Estimated Expiration
2042-03-08

AI Technical Summary

Technical Problem

With the development of virtualization technology, the number of users in the virtual private cloud has increased, and the session table data of the virtual switch is large, resulting in prolonged query time and affecting the user experience.

Method used

By obtaining the five-tuple information and labels of the message, it ensures that the message contains the corresponding label during transmission. The switch forwards the message based on secret key matching, avoiding queries based on the session table, and reducing memory load and delay.

Benefits of technology

It reduces packet forwarding delay, improves user experience, and ensures packet security and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115065735B
    Figure CN115065735B
Patent Text Reader

Abstract

The disclosed embodiment discloses a message processing method and an electronic device, the method is applied to a first switch, the method includes: obtaining a first message, parsing the first message to obtain a first five-tuple information; in response to the first message including a first message tag, sending the first message, the first message tag is obtained according to a first key corresponding to the first switch and the first five-tuple information; receiving a second message, parsing the second message to obtain a second five-tuple information and a second message tag in the second message, and obtaining a second key according to the second message tag and the second five-tuple information; in response to the second key matching the first key, forwarding the second message. This solution can reduce the memory load and the delay of forwarding messages under the premise of ensuring that the message forwarded by the first switch belongs to the session established through the first switch, thereby improving the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of network technology, and in particular to a message processing method and an electronic device. Background Art

[0002] With the continuous development of computer technology, Virtual Private Cloud (VPC) technology has gradually been applied to network deployment in recent years. VPC is a private cloud platform based on virtualization technology, which can combine a series of virtual resources such as network, security, storage, and computing for users to use on demand, providing safe and convenient IT service applications. Among them, VPC service providers can provide each user with a customized network. In this customized network, users need to be provided with various entities in the network, such as virtual switches.

[0003] Among them, due to the need for network security, the virtual switch can update its own session table according to the established session when working, wherein the session table can be used to save the five-tuple information of the corresponding message, and the corresponding message can be understood as the message belonging to the session established through the virtual switch. When the virtual switch receives a message, it can query the session table according to the five-tuple information of the received message to determine whether the received message belongs to the session established through the virtual switch. If confirmed, the message can be forwarded.

[0004] However, with the continuous development of virtualization technology, more and more users are migrating to virtual private clouds. When the number of users of virtual private clouds reaches a considerable scale, the amount of data in the session table of the virtual switch will also become very large. When the virtual switch performs data query in the session table, the load of the memory storage session table will increase sharply, making the query speed lower and increasing the delay when forwarding messages, thereby damaging the user's product experience. Summary of the invention

[0005] In order to solve the problems in the related art, the embodiments of the present disclosure provide a message processing method and an electronic device.

[0006] In a first aspect, an embodiment of the present disclosure provides a message processing method, wherein the method is applied to a first switch, and the method includes:

[0007] Obtain a first message, and parse the first message to obtain first five-tuple information;

[0008] In response to the first message including a first message tag, sending the first message, where the first message tag is obtained according to a first secret key corresponding to the first switch and first five-tuple information;

[0009] receiving a second message, parsing the second message to obtain second quintuple information and a second message tag in the second message, and obtaining a second key according to the second message tag and the second quintuple information;

[0010] In response to the second key matching the first key, forwarding the second message.

[0011] In one implementation of the present disclosure, in response to the first message including the first message label, sending the first message includes:

[0012] In response to the first five-tuple information matching the first access control list and the first message including the first message label, the first message is sent.

[0013] In an implementation of the present disclosure, in response to the first message including the first message label, before sending the first message, the method further includes:

[0014] Checking whether the first message includes the first message label to obtain a first checking result;

[0015] In response to the first message including the first message label, sending the first message includes:

[0016] In response to determining, according to the first checking result, that the first message includes the first message label, the first message is sent.

[0017] In an implementation of the present disclosure, before receiving the second message, the method further includes:

[0018] In response to determining, according to the first check result, that the first message does not include the first message label, inserting the first message label into the first message, and sending the first message after the first message label is inserted.

[0019] In one implementation of the present disclosure, obtaining a first message includes:

[0020] Receive the first message sent by the first session end:

[0021] The method also includes:

[0022] Sending first message identifier update information, where the first message identifier update information is used to indicate the first quintuple information and the corresponding relationship between the first switch and the first message label.

[0023] In a second aspect, the present disclosure provides a message processing method, wherein the method is applied to a first session end, and the method includes:

[0024] In response to the target session between the first session end and the second session end being established, obtaining first five-tuple information of a first to-be-sent message belonging to the target session, and determining a first switch for connecting the first session end to the network;

[0025] Acquire a first message label corresponding to the first five-tuple information and the first switch, and insert the first message label into the first message to be sent to acquire the first message;

[0026] Send the first message.

[0027] In an implementation of the present disclosure, before acquiring the first message label corresponding to the first quintuple information and the first switch, the method further includes:

[0028] receiving first message identifier update information sent by the first switch, and updating the first message identifier database according to the first message identifier update information, where the first message identifier update information is used to indicate the first five-tuple information and the corresponding relationship between the first switch and the first message label;

[0029] Acquiring a first message label corresponding to the first five-tuple information and the first switch includes:

[0030] A query is performed in the first message identification database according to the first quintuple information and the identifier corresponding to the first switch to obtain the first message label.

[0031] In an implementation of the present disclosure, obtaining a first message label corresponding to the first quintuple information and the first switch includes:

[0032] receiving a second message forwarded by the first switch, and parsing the second message to obtain second quintuple information of the second message;

[0033] In response to source information of the second quintuple information matching destination information of the first quintuple information, and destination information of the second quintuple information matching source information of the first quintuple information, a second message label in the second message is determined as the first message label.

[0034] In a third aspect, the implementation of the present disclosure provides a message processing method, wherein the method is applied to a second switch, and the method includes:

[0035] Receiving a first message, and parsing the first message to obtain first five-tuple information and a first message label in the first message;

[0036] Obtain a first secret key according to the first quintuple information and the first message label;

[0037] Obtain a second message, and parse the second message to obtain second quintuple information of the second message;

[0038] In response to the destination information in the second quintuple information matching the source information in the first quintuple information, and the second message including a second message label, the second message is sent, and the second message label is obtained based on the first secret key and the second quintuple information.

[0039] In one implementation of the present disclosure, in response to the destination information in the second quintuple information matching the source information in the first quintuple information, and the second message including the second message label, sending the second message includes:

[0040] In response to the second 5-tuple information matching the second access control list, the destination information in the second 5-tuple information matching the source information in the first 5-tuple information, and the second message including the second message label, sending the second message.

[0041] In one implementation of the present disclosure, in response to the destination information in the second quintuple information matching the source information in the first quintuple information, and the second message including the second message label, before sending the second message, the method further includes:

[0042] Checking whether the second message includes the second message label to obtain a second check result;

[0043] In response to the destination information in the second quintuple information matching the source information in the first quintuple information, and the second message including the second message label, sending the second message includes:

[0044] In response to the destination information in the second quintuple information matching the source information in the first quintuple information, and determining based on the second check result that the second message includes the second message label, the second message is sent.

[0045] In one implementation of the present disclosure, the method further includes:

[0046] In response to the destination information in the second quintuple information matching the source information in the first quintuple information, and determining based on the second check result that the second message does not include a second message label, inserting the second message label into the second message, and sending the second message after the second message label is inserted.

[0047] In one implementation of the present disclosure, obtaining the second message includes:

[0048] Receive the second message sent by the second session end:

[0049] The method also includes:

[0050] Sending second message identification update information, where the second message identification update information is used to indicate the second quintuple information and the corresponding relationship between the first switch and the second message label.

[0051] In a fourth aspect, the present disclosure provides a message processing method, wherein the method is applied to a second session end, and the method includes:

[0052] In response to a target session between the first session end and the second session end being established, obtaining a first message sent by the first session end;

[0053] Determine a first switch for connecting the first session end to the network, and obtain second five-tuple information of a second to-be-sent message belonging to the target session;

[0054] Acquire a second message label corresponding to the second quintuple information and the first switch, and insert the second message label into the second message to be sent to acquire a second message;

[0055] Send the second message.

[0056] In an implementation of the present disclosure, before acquiring the second message label corresponding to the second quintuple information and the first switch, the method further includes:

[0057] receiving second message identification update information sent by the second switch, and updating the second message identification database according to the second message identification update information, where the second message identification update information is used to indicate the second quintuple information and the corresponding relationship between the first switch and the second message label;

[0058] Acquiring a second message label corresponding to the second quintuple information and the first switch includes:

[0059] A query is performed in the second message identification database according to the first quintuple information and the identifier corresponding to the first switch to obtain a second message label.

[0060] In one implementation of the present disclosure, obtaining a first message sent by a first session end includes:

[0061] receiving a first message forwarded by a second session end;

[0062] Acquiring a second message label corresponding to the second quintuple information and the first switch includes:

[0063] Parsing the first message to obtain first five-tuple information of the first message;

[0064] In response to the destination information of the second quintuple information matching the source information of the first quintuple information, and the source information of the second quintuple information matching the destination information of the first quintuple information, the first message label in the first message is determined as the second message label.

[0065] In a fifth aspect, the present disclosure provides a message processing device, the device comprising:

[0066] A first message acquisition module is configured to acquire a first message and parse the first message to acquire first five-tuple information;

[0067] A first message sending module is configured to send the first message in response to the first message including a first message tag, where the first message tag is obtained according to a first secret key corresponding to the first switch and a first five-tuple information;

[0068] a first message receiving module, configured to receive a second message, parse the second message to obtain second quintuple information and a second message tag in the second message, and obtain a second key according to the second message tag and the second quintuple information;

[0069] The first message forwarding module is configured to forward the second message in response to the second key matching the first key.

[0070] In a sixth aspect, an implementation of the present disclosure provides a message processing device, the device comprising:

[0071] A first five-tuple acquisition module is configured to, in response to the target session between the first session end and the second session end being established, acquire first five-tuple information of a first to-be-sent message belonging to the target session, and determine a first switch for connecting the first session end to the network;

[0072] A first label insertion module is configured to obtain a first message label corresponding to the first five-tuple information and the first switch, and insert the first message label into the first message to be sent to obtain the first message;

[0073] The second message sending module is configured to send the first message.

[0074] In a seventh aspect, the present disclosure provides a message processing device, the device comprising:

[0075] A second message receiving module is configured to receive the first message and parse the first message to obtain the first five-tuple information and the first message label in the first message;

[0076] A first secret key acquisition module is configured to acquire a first secret key according to the first five-tuple information and the first message label;

[0077] A second five-tuple acquisition module is configured to acquire a second message and parse the second message to acquire second five-tuple information of the second message;

[0078] The third message sending module is configured to send the second message in response to the destination information in the second quintuple information matching the source information in the first quintuple information, and the second message includes a second message label, where the second message label is obtained based on the first secret key and the second quintuple information.

[0079] In an eighth aspect, the present disclosure provides a message processing device, the device comprising:

[0080] A second message acquisition module is configured to acquire a first message sent by the first session end in response to the target session between the first session end and the second session end being established;

[0081] A third quintuple acquisition module is configured to determine a first switch for connecting the first session end to the network, and acquire second quintuple information of a second to-be-sent message belonging to the target session;

[0082] A second label insertion module is configured to obtain a second message label corresponding to the second quintuple information and the first switch, and insert the second message label into the second message to be sent to obtain a second message;

[0083] The fourth message sending module is configured to send the second message.

[0084] In the ninth aspect, an implementation of the present disclosure provides an electronic device, comprising a memory and at least one processor; the memory is used to store one or more computer instructions, and the one or more computer instructions are executed by at least one processor to implement the method steps described in any implementation of the first to fourth aspects.

[0085] In a tenth aspect, a computer-readable storage medium is provided in an implementation of the present disclosure, on which computer instructions are stored. When the computer instructions are executed by a processor, the method steps described in any implementation of the first to fourth aspects are implemented.

[0086] In an eleventh aspect, a computer program product is provided in an implementation of the present disclosure, comprising computer instructions, which, when executed by a processor, implement the method steps described in any implementation of the first to fourth aspects.

[0087] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:

[0088] According to the technical solution provided by the embodiment of the present disclosure, by acquiring a first message, parsing the first message to acquire a first five-tuple information, and in response to the first message including a first message tag, sending the first message. The first message tag is acquired according to the first key and the first five-tuple information corresponding to the first switch, so the second switch receiving the first message can acquire the first five-tuple information and the first message tag according to the first message, thereby acquiring the first message tag based on the first five-tuple information and the first message tag, and the second switch can determine which switch the first message is sent through according to the first message tag. When the second switch sends the second message, the second switch can ensure that the second message includes the second message tag acquired according to the second key and the second five-tuple information of the second message, wherein if the second message and the first message belong to the same session, the second key can be matched with the first key. The first switch receives the second message, parses the second message to obtain the second five-tuple information and the second message tag in the second message, and obtains the second key according to the second message tag and the second five-tuple information. When the second key matches the first key, it can be determined that the second message belongs to the same session as the message previously sent through the first switch. Therefore, in response to the second key matching the first key, the second message is forwarded. In the above process, since the query is not performed based on the session table at the first switch, the above solution reduces the memory load and reduces the delay of forwarding messages, thereby improving the user experience, while ensuring that the message forwarded by the first switch belongs to the session established through the first switch.

[0089] According to the technical solution provided by the embodiment of the present disclosure, by sending the first message in response to the first quintuple information matching the first access control list and the first message including the first message label, it can be ensured that the message forwarded by the first switch has high security.

[0090] According to the technical solution provided by the embodiment of the present disclosure, a first inspection result is obtained by checking whether the first message includes a first message label, and in response to determining that the first message includes the first message label according to the first inspection result, the first message is sent. This can speed up the sending of the first message when the first message already includes the first message label, reduce the delay in sending the message, and improve the user experience.

[0091] According to the technical solution provided by the embodiment of the present disclosure, in response to determining that the first message does not include the first message label according to the first check result, the first message label is inserted into the first message, and the first message after the first message label is inserted is sent. It can be ensured that the first messages sent by the first switch all include the first message label, thereby avoiding the situation that the switch receiving the first message cannot determine which switch the first message is sent through because the first message sent by the first switch does not include the first message label.

[0092] According to the technical solution provided by the embodiment of the present disclosure, when the first message is sent by the first session end, in order to ensure that the first session end can enable the first messages it sends to include the first message label, by sending the first message identification update information used to indicate the first five-tuple information and the correspondence between the first switch and the first message label, the first session end can obtain the first five-tuple information and the correspondence between the first switch and the first message label according to the first message identification update information. When it is necessary to send the first message, the first message label can be obtained based on the first five-tuple information of the first message and the first switch used to send the first message, and the first message label can be inserted into the first message, thereby ensuring that the first messages sent by the first session end all include the first message label.

[0093] According to the technical solution provided by the embodiment of the present disclosure, in response to the target session between the first session end and the second session end being established, the first five-tuple information of the first to-be-sent message belonging to the target session is obtained, and the first switch used to access the first session end to the network is determined. The first message label corresponding to the first five-tuple information and the first switch is obtained, and the first message label is inserted into the first to-be-sent message to obtain the first message, and the first message is sent, so that the first switch can receive the first message including the first message label, so that the first switch can parse the first message to obtain the first five-tuple information, and in response to the first message including the first message label, send the first message. The first message label is obtained according to the first secret key corresponding to the first switch and the first five-tuple information, so the second switch receiving the first message can obtain the first five-tuple information and the first message label according to the first message, thereby obtaining the first message label based on the first five-tuple information and the first message label, and the second switch can determine which switch the first message is sent through according to the first message label. When the second switch sends the second message, the second switch can ensure that the second message includes a second message label obtained according to the second key and the second five-tuple information of the second message, wherein if the second message and the first message belong to the same session, the second key can be matched with the first key. The first switch receives the second message, parses the second message to obtain the second five-tuple information and the second message label in the second message, and obtains the second key according to the second message label and the second five-tuple information. When the second key matches the first key, it can be determined that the second message belongs to the same session as the message previously sent through the first switch, so in response to the second key matching the first key, the second message is forwarded. In the above process, since the query is not performed based on the session table at the first switch, the above solution reduces the memory load and reduces the delay of forwarding messages on the premise of ensuring that the message forwarded by the first switch belongs to the session established through the first switch, thereby improving the user experience.

[0094] According to the technical solution provided by the embodiment of the present disclosure, by receiving the first message identification update information sent by the first switch, and updating the first message identification database according to the first message identification update information, querying in the first message identification database according to the first five-tuple information and the identifier corresponding to the first switch to obtain the first message label, it can be ensured that the obtained first message label is obtained based on the first five-tuple information indicated by the first switch and the corresponding relationship between the first switch and the first message label, and it can be ensured that the switch receiving the first message can determine through which switch the first message is sent based on the first message label.

[0095] According to the technical solution provided by the embodiment of the present disclosure, by receiving the second message forwarded by the first switch, and parsing the second message to obtain the second five-tuple information of the second message, in response to the source information of the second five-tuple information matching the destination information of the first five-tuple information, and the destination information of the second five-tuple information matching the source information of the first five-tuple information, that is, when it is determined that the second message and the first message belong to the target session, the second message label in the second message is determined as the first message label. Among them, the second message label in the second message can be obtained by the second switch based on the target message label algorithm, by substituting the second five-tuple information and the first secret key for calculation, and the message label obtained by substituting the second five-tuple information and the first secret key for calculation based on the target message label algorithm can be the same as the message label obtained by substituting the first five-tuple information and the first secret key for calculation, so when the above conditions are met, the second message label in the second message can be directly determined as the first message label, which speeds up the acquisition of the first message label.

[0096] According to the technical solution provided by the embodiment of the present disclosure, a first message is received and parsed to obtain the first five-tuple information and the first message tag in the first message. The first message is sent by the first switch in response to the first message including the first message tag, wherein the first message tag is obtained according to the first secret key corresponding to the first switch and the first five-tuple information, so the second switch receiving the first message can obtain the first secret key according to the first five-tuple information and the first message tag, and obtain the second message, and parse the second message to obtain the second five-tuple information of the second message, in response to the destination information in the second five-tuple information matching the source information in the first five-tuple information, that is, determining that the second message and the first message belong to the same session, and the second message includes the second message tag, and sends the second message, the second message tag is obtained according to the first secret key and the second five-tuple information. The first switch receives the second message, parses the second message to obtain the second five-tuple information and the second message tag in the second message, and obtains the second key according to the second message tag and the second five-tuple information. When the second key matches the first key, it can be determined that the second message belongs to the same session as the message previously sent through the first switch. Therefore, in response to the second key matching the first key, the second message is forwarded. In the above process, since the query is not performed based on the session table at the first switch, the above solution reduces the memory load and reduces the delay of forwarding messages, thereby improving the user experience, while ensuring that the message forwarded by the first switch belongs to the session established through the first switch.

[0097] According to the technical solution provided in the embodiment of the present disclosure, by sending the second message in response to the second quintuple information matching the second access control list, the destination information in the second quintuple information matching the source information in the first quintuple information, and the second message including the second message label, it can be ensured that the message forwarded by the second switch has a higher security.

[0098] According to the technical solution provided by the embodiment of the present disclosure, by checking whether the second message includes the second message label to obtain the second check result, and in response to the destination information in the second quintuple information matching the source information in the first quintuple information, and determining that the second message includes the second message label according to the second check result, the second message is sent. When the second message already includes the second message label, the speed of sending the second message can be accelerated, the delay in sending the message can be reduced, and the user experience can be improved.

[0099] According to the technical solution provided by the embodiment of the present disclosure, by responding to the matching of the destination information in the second quintuple information with the source information in the first quintuple information, and determining according to the second check result that the second message does not include the second message label, inserting the second message label into the second message, and sending the second message after the second message label is inserted, it can be ensured that the second messages sent by the second switch all include the second message label, thereby avoiding the situation where the switch receiving the second message cannot determine that the second message belongs to the same session as the message sent by that switch due to the second message sending the second switch not including the second message label.

[0100] According to the technical solution provided by the embodiment of the present disclosure, when the second message is sent by the second session end, in order to ensure that the second session end can make the second messages it sends all include the second message label, by sending second message identification update information used to indicate the second five-tuple information and the correspondence between the first switch and the second message label, the second session end can obtain the second five-tuple information and the correspondence between the first switch and the second message label according to the second message identification update information. When it is necessary to send the second message, the second message label can be obtained based on the second five-tuple information of the second message and the first switch used to send the first message belonging to the same session as the second message, and the second message label can be inserted into the second message, thereby ensuring that the second messages sent by the second session end all include the second message label.

[0101] According to the technical solution provided by the embodiment of the present disclosure, in response to the target session between the first session end and the second session end being established, the first message sent by the first session end is obtained; the first switch used to access the first session end to the network is determined, and the second five-tuple information of the second message to be sent belonging to the target session is obtained; the second message label corresponding to the second five-tuple information and the first switch is obtained, and the second message label is inserted into the second message to be sent to obtain the second message; and the second message is sent. The above scheme enables the second switch to receive the second message including the second message label, thereby ensuring that the second message sent by the second switch includes the second message label. Among them, since the second message label corresponds to the second five-tuple information and the first switch, the first switch can obtain the second five-tuple information and the second message label in the second message by receiving the second message and parsing the second message. The second key can be obtained according to the second message label and the second five-tuple information. When the second key matches the first key, it can be determined that the second message belongs to the same session as the message previously sent through the first switch, so in response to the second key matching the first key, the second message is forwarded. In the above process, since the first switch does not query based on the session table, the above solution reduces the memory load and the delay of forwarding the message while ensuring that the message forwarded by the first switch belongs to the session established through the first switch, thereby improving the user experience.

[0102] According to the technical solution provided by the embodiment of the present disclosure, in response to the target session between the first session end and the second session end being established, the first message sent by the first session end is obtained; the first switch used to access the first session end to the network is determined, and the second five-tuple information of the second message to be sent belonging to the target session is obtained; the second message label corresponding to the second five-tuple information and the first switch is obtained, and the second message label is inserted into the second message to be sent to obtain the second message; and the second message is sent. The above scheme enables the second switch to receive the second message including the second message label, thereby ensuring that the second message sent by the second switch includes the second message label. Among them, since the second message label corresponds to the second five-tuple information and the first switch, the first switch can obtain the second five-tuple information and the second message label in the second message by receiving the second message and parsing the second message. The second key can be obtained according to the second message label and the second five-tuple information. When the second key matches the first key, it can be determined that the second message belongs to the same session as the message previously sent through the first switch, so in response to the second key matching the first key, the second message is forwarded. In the above process, since the first switch does not query based on the session table, the above solution reduces the memory load and the delay of forwarding the message while ensuring that the message forwarded by the first switch belongs to the session established through the first switch, thereby improving the user experience.

[0103] According to the technical solution provided by the embodiment of the present disclosure, by receiving the second message identification update information sent by the second switch, and updating the second message identification database according to the second message identification update information, querying in the second message identification database according to the second five-tuple information and the identifier corresponding to the first switch to obtain the second message label, it can be ensured that the obtained second message label is obtained based on the second five-tuple information indicated by the first switch and the corresponding relationship between the first switch and the second message label, and it can be ensured that the switch receiving the second message can determine through which switch the second message is sent based on the second message label.

[0104] According to the technical solution provided by the embodiment of the present disclosure, by receiving the first message forwarded by the second session end; parsing the first message to obtain the first five-tuple information of the first message; in response to the destination information of the second five-tuple information matching the source information of the first five-tuple information, and the source information of the second five-tuple information matching the destination information of the first five-tuple information, that is, determining that the second message and the first message both belong to the target session, the first message label in the first message is determined as the second message label. Among them, the first message label in the first message can be obtained by the first switch based on the target message label algorithm, by substituting the first five-tuple information and the first secret key for calculation, and the message label obtained by substituting the second five-tuple information and the first secret key for calculation based on the target message label algorithm can be the same as the message label obtained by substituting the first five-tuple information and the first secret key for calculation, so when the above conditions are met, the first message label in the first message can be directly determined as the second message label, which speeds up the acquisition of the second message label.

[0105] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0106] Other features, objectives and advantages of the present disclosure will become more apparent through the following detailed description of non-limiting embodiments in conjunction with the accompanying drawings. In the accompanying drawings:

[0107] Figure 1 A schematic structural block diagram of a message processing system according to an embodiment of the present disclosure is shown.

[0108] Figure 2 A flowchart of a message processing method according to an embodiment of the present disclosure is shown.

[0109] Figure 3 A flowchart of a message processing method according to an embodiment of the present disclosure is shown.

[0110] Figure 4 A flowchart of a message processing method according to an embodiment of the present disclosure is shown.

[0111] Figure 5 A flowchart of a message processing method according to an embodiment of the present disclosure is shown.

[0112] Figure 6 A structural block diagram of a message processing device according to an embodiment of the present disclosure is shown.

[0113] Figure 7 A structural block diagram of a message processing device according to an embodiment of the present disclosure is shown.

[0114] Figure 8A structural block diagram of a message processing device according to an embodiment of the present disclosure is shown.

[0115] Fig. 9 A structural block diagram of a message processing device according to an embodiment of the present disclosure is shown.

[0116] Fig.10 A structural block diagram of an electronic device according to an embodiment of the present disclosure is shown.

[0117] Fig.11 It is a schematic diagram of the structure of a computer system suitable for implementing a method according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0118] Hereinafter, exemplary embodiments of the present disclosure will be described in detail with reference to the accompanying drawings so that those skilled in the art can easily implement them. In addition, for the sake of clarity, parts not related to the description of the exemplary embodiments are omitted in the accompanying drawings.

[0119] In the present disclosure, it should be understood that terms such as "include" or "have" are intended to indicate the presence of labels, numbers, steps, behaviors, components, parts, or combinations thereof disclosed in the present specification, and are not intended to exclude the possibility that one or more other labels, numbers, steps, behaviors, components, parts, or combinations thereof exist or are added.

[0120] It should also be noted that, in the absence of conflict, the embodiments and labels in the embodiments of the present disclosure can be combined with each other. The present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0121] In order to ensure whether the message forwarded by the virtual switch belongs to the session established through the virtual switch, the inventor of the present disclosure has considered the following scheme: In the related art, when the virtual switch is working, it can update its own session table according to the established session, wherein the session table can be used to save the five-tuple information of the corresponding message, and the corresponding message can be understood as the message to which the session established through the virtual switch belongs. When the virtual switch receives the message, it can query the session table according to the five-tuple information of the received message to determine whether the received message belongs to the session established through the virtual switch. If it is determined, the received message can be forwarded. Disadvantages of this scheme: In recent years, with the continuous development of virtualization technology, more and more users have migrated to virtual private clouds. When the number of users of the virtual private cloud reaches a considerable scale, the amount of data in the session table of the virtual switch will also become very large. When the virtual switch performs data query in the session table, the load of the memory storage session table will increase sharply, making the search speed lower, increasing the delay of forwarding messages, thereby damaging the user's product experience.

[0122] Considering the shortcomings of the above scheme, the inventor of the present disclosure proposes a new scheme: the scheme is applied to the first switch, by obtaining the first message, parsing the first message to obtain the first five-tuple information, and sending the first message in response to the first message including the first message label. The first message label is obtained according to the first key and the first five-tuple information corresponding to the first switch, so the second switch receiving the first message can obtain the first five-tuple information and the first message label according to the first message, thereby obtaining the first message label based on the first five-tuple information and the first message label, and the second switch can determine which switch the first message is sent through according to the first message label. When the second switch sends the second message, the second switch can ensure that the second message includes the second message label obtained according to the second key and the second five-tuple information of the second message, wherein if the second message and the first message belong to the same session, the second key can be matched with the first key. The first switch receives the second message, parses the second message to obtain the second five-tuple information and the second message tag in the second message, and obtains the second key according to the second message tag and the second five-tuple information. When the second key matches the first key, it can be determined that the second message belongs to the same session as the message previously sent through the first switch. Therefore, in response to the second key matching the first key, the second message is forwarded. In the above process, since the query is not performed based on the session table at the first switch, the above solution reduces the memory load and reduces the delay of forwarding messages, thereby improving the user experience, while ensuring that the message forwarded by the first switch belongs to the session established through the first switch.

[0123] In order to solve the above problems, the present disclosure proposes a message processing method and an electronic device.

[0124] Figure 1 A schematic structural block diagram of a message processing system according to an embodiment of the present disclosure is shown as follows: Figure 1 The message processing system includes a first session end 101 , a first switch 102 , a second switch 103 and a second session end 104 .

[0125] The first session end 101 is used to send a message destined for the network to the first switch 102, and receive a message from the network belonging to the first session end 101 through the first switch 102. The first session end 101 can be a virtual machine (VM) or a physical machine.

[0126] The first switch 102 is used to forward the message sent from the first session end 101 to the network to the network, forward the message from the network belonging to the first session end 101 to the first session end 101, and manage the message of the first session end 101. The first switch 102 can be a switch or a virtual switch.

[0127] The second switch 103 is used to forward the message from the network belonging to the second session end 104 to the second session end 104, forward the message sent by the second session end 104 to the network to the network, and manage the message of the second session end 104. The second switch 103 can be a switch or a virtual switch.

[0128] The second session end 104 is used to receive the message from the network belonging to the second session end 104 through the second switch 103, and send the message destined for the network to the second switch 103. The second session end 104 can be a virtual machine or a physical machine.

[0129] Among them, virtual machines can be understood as virtualization layers running on virtualization platforms. For example, in cloud computing platforms, virtual machines can be one or more independent hosts (i.e., cloud hosts) or one or more independent servers (i.e., cloud servers) divided by the virtualization technology on cluster servers; in other virtualization systems or platforms, virtual machines can be one or more virtual hosts implemented by the virtualization technology on one or more physical hosts, or can be one or more virtual dedicated servers implemented by the virtualization technology on one or more physical servers.

[0130] A physical machine can be understood as a name for a physical computer relative to a virtual machine. A physical machine can provide a hardware environment for a virtual machine.

[0131] A switch can be understood as a network device used for data transfer. A switch can provide a transmission channel for any two network nodes connected to it.

[0132] A virtual switch can be understood as a virtual machine obtained based on a physical machine, and a corresponding virtual switch can be virtualized for the virtual machine. The virtual machine can communicate with other virtual machines or physical machines through the virtual switch.

[0133] Figure 2 A flow chart of a message processing method according to an embodiment of the present disclosure is shown, and the method is applied to a first switch, such as Figure 2 As shown, the message processing method includes steps S101, S102, S103, and S104.

[0134] In step S101, a first message is obtained, and the first message is parsed to obtain first quintuple information.

[0135] In step S102, in response to the first message including a first message tag, the first message is sent, where the first message tag is obtained according to a first secret key corresponding to the first switch and first five-tuple information.

[0136] In step S103, a second message is received, the second message is parsed to obtain second quintuple information and a second message tag in the second message, and a second key is obtained according to the second message tag and the second quintuple information.

[0137] In step S104, in response to the second key matching the first key, the second message is forwarded.

[0138] In one embodiment of the present disclosure, the first message can be understood as a message sent from the first session end to the network, wherein the first message can be a message sent to the second session end, a target session (Session) is established between the first session end and the second session end, and the first message belongs to the target session.

[0139] In one embodiment of the present disclosure, obtaining the first message may be receiving a message sent by the first session end, or may be receiving a first message forwarded by other devices or systems.

[0140] In one embodiment of the present disclosure, the first five-tuple information can be understood as a five-tuple used to indicate a first message, wherein the five-tuple includes a source IP address (Source IP), a source port (Source Port), a destination IP address (Destination IP), a destination port (Destination Port) and a transport layer protocol.

[0141] In one embodiment of the present disclosure, the first message includes a first message label, which can be understood as the first message label being located in at least one field of the first message. Exemplarily, when the first message is a message based on Internet Protocol Version 6 (IPV6), the first message label can be located in a field between a layer 2 message and a layer 3 message of the first message, and the field can be a flow label field. Alternatively, when the first message is a message based on Internet Protocol Version 4 (IPV4), the first message label can be located in a Multi-Protocol Label Switching (MPLS) field of the first message.

[0142] In one embodiment of the present disclosure, the first message label is obtained according to the first secret key and the first five-tuple information corresponding to the first switch, which can be understood as substituting the first secret key and the first five-tuple information for calculation according to a pre-acquired message label calculation algorithm to obtain the first message label; or, it can also be understood as obtaining a pre-trained message label model, and inputting the first secret key and the first five-tuple information into the message label model to obtain the first message label output by the message label model.

[0143] In one embodiment of the present disclosure, sending the first message may be understood as sending the first message according to the first quintuple information.

[0144] In one embodiment of the present disclosure, the second message can be understood as a message sent by the second session end to the network, wherein the second message can be a message sent to the first session end, and the second message belongs to the target session established between the first session end and the second session end.

[0145] In one embodiment of the present disclosure, the second quintuple information may be understood as a quintuple used to indicate the second message.

[0146] In one embodiment of the present disclosure, the second message includes a second message label, which can be understood as the second message label being located in at least one field of the second message. Exemplarily, when the second message is a message based on the IPV6 protocol, the second message label can be located in a field between the second layer message and the third layer message of the second message, and the field can be a flow label field. Alternatively, when the second message is a message based on the IPV4 protocol, the second message label can be located in the multi-protocol label switching field of the second message.

[0147] In one embodiment of the present disclosure, obtaining the second key according to the second message label and the second quintuple information can be understood as substituting the second message label and the second quintuple information into a pre-acquired key calculation algorithm to perform calculation to obtain the second key; or, it can also be understood as obtaining a pre-trained key model and inputting the second message label and the second quintuple information into the key model to obtain the second key output by the key model.

[0148] In one embodiment of the present disclosure, the second key matches the first key, which can be understood as the second key being the same as the first key; it can also be understood as, based on the key matching algorithm, substituting the second key and the first key for calculation, and determining whether the second key matches the first key based on the calculation result.

[0149] In one embodiment of the present disclosure, forwarding the second message may be understood as forwarding the second message according to the second 5-tuple information.

[0150] In one embodiment of the present disclosure, when the second key does not match the first key, the second message may not be forwarded and may be discarded.

[0151] According to the technical solution provided by the embodiment of the present disclosure, by acquiring a first message, parsing the first message to acquire a first five-tuple information, and in response to the first message including a first message tag, sending the first message. The first message tag is acquired according to the first key and the first five-tuple information corresponding to the first switch, so the second switch receiving the first message can acquire the first five-tuple information and the first message tag according to the first message, thereby acquiring the first message tag based on the first five-tuple information and the first message tag, and the second switch can determine which switch the first message is sent through according to the first message tag. When the second switch sends the second message, the second switch can ensure that the second message includes the second message tag acquired according to the second key and the second five-tuple information of the second message, wherein if the second message and the first message belong to the same session, the second key can be matched with the first key. The first switch receives the second message, parses the second message to obtain the second five-tuple information and the second message tag in the second message, and obtains the second key according to the second message tag and the second five-tuple information. When the second key matches the first key, it can be determined that the second message belongs to the same session as the message previously sent through the first switch. Therefore, in response to the second key matching the first key, the second message is forwarded. In the above process, since the query is not performed based on the session table at the first switch, the above solution reduces the memory load and reduces the delay of forwarding messages, thereby improving the user experience, while ensuring that the message forwarded by the first switch belongs to the session established through the first switch.

[0152] In one embodiment of the present disclosure, in step S104, in response to the first message including the first message label, sending the first message may be implemented by the following steps:

[0153] In response to the first five-tuple information matching the first access control list and the first message including the first message label, the first message is sent.

[0154] In one embodiment of the present disclosure, the first access control list may be understood as including at least a portion of the five-tuple information of the message allowed to be forwarded, for example, the first access control list may include the source IP and source port in the five-tuple information of the message allowed to be forwarded. Alternatively, the first access control list may also be understood as including at least a portion of the five-tuple information of the message to be discarded, for example, the first access control list may include the source IP and source port in the five-tuple information of the message to be discarded.

[0155] In one embodiment of the present disclosure, when the first access control list includes at least a part of the five-tuple information of the message that is allowed to be forwarded, the first five-tuple information matches the first access control list, which can be understood as the first access control list includes at least a part or all of the first five-tuple information. When the first access control list includes at least a part of the five-tuple information of the message that needs to be discarded, the first five-tuple information matches the first access control list, which can be understood as the first access control list does not include any part of the first five-tuple information.

[0156] According to the technical solution provided by the embodiment of the present disclosure, by sending the first message in response to the first quintuple information matching the first access control list and the first message including the first message label, it can be ensured that the message forwarded by the first switch has high security.

[0157] In an implementation of the present disclosure, in step S104, in response to the first message including the first message label, before sending the first message, the method further includes the following steps:

[0158] Check whether the first message includes the first message label to obtain a first check result.

[0159] In step S104, in response to the first message including the first message label, sending the first message may be implemented by the following steps:

[0160] In response to determining, according to the first checking result, that the first message includes the first message label, the first message is sent.

[0161] In one implementation of the present disclosure, checking whether the first message includes the first message label to obtain a first check result can be understood as reading the content of the corresponding field in the first message, and comparing the read content with the first message label obtained by the first switch according to the first secret key and the first quintuple information. When the two are the same, it is determined that the first message includes the first message label.

[0162] According to the technical solution provided by the embodiment of the present disclosure, a first inspection result is obtained by checking whether the first message includes a first message label, and in response to determining that the first message includes the first message label according to the first inspection result, the first message is sent. This can speed up the sending of the first message when the first message already includes the first message label, reduce the delay in sending the message, and improve the user experience.

[0163] In an implementation of the present disclosure, in step S103, before receiving the second message, the method further includes the following steps:

[0164] In response to determining, according to the first check result, that the first message does not include the first message label, inserting the first message label into the first message, and sending the first message after the first message label is inserted.

[0165] In an implementation of the present disclosure, inserting the first message label into the first message can be understood as inserting the first message label into a corresponding field of the first message to obtain the first message after the first message label is inserted.

[0166] According to the technical solution provided by the embodiment of the present disclosure, in response to determining that the first message does not include the first message label according to the first check result, the first message label is inserted into the first message, and the first message after the first message label is inserted is sent. It can be ensured that the first messages sent by the first switch all include the first message label, thereby avoiding the situation that the switch receiving the first message cannot determine which switch the first message is sent through because the first message sent by the first switch does not include the first message label.

[0167] In one implementation of the present disclosure, in step S101, obtaining the first message may be implemented by the following steps:

[0168] Receive the first message sent by the first session end:

[0169] The method further comprises the steps of:

[0170] Sending first message identifier update information, where the first message identifier update information is used to indicate the first quintuple information and the corresponding relationship between the first switch and the first message label.

[0171] According to the technical solution provided by the embodiment of the present disclosure, when the first message is sent by the first session end, in order to ensure that the first session end can enable the first messages it sends to include the first message label, by sending the first message identification update information used to indicate the first five-tuple information and the correspondence between the first switch and the first message label, the first session end can obtain the first five-tuple information and the correspondence between the first switch and the first message label according to the first message identification update information. When it is necessary to send the first message, the first message label can be obtained based on the first five-tuple information of the first message and the first switch used to send the first message, and the first message label can be inserted into the first message, thereby ensuring that the first messages sent by the first session end all include the first message label.

[0172] Figure 3 A flow chart of a message processing method according to an embodiment of the present disclosure is shown, and the method is applied to a first session end, such as Figure 3 As shown, the message processing method includes steps S201, S202, and S203.

[0173] In step S201, in response to a target session between a first session end and a second session end being established, first five-tuple information of a first to-be-sent message belonging to the target session is obtained, and a first switch for connecting the first session end to a network is determined.

[0174] In step S202, a first message label corresponding to the first five-tuple information and the first switch is obtained, and the first message label is inserted into a first message to be sent to obtain a first message.

[0175] In step S203, a first message is sent.

[0176] In an implementation of the present disclosure, the first message to be sent can be understood as a message that the first session end needs to send to the network.

[0177] In one implementation of the present disclosure, the first five-tuple information can be understood as a five-tuple used to indicate the first message to be sent, wherein the five-tuple includes a source IP address, a source port, a destination IP address, a destination port, and a transport layer protocol.

[0178] In an implementation of the present disclosure, obtaining the first five-tuple information of the first message to be sent belonging to the target session can be understood as obtaining the first five-tuple information by parsing the first message to be sent.

[0179] In one embodiment of the present disclosure, obtaining the first message label corresponding to the first quintuple information and the first switch can be understood as querying according to the first quintuple information and the label corresponding to the first switch to obtain the first message label corresponding to the first quintuple information and the first switch.

[0180] In one embodiment of the present disclosure, the first message label is inserted into the first message to be sent, which can be understood as inserting the first message label into at least one field of the message to be sent to obtain the first message. Exemplarily, when the first message to be sent is a message based on the IPV6 protocol, the first message label can be inserted into the field between the second layer message and the third layer message of the first message to be sent to obtain the first message, and the field can be a flow label field. Alternatively, when the first message to be sent is a message based on the IPV4 protocol, the first message label can be inserted into the MPLS field of the first message to be sent to obtain the first message.

[0181] In an implementation of the present disclosure, the first message may be understood as a message that may be sent to the network through the first switch, wherein the first message may be a message sent to the second session end, and the first message belongs to the target session.

[0182] In one embodiment of the present disclosure, sending the first message may be understood as sending the first message to the first switch so that the first switch forwards the first message.

[0183] According to the technical solution provided by the embodiment of the present disclosure, in response to the target session between the first session end and the second session end being established, the first five-tuple information of the first to-be-sent message belonging to the target session is obtained, and the first switch used to access the first session end to the network is determined. The first message label corresponding to the first five-tuple information and the first switch is obtained, and the first message label is inserted into the first to-be-sent message to obtain the first message, and the first message is sent, so that the first switch can receive the first message including the first message label, so that the first switch can parse the first message to obtain the first five-tuple information, and in response to the first message including the first message label, send the first message. The first message label is obtained according to the first secret key corresponding to the first switch and the first five-tuple information, so the second switch receiving the first message can obtain the first five-tuple information and the first message label according to the first message, thereby obtaining the first message label based on the first five-tuple information and the first message label, and the second switch can determine which switch the first message is sent through according to the first message label. When the second switch sends the second message, the second switch can ensure that the second message includes a second message label obtained according to the second key and the second five-tuple information of the second message, wherein if the second message and the first message belong to the same session, the second key can be matched with the first key. The first switch receives the second message, parses the second message to obtain the second five-tuple information and the second message label in the second message, and obtains the second key according to the second message label and the second five-tuple information. When the second key matches the first key, it can be determined that the second message belongs to the same session as the message previously sent through the first switch, so in response to the second key matching the first key, the second message is forwarded. In the above process, since the query is not performed based on the session table at the first switch, the above solution reduces the memory load and reduces the delay of forwarding messages on the premise of ensuring that the message forwarded by the first switch belongs to the session established through the first switch, thereby improving the user experience.

[0184] In an implementation of the present disclosure, before acquiring the first message label corresponding to the first five-tuple information and the first switch, the method further includes the following steps:

[0185] receiving first message identifier update information sent by the first switch, and updating the first message identifier database according to the first message identifier update information, where the first message identifier update information is used to indicate the first five-tuple information and the corresponding relationship between the first switch and the first message label;

[0186] Acquiring a first message label corresponding to the first five-tuple information and the first switch includes:

[0187] A query is performed in the first message identification database according to the first quintuple information and the identifier corresponding to the first switch to obtain the first message label.

[0188] In one embodiment of the present disclosure, the first message identification database may be understood as a five-tuple information indicating messages belonging to an established session and a correspondence between an identification corresponding to a switch for forwarding the message and a message label.

[0189] In one embodiment of the present disclosure, updating the first message identification database according to the first message identification update information may be to search the first message identification database according to the first message identification update information to determine whether the first message identification database includes information indicating that the first five-tuple information, the identifier corresponding to the first switch, and the first message label have a corresponding relationship. When it is determined that the first message identification database does not include the retrieved information, adding information indicating that the first five-tuple information, the identifier corresponding to the first switch, and the first message label have a corresponding relationship to the first message identification database.

[0190] According to the technical solution provided by the embodiment of the present disclosure, by receiving the first message identification update information sent by the first switch, and updating the first message identification database according to the first message identification update information, querying in the first message identification database according to the first five-tuple information and the identifier corresponding to the first switch to obtain the first message label, it can be ensured that the obtained first message label is obtained based on the first five-tuple information indicated by the first switch and the corresponding relationship between the first switch and the first message label, and it can be ensured that the switch receiving the first message can determine through which switch the first message is sent based on the first message label.

[0191] In an implementation of the present disclosure, obtaining a first message label corresponding to the first five-tuple information and the first switch includes the following steps:

[0192] receiving a second message forwarded by the first switch, and parsing the second message to obtain second quintuple information of the second message;

[0193] In response to source information of the second quintuple information matching destination information of the first quintuple information, and destination information of the second quintuple information matching source information of the first quintuple information, a second message label in the second message is determined as the first message label.

[0194] In one embodiment of the present disclosure, the second message can be understood as a message sent by the second session end to the network, wherein the second message can be a message sent to the first session end, and the second message belongs to the target session established between the first session end and the second session end.

[0195] In one embodiment of the present disclosure, the second quintuple information may be understood as a quintuple used to indicate the second message.

[0196] In one embodiment of the present disclosure, the source information of the second quintuple information matches the destination information of the first quintuple information, which can be understood as the source IP of the second quintuple information being the same as the destination IP of the first quintuple information; or the source IP of the second quintuple information being the same as the destination IP of the first quintuple information, and the source port of the second quintuple information being the same as the destination port of the first quintuple information.

[0197] In one embodiment of the present disclosure, the destination information of the second quintuple information matches the source information of the first quintuple information, which can be understood as the destination IP of the second quintuple information being the same as the source IP of the first quintuple information; or the destination IP of the second quintuple information being the same as the source IP of the first quintuple information, and the destination port of the second quintuple information being the same as the source port of the first quintuple information.

[0198] In one embodiment of the present disclosure, the second message label may be located in at least one field of the second message. Exemplarily, when the second message is a message based on the IPV6 protocol, the second message label may be located in a field between the layer 2 message and the layer 3 message of the second message, and the field may be a flow label field. Alternatively, when the second message is a message based on the IPV4 protocol, the second message label may be located in a multi-protocol label switching field of the second message.

[0199] According to the technical solution provided by the embodiment of the present disclosure, by receiving the second message forwarded by the first switch, and parsing the second message to obtain the second five-tuple information of the second message, in response to the source information of the second five-tuple information matching the destination information of the first five-tuple information, and the destination information of the second five-tuple information matching the source information of the first five-tuple information, that is, when it is determined that the second message and the first message belong to the target session, the second message label in the second message is determined as the first message label. Among them, the second message label in the second message can be obtained by the second switch based on the target message label algorithm, by substituting the second five-tuple information and the first secret key for calculation, and the message label obtained by substituting the second five-tuple information and the first secret key for calculation based on the target message label algorithm can be the same as the message label obtained by substituting the first five-tuple information and the first secret key for calculation, so when the above conditions are met, the second message label in the second message can be directly determined as the first message label, which speeds up the acquisition of the first message label.

[0200] Figure 4 A flow chart of a message processing method according to an embodiment of the present disclosure is shown, and the method is applied to a second switch, such as Figure 4 As shown, the message processing method includes steps S301, S302, S303, and S304.

[0201] In step S301, a first message is received, and the first message is parsed to obtain first five-tuple information and a first message label in the first message.

[0202] In step S302, a first key is obtained according to the first five-tuple information and the first message label.

[0203] In step S303, a second message is obtained, and the second message is parsed to obtain second quintuple information of the second message.

[0204] In step S304, in response to the destination information in the second quintuple information matching the source information in the first quintuple information, and the second message including a second message tag, the second message is sent, and the second message tag is obtained based on the first secret key and the second quintuple information.

[0205] In one embodiment of the present disclosure, the first message can be understood as a message sent by the first session end to the network through the first switch, wherein the first message can be a message sent to the second session end, a target session is established between the first session end and the second session end, and the first message belongs to the target session.

[0206] In one embodiment of the present disclosure, the first five-tuple information can be understood as a five-tuple used to indicate the first message, wherein the five-tuple includes a source IP address, a source port, a destination IP address, a destination port, and a transport layer protocol.

[0207] In one embodiment of the present disclosure, the first message label may be located in at least one field of the first message. Exemplarily, when the first message is a message based on the IPV6 protocol, the first message label may be located in a field between the layer 2 message and the layer 3 message of the first message, and the field may be a flow label field. Alternatively, when the first message is a message based on the IPV4 protocol, the first message label may be located in the MPLS field of the first message.

[0208] In one embodiment of the present disclosure, the first message label can be obtained according to the first secret key and the first five-tuple information corresponding to the first switch. Specifically, the first message label can be obtained by substituting the first secret key and the first five-tuple information into a pre-acquired message label calculation algorithm to obtain the first message label; or, it can also be understood as obtaining a pre-trained message label model, and inputting the first secret key and the first five-tuple information into the message label model to obtain the first message label output by the message label model.

[0209] In one embodiment of the present disclosure, obtaining the first key according to the first quintuple information and the first message label can be understood as substituting the first quintuple information and the first message label into a pre-acquired key calculation algorithm to perform calculation to obtain the first key; or, it can also be understood as obtaining a pre-trained key model, and inputting the first quintuple information and the first message label into the key model to obtain the first key output by the key model.

[0210] In one embodiment of the present disclosure, obtaining the second message may be receiving a message sent by the second session end, or may be receiving a second message forwarded by other devices or systems.

[0211] In one embodiment of the present disclosure, the second quintuple information may be understood as a quintuple used to indicate the second message.

[0212] In one embodiment of the present disclosure, the destination information of the second quintuple information matches the source information of the first quintuple information, which can be understood as the destination IP of the second quintuple information being the same as the source IP of the first quintuple information; or the destination IP of the second quintuple information being the same as the source IP of the first quintuple information, and the destination port of the second quintuple information being the same as the source port of the first quintuple information.

[0213] In one embodiment of the present disclosure, the second message includes a second message label, which can be understood as the second message label being located in at least one field of the second message. Exemplarily, when the second message is a message based on the IPV6 protocol, the second message label can be located in a field between the layer 2 message and the layer 3 message of the second message, and the field can be a flow label field. Alternatively, when the second message is a message based on the IPV4 protocol, the second message label can be located in the MPLS field of the second message.

[0214] In one embodiment of the present disclosure, the second message label is obtained based on the first secret key and the second quintuple information, which can be understood as substituting the first secret key and the second quintuple information for calculation according to a pre-acquired message label calculation algorithm to obtain the second message label; or, it can also be understood as obtaining a pre-trained message label model, and inputting the first secret key and the second quintuple information into the message label model to obtain the second message label output by the message label model.

[0215] In one embodiment of the present disclosure, sending the second message may be understood as sending the second message according to the second quintuple information.

[0216] According to the technical solution provided by the embodiment of the present disclosure, a first message is received and parsed to obtain the first five-tuple information and the first message tag in the first message. The first message is sent by the first switch in response to the first message including the first message tag, wherein the first message tag is obtained according to the first secret key corresponding to the first switch and the first five-tuple information, so the second switch receiving the first message can obtain the first secret key according to the first five-tuple information and the first message tag, and obtain the second message, and parse the second message to obtain the second five-tuple information of the second message, in response to the destination information in the second five-tuple information matching the source information in the first five-tuple information, that is, determining that the second message and the first message belong to the same session, and the second message includes the second message tag, and sends the second message, the second message tag is obtained according to the first secret key and the second five-tuple information. The first switch receives the second message, parses the second message to obtain the second five-tuple information and the second message tag in the second message, and obtains the second key according to the second message tag and the second five-tuple information. When the second key matches the first key, it can be determined that the second message belongs to the same session as the message previously sent through the first switch. Therefore, in response to the second key matching the first key, the second message is forwarded. In the above process, since the query is not performed based on the session table at the first switch, the above solution reduces the memory load and reduces the delay of forwarding messages, thereby improving the user experience, while ensuring that the message forwarded by the first switch belongs to the session established through the first switch.

[0217] In one implementation of the present disclosure, in response to the destination information in the second quintuple information matching the source information in the first quintuple information, and the second message including the second message label, sending the second message includes:

[0218] In response to the second 5-tuple information matching the second access control list, the destination information in the second 5-tuple information matching the source information in the first 5-tuple information, and the second message including the second message label, sending the second message.

[0219] In one embodiment of the present disclosure, the second access control list may be understood as including at least a portion of the five-tuple information of the message allowed to be forwarded, for example, the second access control list may include the source IP and source port in the five-tuple information of the message allowed to be forwarded. Alternatively, the second access control list may also be understood as including at least a portion of the five-tuple information of the message to be discarded, for example, the second access control list may include the source IP and source port in the five-tuple information of the message to be discarded.

[0220] In one embodiment of the present disclosure, when the second access control list includes at least a portion of the five-tuple information of the message that is allowed to be forwarded, the second five-tuple information matches the second access control list, which can be understood as the second access control list includes at least a portion or all of the second five-tuple information. When the second access control list includes at least a portion of the five-tuple information of the message that needs to be discarded, the second five-tuple information matches the first access control list, which can be understood as the second access control list does not include any part of the second five-tuple information.

[0221] According to the technical solution provided in the embodiment of the present disclosure, by sending the second message in response to the second quintuple information matching the second access control list, the destination information in the second quintuple information matching the source information in the first quintuple information, and the second message including the second message label, it can be ensured that the message forwarded by the second switch has a higher security.

[0222] In one implementation of the present disclosure, in response to the destination information in the second quintuple information matching the source information in the first quintuple information, and the second message including the second message label, before sending the second message, the method further includes:

[0223] Checking whether the second message includes the second message label to obtain a second check result;

[0224] In response to the destination information in the second quintuple information matching the source information in the first quintuple information, and the second message including the second message label, sending the second message includes:

[0225] In response to the destination information in the second quintuple information matching the source information in the first quintuple information, and determining based on the second check result that the second message includes the second message label, the second message is sent.

[0226] In one implementation of the present disclosure, checking whether the second message includes the second message tag to obtain the second check result can be understood as reading the content of the corresponding field in the second message, and comparing the read content with the second message tag obtained by the second switch according to the first secret key and the second quintuple information. When the two are the same, it is determined that the second message includes the second message tag.

[0227] According to the technical solution provided by the embodiment of the present disclosure, by checking whether the second message includes the second message label to obtain the second check result, and in response to the destination information in the second quintuple information matching the source information in the first quintuple information, and determining that the second message includes the second message label according to the second check result, the second message is sent. When the second message already includes the second message label, the speed of sending the second message can be accelerated, the delay in sending the message can be reduced, and the user experience can be improved.

[0228] In one implementation of the present disclosure, the method further includes:

[0229] In response to the destination information in the second quintuple information matching the source information in the first quintuple information, and determining based on the second check result that the second message does not include a second message label, inserting the second message label into the second message, and sending the second message after the second message label is inserted.

[0230] In an implementation of the present disclosure, inserting the second message label into the second message can be understood as inserting the second message label into a corresponding field of the second message to obtain the second message after the second message label is inserted.

[0231] According to the technical solution provided by the embodiment of the present disclosure, by responding to the matching of the destination information in the second quintuple information with the source information in the first quintuple information, and determining according to the second check result that the second message does not include the second message label, inserting the second message label into the second message, and sending the second message after the second message label is inserted, it can be ensured that the second messages sent by the second switch all include the second message label, thereby avoiding the situation where the switch receiving the second message cannot determine that the second message belongs to the same session as the message sent by that switch due to the second message sending the second switch not including the second message label.

[0232] In one implementation of the present disclosure, obtaining the second message includes:

[0233] Receive the second message sent by the second session end:

[0234] The method also includes:

[0235] Sending second message identification update information, where the second message identification update information is used to indicate the second quintuple information and the corresponding relationship between the first switch and the second message label.

[0236] According to the technical solution provided by the embodiment of the present disclosure, when the second message is sent by the second session end, in order to ensure that the second session end can make the second messages it sends all include the second message label, by sending second message identification update information used to indicate the second five-tuple information and the correspondence between the first switch and the second message label, the second session end can obtain the second five-tuple information and the correspondence between the first switch and the second message label according to the second message identification update information. When it is necessary to send the second message, the second message label can be obtained based on the second five-tuple information of the second message and the first switch used to send the first message belonging to the same session as the second message, and the second message label can be inserted into the second message, thereby ensuring that the second messages sent by the second session end all include the second message label.

[0237] Figure 5 A flow chart of a message processing method according to an embodiment of the present disclosure is shown, and the method is applied to a second session end, such as Figure 5 As shown, the message processing method includes steps S401, S402, S403, and S404.

[0238] In step S401, in response to a target session between a first session end and a second session end being established, a first message sent by the first session end is acquired.

[0239] In step S402, a first switch for connecting the first session end to the network is determined, and second five-tuple information of a second to-be-sent message belonging to the target session is obtained.

[0240] In step S403, a second message label corresponding to the second quintuple information and the first switch is obtained, and the second message label is inserted into the second message to be sent to obtain a second message.

[0241] In step S404, a second message is sent.

[0242] In one embodiment of the present disclosure, the first message may be understood as a message sent from the first session end to the network, wherein the first message may belong to the target session.

[0243] In one implementation of the present disclosure, determining the first switch for accessing the first session end to the network can be understood as parsing the first session to obtain first five-tuple information, and querying according to the first five-tuple information to determine the first switch for accessing the first session end to the network. The first five-tuple information can be understood as a five-tuple for indicating the first message to be sent, wherein the five-tuple includes a source IP address, a source port, a destination IP address, a destination port, and a transport layer protocol.

[0244] In one implementation of the present disclosure, the second quintuple information may be understood as a quintuple used to indicate the second message to be sent.

[0245] In one implementation of the present disclosure, obtaining the second quintuple information of the second message to be sent belonging to the target session can be understood as obtaining the second quintuple information by parsing the second message to be sent.

[0246] In an implementation of the present disclosure, obtaining the second message label corresponding to the second quintuple information and the first switch can be understood as querying according to the second quintuple information and the label corresponding to the first switch to obtain the second message label corresponding to the second quintuple information and the first switch.

[0247] In one embodiment of the present disclosure, the second message label is inserted into the second message to be sent, which can be understood as inserting the second message label into at least one field of the message to be sent to obtain the second message. Exemplarily, when the second message to be sent is a message based on the IPV6 protocol, the second message label can be inserted into the field between the second layer message and the third layer message of the second message to be sent to obtain the second message, and the field can be a flow label field. Alternatively, when the second message to be sent is a message based on the IPV4 protocol, the second message label can be inserted into the MPLS field of the second message to be sent to obtain the second message.

[0248] In an implementation of the present disclosure, the second message may be understood as a message that may be sent to the network through the second switch, wherein the second message may be a message sent to the first session end, and the second message belongs to the target session.

[0249] According to the technical solution provided by the embodiment of the present disclosure, in response to the target session between the first session end and the second session end being established, the first message sent by the first session end is obtained; the first switch used to access the first session end to the network is determined, and the second five-tuple information of the second message to be sent belonging to the target session is obtained; the second message label corresponding to the second five-tuple information and the first switch is obtained, and the second message label is inserted into the second message to be sent to obtain the second message; and the second message is sent. The above scheme enables the second switch to receive the second message including the second message label, thereby ensuring that the second message sent by the second switch includes the second message label. Among them, since the second message label corresponds to the second five-tuple information and the first switch, the first switch can obtain the second five-tuple information and the second message label in the second message by receiving the second message and parsing the second message. The second key can be obtained according to the second message label and the second five-tuple information. When the second key matches the first key, it can be determined that the second message belongs to the same session as the message previously sent through the first switch, so in response to the second key matching the first key, the second message is forwarded. In the above process, since the first switch does not query based on the session table, the above solution reduces the memory load and the delay of forwarding the message while ensuring that the message forwarded by the first switch belongs to the session established through the first switch, thereby improving the user experience.

[0250] In an implementation of the present disclosure, before acquiring the second message label corresponding to the second quintuple information and the first switch, the method further includes:

[0251] receiving second message identification update information sent by the second switch, and updating the second message identification database according to the second message identification update information, where the second message identification update information is used to indicate the second quintuple information and the corresponding relationship between the first switch and the second message label;

[0252] Acquiring a second message label corresponding to the second quintuple information and the first switch includes:

[0253] A query is performed in the second message identification database according to the first quintuple information and the identifier corresponding to the first switch to obtain a second message label.

[0254] In one embodiment of the present disclosure, the second message identification database can be understood as a correspondence between the five-tuple information indicating the message belonging to the established session, the identifier corresponding to the switch for forwarding the message belonging to the same session as the message, and the message label.

[0255] In one embodiment of the present disclosure, updating the second message identification database according to the second message identification update information may be to search the second message identification database according to the second message identification update information to determine whether the second message identification database includes information indicating that the second five-tuple information, the identifier corresponding to the first switch, and the second message label have a corresponding relationship. When it is determined that the second message identification database does not include the retrieved information, information indicating that the second five-tuple information, the identifier corresponding to the first switch, and the second message label have a corresponding relationship is added to the second message identification database.

[0256] According to the technical solution provided by the embodiment of the present disclosure, by receiving the second message identification update information sent by the second switch, and updating the second message identification database according to the second message identification update information, querying in the second message identification database according to the second five-tuple information and the identifier corresponding to the first switch to obtain the second message label, it can be ensured that the obtained second message label is obtained based on the second five-tuple information indicated by the first switch and the corresponding relationship between the first switch and the second message label, and it can be ensured that the switch receiving the second message can determine through which switch the second message is sent based on the second message label.

[0257] In one implementation of the present disclosure, obtaining a first message sent by a first session end includes:

[0258] receiving a first message forwarded by a second session end;

[0259] Acquiring a second message label corresponding to the second quintuple information and the first switch includes:

[0260] Parsing the first message to obtain first five-tuple information of the first message;

[0261] In response to the destination information of the second quintuple information matching the source information of the first quintuple information, and the source information of the second quintuple information matching the destination information of the first quintuple information, the first message label in the first message is determined as the second message label.

[0262] In one embodiment of the present disclosure, the first five-tuple information may be understood as a five-tuple used to indicate the first message.

[0263] In one embodiment of the present disclosure, the destination information of the second quintuple information matches the source information of the first quintuple information, which can be understood as the destination IP of the second quintuple information being the same as the source IP of the first quintuple information; or the destination IP of the second quintuple information being the same as the source IP of the first quintuple information, and the destination port of the second quintuple information being the same as the source port of the first quintuple information.

[0264] In one embodiment of the present disclosure, the source information of the second quintuple information matches the destination information of the first quintuple information, which can be understood as the source IP of the second quintuple information being the same as the destination IP of the first quintuple information; or the source IP of the second quintuple information being the same as the destination IP of the first quintuple information, and the source port of the second quintuple information being the same as the destination port of the first quintuple information.

[0265] In one embodiment of the present disclosure, the first message label may be located in at least one field of the first message. Exemplarily, when the first message is a message based on the IPV6 protocol, the first message label may be located in a field between the layer 2 message and the layer 3 message of the first message, and the field may be a flow label field. Alternatively, when the first message is a message based on the IPV4 protocol, the first message label may be located in the multi-protocol label switching field of the second message.

[0266] According to the technical solution provided by the embodiment of the present disclosure, by receiving the first message forwarded by the second session end; parsing the first message to obtain the first five-tuple information of the first message; in response to the destination information of the second five-tuple information matching the source information of the first five-tuple information, and the source information of the second five-tuple information matching the destination information of the first five-tuple information, that is, determining that the second message and the first message both belong to the target session, the first message label in the first message is determined as the second message label. Among them, the first message label in the first message can be obtained by the first switch based on the target message label algorithm, by substituting the first five-tuple information and the first secret key for calculation, and the message label obtained by substituting the second five-tuple information and the first secret key for calculation based on the target message label algorithm can be the same as the message label obtained by substituting the first five-tuple information and the first secret key for calculation, so when the above conditions are met, the first message label in the first message can be directly determined as the second message label, which speeds up the acquisition of the second message label.

[0267] The following reference Figure 6 A message processing device according to an embodiment of the present disclosure is described. Figure 6 A structural block diagram of a message processing device according to an embodiment of the present disclosure is shown.

[0268] like Figure 6 As shown, the message processing device 200 includes:

[0269] The first message acquisition module 201 is configured to acquire a first message and parse the first message to acquire first quintuple information;

[0270] The first message sending module 202 is configured to send the first message in response to the first message including a first message tag, where the first message tag is obtained according to a first secret key corresponding to the first switch and a first five-tuple information;

[0271] The first message receiving module 203 is configured to receive a second message, parse the second message to obtain second quintuple information and a second message tag in the second message, and obtain a second key according to the second message tag and the second quintuple information;

[0272] The first message forwarding module 204 is configured to forward the second message in response to the second key matching the first key.

[0273] Those skilled in the art will understand that referring to Figure 6 The described technical solution can be combined with any of the embodiments described above, so as to have the technical effect achieved by any of the embodiments described above. The specific contents can refer to the description of the above embodiments, and the specific contents will not be repeated here.

[0274] The following reference Figure 7 A message processing device according to an embodiment of the present disclosure is described. Figure 7 A structural block diagram of a message processing device according to an embodiment of the present disclosure is shown.

[0275] like Figure 7 As shown, the message processing device 300 includes:

[0276] The first five-tuple acquisition module 301 is configured to, in response to the target session between the first session end and the second session end being established, acquire the first five-tuple information of the first to-be-sent message belonging to the target session, and determine the first switch for connecting the first session end to the network;

[0277] A first label inserting module 302 is configured to obtain a first message label corresponding to the first five-tuple information and the first switch, and insert the first message label into the first message to be sent to obtain the first message;

[0278] The second message sending module 303 is configured to send a first message.

[0279] Those skilled in the art will understand that referring to Figure 7 The described technical solution can be combined with any of the embodiments described above, so as to have the technical effect achieved by any of the embodiments described above. The specific contents can refer to the description of the above embodiments, and the specific contents will not be repeated here.

[0280] The following reference Figure 8 A message processing device according to an embodiment of the present disclosure is described. Figure 8A structural block diagram of a message processing device according to an embodiment of the present disclosure is shown.

[0281] like Figure 8 As shown, the message processing device 400 includes:

[0282] The second message receiving module 401 is configured to receive the first message and parse the first message to obtain the first five-tuple information and the first message label in the first message;

[0283] A first key acquisition module 402, configured to acquire a first key according to the first five-tuple information and the first message label;

[0284] The second five-tuple acquisition module 403 is configured to acquire the second message and parse the second message to acquire the second five-tuple information of the second message;

[0285] The third message sending module 404 is configured to send the second message in response to the destination information in the second quintuple information matching the source information in the first quintuple information, and the second message including a second message label, where the second message label is obtained based on the first secret key and the second quintuple information.

[0286] Those skilled in the art will understand that referring to Figure 8 The described technical solution can be combined with any of the embodiments described above, so as to have the technical effect achieved by any of the embodiments described above. The specific contents can refer to the description of the above embodiments, and the specific contents will not be repeated here.

[0287] The following reference Fig. 9 A message processing device according to an embodiment of the present disclosure is described. Fig. 9 A structural block diagram of a message processing device according to an embodiment of the present disclosure is shown.

[0288] like Fig. 9 As shown, the message processing device 500 includes:

[0289] The second message acquisition module 501 is configured to acquire a first message sent by the first session end in response to the target session between the first session end and the second session end being established;

[0290] The third quintuple acquisition module 502 is configured to determine a first switch for connecting the first session end to the network, and acquire second quintuple information of a second to-be-sent message belonging to the target session;

[0291] The second label inserting module 503 is configured to obtain a second message label corresponding to the second quintuple information and the first switch, and insert the second message label into the second message to be sent to obtain a second message;

[0292] The fourth message sending module 504 is configured to send a second message.

[0293] Those skilled in the art will understand that referring to Fig. 9 The described technical solution can be combined with any of the embodiments described above, so as to have the technical effect achieved by any of the embodiments described above. The specific contents can refer to the description of the above embodiments, and the specific contents will not be repeated here.

[0294] Fig.10 A structural block diagram of an electronic device according to an embodiment of the present disclosure is shown.

[0295] The present disclosure also provides an electronic device, such as Fig.10 As shown, it includes at least one processor 601; and a memory 602 that is communicatively connected to the at least one processor 601; wherein the memory 602 stores instructions that can be executed by the at least one processor 601, and the instructions are executed by the at least one processor 601 to implement the steps in any of the above message processing methods:

[0296] Fig.11 It is a schematic diagram of the structure of a computer system suitable for implementing a method according to an embodiment of the present disclosure.

[0297] like Fig.11 As shown, the computer system 700 includes a processing unit 701, which can perform various processes in the embodiments shown in the above figures according to the program stored in the read-only memory (ROM) 702 or the program loaded from the storage part 708 to the random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the system 700 are also stored. The CPU 701, the ROM 702, and the RAM 703 are connected to each other through a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0298] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, a modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 710 as needed, so that a computer program read therefrom is installed into the storage section 708 as needed. Among them, the processing unit 701 can be implemented as a processing unit such as a CPU, a GPU, a TPU, an FPGA, an NPU, etc.

[0299] In particular, according to an embodiment of the present disclosure, the method described above with reference to the accompanying drawings can be implemented as a computer software program. Exemplarily, an embodiment of the present disclosure includes a computer program product, which includes a computer program tangibly contained on a readable medium thereof, and the computer program includes a program code for executing the method in the accompanying drawings. In such an embodiment, the computer program can be downloaded and installed from a network through a communication part 709, and / or installed from a removable medium 711. Exemplarily, an embodiment of the present disclosure includes a readable storage medium on which computer instructions are stored, and when the computer instructions are executed by a processor, the program code for executing the method in the accompanying drawings is implemented.

[0300] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each box in the road map or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. Exemplary, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0301] The units or modules involved in the embodiments described in the present disclosure may be implemented by software or hardware. The units or modules described may also be set in a processor, and the names of these units or modules do not constitute limitations on the units or modules themselves in some cases.

[0302] As another aspect, the present disclosure further provides a computer-readable storage medium, which may be a computer-readable storage medium included in the node described in the above embodiment; or a computer-readable storage medium that exists independently and is not installed in a device. The computer-readable storage medium stores one or more programs, and the programs are used by one or more processors to execute the method described in the present disclosure.

[0303] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present disclosure is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the inventive concept. The above exemplary features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) to form a technical solution.

Claims

1. A message processing method, wherein: The method is applied to a first switch, and the method includes: Obtain a first message, and parse the first message to obtain first quintuple information; In response to the first message including a first message tag, determining that the first message belongs to a message established through the first switch, and sending the first message, wherein the first message tag is obtained according to a first secret key corresponding to the first switch and the first five-tuple information; Receiving a second message, parsing the second message to obtain second quintuple information and a second message tag in the second message, and obtaining a second key according to the second message tag and the second quintuple information; In response to the second key matching the first key, forwarding the second message.

2. The message processing method according to claim 1, wherein: In response to the first message including the first message label, sending the first message includes: In response to the first quintuple information matching a first access control list and the first message including a first message label, the first message is sent.

3. The message processing method according to claim 1, wherein: In response to the first message including the first message label, before sending the first message, the method further includes: Checking whether the first message includes the first message label to obtain a first checking result; The sending of the first message in response to the first message including the first message label includes: In response to determining, according to the first checking result, that the first message includes the first message label, the first message is sent.

4. The message processing method according to claim 3, wherein: Before receiving the second message, the method further includes: In response to determining, according to the first checking result, that the first message does not include the first message label, inserting the first message label into the first message, and sending the first message after the first message label is inserted.

5. The message processing method according to claim 4, wherein: The obtaining of the first message includes: Receive the first message sent by the first session end: The method further comprises: Sending first message identifier update information, where the first message identifier update information is used to indicate the first quintuple information and the corresponding relationship between the first switch and the first message label.

6. A message processing method, wherein: The method is applied to a first session end, and the method includes: In response to the target session between the first session end and the second session end being established, obtaining first five-tuple information of a first to-be-sent message belonging to the target session, and determining a first switch for connecting the first session end to a network; Acquire a first message label corresponding to the first quintuple information and the first switch, and insert the first message label into the first message to be sent to acquire the first message; Sending the first message; The first switch is configured as: Receiving a first message, and parsing the first message to obtain first quintuple information; In response to the first message including a first message tag, determining that the first message belongs to a message established through the first switch, and sending the first message, wherein the first message tag is obtained according to a first secret key corresponding to the first switch and the first five-tuple information; Receiving a second message, parsing the second message to obtain second quintuple information and a second message tag in the second message, and obtaining a second key according to the second message tag and the second quintuple information; In response to the second key matching the first key, forwarding the second message.

7. A message processing method, wherein: The method is applied to a second switch, and the method includes: Receiving a first message, and parsing the first message to obtain first five-tuple information and a first message label in the first message; Acquire a first secret key according to the first quintuple information and the first message label; Obtain a second message, and parse the second message to obtain second quintuple information of the second message; In response to the destination information in the second quintuple information matching the source information in the first quintuple information, and the second message including a second message label, the second message is sent, and the second message label is obtained based on the first secret key and the second quintuple information.

8. The message processing method according to claim 7, wherein: In response to the destination information in the second five-tuple information matching the source information in the first five-tuple information, and the second message including a second message label, sending the second message includes: In response to the second five-tuple information matching the second access control list, the destination information in the second five-tuple information matching the source information in the first five-tuple information, and the second message including a second message label, the second message is sent.

9. The message processing method according to claim 7, wherein: In response to the destination information in the second five-tuple information matching the source information in the first five-tuple information, and the second message including a second message label, before sending the second message, the method further includes: Checking whether the second message includes the second message label to obtain a second checking result; In response to the destination information in the second five-tuple information matching the source information in the first five-tuple information, and the second message including a second message label, sending the second message includes: In response to the destination information in the second five-tuple information matching the source information in the first five-tuple information, and determining based on the second check result that the second message includes the second message label, the second message is sent.

10. The message processing method according to claim 9, wherein: The method further comprises: In response to the destination information in the second five-tuple information matching the source information in the first five-tuple information, and determining based on the second check result that the second message does not include the second message label, inserting the second message label into the second message, and sending the second message after the second message label is inserted.

11. The message processing method according to claim 10, wherein: The obtaining of the second message comprises: Receive the second message sent by the second session end: The method further comprises: Sending second message identifier update information, where the second message identifier update information is used to indicate the second quintuple information and the corresponding relationship between the second switch and the second message label.

12. A message processing method, wherein: The method is applied to the second session end, and the method includes: In response to a target session between the first session end and the second session end being established, acquiring a first message sent by the first session end; Determine a first switch for connecting the first session end to a network, and obtain second five-tuple information of a second to-be-sent message belonging to the target session; Acquire a second message label corresponding to the second quintuple information and the first switch, and insert the second message label into the second message to be sent to acquire the second message; Sending the second message; The second switch is configured as: Obtain a first message, and parse the first message to obtain first five-tuple information and a first message label in the first message; Acquire a first secret key according to the first quintuple information and the first message label; Receiving the second message, and parsing the second message to obtain second quintuple information of the second message; In response to the destination information in the second quintuple information matching the source information in the first quintuple information, and the second message including a second message label, the second message is sent, and the second message label is obtained based on the first secret key and the second quintuple information.

13. An electronic device, wherein: The method comprises a memory and at least one processor; wherein the memory is used to store one or more computer instructions, wherein the one or more computer instructions are executed by the at least one processor to implement the method steps described in any one of claims 1 to 12.

Citation Information

Patent Citations

  • Method and device for processing fragmented IP data packet

    CN113438176A