Link switching method, system and device

By constructing user data packets and updating header information on the end-side device, proactive rerouting is achieved, solving the problem of slow link failure response in large-scale networks and providing rapid fault recovery and high availability.

CN121603431APending Publication Date: 2026-03-03CLOUD INTELLIGENCE ASSETS HOLDING (SINGAPORE) PTE LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411177918.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-26
Publication Date
2026-03-03

AI Technical Summary

Technical Problem

Existing technologies are unable to quickly respond to and recover from link failures in large-scale networks, affecting network transmission performance, especially since failures caused by misconfiguration, software defects, and abnormal interactions are difficult to respond to quickly and globally.

Method used

Configure a rerouting module on the end device to construct user data packets and update header information to achieve proactive rerouting, select the target communication link and switch the link, avoiding reliance on the server to quickly respond to link failures.

Benefits of technology

It enables faster fault response and recovery in large-scale networks, provides high availability assurance, and reduces the impact of faults on target services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121603431A_ABST
    Figure CN121603431A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a link switching method, system and device, and the link switching method is applied to an end side device, and comprises the steps: obtaining a transmission data packet of a target service, and calling a re-routing module to construct a user data packet containing the transmission data packet; selecting a communication link according to the user header information of the user data packet, and sending the user data packet to a server of the target service by using the communication link; under the condition that the communication link is abnormal, calling the rerouting module to update header information of a data packet to be sent in the communication link; and switching the communication link to a target communication link based on the updated header information, and sending the data packet to be sent to the server by using the target communication link.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments in this specification relate to the field of communication technology, and in particular to link switching methods, systems and apparatus. Background Technology

[0002] With the development of internet technology, large-scale networks typically carry various sensitive services such as cloud computing, gaming, finance, and AI training and inference. Ensuring high network availability has become a critical issue. In existing technologies, device or link failures are inevitable in large-scale networks. To avoid the impact of these failures, detection technologies are often used to quickly detect network faults. However, this process largely relies on upper-layer protocols or maintenance personnel for fault recovery and bypass. Furthermore, link switching schemes based on routing protocols can also bypass faults, but they struggle to cover various faults caused by misconfiguration, software defects, and abnormal interactions in large-scale networks, and they cannot provide a rapid global response. This significantly impacts network transmission performance, thus necessitating an effective solution to address these problems. Summary of the Invention

[0003] In view of this, embodiments of this specification provide a link switching method. One or more embodiments of this specification also relate to a link switching system, a link switching device, a computing device, a computer-readable storage medium, and a computer program product, to address the technical deficiencies existing in the prior art.

[0004] According to a first aspect of the embodiments of this specification, a link switching method is provided, applied to an end-side device, comprising:

[0005] Obtain the transmission data packets of the target service, and call the rerouting module to construct a user data packet containing the transmission data packets;

[0006] A communication link is selected based on the user header information of the user data packet, and the user data packet is sent to the server of the target service using the communication link;

[0007] In the event of an abnormal communication link, the rerouting module is invoked to update the header information of the data packets to be sent in the communication link;

[0008] Based on the updated header information, the communication link is switched to the target communication link, and the data packet to be sent is sent to the server using the target communication link.

[0009] According to a second aspect of the embodiments of this specification, a link switching system is provided, the link switching system including a processing module and a rerouting module, including:

[0010] The processing module is used to obtain the transmission data packets of the target service and send them to the rerouting module;

[0011] The rerouting module is used to construct a user data packet containing the transmitted data packet and feed it back to the processing module;

[0012] The processing module is configured to select a communication link based on the user header information of the user data packet, and use the communication link to send the user data packet to the server of the target service; in the event of an abnormal communication link, the data packet to be sent in the communication link is sent to the rerouting module.

[0013] The rerouting module is used to update the header information of the data packet to be sent and to feed back the data packet to be sent with the updated header information to the processing module.

[0014] The processing module is used to switch the communication link to the target communication link based on the updated header information, and use the target communication link to send the data packet to be sent to the server.

[0015] According to a third aspect of the embodiments of this specification, a link switching device is provided, applied to an end-side device, comprising:

[0016] The acquisition unit is configured to acquire the transmission data packets of the target service and call the rerouting module to construct a user data packet containing the transmission data packets;

[0017] The selection unit is configured to select a communication link based on the user header information of the user data packet, and use the communication link to send the user data packet to the server of the target service;

[0018] The update unit is configured to call the rerouting module to update the header information of the data packets to be sent in the communication link in the event of an anomaly in the communication link.

[0019] The sending unit is configured to switch the communication link to the target communication link based on the updated header information, and use the target communication link to send the data packet to be sent to the server.

[0020] According to a fourth aspect of the embodiments of this specification, a computing device is provided, comprising:

[0021] Memory and processor;

[0022] The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions, which, when executed by the processor, implement the steps of the link switching method described above.

[0023] According to a fifth aspect of the embodiments of this specification, a computer-readable storage medium is provided that stores computer-executable instructions, which, when executed by a processor, implement the steps of the link switching method described above.

[0024] According to a sixth aspect of the embodiments of this specification, a computer program product is provided, including a computer program or instructions that, when executed by a processor, implement the steps of the link switching method described above.

[0025] The link switching method provided in this embodiment enables proactive rerouting by the end-side device, achieving faster fault response and recovery globally. After the end-side device obtains the transmission data packet of the target service, it calls the rerouting module configured on the end-side device to construct a user data packet containing the transmission data packet; the user data packet and the transmission data packet are of different types. Based on this, a communication link can be selected using the user header information of the user data packet, and the user data packet is sent to the server of the target service via the communication link to complete the transmission of the associated target service data packet. Furthermore, if a communication link anomaly is detected, the rerouting module can be called to update the header information of the data packet to be sent in the communication link. This allows the end-side device to proactively perform rerouting after updating the header information of the data packet to be sent, thereby enabling the communication link to be switched to the target communication link based on the updated header information, and the data packet to be sent to the server via the target communication link. This achieves faster response to link failures and recovery of data packet transmission without relying on the server, providing high availability assurance for large-scale networks. Attached Figure Description

[0026] Figure 1 This is a schematic diagram of a link switching method provided in one embodiment of this specification;

[0027] Figure 2 This is a flowchart of a link switching method provided in one embodiment of this specification;

[0028] Figure 3 This is a schematic diagram of the link switching process in a link switching method provided in one embodiment of this specification;

[0029] Figure 4 This is a flowchart illustrating the processing procedure of a link switching method provided in one embodiment of this specification;

[0030] Figure 5 This is a schematic diagram of the structure of a link switching system provided in one embodiment of this specification;

[0031] Figure 6 This is a schematic diagram of the structure of a link switching device provided in one embodiment of this specification;

[0032] Figure 7 This is a structural block diagram of a computing device provided in one embodiment of this specification. Detailed Implementation

[0033] Many specific details are set forth in the following description to provide a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar extensions without departing from the spirit of this specification. Therefore, this specification is not limited to the specific implementations disclosed below.

[0034] The terminology used in one or more embodiments of this specification is for the purpose of describing particular embodiments only and is not intended to be limiting of the one or more embodiments of this specification. The singular forms “a,” “described,” and “the” as used in one or more embodiments of this specification and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.

[0035] It should be understood that although the terms first, second, etc., may be used to describe various information in one or more embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first may also be referred to as second without departing from the scope of one or more embodiments of this specification, and similarly, second may also be referred to as first. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to a determination."

[0036] Furthermore, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties. Moreover, the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.

[0037] First, the terms and concepts used in one or more embodiments of this specification will be explained.

[0038] ECMP hashing: Equal-cost Multipath Routing, can calculate the hash result based on the data packet header information and select the path.

[0039] RTO: Retransmission Time Out, a TCP protocol mechanism that determines if a data transmission timeout exceeds this period and a retransmission operation is required.

[0040] TCP (Transmission Control Protocol) is a connection-oriented, reliable, byte-stream-based transport layer communication protocol.

[0041] UDP: User Datagram Protocol (UDP) is a protocol that operates at the transport layer of the OSI (Open Systems Interconnection) model. It uses IP as its underlying protocol and provides applications with a fewer protocol mechanisms to send messages to other programs.

[0042] This specification provides a link switching method, and also relates to a link switching system, a link switching device, a computing device, a computer-readable storage medium, and a computer program product, which will be described in detail in the following embodiments.

[0043] In practical applications, solutions such as Fast Reroute require pre-preparing backup links for critical nodes and links, and these backup links are prone to overload. While global routing and traffic engineering can perform traffic scheduling on a global scale, they require transmitting topology updates across the entire network or adjusting transmission link weights based on traffic characteristics. In large-scale networks with numerous routing entries, their response time can reach the minute level. Therefore, an effective solution is urgently needed to address these issues.

[0044] See Figure 1The schematic diagram illustrates the link switching method provided in this embodiment. To enable proactive rerouting by the end-side device and achieve faster fault response and recovery globally, the end-side device, after obtaining the transmission data packet of the target service, can invoke the rerouting module configured on the end-side device to construct a user data packet containing the transmission data packet; and the user data packet is of a different type than the transmission data packet. Based on this, a communication link can be selected by combining the user header information of the user data packet, and the user data packet can be sent to the server of the target service using the communication link to complete the transmission of the associated target service data packet. Furthermore, if a communication link anomaly is detected, the rerouting module can be invoked to update the header information of the data packet to be sent in the communication link; after the end-side device completes the header information update of the data packet to be sent, it can proactively complete rerouting, thereby enabling the communication link to be switched to the target communication link based on the updated header information, and the data packet to be sent to the server using the target communication link. This achieves faster response to link failures and recovery of data packet transmission without relying on the server, providing high availability assurance for large-scale networks.

[0045] See Figure 2 , Figure 2 A flowchart of a link switching method according to an embodiment of this specification is shown. The method is applied to an end-side device and specifically includes the following steps.

[0046] Step S202: Obtain the transmission data packet of the target service, and call the rerouting module to construct a user data packet containing the transmission data packet.

[0047] The link switching method provided in this embodiment is applied to the end-side device. In the event of a link failure, the end-side device can actively trigger a rerouting operation through the rerouting module, thereby selecting a new link for data packet transmission. This ensures rapid detection and response to the fault, preventing the fault from persisting for an extended period and affecting data packet transmission, which in turn affects the operation of the target service.

[0048] Specifically, the target service refers to a service running on the endpoint device. It needs to transmit data packets with the server to provide corresponding service content to the user. The target service can be related to services such as cloud computing, gaming, finance, and AI training and inference. For example, if the target service is a gaming service, transmitting game-related data packets between the client and the game server allows the client to display game screenshots for the user to play. Alternatively, if the target service is an AI training and inference service, transmitting model parameter data packets between the client and the server providing the AI ​​training service allows the server to train a target model (such as an image recognition model, text model, question-answering model, etc.) according to the client's needs and deploy it to the client for use. In practical applications, the target service can be any type of service with network transmission requirements; this embodiment does not impose any limitations.

[0049] Accordingly, the transmission data packet specifically refers to the data packet that the target service needs to send to the server during its runtime phase; it can be understood as a TCP data packet associated with the target service. Correspondingly, the rerouting module specifically refers to a module configured on the end-side device responsible for encapsulating all transmission data packets with a layer of user data packets. It can define header information for the data packets, thereby enabling the end-side device to actively detect link failures and quickly switch links. Correspondingly, the user data packet specifically refers to the data packet obtained after encapsulating the transmission data packet; it can be a UDP data packet.

[0050] Therefore, to enable proactive rerouting by the end-device and achieve faster fault response and recovery globally, after the end-device obtains the transmission data packet of the target service, it can invoke the rerouting module configured on the end-device to construct a user data packet containing the transmission data packet; and the user data packet is of a different type than the transmission data packet. Based on this, a communication link can be selected using the user header information of the user data packet, and the user data packet can be sent to the server of the target service using this communication link to complete the transmission of the associated target service data packet. Furthermore, if a communication link anomaly is detected, the rerouting module can be invoked to update the header information of the data packet to be sent in the communication link; this allows the end-device to proactively perform rerouting after updating the header information of the data packet to be sent, thereby enabling the switching of the communication link to the target communication link based on the updated header information, and the use of the target communication link to send the data packet to be sent to the server.

[0051] Furthermore, considering that once the end-side device and the server establish a network connection, a unique transmission link is identified, and in the event of a link failure, retransmission alone cannot escape the fault, and redundant links in the network are not fully utilized. Therefore, to support proactive rerouting by the end-side device and complete link switching in the event of link failure, a user data packet can be encapsulated outside the data packet before transmission, ensuring that the end-side device can initiate link switching operations in the event of a link failure. In this embodiment, the specific implementation is as follows:

[0052] The system acquires the transmission data packet of the target service and determines the transmission header information of the transmission data packet; it extracts the source address information and destination address information from the transmission header information, calls the rerouting module to determine the source port information, and determines the preset destination port information; based on the source address information, the destination address information, the source port information, and the destination port information, it constructs a user data packet containing the transmission data packet; wherein, the source address information and the destination address information in the transmission header information are the same as the user source address information and the user destination address information in the user header information; the source port information is obtained by the rerouting module by querying a pre-stored source port maintenance table.

[0053] Specifically, the transmission header information refers to the message header information corresponding to the transmitted data packet, which includes the source address information (source IP, sIP), destination address information (destination IP, dIP), source port information (sport), destination port information (dport), and protocol number associated with the transmitted data packet. Correspondingly, the preset destination port information refers to a uniformly set specified port, such as 251, which can be set according to actual needs. This embodiment does not impose any limitations on it.

[0054] Based on this, after obtaining the transmission data packet associated with the target service, in order to support the rerouting operation when the end device detects a link anomaly, the transmission header information of the transmission data packet can be determined first. At this time, the source address information and destination address information can be extracted from the transmission header information and used directly as the source address and destination address of the user data packet to be encapsulated. At the same time, in order to specify the communication link to complete the transmission of the data packet, the rerouting module can be called to randomly determine the source port information and determine the preset destination port information.

[0055] Based on this, a user data packet encapsulated with the source address information, destination address information, source port information, and destination port information can be constructed to encapsulate the transmitted data packet. This allows the transmitted data packet to be sent to the server. Furthermore, the source and destination address information in the transmission header is identical to the user source and destination address information in the user header; simultaneously, the source port information is randomly obtained by the rerouting module from a pre-stored source port maintenance table.

[0056] In other words, to support rerouting on the end-side device when the link fails, a rerouting module (Reroute module) can be inserted into the Linux kernel on the end side. This module can encapsulate all TCP packets associated with the target service with a UDP packet, and the source IP and destination IP in the header of the encapsulated UDP packet are the same as those in the inner TCP packet. Furthermore, the source port is randomly assigned by the rerouting module, while the destination port can be uniformly set to a specified port. This allows data packets to be sent to the server by transmitting UDP packets containing TCP packets, ensuring the normal operation of the target service.

[0057] This embodiment uses AI training and inference service as an example to illustrate the link switching method. Descriptions of other scenarios can refer to the same or corresponding descriptions in this embodiment, and no limitations are made here. Specifically, the end-side device pre-configures the Reroute module. When the end-side device sends TCP packets (encapsulating initial model parameters) to the server using the model training service, the source IP and destination IP can be extracted from the header of the TCP packet to be sent. Simultaneously, the Reroute module is called to randomly specify the source port, and the destination port can be uniformly set to 251. Based on this, a UDP packet is encapsulated around the TCP packet for subsequent transmission to the server, enabling the server to complete the training of the specified model based on the initial model parameters provided by the end-side device.

[0058] In summary, by calling the rerouting module to encapsulate a user data packet on top of the transmitted data packet, it is possible to update the header of the user data packet by adjusting the source port in the event of a link failure. This allows for the selection of a new link for data packet transmission, avoiding the need for more fault recovery time and thus preventing service disruptions.

[0059] Step S204: Select a communication link based on the user header information of the user data packet, and use the communication link to send the user data packet to the server of the target service.

[0060] Specifically, after the rerouting module encapsulates the transmitted data packet with a user data packet, in order to successfully send the user data packet containing the transmitted data packet to the target service's server for processing, a communication link can be selected based on the user header information of the user data packet. This communication link is then used to send the user data packet to the target service's server. In other words, the transmitted data packet associated with the target service will be re-encapsulated according to the above logic, and then the entire data packet will be sent to the server via the currently selected communication link. Here, the communication link specifically refers to the link between the end-side device selected based on the user header information and the server that connects to transmit data packets.

[0061] Furthermore, when selecting a communication link to transmit user data packets, this can be achieved in the following way:

[0062] Extract the user header information of the user data packet; perform a hash calculation on the user header information to obtain the user hash value; select a communication link according to the user hash value, and execute the step of sending the user data packet to the server of the target service using the communication link.

[0063] Specifically, the user header information refers to the message header corresponding to the user data packet, which includes the source port, destination port, source IP, destination IP, and protocol number associated with the user data packet. Correspondingly, the user hash value refers to the hash value obtained by performing an ECMP hash operation on the message header information, which matches a communication link.

[0064] Based on this, after obtaining the user data packet, the user header information of the user data packet can be extracted; and the user header information can be hashed using ECMP hash to obtain the user hash value; at this time, a communication link can be selected according to the user hash value, and it can be used as the communication connection between the end device and the server, and the steps of sending the user data packet to the target service server using the communication link can continue.

[0065] Following the previous example, after obtaining a UDP packet containing TCP packets, we can extract the UDP packet header information {sIP, sport, dIP, dport, protocol number}. Then, we use ECMP hashing to perform a hash operation on the header information to obtain the hash value Hash1. Finally, we select the appropriate packet based on the hash value Hash1. Figure 3 Communication link 'a' is used as the communication connection between the end device and the server. Then, UDP packets containing TCP packets are sent to the server via communication link 'a', so that the server can train the target model based on the initial model parameters encapsulated in the data packets.

[0066] In summary, by performing hash operations on the header information of user data packets to select communication links, it is possible to switch links by adjusting the source port of user data packets when a link is abnormal. This allows for rapid repair of link failures without affecting the operation of the target service.

[0067] Step S206: In the event of an abnormal communication link, the rerouting module is invoked to update the header information of the data packets to be sent in the communication link.

[0068] Specifically, after selecting the communication link as described above, all subsequent data packets can be sent through the communication link. During this stage, network fluctuations or equipment failures can cause data packets to fail to reach the server. To avoid packet loss, a retransmission mechanism is typically used; however, this operation is affected by link recovery. If link recovery fails, data packet transmission will also fail.

[0069] Therefore, to ensure the target service continues to operate normally and data packets continue to be sent from the endpoint to the server in this situation, the endpoint can actively reroute, i.e., actively switch to another communication link. Since the transmission of data packets is accomplished by encapsulating user data packets, in the event of a communication link failure, the rerouting module can be invoked to update the header information of the data packets to be sent in the communication link. After the header information is updated, a new link can be selected based on the updated header information, thereby completing the retransmission of the data packets to be sent to the server, and quickly resolving the problem of data packet transmission failure caused by link failure.

[0070] Specifically, the data packets to be sent refer to data packets that are related to user data packets and need to be transmitted to the server via a communication link. For example, if the target service has n TCP data packets, during the data packet transmission to the server, each TCP data packet will be encapsulated with a UDP data packet through the above process before being sent to the server via a specified communication link. During the transmission process, if the link fails, m (m < n) of the n data packets will fail to reach the server via the failed link. These packets can be considered as data packets to be sent, and they are UDP data packets to be sent obtained after re-encapsulation by the rerouting module. Correspondingly, the header information is the message header corresponding to the data packets to be sent.

[0071] In practice, since the data packets sent to the server are user data packets that are re-encapsulated from the transmitted data packets, the congestion management strategy can be used to detect whether the link is abnormal, thereby triggering the call to the rerouting module to switch links.

[0072] In this embodiment, the specific implementation method is as follows:

[0073] The communication link is subjected to congestion detection and timeout retransmission detection according to the preset congestion management strategy; if the congestion detection or timeout retransmission detection fails, the communication link is determined to be abnormal, and the step of calling the rerouting module to update the header information of the data packets to be sent in the communication link is executed.

[0074] Specifically, the congestion management strategy refers to the TCP congestion management mechanism. Based on this, when transmitting user data packets through a communication link, the TCP congestion management mechanism can be used to perform congestion detection and timeout retransmission detection on the communication link. If either congestion detection or timeout retransmission detection fails, it indicates that the communication link is abnormal. Therefore, the step of calling the rerouting module to update the header information of the data packets to be sent in the communication link can be executed to achieve proactive rerouting by the end-side device.

[0075] In summary, by employing a congestion management mechanism to detect communication link anomalies, problems can be quickly identified when an anomaly occurs, allowing for rapid response and subsequent link switching to avoid impacting service operation.

[0076] Furthermore, when the rerouting module updates the header information of the data packet to be sent in the communication link, considering that the data packet to be sent also belongs to the user data packet type, it is a data packet obtained by re-encapsulating the transmitted data packet. The source IP and destination IP in its message information are the same as those of the transmitted data packet, and the source port is randomly assigned by the rerouting module. Therefore, by updating the source port information in the header information, the switching to the new link can be completed after the header information is updated. In this embodiment, the specific implementation method is as follows:

[0077] The system identifies the data packets to be sent in the communication link and obtains the header information of the data packets to be sent; it then identifies the source port information to be updated in the header information and calls the rerouting module to update the source port information to be updated, which serves as the update of the header information.

[0078] Specifically, the source port information to be updated refers to the source port corresponding to the data packet to be sent. Based on this, after a communication link failure, to ensure that data packets can continue to be transmitted to the server, the data packets to be sent in the communication link can be identified, and their header information can be obtained. Based on this, the source port information to be updated can be determined from the header information, and the rerouting module can be called to update the source port information, which will then be used as the header information update. This allows for subsequent link switching operations to be completed by combining the new header information.

[0079] In summary, by updating the source port information in the header of the data packet to be sent, the header information of the data packet to be sent can be updated without affecting other header information. This allows the end device to reselect the link, ensuring that the data packet can be successfully sent to the server.

[0080] Furthermore, to avoid the source port remaining unchanged before and after the rerouting module switches source ports, thus affecting the link switching operation, a table recording source port information can be maintained on the end-side device. This allows the new source port information to be read and used when switching source port information. In this embodiment, the specific implementation is as follows:

[0081] The user source port information is determined from the user header information, and a pre-stored source port maintenance table is loaded; the rerouting module is called to query the source port maintenance table, and candidate source port information different from the user source port information is determined based on the query result; the rerouting module is called to update the source port information to be updated to the candidate source port information.

[0082] Specifically, user source port information refers to the source port information in the header of user data packets. Correspondingly, the source port maintenance table is a table cached by the end device to record the source port information corresponding to currently used UDP data packets. Furthermore, candidate source port information refers to source port information that differs from the user source port information.

[0083] Based on this, when switching source port information, the user's source port information can be determined in the user header information first, and the pre-stored source port maintenance table can be loaded. At this time, the rerouting module can be called to query the source port maintenance table, thereby determining the candidate source port information that is different from the user's source port information based on the query results. Then, the rerouting module can be called to update the source port information to be updated to the candidate source port information, thereby updating the header information corresponding to the data packet to be sent, so as to facilitate the selection of a new communication link for subsequent use.

[0084] Continuing with the previous example, after determining communication link 'a', the end device continuously sends UDP packets (encapsulated with TCP packets) related to the model training service to the server via communication link 'a'. At some point, thanks to TCP's congestion management mechanism, if congestion is detected on communication link 'a', unsent UDP packets cannot be delivered to the server, thus affecting model training operations. Therefore, we can first determine the UDP packets that have not yet been sent, and simultaneously determine the source port information in the header of these unsent UDP packets. Based on this, we can query a table recording the currently used outer source ports, and then randomly generate a target source port that differs from the source port information in the header of the unsent UDP packets. The header information of the unsent UDP packets will then be updated to {sIP, target sport, dIP, dport, protocol number}, and a new link can be selected according to this header information to complete the transmission of the remaining UDP packets.

[0085] In summary, by caching the source port maintenance table on the end-side device, the end-side device can select different candidate source port information when updating packet information to complete the update, thereby enabling link switching.

[0086] Step S208: Based on the updated header information, switch the communication link to the target communication link, and use the target communication link to send the data packet to be sent to the server.

[0087] Specifically, after the rerouting module updates the header information of the data packet to be sent, the selection of the communication link is based on the header information. Therefore, after the header information is updated, a new communication link can be selected based on the updated header information, thereby switching the communication link to the target communication link. This facilitates the subsequent transmission of the data packet to the server using the target communication link. The target communication link specifically refers to the new communication link selected based on the updated header information.

[0088] Furthermore, during link switching, a new hash calculation is performed based on the updated header information, and a new link is selected. In this embodiment, the specific implementation is as follows:

[0089] The updated header information is hashed to obtain an updated hash value; a target communication link is selected according to the updated hash value, the communication link is updated to the target communication link, and the data packet to be sent is sent to the server using the target communication link.

[0090] Based on this, after obtaining the updated header information, a hash calculation can be performed on the updated header information to obtain the updated hash value. Then, the target communication link can be selected according to the updated hash value, thereby updating the abnormal communication link to the target communication link and executing the step of sending the data packet to be sent to the server using the target communication link.

[0091] It should be noted that the process of calculating the updated hash value is similar to the process of calculating the user hash value described above. The same or corresponding descriptions can be found in the descriptions in the above embodiments, and this embodiment does not make any limitations here.

[0092] Continuing with the previous example, the header information of unsent UDP packets is updated to {sIP, destination port, dIP, dport, protocol number}. ECMP hashing can be used to perform a rehashing operation on the header information to obtain the hash value Hash2. Then, communication link b is selected based on the hash value Hash2 and used as the communication connection between the end device and the server. Afterwards, communication link a can be switched to communication link b, see [link to relevant documentation]. Figure 3 The diagram shown illustrates how, by continuing to send UDP data packets to the server via communication link b, the server can train the target model based on the initial model parameters encapsulated in the data packets.

[0093] The link switching method provided in this embodiment enables proactive rerouting by the end-side device, achieving faster fault response and recovery globally. After the end-side device obtains the transmission data packet of the target service, it calls the rerouting module configured on the end-side device to construct a user data packet containing the transmission data packet; the user data packet and the transmission data packet are of different types. Based on this, a communication link can be selected using the user header information of the user data packet, and the user data packet is sent to the server of the target service via the communication link to complete the transmission of the associated target service data packet. Furthermore, if a communication link anomaly is detected, the rerouting module can be called to update the header information of the data packet to be sent in the communication link. This allows the end-side device to proactively perform rerouting after updating the header information of the data packet to be sent, thereby enabling the communication link to be switched to the target communication link based on the updated header information, and the data packet to be sent to the server via the target communication link. This achieves faster response to link failures and recovery of data packet transmission without relying on the server, providing high availability assurance for large-scale networks.

[0094] The following is in conjunction with the appendix Figure 4 Taking the application of the link switching method provided in this specification in a game scenario as an example, the link switching method will be further explained. Figure 4The present specification shows a flowchart of a link switching method according to an embodiment, which includes the following steps.

[0095] Step S402: Obtain the transmission data packet of the game service and determine the transmission header information of the transmission data packet.

[0096] Step S404: Extract source address information and destination address information from the transmission header information, call the rerouting module to determine source port information, and determine the preset destination port information.

[0097] Step S406: Based on the source address information, destination address information, source port information, and destination port information, construct a user data packet containing the transmitted data packet.

[0098] Step S408: Extract the user header information of the user data packet, perform hash calculation on the user header information, and obtain the user hash value.

[0099] Step S410: Select a communication link according to the user hash value, and use the communication link to send the user data packet to the game server.

[0100] Step S412: In the event of a communication link malfunction, determine the data packets to be sent in the communication link and obtain the header information of the data packets to be sent.

[0101] Step S414: Determine the source port information to be updated in the header information, and call the rerouting module to update the source port information to be updated as an update of the header information.

[0102] Step S416: Perform hash calculation on the updated header information to obtain the updated hash value, and select the target communication link according to the updated hash value.

[0103] Step S418: Update the communication link to the target communication link, and use the target communication link to send the data packet to be sent to the game server.

[0104] In summary, to enable proactive rerouting by the end-device and achieve faster fault response and recovery globally, after the end-device obtains the transmission data packet of the target service, it can invoke the rerouting module configured on the end-device to construct a user data packet containing the transmission data packet; and the user data packet and the transmission data packet should be of different types. Based on this, a communication link can be selected using the user header information of the user data packet, and the user data packet can be sent to the server of the target service using this communication link to complete the transmission of the associated target service data packet. Furthermore, if a communication link anomaly is detected, the rerouting module can be invoked to update the header information of the data packet to be sent in the communication link. This allows the end-device to proactively perform rerouting after updating the header information of the data packet to be sent, thereby enabling the switching of the communication link to the target communication link based on the updated header information, and using the target communication link to send the data packet to be sent to the server. This achieves faster response to link failures and recovery of data packet transmission without relying on the server, providing high availability assurance for large-scale networks.

[0105] Corresponding to the above method embodiments, this specification also provides a link switching system embodiment. Figure 5 A schematic diagram of a link switching system according to one embodiment of this specification is shown. Figure 5 As shown, the link switching system 500 includes a processing module 510 and a rerouting module 520, comprising:

[0106] The processing module 510 is used to obtain the transmission data packet of the target service and send it to the rerouting module;

[0107] The rerouting module 520 is used to construct a user data packet containing the transmitted data packet and feed it back to the processing module;

[0108] The processing module 510 is configured to select a communication link based on the user header information of the user data packet, and use the communication link to send the user data packet to the server of the target service; in the event of an abnormal communication link, the data packet to be sent in the communication link is sent to the rerouting module.

[0109] The rerouting module 520 is used to update the header information of the data packet to be sent and to feed back the data packet to be sent with the updated header information to the processing module.

[0110] The processing module 510 is used to switch the communication link to the target communication link based on the updated header information, and use the target communication link to send the data packet to be sent to the server.

[0111] In an optional embodiment, obtaining the transmission data packet of the target service and invoking the rerouting module to construct a user data packet containing the transmission data packet includes:

[0112] Obtain the transmission data packet of the target service and determine the transmission header information of the transmission data packet; extract the source address information and destination address information from the transmission header information, call the rerouting module to determine the source port information, and determine the preset destination port information; based on the source address information, the destination address information, the source port information, and the destination port information, construct a user data packet containing the transmission data packet.

[0113] In an optional embodiment, the step of selecting a communication link based on the user header information of the user data packet and using the communication link to send the user data packet to the server of the target service includes:

[0114] Extract the user header information of the user data packet; perform a hash calculation on the user header information to obtain the user hash value; select a communication link according to the user hash value, and execute the step of sending the user data packet to the server of the target service using the communication link.

[0115] In an optional embodiment, the step of invoking the rerouting module to update the header information of the data packets to be sent in the communication link includes:

[0116] The system identifies the data packets to be sent in the communication link and obtains the header information of the data packets to be sent; it then identifies the source port information to be updated in the header information and calls the rerouting module to update the source port information to be updated, which serves as the update of the header information.

[0117] In an optional embodiment, the step of invoking the rerouting module to update the source port information to be updated includes:

[0118] The user source port information is determined from the user header information, and a pre-stored source port maintenance table is loaded; the rerouting module is called to query the source port maintenance table, and candidate source port information different from the user source port information is determined based on the query result; the rerouting module is called to update the source port information to be updated to the candidate source port information.

[0119] In an optional embodiment, the step of switching the communication link to the target communication link based on the updated header information, and using the target communication link to send the data packet to be sent to the server, includes:

[0120] The updated header information is hashed to obtain an updated hash value; a target communication link is selected according to the updated hash value, the communication link is updated to the target communication link, and the data packet to be sent is sent to the server using the target communication link.

[0121] In an optional embodiment, the source address information and the destination address information in the transmission header information are the same as the user source address information and the user destination address information in the user header information; the source port information is obtained by the rerouting module from a pre-stored source port maintenance table.

[0122] In an optional embodiment, before the step of calling the rerouting module to update the header information of the data packets to be sent in the communication link in the event of a communication link failure, the method further includes:

[0123] The communication link is subjected to congestion detection and timeout retransmission detection according to the preset congestion management strategy; if the congestion detection or timeout retransmission detection fails, the communication link is determined to be abnormal, and the step of calling the rerouting module to update the header information of the data packets to be sent in the communication link is executed.

[0124] The above is an illustrative scheme of a link switching system according to this embodiment. It should be noted that the technical solution of this link switching system and the technical solution of the link switching method described above belong to the same concept. For details not described in detail in the technical solution of the link switching system, please refer to the description of the technical solution of the link switching method described above.

[0125] Corresponding to the above method embodiments, this specification also provides embodiments of link switching devices. Figure 6 A schematic diagram of a link switching device according to one embodiment of this specification is shown. Figure 6 As shown, this device is applied to an end-side device and includes:

[0126] The acquisition unit 602 is configured to acquire the transmission data packet of the target service and call the rerouting module to construct a user data packet containing the transmission data packet;

[0127] Selection unit 604 is configured to select a communication link based on the user header information of the user data packet, and use the communication link to send the user data packet to the server of the target service;

[0128] The update unit 606 is configured to call the rerouting module to update the header information of the data packets to be sent in the communication link when the communication link is abnormal.

[0129] The sending unit 608 is configured to switch the communication link to the target communication link based on the updated header information, and use the target communication link to send the data packet to be sent to the server.

[0130] In an optional embodiment, the acquisition unit 602 is further configured to:

[0131] Obtain the transmission data packet of the target service and determine the transmission header information of the transmission data packet; extract the source address information and destination address information from the transmission header information, call the rerouting module to determine the source port information, and determine the preset destination port information; based on the source address information, the destination address information, the source port information, and the destination port information, construct a user data packet containing the transmission data packet.

[0132] In an optional embodiment, the selection unit 604 is further configured to:

[0133] Extract the user header information of the user data packet; perform a hash calculation on the user header information to obtain the user hash value; select a communication link according to the user hash value, and execute the step of sending the user data packet to the server of the target service using the communication link.

[0134] In an optional embodiment, the update unit 606 is further configured to:

[0135] The system identifies the data packets to be sent in the communication link and obtains the header information of the data packets to be sent; it then identifies the source port information to be updated in the header information and calls the rerouting module to update the source port information to be updated, which serves as the update of the header information.

[0136] In an optional embodiment, the update unit 606 is further configured to:

[0137] The user source port information is determined from the user header information, and a pre-stored source port maintenance table is loaded; the rerouting module is called to query the source port maintenance table, and candidate source port information different from the user source port information is determined based on the query result; the rerouting module is called to update the source port information to be updated to the candidate source port information.

[0138] In an optional embodiment, the transmitting unit 608 is further configured to:

[0139] The updated header information is hashed to obtain an updated hash value; a target communication link is selected according to the updated hash value, the communication link is updated to the target communication link, and the data packet to be sent is sent to the server using the target communication link.

[0140] In an optional embodiment, the source address information and the destination address information in the transmission header information are the same as the user source address information and the user destination address information in the user header information; the source port information is obtained by the rerouting module from a pre-stored source port maintenance table.

[0141] In an optional embodiment, the apparatus further includes:

[0142] The detection module is configured to perform congestion detection and timeout retransmission detection on the communication link according to a preset congestion management strategy; if the congestion detection or timeout retransmission detection fails, the communication link is determined to be abnormal, and the step of calling the rerouting module to update the header information of the data packets to be sent in the communication link is executed.

[0143] The above is a schematic scheme of a link switching device according to this embodiment. It should be noted that the technical solution of this link switching device and the technical solution of the link switching method described above belong to the same concept. For details not described in detail in the technical solution of the link switching device, please refer to the description of the technical solution of the link switching method described above.

[0144] Figure 7 A structural block diagram of a computing device 700 according to one embodiment of this specification is shown. The components of the computing device 700 include, but are not limited to, a memory 710 and a processor 720. The processor 720 is connected to the memory 710 via a bus 730, and a database 750 is used to store data.

[0145] The computing device 700 also includes an access device 740, which enables the computing device 700 to communicate via one or more networks 760. Examples of these networks include Public Switched Telephone Network (PSTN), Local Area Network (LAN), Wide Area Network (WAN), Personal Area Network (PAN), or combinations of communication networks such as the Internet. The access device 740 may include one or more of any type of wired or wireless network interface (e.g., a network interface card (NIC)), such as an IEEE 802.11 Wireless Local Area Network (WLAN) wireless interface, a Wi-MAX (Worldwide Interoperability for Microwave Access) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, or a Near Field Communication (NFC) interface.

[0146] In one embodiment of this specification, the above-described components of the computing device 700 and Figure 7 Other components, not shown, can also be connected to each other, for example, via a bus. It should be understood that... Figure 7 The block diagram of the computing device shown is for illustrative purposes only and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.

[0147] The computing device 700 can be any type of stationary or mobile computing device, including mobile computers or mobile computing devices (e.g., tablet computers, personal digital assistants, laptop computers, notebook computers, netbooks, etc.), mobile phones (e.g., smartphones), wearable computing devices (e.g., smartwatches, smart glasses, etc.) or other types of mobile devices, or stationary computing devices such as desktop computers or personal computers (PCs). The computing device 700 can also be a mobile or stationary server.

[0148] The processor 720 is configured to execute the following computer-executable instructions, which, when executed by the processor, implement the steps of the link switching method described above.

[0149] The above is an illustrative scheme of a computing device according to this embodiment. It should be noted that the technical solution of this computing device and the technical solution of the link switching method described above belong to the same concept. For details not described in detail in the technical solution of the computing device, please refer to the description of the technical solution of the link switching method described above.

[0150] An embodiment of this specification also provides a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the steps of the link switching method described above.

[0151] The above is an illustrative scheme of a computer-readable storage medium according to this embodiment. It should be noted that the technical solution of this storage medium and the technical solution of the link switching method described above belong to the same concept. For details not described in detail in the technical solution of the storage medium, please refer to the description of the technical solution of the link switching method described above.

[0152] An embodiment of this specification also provides a computer program, wherein when the computer program is executed in a computer, it causes the computer to perform the steps of the above-described link switching method.

[0153] The above is an illustrative scheme of a computer program according to this embodiment. It should be noted that the technical solution of this computer program and the technical solution of the link switching method described above belong to the same concept. For details not described in detail in the technical solution of the computer program, please refer to the description of the technical solution of the link switching method described above.

[0154] An embodiment of this specification also provides a computer program product, including a computer program or instructions that, when executed by a processor, implement the steps of the link switching method described above.

[0155] The above is an illustrative scheme of a computer program product according to this embodiment. It should be noted that the technical solution of this computer program product and the technical solution of the link switching method described above belong to the same concept. For details not described in detail in the technical solution of the computer program product, please refer to the description of the technical solution of the link switching method described above.

[0156] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.

[0157] The computer instructions include computer program code, which may be in the form of source code, object code, executable file, or certain intermediate forms. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium may be appropriately added or removed according to the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media may not include electrical carrier signals and telecommunication signals.

[0158] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments in this specification are not limited to the described order of actions, because according to the embodiments in this specification, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the embodiments in this specification.

[0159] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0160] The preferred embodiments disclosed above are merely illustrative of this specification. The optional embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the embodiments described herein. These embodiments are selected and specifically described in this specification to better explain the principles and practical applications of the embodiments, thereby enabling those skilled in the art to better understand and utilize this specification. This specification is limited only by the claims and their full scope and equivalents.

Claims

1. A link switching method, applied to an end-side device, comprising: Obtain the transmission data packets of the target service, and call the rerouting module to construct a user data packet containing the transmission data packets; A communication link is selected based on the user header information of the user data packet, and the user data packet is sent to the server of the target service using the communication link; In the event of an abnormal communication link, the rerouting module is invoked to update the header information of the data packets to be sent in the communication link; Based on the updated header information, the communication link is switched to the target communication link, and the data packet to be sent is sent to the server using the target communication link.

2. The link switching method according to claim 1, wherein obtaining the transmission data packet of the target service and invoking the rerouting module to construct a user data packet containing the transmission data packet includes: Obtain the transmission data packets of the target service and determine the transmission header information of the transmission data packets; Extract source address information and destination address information from the transmission header information, call the rerouting module to determine source port information, and determine the preset destination port information; Based on the source address information, the destination address information, the source port information, and the destination port information, a user data packet containing the transmitted data packet is constructed.

3. The link switching method according to claim 1, wherein selecting a communication link based on the user header information of the user data packet and sending the user data packet to the server of the target service using the communication link comprises: Extract the user header information from the user data packet; Perform a hash calculation on the user header information to obtain the user hash value; Select a communication link according to the user hash value, and execute the step of sending the user data packet to the server of the target service using the communication link.

4. The link switching method according to claim 1, wherein calling the rerouting module to update the header information of the data packet to be sent in the communication link includes: Identify the data packet to be sent in the communication link and obtain the header information of the data packet to be sent; The source port information to be updated is determined from the header information, and the rerouting module is invoked to update the source port information to be updated, which is used as the update of the header information.

5. The link switching method according to claim 4, wherein invoking the rerouting module to update the source port information to be updated includes: The user source port information is determined from the user header information, and a pre-stored source port maintenance table is loaded. The rerouting module is invoked to query the source port maintenance table, and candidate source port information that is different from the user's source port information is determined based on the query result. The rerouting module is invoked to update the source port information to be updated to the candidate source port information.

6. The link switching method according to claim 1, wherein switching the communication link to a target communication link based on the updated header information, and sending the data packet to be sent to the server using the target communication link, comprises: Perform a hash calculation on the updated header information to obtain the updated hash value; Select a target communication link according to the updated hash value, update the communication link to the target communication link, and execute the step of sending the data packet to be sent to the server using the target communication link.

7. The link switching method according to claim 2, wherein the source address information and the destination address information in the transmission header information are the same as the user source address information and the user destination address information in the user header information; the source port information is obtained by the rerouting module from a pre-stored source port maintenance table.

8. The link switching method according to any one of claims 1-7, further comprising, before the step of calling the rerouting module to update the header information of the data packets to be sent in the communication link in the event of an abnormal communication link: The communication link is congestion detected and timeout retransmission detected according to the preset congestion management strategy; If congestion detection or timeout retransmission detection fails, the communication link is determined to be abnormal, and the step of calling the rerouting module to update the header information of the data packets to be sent in the communication link is executed.

9. A link switching system, the link switching system comprising a processing module and a rerouting module, comprising: The processing module is used to obtain the transmission data packets of the target service and send them to the rerouting module; The rerouting module is used to construct a user data packet containing the transmitted data packet and feed it back to the processing module; The processing module is configured to select a communication link based on the user header information of the user data packet, and use the communication link to send the user data packet to the server of the target service; in the event of an abnormal communication link, the data packet to be sent in the communication link is sent to the rerouting module. The rerouting module is used to update the header information of the data packet to be sent and to feed back the data packet to be sent with the updated header information to the processing module. The processing module is used to switch the communication link to the target communication link based on the updated header information, and use the target communication link to send the data packet to be sent to the server.

10. A link switching device, applied to end-side equipment, comprising: The acquisition unit is configured to acquire the transmission data packets of the target service and call the rerouting module to construct a user data packet containing the transmission data packets; The selection unit is configured to select a communication link based on the user header information of the user data packet, and use the communication link to send the user data packet to the server of the target service; The update unit is configured to call the rerouting module to update the header information of the data packets to be sent in the communication link in the event of an anomaly in the communication link. The sending unit is configured to switch the communication link to the target communication link based on the updated header information, and use the target communication link to send the data packet to be sent to the server.

11. A computing device, comprising: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions, which, when executed by the processor, implement the steps of the method according to any one of claims 1 to 8.

12. A computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the steps of the method according to any one of claims 1 to 8.

13. A computer program product comprising a computer program or instructions which, when executed by a processor, implement the steps of the method according to any one of claims 1 to 8.