Link switching method and device based on DPU, electronic equipment and storage medium

By constructing the target links and alternative links between multiple DPUs in electronic devices, the problem of network interaction caused by the link failure between the electronic device and the DPU is solved, and the high availability of the link and the fast network of the network and the network of the network recover.

CN119364563APending Publication Date: 2025-01-24YUSUR TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411421534.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-12
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

When the link between the electronic device and the DPU fails, it may lead to abnormal interaction between the non-public network and the public network, and rapid recovery cannot be achieved.

Method used

By determining the routing information of multiple DPUs, the target link between the electronic equipment and the target DPU, and the alternative link between the alternative DPU, switch it to the alternative chain when the target link fails, Road, and access the public network through the selection of DPUs.

Benefits of technology

It realizes the interaction between non-public networks and public networks, ensuring the high availability of links and the rapid recovery capability of the network.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119364563A_ABST
    Figure CN119364563A_ABST
Patent Text Reader

Abstract

The invention provides a link switching method and device based on a DPU, electronic equipment and a storage medium. The method can be applied to an electronic device, the electronic device is deployed in a non-public network, and the method can comprise the following steps: determining routing information of a plurality of data processors (DPUs); based on the routing information of the plurality of DPUs, constructing a target link between the electronic equipment and the target DPU and an alternative link between the electronic equipment and the alternative DPU; and under the condition that the target link fails, switching the target link to the alternative link, and sending the service flow to the alternative DPU through the alternative link so as to access the public network through the alternative DPU. Therefore, interaction between the non-public network and the public network can be realized, and high availability of the link and rapid recovery capability of the network are ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present application relate to the field of computer technology, and in particular, to a DPU-based link switching method, device, electronic device, and storage medium. Background Art

[0002] The Data Processing Unit (DPU) is a type of special-purpose processor. It is the third important computing chip in the data center scenario after the Central Processing Unit (CPU) and the Graphics Processing Unit (GPU). It provides a computing engine for high-bandwidth, low-latency, and data-intensive computing scenarios.

[0003] Currently, electronic devices deployed in non-public networks can access public networks through DPUs. However, if a link between the electronic device and the DPU fails, the entire network may become abnormal, making it impossible to interact with the non-public network and the public network. Summary of the invention

[0004] In view of this, the present application provides a DPU-based link switching method, device, electronic device and storage medium, which can realize the interaction between non-public networks and public networks, ensure the high availability of links and the rapid recovery capability of the network.

[0005] In a first aspect, the present application provides a DPU-based link switching method, which is applied to an electronic device, and the electronic device is deployed in a non-public network. The method includes: determining routing information of multiple data processors DPUs; based on the routing information of the multiple DPUs, constructing a target link between the electronic device and the target DPU, and an alternative link between the electronic device and the alternative DPU; wherein the multiple DPUs include a target DPU and an alternative DPU; in the event of a failure in the target link, switching the target link to the alternative link, and sending business traffic to the alternative DPU via the alternative link, so as to access the public network through the alternative DPU.

[0006] In a second aspect, the present application provides a DPU-based link switching device, which is applied to an electronic device, and the electronic device is deployed in a non-public network. The device includes: a determination module, which is used to determine the routing information of multiple data processors DPUs; a construction module, which is used to construct a target link between the electronic device and the target DPU, and an alternative link between the electronic device and the alternative DPU based on the routing information of the multiple DPUs; wherein the multiple DPUs include a target DPU and an alternative DPU; a switching module, which is used to switch the target link to an alternative link in the event of a failure in the target link; and a communication module, which is used to send business traffic to the alternative DPU via the alternative link, so as to access the public network through the alternative DPU.

[0007] In a third aspect, the present application provides an electronic device comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other through the communication bus; the memory is used to store one or more executable instructions, and the executable instructions enable the processor to execute the method described in the first aspect above.

[0008] In a fourth aspect, the present application provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by one or more processors, it implements the method described in the first aspect.

[0009] In a fifth aspect, the present application provides a computer program product, comprising computer program instructions, which enable a computer to execute the method described in the first aspect above.

[0010] In a sixth aspect, the present application provides a computer program, which, when executed on a computer, enables the computer to execute the method described in the first aspect above.

[0011] The embodiment of the present application provides a link switching method, device, electronic device and storage medium based on DPU, the method is applied to electronic devices, the electronic devices are deployed in non-public networks, the method may include: based on the routing information of multiple DPUs, constructing a target link between the electronic device and the target DPU, and an alternative link between the electronic device and the alternative DPU, so that in the event of a failure in the target link, the target link is switched to the alternative link, and service traffic is sent to the alternative DPU through the alternative link. In this way, in the event of a failure in the target link, the link can be switched so that the electronic device can access the public network through the alternative DPU, thereby realizing the interaction between the non-public network and the public network, and ensuring the high availability of the link and the rapid recovery capability of the network. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0013] Figure 1 This is a scenario diagram of an electronic device accessing a public network provided by this application Figure 1 ;

[0014] Figure 2 It is a flowchart of a link switching method based on DPU provided in an embodiment of the present application;

[0015] Figure 3 This is a schematic diagram of a scenario in which an electronic device accesses a public network provided by an embodiment of the present application. Figure 2 ;

[0016] Figure 4 It is a schematic diagram of the composition structure of a link switching device based on a DPU provided in an embodiment of the present application;

[0017] Figure 5 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0018] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present application, the technical solutions in the embodiments of the present application will be described clearly and in detail below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the embodiments of the present application should fall within the scope of protection of the embodiments of the present application.

[0019] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0020] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0021] It should also be pointed out that the terms "first\second\third" involved in the embodiments of the present application are only used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged in a specific order or sequence where permitted, so that the embodiments of the present application described here can be implemented in an order other than that illustrated or described here.

[0022] In addition, the term "and / or" in the embodiments of the present application is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0023] To facilitate understanding of the technical solutions of the embodiments of the present application, the relevant technologies of the embodiments of the present application are described below. The following related technologies can be arbitrarily combined with the technical solutions of the embodiments of the present application as optional solutions, and they all belong to the protection scope of the embodiments of the present application.

[0024] The technical terms in the embodiments of the present application are briefly explained below.

[0025] DPU: DPU is a major category of the latest developed special-purpose processors. It is data-centric, input / output (I / O) intensive, and uses software-defined technology to support infrastructure resource layer virtualization. It is a new generation of computing chips that can improve computing system efficiency, reduce the total cost of ownership of the overall system, improve data processing performance, and reduce the performance loss of other computing chips. It provides a computing engine for high-bandwidth, low-latency, and data-intensive computing scenarios.

[0026] Kubernetes: Also known as K8s, it is a portable, extensible open source platform for automatically deploying, scaling, and managing containerized applications. K8s combines the containers that make up the application into logical units for easy management and service discovery.

[0027] Pod: Pod is the smallest basic unit for deployment and management in a K8s cluster. Pod can be used for collaborative addressing and collaborative scheduling. Pod is a collection of one or more containers, an abstract collection of one or a group of services (processes). Network and storage can be shared in Pod.

[0028] Virtual Machine (VM): VM is a computer environment implemented by software or hardware, which creates a virtual computer system on a physical computer, including virtual CPU, memory, hard disk, network interface, etc. This allows a physical computer to run multiple independent operating system and application instances at the same time, each instance runs in its own virtual machine, isolated from each other and does not interfere with each other.

[0029] Virtual Private Cloud (VPC): VPC allows users to create an isolated network environment in the cloud, ensuring that the user's resources are isolated from other users' resources. Users can select the Internet Protocol (IP) address range assigned to the VPC to define the IP address space of the VPC internal network.

[0030] Open Virtual Network (OVN): OVN is an open source project that provides software defined network (SDN) capabilities and can be used in conjunction with the Open Virtual Switch (OVS). OVN provides powerful virtual network capabilities such as logical switching, logical routing, firewall rules, and load balancing.

[0031] Logical router: In OVN, a logical router is responsible for forwarding business traffic between different logical switches. It is equivalent to a virtual router that can route data packets between different virtual networks.

[0032] High availability of links: High availability of links refers to the ability of links to switch from one link to another. In particular, when a link fails, high availability of links can ensure the rapid recovery of the network.

[0033] Currently, electronic devices deployed in non-public networks can access public networks through DPU. Figure 1 The scenario of electronic devices accessing a public network is described.

[0034] Figure 1 This is a scenario diagram of an electronic device accessing a public network provided by this application Figure 1 .like Figure 1As shown, the K8s cluster may include an electronic device (not shown) and DPU1 103. The electronic device may be deployed in a non-public network 110. A logical switch 104, a logical router 105, and a container are deployed in the electronic device. The container may include Pod 106, VM 107, Pod 108, and Vm 109. The detailed process of the electronic device accessing the public network 101 may include:

[0035] First, configure the routing information of DPU1 103 and the routing information of the container (one or more of Pod106, VM107, Pod108 and Vm109) on the logical router 105;

[0036] Secondly, based on the routing information of DPU1 103 and the routing information of the container, a link between the logical router 105 and DPU1 103 is constructed; and a link between the logical router 105 and the container;

[0037] Then, the logical router 105 may receive the service traffic sent by the container based on the link between the logical router 105 and the container, and then send the service traffic to the DPU1 103 based on the link between the logical router 105 and the DPU1 103; wherein the logical switch 104 is used to associate the DPU1 103 and the logical router 105;

[0038] Finally, DPU1 103 sends business traffic to the public network 101, thereby enabling the electronic device to access the public network; wherein the physical switch 102 is used to associate DPU1 103 with the public network 101.

[0039] It can be understood that DPU1 103 can act as a gateway to enable electronic devices to access the public network 101.

[0040] Exemplarily, the non-public network 110 may be a VPC.

[0041] like Figure 1 As shown, due to the routing information of DPU1 103 configured on the logical router 105, a single link between the logical router 105 and the DPU is constructed. However, the single link may be at risk of failure, thereby affecting the access of the electronic device to the public network.

[0042] That is to say, in the event that a link between an electronic device and a DPU fails, the entire network may become abnormal, making it impossible to achieve interaction between the non-public network and the announcement network.

[0043] Based on this, an embodiment of the present application provides a DPU-based link switching method, which is applied to an electronic device, and the electronic device is deployed in a non-public network. The method may include: based on the routing information of multiple DPUs, constructing a target link between the electronic device and the target DPU, and an alternative link between the electronic device and the alternative DPU, so that in the event of a failure in the target link, the target link is switched to the alternative link, and service traffic is sent to the alternative DPU through the alternative link. In this way, in the event of a failure in the target link, the link switching can be used to enable the electronic device to access the public network through the alternative DPU, thereby realizing the interaction between the non-public network and the public network, and ensuring the high availability of the link and the rapid recovery capability of the network.

[0044] To facilitate understanding of the technical solutions of the embodiments of the present application, the technical solutions of the present application are described in detail below through specific embodiments. The above related technologies can be combined arbitrarily with the technical solutions of the embodiments of the present application as optional solutions, and they all belong to the protection scope of the embodiments of the present application. The embodiments of the present application include at least part of the following contents.

[0045] Figure 2 1 is a flow chart of a link switching method based on a DPU provided in an embodiment of the present application, the method is applied to an electronic device, and the electronic device is deployed in a non-public network. Figure 2 As shown, the method may include the following steps.

[0046] S210: Determine routing information of multiple DPUs.

[0047] It should be noted that, in the embodiments of the present application, the DPU-based link switching method can be applied to a DPU-based link switching device, or an electronic device integrated with the device.

[0048] It should also be noted that multiple DPUs can be connected to electronic devices via network cables or optical fibers, or multiple DPUs can be connected to electronic devices via other methods, which is not limited in the embodiments of the present application.

[0049] Exemplarily, the routing information of the multiple DPUs may be obtained through a logical router in the electronic device. For example, the multiple DPUs may send their respective routing information to the logical router.

[0050] In some embodiments, determining routing information of multiple DPUs may include: creating multiple network cards on the multiple DPUs, obtaining media access control (MAC) addresses of the multiple network cards, wherein a network card is created on each of the multiple DPUs; obtaining IP addresses of the multiple DPUs; and determining routing information of the multiple DPUs based on the MAC addresses of the multiple network cards and / or the IP addresses of the multiple DPUs.

[0051] Exemplarily, the routing information of the multiple DPUs may include MAC addresses of multiple network cards and / or IP addresses of multiple DPUs.

[0052] Through this method, the routing information of multiple DPUs can be determined based on the MAC addresses of multiple network cards and / or the IP addresses of multiple DPUs. Subsequently, based on the routing information of multiple DPUs, links between electronic devices and multiple DPUs can be built, thereby facilitating link switching when a link fails, ensuring high availability of the link and rapid recovery capabilities of the network.

[0053] S220: Construct a target link between the electronic device and the target DPU, and an alternative link between the electronic device and the alternative DPU, using routing information of multiple DPUs.

[0054] The multiple DPUs include a target DPU and candidate DPUs.

[0055] It should be noted that after the electronic device obtains the routing information of multiple DPUs, it can know the location of a certain DPU when sending business traffic to the DPU, so that it can establish links with multiple DPUs.

[0056] It should also be noted that the link between the logical router in the electronic device and the container in the electronic device has been established. In other words, the logical router has learned the routing information of the container, and the container can also accurately send the service traffic to the logical router. Based on this, after the logical router learns the routing information of multiple DPUs, it can forward the service traffic received from the container to a certain DPU.

[0057] S230. When a target link fails, switch the target link to an alternative link, and send service traffic to an alternative DPU through the alternative link, so as to access a public network through the alternative DPU.

[0058] In some embodiments, the target link fails, which may include:

[0059] The target link is disconnected; and / or,

[0060] The peak bandwidth of the target link is less than the preset peak bandwidth; and / or,

[0061] The target DPU hardware is damaged.

[0062] It is understandable that the target link failure may also be caused by a power outage or a crash of the server of the target DPU.

[0063] It should be noted that, when the bandwidth peak of the target link is less than the preset bandwidth peak, and / or the hardware of the target DPU is damaged, the target link may not be disconnected.

[0064] It should also be noted that the preset bandwidth peak value may be set manually or by other means, and the embodiments of the present application are not limited to this.

[0065] It should be understood that if the bandwidth peak of the target link is less than the preset bandwidth peak, it means that the transmission capacity of the target link is limited and the service traffic cannot be transmitted.

[0066] Exemplarily, the hardware damage of the target DPU may be caused by a loose network cable or optical fiber of the target DPU, or may be caused by other reasons, which is not limited in the embodiments of the present application.

[0067] In some embodiments, there are multiple alternative DPUs; switching the target link to the alternative link may include: determining the priorities of multiple alternative DPUs; sorting the priorities of the multiple alternative DPUs from small to large, and selecting the DPU with the highest priority from the multiple alternative DPUs; switching the target link to: the alternative link between the electronic device and the DPU with the highest priority.

[0068] It should be noted that the priorities of multiple alternative DPUs can be determined based on the configuration information of multiple alternative DPUs (such as the memory used by the alternative DPUs, and the historical usage time), and / or the user's setting information (such as the alternative DPUs that the user prefers to use, and the service type used by the user).

[0069] For example, if a candidate DPU has used a large amount of memory, has been used for a long time, is not preferred by the user, and does not match the service type used by the user, it means that the priority of the candidate DPU is low.

[0070] It is understandable that the priorities of multiple candidate DPUs can be updated based on the configuration information of the multiple candidate DPUs and / or the user's setting information, so as to further meet the user's usage needs and improve the user's usage experience.

[0071] Through this method, since the alternative link is the link between the electronic device and the DPU with the highest priority, by switching the target link to the alternative link, the stability of business traffic transmission can be guaranteed when business traffic is subsequently transmitted based on the DPU with the highest priority.

[0072] It should be understood that, when the target link is not faulty, the target link may be congested due to excessive traffic. Based on this, two possible implementations of reducing the traffic on the target link are given below.

[0073] A possible implementation method is to divert the business traffic to obtain a first part of business traffic and a second part of business traffic when the target link has not failed; send the first part of business traffic to the target DPU through the target link, and send the second part of business traffic to the alternative DPU through the alternative link, so as to access the public network through the target DPU and the alternative DPU.

[0074] It should be noted that when diverting business traffic, the first part of the business traffic and the second part of the business traffic obtained by diversion can be made to be the same size, or the first part of the business traffic can be greater than the second part of the business traffic, or the second part of the business traffic can be greater than the first part of the business traffic. The embodiments of the present application are not limited to this.

[0075] Through this method, when the target link has not failed, the business traffic can be diverted so that the target link and the alternative link transmit the business traffic together, thereby avoiding link congestion caused by excessive business traffic on the target link and achieving load (i.e., target DPU and alternative DPU) balancing.

[0076] Another possible implementation method is to determine the priorities of the alternative DPU and the target DPU when the target link is not faulty; when the priority of the alternative DPU is higher than that of the target DPU, switch the target link to the alternative link, and send service traffic to the alternative DPU through the alternative link to access the public network through the alternative DPU.

[0077] It should be noted that the priority of the alternative DPU and the target DPU can be determined based on the configuration information of the alternative DPU and the target DPU (such as the memory used by the two DPUs, and the historical usage time of the two DPUs), and / or the user's setting information (such as the DPU that the user prefers to use, and the type of service used by the user).

[0078] Through this method, when the target link is not faulty, the target link can be switched to an alternative link between the electronic device and an alternative DPU with a higher priority. In this way, on the one hand, excessive service traffic on the target link can be avoided to cause link congestion; on the other hand, when the service traffic is subsequently transmitted based on the alternative DPU with the highest priority, the stability of service traffic transmission can be guaranteed.

[0079] In some embodiments, a container and a logical router are deployed in an electronic device; business traffic is sent to an alternative DPU through an alternative link to access a public network through the alternative DPU, including: the container sends business traffic to the logical router; the logical router sends business traffic to the alternative DPU through the alternative link to enable the container to access the public network through the alternative DPU.

[0080] It should be noted that the container and the logical switch can be associated through the logical switch, and the alternative DPU and the public network can be associated through the physical switch.

[0081] Through this method, the container deployed on the electronic device can access the public network through the alternative DPU, thereby realizing the interaction between the non-public network and the public network.

[0082] The embodiment of the present application provides a link switching method based on DPU, which is applied to an electronic device, and the electronic device is deployed in a non-public network. The method may include: based on the routing information of multiple DPUs, constructing a target link between the electronic device and the target DPU, and an alternative link between the electronic device and the alternative DPU, so that in the case of a failure of the target link, the target link is switched to the alternative link, and service traffic is sent to the alternative DPU through the alternative link. In this way, in the case of a failure of the target link, the link switching can be used to enable the electronic device to access the public network through the alternative DPU, thereby realizing the interaction between the non-public network and the public network, ensuring the high availability of the link and the rapid recovery capability of the network.

[0083] The following describes in detail the DPU-based link switching method provided in the above embodiment in combination with specific application scenarios.

[0084] Figure 3 This is a schematic diagram of a scenario in which an electronic device accesses a public network provided by an embodiment of the present application. Figure 2 .like Figure 3As shown, the K8s cluster may include an electronic device (not shown), DPU2 303 and DPU3 304. The electronic device may be deployed in a non-public network 311. A logical switch 305, a logical router 306 and a container are deployed in the electronic device. The container may include Pod 307, VM 308, Pod 309 and Vm 310. The detailed process of the electronic device accessing the public network 301 may include:

[0085] First, the routing information of DPU2 303, DPU3 304 and the routing information of the container (one or more of Pod307, VM308, Pod309 and Vm310) are configured on the logical router 306;

[0086] Secondly, based on the routing information of DPU2 303 and DPU3 304 and the routing information of the container, a target link between the logical router 306 and DPU2 303, an alternative link between the logical router 306 and DPU3 304, and a link between the logical router 306 and the container are constructed;

[0087] Then, the logical router 306 can receive the service traffic sent by the container based on the link between the container and the logical router 306, and send the service traffic to DPU2 303 through the target link. In the event of a target link failure, the target link is switched to an alternative link, and the service traffic is sent to DPU3 304 through the alternative link. The logical switch 305 is used to associate DPU2 303, DPU3 304 and the logical router 306;

[0088] Finally, DPU2 303 sends service traffic to the public network 301; in the event of a target link failure, DPU3 304 sends service traffic to the public network 301, thereby enabling electronic devices to access the public network. The physical switch 302 is used to associate DPU2 303, DPU3 304, and the public network 301.

[0089] It can be understood that DPU2 303 and DPU3 304 can act as gateways to enable electronic devices to access the public network 101.

[0090] like Figure 1 As shown, since the routing information of DPU2 303 and DPU3 304 is configured on the logical router 306, multiple links between the logical router 306 and the DPU are constructed. Therefore, in the event of a link failure, the electronic device can still access the public network through another link.

[0091] In addition, when there is no failure in the target link, the logical router 306 can divert the business traffic received from the container, send a part of the business traffic to DPU2 303 through the target link, and then send another part of the business traffic to DPU3 304 through the alternative link, so that the electronic device can access the public network through DPU2 303 and DPU3 304, thereby avoiding link congestion caused by excessive business traffic on the target link, and achieving load balancing on DPU2 303 and DPU3 304.

[0092] When there is no failure in the target link, the priorities of DPU2 303 and DPU3 304 can also be determined; when the priority of DPU3 304 is higher than that of DPU2 303, the target link is switched to the alternative link, and business traffic is sent to DPU3 304 through the alternative link, so that the electronic device can access the public network through DPU3 304, thereby avoiding link congestion caused by excessive business traffic on the target link, and ensuring the stability of business traffic transmission when business traffic is subsequently transmitted based on the DPU3 304 with the highest priority.

[0093] An embodiment of the present application provides a DPU-based link switching method, which can configure the routing information of multiple DPUs on a logical router, thereby building multiple links based on the multiple DPUs to access the public network. In the event of a link failure, the link can still be switched to use another link to access the public network, and the link switching is imperceptible to the container, ensuring the normal transmission of business traffic.

[0094] The preferred embodiments of the present application are described in detail above in conjunction with the accompanying drawings. However, the present application is not limited to the specific details in the above embodiments. Within the technical concept of the present application, the technical solution of the present application can be subjected to a variety of simple modifications, and these simple modifications all belong to the protection scope of the present application. For example, the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. In order to avoid unnecessary repetition, the present application will not further explain various possible combinations. For another example, the various different embodiments of the present application can also be arbitrarily combined, as long as they do not violate the idea of ​​the present application, they should also be regarded as the contents disclosed in the present application. For another example, under the premise of no conflict, the various embodiments and / or the technical features in the various embodiments described in the present application can be arbitrarily combined with the prior art, and the technical solution obtained after the combination should also fall within the protection scope of the present application.

[0095] It should also be understood that in the various method embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0096] Based on the same inventive concept as the above embodiments, Figure 4 is a schematic diagram of the structure of a link switching device based on a DPU provided in an embodiment of the present application, such as Figure 4 As shown, the DPU-based link switching device 400 is applied to an electronic device, and the electronic device is deployed in a non-public network. The DPU-based link switching device 400 may include a determination module 410, a construction module 420, a switching module 430 and a communication module 440, wherein:

[0097] A determination module 410, configured to determine routing information of a plurality of data processors DPUs;

[0098] A construction module 420 is used to construct a target link between the electronic device and the target DPU, and an alternative link between the electronic device and the alternative DPU based on the routing information of the multiple DPUs; wherein the multiple DPUs include the target DPU and the alternative DPU;

[0099] A switching module 430, configured to switch the target link to an alternative link when a target link fails;

[0100] The communication module 440 is used to send service traffic to the alternative DPU through the alternative link to access the public network through the alternative DPU.

[0101] In some embodiments, the DPU-based link switching device 400 may further include a traffic diversion module 450; wherein:

[0102] A traffic diversion module 450 is used to divert the service traffic to obtain a first portion of service traffic and a second portion of service traffic when no failure occurs in the target link;

[0103] The communication module 440 is further configured to send a first portion of service traffic to a target DPU via a target link, and to send a second portion of service traffic to an alternative DPU via an alternative link, so as to access a public network via the target DPU and the alternative DPU.

[0104] In some embodiments, the determination module 410 is also used to determine the priority of the alternative DPU and the target DPU when the target link is not faulty; the switching module 430 is also used to switch the target link to the alternative link when the priority of the alternative DPU is higher than the priority of the target DPU; the communication module 440 is also used to send business traffic to the alternative DPU through the alternative link to access the public network through the alternative DPU.

[0105] In some embodiments, there are multiple candidate DPUs; the DPU-based link switching device 400 may further include a selection module 460; wherein:

[0106] The determination module 410 is further configured to determine the priorities of the plurality of candidate DPUs;

[0107] A selection module 460 is used to sort the priorities of multiple candidate DPUs from small to large, and select the DPU with the highest priority from the multiple candidate DPUs;

[0108] The switching module 430 is further configured to switch the target link to: an alternative link between the electronic device and the DPU with the highest priority.

[0109] In some embodiments, the target link fails, including:

[0110] The target link is disconnected; and / or,

[0111] The peak bandwidth of the target link is less than the preset peak bandwidth; and / or,

[0112] The target DPU hardware is damaged.

[0113] In some embodiments, the DPU-based link switching device 400 may further include an acquisition module 470; wherein:

[0114] The construction module 420 is further used to create multiple network cards on the multiple DPUs, and obtain media access control MAC addresses of the multiple network cards, wherein one network card is created on each of the multiple DPUs;

[0115] An acquisition module 470, configured to acquire Internet Protocol IP addresses of a plurality of DPUs;

[0116] The determination module 410 is further configured to determine routing information of multiple DPUs based on the MAC addresses of multiple network cards and / or the IP addresses of multiple DPUs.

[0117] In some embodiments, a container and a logical router are deployed in the electronic device; the communication module 440 is also used to send business traffic to the logical router through the container; and send business traffic to the alternative DPU through the logical router, so that the container can access the public network through the alternative DPU.

[0118] The embodiment of the present application provides a link switching device based on DPU, which is applied to an electronic device, and the electronic device is deployed in a non-public network. The device may include: based on the routing information of multiple DPUs, constructing a target link between the electronic device and the target DPU, and an alternative link between the electronic device and the alternative DPU, so that in the case of a failure of the target link, the target link is switched to the alternative link, and business traffic is sent to the alternative DPU through the alternative link. In this way, in the case of a failure of the target link, the link switching can be used to enable the electronic device to access the public network through the alternative DPU, thereby realizing the interaction between the non-public network and the public network, ensuring the high availability of the link and the rapid recovery capability of the network.

[0119] Those skilled in the art should understand that the relevant description of the above-mentioned DPU-based link switching device in the embodiment of the present application can be understood by referring to the relevant description of the DPU-based link switching method in the embodiment of the present application.

[0120] Figure 5 1 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present application. The electronic device may include: a processor (Processor) 510, a communication interface (Communications Interface) 520, a memory (Memory) 530 storing a program 550, and a communication bus 540.

[0121] The processor 510 , the communication interface 520 , and the memory 530 communicate with each other via the communication bus 540 .

[0122] The communication interface 520 is used to communicate with other electronic devices or servers.

[0123] The processor 510 is used to execute the program 550, and specifically can execute the relevant steps in the above method embodiment.

[0124] Specifically, the program 550 may include a program 550 code, which includes one or more executable computer operation instructions.

[0125] The processor 510 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application. The one or more processors included in the smart device may be processors of the same type, such as one or more CPUs; or may be processors of different types, such as one or more CPUs and one or more ASICs.

[0126] The memory 530 is used to store one or more executable instructions. The memory 530 may include a high-speed random access memory (RAM), and may also include a non-volatile memory (Non-Volatile Memory), such as one or more disk memories.

[0127] One or more executable instructions may be specifically used to enable the processor 510 to execute the method provided in the embodiment of the present application.

[0128] In addition, the specific implementation of each step in one or more executable instructions can refer to the corresponding description of the corresponding steps and units in the above method embodiments, which will not be repeated here. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the above-described devices and modules can refer to the corresponding process description in the above method embodiments, which will not be repeated here.

[0129] An embodiment of the present application also provides a computer-readable storage medium for storing a computer program.

[0130] In some embodiments, the computer-readable storage medium can be applied to the electronic device in the embodiments of the present application, and when the computer program is executed by one or more processors, it implements the corresponding processes implemented by the electronic device in the various methods of the embodiments of the present application. For the sake of brevity, they are not repeated here.

[0131] An embodiment of the present application also provides a computer program product, including computer program instructions.

[0132] In some embodiments, the computer program product can be applied to the electronic device in the embodiments of the present application, and the computer program instructions enable the computer to execute the corresponding processes implemented by the electronic device in the various methods of the embodiments of the present application. For the sake of brevity, they will not be repeated here.

[0133] The embodiment of the present application also provides a computer program.

[0134] In some embodiments, the computer program can be applied to the electronic devices in the embodiments of the present application. When the computer program runs on a computer, the computer executes the corresponding processes implemented by the electronic devices in the various methods of the embodiments of the present application. For the sake of brevity, they will not be repeated here.

[0135] Those of ordinary skill in the art will appreciate that the units and method steps of each example described in conjunction with the embodiments disclosed in this application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the embodiments of this application.

[0136] It should be noted that, in this application, the terms "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0137] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0138] The methods disclosed in several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.

[0139] The features disclosed in several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.

[0140] The features disclosed in several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.

[0141] The above implementation methods are only used to illustrate the embodiments of the present application, and are not limitations on the embodiments of the present application. Ordinary technicians in the relevant technical field can make various changes and modifications without departing from the spirit and scope of the embodiments of the present application. Therefore, all equivalent technical solutions also belong to the scope of the embodiments of the present application. The scope of patent protection of the embodiments of the present application should be limited by the claims.

Claims

1. A link switching method based on DPU, applied to an electronic device, wherein the electronic device is deployed in a non-public network, characterized in that: The method comprises: Determine routing information of multiple data processors DPU; Based on the routing information of the multiple DPUs, construct a target link between the electronic device and the target DPU, and an alternative link between the electronic device and the alternative DPU; wherein the multiple DPUs include the target DPU and the alternative DPU; In the event that the target link fails, the target link is switched to the alternative link, and service traffic is sent to the alternative DPU through the alternative link, so as to access the public network through the alternative DPU.

2. The method according to claim 1, characterized in that: The method further comprises: In the case that the target link does not fail, the service traffic is split to obtain a first part of service traffic and a second part of service traffic; The first portion of service traffic is sent to the target DPU through the target link, and the second portion of service traffic is sent to the alternative DPU through the alternative link, so as to access the public network through the target DPU and the alternative DPU.

3. The method according to claim 1, characterized in that The method further comprises: In a case where the target link does not fail, determining the priorities of the candidate DPU and the target DPU; In the case that the priority of the alternative DPU is higher than the priority of the target DPU, the target link is switched to the alternative link, and service traffic is sent to the alternative DPU through the alternative link, so as to access the public network through the alternative DPU.

4. The method according to any one of claims 1 to 3, characterized in that There are multiple candidate DPUs; switching the target link to the candidate link includes: Determining the priorities of the multiple candidate DPUs; Sort the priorities of the multiple candidate DPUs from small to large, and select the DPU with the highest priority from the multiple candidate DPUs; Switch the target link to: an alternative link between the electronic device and the DPU with the highest priority.

5. The method according to any one of claims 1 to 3, characterized in that The target link fails, including: The target link is disconnected; and / or, The bandwidth peak of the target link is less than the preset bandwidth peak; and / or, The hardware of the target DPU is damaged.

6. The method according to any one of claims 1 to 3, characterized in that The determining of routing information of the plurality of DPUs includes: Creating multiple network cards on the multiple DPUs, and obtaining media access control MAC addresses of the multiple network cards, wherein one network card is created on each of the multiple DPUs; Obtaining Internet Protocol (IP) addresses of the plurality of DPUs; Based on the MAC addresses of the multiple network cards and / or the IP addresses of the multiple DPUs, the routing information of the multiple DPUs is determined.

7. The method according to any one of claims 1 to 3, characterized in that A container and a logical router are deployed in the electronic device; The sending of service traffic to the alternative DPU through the alternative link to access the public network through the alternative DPU includes: The container sends the service traffic to the logical router; The logical router sends the service traffic to the alternative DPU through the alternative link, so that the container accesses the public network through the alternative DPU.

8. A link switching device based on DPU, applied to an electronic device, wherein the electronic device is deployed in a non-public network, characterized in that: The device comprises: A determination module, used to determine routing information of multiple data processors DPU; A construction module, configured to construct a target link between the electronic device and a target DPU, and an alternative link between the electronic device and an alternative DPU based on the routing information of the multiple DPUs; wherein the multiple DPUs include the target DPU and the alternative DPU; A switching module, configured to switch the target link to the alternative link when a failure occurs in the target link; A communication module is used to send business traffic to the alternative DPU through the alternative link to access the public network through the alternative DPU.

9. An electronic device, comprising: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store one or more executable instructions, and the executable instructions enable the processor to execute the method according to any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, wherein the computer program implements the method according to any one of claims 1 to 7 when executed by one or more processors.