Network configuration method, device, storage medium, system and program product

CN122802360APending Publication Date: 2026-09-22ALIBABA CLOUD COMPUTING CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510329351.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-19
Publication Date
2026-09-22

AI Technical Summary

Technical Problem

其中,在短连接模式下,每一台控制器可以向任意一台转发器下发网络配置信息,在实际应用的过程中,当某一控制器出现故障(这里将与该故障控制器连接的转发器称为目标转发器)时,可以通过其它可用控制器快速恢复与目标转发器的短连接,并完成网络配置信息下发任务,但是,短连接模式的网络配置信息下发性能较差

Benefits of technology

[0023]本申请实施例提供的网络配置方案中,在初始状态下,目标控制器接收目标时间窗口内应用程序发送的第一网络配置请求,并根据第一网络配置请求,确定出与第一网络配置请求对应的第一网络配置信息所要下发的目标转发器,进而通过短连接模式将第一网络配置信息发送至目标转发器,在此过程中,即使目标控制器宕机,也可以通过其它控制器与该目标转发器快速短连接,进而将未发送完毕的第一网络配置信息继续发送至目标转发器,保证了目标控制器故障情况下目标转发器的网络配置信息的配置恢复速度。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122802360A_ABST
    Figure CN122802360A_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a network configuration method, device, storage medium, system and program product, relating to the technical field of network communication. The method comprises: determining first network configuration information corresponding to a first network configuration request and a target forwarder corresponding to the first network configuration information; sending the first network configuration information to the target forwarder through a short connection between the target forwarder; updating a total number of network configuration requests corresponding to the target forwarder within a target time window to determine whether to switch the connection mode between the target forwarder to a long connection mode according to the total number of network configuration requests; and if it is determined to switch the connection mode between the target forwarder to the long connection mode, sending second network configuration information to the target forwarder through a long connection between the target forwarder. The present scheme can simultaneously take into account the network configuration information issuing performance of the controller and the network configuration information configuration recovery speed of the forwarder under the controller failure condition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of network communication technology, and in particular to a network configuration method, device, storage medium, system, and program product. Background Technology

[0002] In cloud computing scenarios, Software Defined Networking (SDN) is typically used as the network infrastructure. SDN divides the network into two planes: a control plane and a data plane. The control plane usually has multiple controllers that send network configuration information to the data plane, enabling the forwarders in the data plane to forward data packets based on the received network configuration information. This network configuration information can include: the tunnel number, IP address, port information, and bandwidth configuration information of the virtual switches (vSwitch) configured for the forwarders.

[0003] Currently, there are two connection modes between controllers and repeaters in SDN: short connection mode and long connection mode. In short connection mode, each controller can send network configuration information to any repeater. In practical applications, when a controller fails (the repeater connected to the failed controller is referred to as the target repeater), the short connection with the target repeater can be quickly restored by other available controllers, and the network configuration information can be sent. However, the performance of sending network configuration information in short connection mode is relatively poor. In long connection mode, each controller maintains a long connection with only one repeater. The performance of sending network configuration information is better; however, when a controller fails, the configuration recovery speed of the repeater is slower. Summary of the Invention

[0004] This application provides a network configuration method, device, storage medium, system, and program product to improve the configuration efficiency of network configuration information for repeaters.

[0005] In a first aspect, embodiments of this application provide a network configuration method applied to a target controller in a controller cluster, the method comprising:

[0006] In response to receiving a first network configuration request sent by an application within a target time window, the system determines the first network configuration information corresponding to the first network configuration request and the target forwarder corresponding to the first network configuration information, wherein the target forwarder belongs to a forwarder cluster controlled by the controller cluster.

[0007] The first network configuration information is sent to the target repeater via a short connection.

[0008] Update the total number of network configuration requests corresponding to the target forwarder within the target time window, so as to determine whether to switch the connection mode with the target forwarder to long connection mode based on the total number of network configuration requests;

[0009] In response to receiving a second network configuration request sent by the application within the target time window, the second network configuration information corresponding to the second network configuration request and the target forwarder corresponding to the second network configuration information are determined, wherein the second network configuration request is received later than the first network configuration request;

[0010] If it is determined that the connection mode with the target repeater will be switched to a long connection mode, then the second network configuration information will be sent to the target repeater through the long connection.

[0011] Secondly, embodiments of this application provide a network configuration device applied to a target controller in a controller cluster, the device comprising:

[0012] The response module is used to respond to receiving a first network configuration request sent by an application within a target time window, and to determine the first network configuration information corresponding to the first network configuration request and the target forwarder corresponding to the first network configuration information, wherein the target forwarder belongs to the forwarder cluster controlled by the controller cluster.

[0013] The sending module is used to send the first network configuration information to the target repeater via a short connection.

[0014] The update module is used to update the total number of network configuration requests corresponding to the target repeater within the target time window, so as to determine whether to switch the connection mode with the target repeater to a long connection mode based on the total number of network configuration requests.

[0015] The determination module is configured to, in response to receiving a second network configuration request sent by the application within the target time window, determine the second network configuration information corresponding to the second network configuration request and the target forwarder corresponding to the second network configuration information, wherein the second network configuration request is received later than the first network configuration request, and if it is determined that the connection mode with the target forwarder will be switched to a long connection mode, then send the second network configuration information to the target forwarder through the long connection with the target forwarder.

[0016] Thirdly, embodiments of this application provide a network configuration system, including: an application device running an application, a controller cluster, and a repeater cluster controlled by the controller cluster;

[0017] The application device is used to send a network configuration request to a target controller in the controller cluster through an application, and the network configuration request includes at least a first network configuration request and a second network configuration request.

[0018] In response to receiving a first network configuration request from the application within a target time window, the target controller in the controller cluster determines the first network configuration information corresponding to the first network configuration request and the target forwarder corresponding to the first network configuration information. It then sends the first network configuration information to the target forwarder via a short connection. The controller also updates the total number of network configuration requests corresponding to the target forwarder within the target time window to determine whether to switch the connection mode with the target forwarder to a long connection mode based on the total number of network configuration requests.

[0019] In response to receiving a second network configuration request sent by the application within the target time window, the system determines the second network configuration information corresponding to the second network configuration request and the target forwarder corresponding to the second network configuration information; if it determines to switch the connection mode with the target forwarder to a long connection mode, the system sends the second network configuration information to the target forwarder through the long connection with the target forwarder, wherein the second network configuration request is received later than the first network configuration request.

[0020] Fourthly, embodiments of this application provide an electronic device, including: a memory, a processor, and a communication interface; wherein, the memory stores executable code, and when the executable code is executed by the processor, the processor performs the method as described in the first aspect.

[0021] Fifthly, embodiments of this application provide a non-transitory machine-readable storage medium storing executable code, which, when executed by a processor of an electronic device, enables the processor to at least implement the method described in the first aspect.

[0022] In a sixth aspect, embodiments of this application provide a computer program product, the computer program product including a computer program, which, when executed by a processor, can implement the method described in the first aspect.

[0023] In the network configuration scheme provided in this application embodiment, in the initial state, the target controller receives the first network configuration request sent by the application within the target time window, and determines the target forwarder to which the first network configuration information corresponding to the first network configuration request should be sent based on the first network configuration request. Then, the first network configuration information is sent to the target forwarder through a short connection mode. During this process, even if the target controller crashes, it can quickly establish a short connection with the target forwarder through other controllers, and then continue to send the unsent first network configuration information to the target forwarder, thus ensuring the configuration recovery speed of the network configuration information of the target forwarder in the event of a target controller failure.

[0024] Subsequently, the target controller updates the total number of network configuration requests corresponding to the target repeater within the target time window. If the total number of network configuration requests meets the connection mode switching condition between the target controller and the target repeater, it determines to switch the connection mode between the target controller and the target repeater to a long connection mode. Based on the second network configuration request received by the target controller, it determines the target repeater to which the second network configuration information corresponding to the second network configuration request should be sent, and then sends the second network configuration information to the target repeater through the long connection mode, ensuring the performance of the target controller in sending network configuration information. In summary, the embodiments of this application can flexibly switch the connection mode between the target controller and the target repeater based on the total number of network configuration requests, which can simultaneously take into account the network configuration information sending performance of the controller and the configuration recovery speed of the repeater's network configuration information in the event of a controller failure.

[0025] In summary, by using short-connection configuration when the number of network configuration requests to the target repeater is small, the advantages of short connections can be leveraged to quickly restore the corresponding network configuration information processing in the event of a controller failure. Conversely, when the number of network configuration requests to the target repeater is concentrated and large, switching to long-connection mode can leverage the advantages of long connections to complete the distribution of these network configuration information more quickly, thus improving configuration efficiency. Attached Figure Description

[0026] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0027] Figure 1 A schematic diagram of an SDN architecture provided for an embodiment of this application;

[0028] Figure 2aThis is a schematic diagram illustrating the application of a short connection mode provided in an embodiment of this application;

[0029] Figure 2b This is another application diagram of a short connection mode provided in the embodiments of this application;

[0030] Figure 3a This is a schematic diagram illustrating an application of a long-connection mode provided in an embodiment of this application;

[0031] Figure 3b This is another application diagram of a long-connection mode provided in the embodiments of this application;

[0032] Figure 4 A flowchart illustrating a network configuration method provided in an embodiment of this application;

[0033] Figure 5 This application provides an schematic diagram of a connection mode switching based on a time window, as illustrated in an embodiment of this application.

[0034] Figure 6a This application illustration shows the dependency relationship between different types of network configuration information and different repeaters in a repeater cluster, as provided in an embodiment of this application.

[0035] Figure 6b This application provides an schematic diagram illustrating the operation of network configuration information in an embodiment of this application.

[0036] Figure 6c This is another application diagram illustrating the operation of network configuration information provided in this application embodiment;

[0037] Figure 6d This is a schematic diagram illustrating another application of network configuration information provided in an embodiment of this application.

[0038] Figure 7 This application provides an schematic diagram illustrating the effect of determining the retransmission impact of first network configuration information on the target repeater, as provided in an embodiment of this application.

[0039] Figure 8 Another flowchart of a network configuration method provided in an embodiment of this application;

[0040] Figure 9 Another flowchart illustrating a network configuration method provided in an embodiment of this application;

[0041] Figure 10 Another flowchart of a network configuration method provided in an embodiment of this application;

[0042] Figure 11 This is an application diagram illustrating a network configuration method provided in an embodiment of this application;

[0043] Figure 12 This is a schematic diagram of the structure of a network configuration device provided in an embodiment of this application;

[0044] Figure 13 This is a schematic diagram of the structure of an electronic device provided in this embodiment. Detailed Implementation

[0045] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application. In addition, the timing of the steps in the following method embodiments is only an example and not a strict limitation.

[0046] It should be noted that, in the cases involving user information in the embodiments of this application, 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 the embodiments of this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, 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. In addition, the various models involved in this application (including but not limited to large language models or other models) comply with relevant laws and standards.

[0047] First, the terms or concepts involved in the embodiments of this application will be explained:

[0048] Software-defined networking (SDN) is a method of network virtualization that separates the control plane from the data plane of network devices, enabling flexible control of network traffic and making the network more intelligent.

[0049] Virtual Private Cloud (VPC): An isolated private network space created in a public cloud, where users can customize network configurations (IP ranges, subnets, routing tables, etc.) to achieve secure isolation and flexible management of resources.

[0050] Transmission Control Protocol (TCP) is a connection-oriented, reliable, byte-stream-based transport layer communication protocol. The two communicating parties need to establish a connection through a three-way handshake and terminate the connection through a four-way handshake to ensure the reliability of transmission.

[0051] Long-lived connection: refers to a TCP long-lived connection, where multiple subsequent data packets can be transmitted using the same connection after the TCP handshake.

[0052] Short connection: refers to a short TCP connection, where each packet transmission requires going through the complete process of TCP handshake, connection establishment, and release.

[0053] Hybrid Connection Scheduler (HCS): It can dynamically schedule long and short connection modes, while taking into account the performance of the controller's network configuration information delivery and the configuration recovery speed of the repeater's network configuration information in the event of controller failure.

[0054] Figure 1 This application provides a schematic diagram of an SDN architecture, as shown in the embodiment. Figure 1 As shown, this SDN architecture consists of three layers: the application layer, the control plane, and the data plane. The application layer primarily contains user-facing applications (APPs) used to send network configuration requests (also known as API requests) to the control plane. The control plane contains centralized or distributed controllers that receive and parse the API requests sent by the application layer, generate network configuration information based on these requests (such as VPC-related configuration information, virtual switch (vSwitch) tunnel numbers, IP addresses, and port information configured for the forwarders, and then send this network configuration information to the data plane via a specified protocol (such as OpenFlow). The data plane receives the network configuration information sent by the controller through forwarders (such as switches and routers) and performs subsequent packet forwarding based on this information.

[0055] During this process, there are two connection modes between the controller and the repeater: short connection mode and long connection mode. Figure 2a This is a schematic diagram illustrating an application of a short connection mode provided in an embodiment of this application. Figure 2a The diagram illustrates two controllers (Controller 1 and Controller 2), three repeaters (Repeater 1, Repeater 2, and Repeater 3), and a database. The database stores network configuration information, repeater device status information (e.g., repeater power-on status, upgrade status, etc.), and workflow information (containing multiple steps, such as calculation, generation, invocation, push, and other types of steps). In practical applications, each controller can send network configuration information to any repeater.

[0056] To better understand the network configuration information distribution process in short-connection mode, let's take an example. Suppose controller 1 needs to distribute network configuration information to forwarder 2. First, controller 1 and forwarder 2 need to go through a three-way TCP handshake. Specifically, controller 1 sends a synchronization message (also called a SYN message) to forwarder 2, requesting to establish a connection. This SYN message carries controller 1's initial sequence number. After receiving the SYN message, forwarder 2 sends an acknowledgment message (also called a SYN-ACK message) back to controller 1. After receiving the SYN-ACK message, controller 1 sends an ACK message to forwarder 2, acknowledging the SYN-ACK message sent by forwarder 2. At this point, the short connection between controller 1 and forwarder 2 is officially established, and they can begin data exchange. In practice, controller 1 sends network configuration information to repeater 2 via a short connection. After successful transmission, controller 1 updates the database with the device status (e.g., online status, health status) and workflow information (e.g., currently at step 5 / 13) of repeater 2 based on the response information from repeater 2. Simultaneously, controller 1 disconnects from repeater 2.

[0057] Subsequently, if controller 1 needs to send network configuration information to repeater 2, the three-way TCP handshake process described above must be repeated. Only after a successful handshake can controller 1 and repeater 2 exchange data. At this point, controller 1 can retrieve the latest device status and workflow information of repeater 2 from the database, and then send the network configuration information to repeater 2 based on the latest device status and workflow information. After successful sending, the database is updated again in the same way. Simultaneously, controller 1 disconnects from repeater 2.

[0058] The above describes the normal operation of the short-connection mode. However, in practical applications, scenarios often occur where the controller crashes due to malfunctions. The following section discusses... Figure 2b This section provides a detailed explanation of how the short connection mode works in this scenario. Figure 2b This is another application diagram illustrating a short connection mode provided in an embodiment of this application. Figure 2b The system also includes two controllers (controller 1 and controller 2), three repeaters (repeater 1, repeater 2 and repeater 3), and a database.

[0059] In practical applications, assuming that the control system used to manage controller 1 and controller 2 detects a sudden failure of controller 1 through a heartbeat mechanism (assuming that controller 1 is currently short-connected to repeater 2), it can be determined that controller 1 is in a sudden downtime state. At this time, the control system can call controller 2 to read the device status (such as online status, health status, etc.) and workflow information of repeater 2 from the database (such as currently proceeding to step 5 / 13), so that controller 2 can establish a new short connection with repeater 2 based on the device status and workflow information of repeater 2, and continue to complete the distribution of the remaining network configuration information (such as continuing to complete the remaining steps 6-13).

[0060] The above describes the operation process of the short-connection mode in the event of a single controller failure. It can be seen that the short-connection mode has the following advantages and disadvantages:

[0061] Advantages: Since both device status information and workflow information are stored in the database, when a single controller fails, the remaining controllers that are still functioning can quickly read the "device status information and workflow information" of the repeaters connected to the failed controller from the database and restore the network configuration information to send out tasks. In other words, the configuration recovery speed of the repeater's network configuration information is fast in the event of a controller failure.

[0062] Disadvantages: Each interaction between the controller and the repeater requires a TCP handshake, connection establishment, and connection release, adding extra TCP performance overhead. Furthermore, since network configuration information is stored in a database, the controller generates numerous read / write operations (I / O operations) with the database during the distribution of network configuration information, resulting in high I / O overhead. In summary, the controller's performance in distributing network configuration information is poor.

[0063] Figure 3a This is a schematic diagram illustrating an application of a long-connection mode provided in an embodiment of this application. Figure 3a The diagram illustrates two controllers (Controller 1 and Controller 2), three repeaters (Repeater 1, Repeater 2, and Repeater 3), and a database. The database stores network configuration information. The repeater's device status information (e.g., power-on status, upgrade status, etc.) and workflow information (containing multiple steps, such as information calculation, generation, retrieval, and push) are maintained in the controller's local memory. In practical applications, each repeater maintains a long-term connection with only one controller.

[0064] To facilitate understanding of the network configuration information distribution process in long-connection mode, for example, in the initial state, controller 1 can proactively establish a long connection with repeater 1, or, when repeater 1 starts up, it can establish a long connection with controller 1 according to the load balancing strategy or manual allocation (without needing to perform repeated handshakes). When controller 1 needs to distribute network configuration information to repeater 1, it can directly send the network configuration information through the established long connection, and update the device status information and workflow information of repeater 1 in the local memory of controller 1.

[0065] The above describes the normal operation of the long-connection mode. However, in practical applications, scenarios often occur where the controller crashes due to malfunctions. The following section discusses... Figure 3b This section provides a detailed explanation of how the long-connection mode works in this scenario. Figure 3b This is another application diagram of a long connection mode provided in the embodiments of this application. Figure 3b The equipment structure and Figure 3a Similarly, it also includes two controllers (controller 1 and controller 2), three repeaters (repeater 1, repeater 2 and repeater 3), and a database.

[0066] In practical applications, suppose the control system managing controllers 1 and 2 detects a sudden failure of controller 1 via a heartbeat mechanism (assuming controller 1 is currently permanently connected to repeater 1). This indicates that controller 1 has suddenly crashed. In this case, repeater 1 can initiate a reconnection to controller 2 and synchronize its device status and workflow information. Controller 2 then reconstructs the repeater's device status and workflow information in its local memory, establishing a permanent connection with repeater 1. Subsequently, controller 2 can send network configuration information to repeater 1. Understandably, the device status and workflow information originally stored in controller 1's memory will be lost during this process.

[0067] The above describes the operation process of the long-connection mode in the event of a single controller failure. It can be seen that the above long-connection mode has the following advantages and disadvantages:

[0068] Advantages: Since device status and workflow information are maintained in the controller's local memory, the controller significantly reduces database I / O operations and lowers I / O overhead during network configuration information distribution. Furthermore, the controller and repeater only need a single handshake to establish a long-lived connection, reducing additional TCP performance overhead. In summary, the controller performs well in network configuration information distribution under long-connection mode.

[0069] Disadvantages: Because the database does not store the device status and workflow information of the repeaters, when a controller fails, the device status and workflow information of the repeaters that are permanently connected to the failed controller will be lost. The repeater needs to resend its device status and workflow information to the new controller. Only after the repeater's device status and workflow information is reconstructed in the new controller can the new controller continue to send network configuration information to the repeater via a permanent connection. In summary, the long-connection mode results in a slower recovery speed of the repeater's network configuration information in the event of a controller failure.

[0070] Based on the above description of short-connection and long-connection modes, it is clear that neither connection mode can simultaneously guarantee the performance of the controller's network configuration information delivery and the speed of the repeater's network configuration information recovery in the event of a controller failure. Therefore, this application provides a network configuration method that addresses the above problems through the following approach: In the initial state, the target controller and the target repeater interact using a short-connection mode to ensure the speed of the target repeater's network configuration information recovery in the event of a target controller failure. However, if the target repeater suddenly and continuously receives a large number of network configuration requests, the connection mode between the target controller and the target repeater is switched to a long-connection mode. This allows the target controller to subsequently deliver network configuration information to the target repeater based on the long-connection mode, ensuring the performance of the target controller's network configuration information delivery. In summary, this solution allows for flexible switching of connection modes, simultaneously balancing the performance of the controller's network configuration information delivery and the speed of the repeater's network configuration information recovery in the event of a controller failure.

[0071] Figure 4 A flowchart illustrating a network configuration method provided in this application embodiment, wherein the method is applied to a target controller in a controller cluster, such as... Figure 4 As shown, the method includes the following steps:

[0072] 401. The target controller responds to receiving a first network configuration request sent by the application within the target time window, determines the first network configuration information corresponding to the first network configuration request and the target forwarder corresponding to the first network configuration information, and the target forwarder belongs to the forwarder cluster controlled by the controller cluster.

[0073] 402. The target controller sends the first network configuration information to the target repeater through a short connection with the target repeater.

[0074] 403. The target controller updates the total number of network configuration requests corresponding to the target repeater within the target time window to determine whether to switch the connection mode with the target repeater to long connection mode based on the total number of network configuration requests.

[0075] 404. The target controller responds to receiving a second network configuration request sent by the application within the target time window, determines the second network configuration information corresponding to the second network configuration request and the target repeater corresponding to the second network configuration information, wherein the second network configuration request is received later than the first network configuration request.

[0076] 405. If the target controller determines to switch the connection mode with the target repeater to a long connection mode, it sends the second network configuration information to the target repeater through the long connection with the target repeater.

[0077] In practical applications, users send the first network configuration request to the target controller through the application. The following explanation is based on the target time window:

[0078] In practice, the target controller receives the first network configuration requests sent by the application within the target time window. The target time window can contain one or more consecutive time windows. For example, if a target time window is 10 seconds long, and it contains one time window, the target controller receives the first network configuration requests sent by the application within those 10 seconds. For instance, if the application sends three first network configuration requests within 10 seconds, the target controller receives three first network configuration requests within the target time window. If the target time window consists of multiple time windows (assuming two time windows with a 4-second overlap), the target controller receives the first network configuration requests sent by the application within 6 seconds + 4 seconds + 6 seconds = 16 seconds. Assuming the application sends eight first network configuration requests within these 16 seconds, the target controller receives eight first network configuration requests within the target time window. These first network configuration requests can include updating VPC-related configuration information, generating vSwitch tunnel numbers, modifying bandwidth packets, etc., and are not listed here.

[0079] After receiving the first network configuration request sent by the application within the target time window, the target controller parses the first network configuration request to obtain information such as the application identifier (or user identifier) ​​and the forwarder identifier carried in the network configuration request. Then, based on the application identifier (or user identifier) ​​and the forwarder identifier carried in the first network configuration request, it determines that the application needs to send the first network configuration information corresponding to the first network configuration request to the target forwarder in the forwarder cluster.

[0080] Subsequently, the target controller sends the first network configuration information to the target repeater via a short connection, specifically:

[0081] As one implementation, after receiving the first network configuration information, the target controller segments the information into multiple fragments of a fixed size (e.g., each fragment is 1KB), and synchronizes the fragment sequence number of each fragment and the total number of fragments to the database. In practice, the target controller sends the multiple fragments sequentially to the target forwarder via short connections according to the segmentation order. Upon receiving each fragment, the target forwarder verifies its fragment sequence number. If verification passes, the fragment is stored; if verification fails (e.g., due to a sudden crash of the target controller causing fragment loss), an error response is sent to the control system corresponding to the controller cluster. This error response includes the sequence number of the fragment that failed verification. The control system then calls a new controller to establish a new short connection with the target forwarder, allowing the new controller to continue sending fragments to the target forwarder starting from the fragment corresponding to the failed sequence number, until the target forwarder receives all the fragments corresponding to the first network configuration information. At this point, the target forwarder can reassemble all the fragments according to their fragment sequence numbers to obtain the complete first network configuration information.

[0082] As another implementation, the first network configuration information is sent to the target repeater via a short connection, including: determining a sending workflow for the first network configuration information, the sending workflow including multiple steps involved in sending the first network configuration information, the multiple steps including at least one step of interacting with the target repeater; storing the multiple steps and the first network configuration information in a database, the database being shared by the controller cluster; sending the first network configuration information to the target repeater according to the execution order of the multiple steps; wherein, when at least one step is executed, obtaining the device status information corresponding to the target repeater to execute at least one step based on the device status information; and updating the database with the execution status of the multiple steps and the device status information of the target repeater corresponding to each of the at least one step.

[0083] In practical applications, it is first necessary to clarify all the steps involved in sending the first network configuration information (i.e., to determine the workflow for sending the first network configuration information). These steps may include obtaining, verifying, encapsulating, and sending the configuration information. For ease of understanding, the following example illustrates the multiple steps corresponding to the above sending workflow, using the example of the target controller sending a new VPC configuration message to the target forwarder:

[0084] Step 1: Verify the validity of the configuration.

[0085] Step 2: Check the online status of the target repeater.

[0086] Step 3: Distribute basic VPC configurations (such as subnets and gateways) via short connections.

[0087] Step 4: Deploy routing table rules via short connections.

[0088] Step 5: Send security group rules via short connection.

[0089] Step 6: Confirm that all configurations are in effect and log them.

[0090] After obtaining the above steps, these steps and the initial network configuration information are stored in a database shared by the controller cluster to ensure information consistency and availability. Assuming the initial network configuration information pertains to creating a VPC network interface, this initial network configuration information, along with related steps (such as obtaining VPC information, verifying configuration parameters, and encapsulating them into a specific protocol format), will all be stored in the database.

[0091] Next, according to the execution order of the steps stored in the database, the first network configuration information is sent to the target forwarder. For example, in a scenario of creating a VPC network interface, the first network configuration information might first be sent to the controller responsible for VPC management, and then processed sequentially by the controller according to the workflow steps before being sent to the target forwarder. At at least one step, it is necessary to obtain the device status information corresponding to the target forwarder and execute the corresponding steps based on this information. For example, before sending the first network configuration information, it may be necessary to check the online or health status of the target forwarder. If the target forwarder is offline or unhealthy, the sending of the first network configuration information is paused or rescheduled. Furthermore, as the sending workflow progresses, the execution status of multiple steps and the device status information of the target forwarder corresponding to at least one step in the database need to be continuously updated. For example, during the sending of the first network configuration information, the execution result of each step (such as success, failure, retry, etc.) is recorded in the database. Simultaneously, the device status information of the target forwarder (such as online, offline, healthy, unhealthy, etc.) is also updated as the sending workflow progresses.

[0092] By clearly defining the multiple steps for sending the initial network configuration information, a consistent process can be ensured for each network configuration information delivery operation, reducing human error and configuration deviations. Storing these multiple steps and the initial network configuration information in a shared database enables rapid controller switching in the event of a target controller failure. Dynamically acquiring the target repeater's device status information during at least one step allows for real-time adjustment of operational strategies, preventing the issuance of invalid requests to malfunctioning repeaters. After multiple steps are completed, the execution status of each step and the device status information of the target repeater corresponding to each step are updated in the database, laying the foundation for smooth controller switching in subsequent short-connection mode.

[0093] After the target controller sends the first network configuration information to the target repeater via short connection mode, it counts the total number of network configuration requests corresponding to the target repeater within the target time window. Simultaneously, the target controller disconnects from the target repeater. It should be noted that although the target controller and target repeater are disconnected at this point, the target controller will still locally record the connection mode used with the target repeater until the statistical results are available. If the statistical results show that the total number of network configuration requests does not meet the connection mode switching conditions, the target controller and target repeater can continue to maintain a short connection based on the connection mode recorded locally by the target controller.

[0094] Conversely, if the total number of network configuration requests meets the connection mode switching condition, it is determined that the connection mode with the target forwarder will be switched to long connection mode. At this time, the second network configuration information received by the target controller after the first network configuration request will be sent to the target forwarder through the long connection with the target forwarder.

[0095] As one implementation, after receiving the first network configuration information, the target controller can divide it into multiple fragments of a fixed size (e.g., each fragment is 1KB), and store the fragment number of each fragment and the total number of fragments in the target controller's local memory. In practice, the target controller sends the multiple fragments sequentially to the target forwarder via a long connection according to the order of division. Upon receiving each fragment, the target forwarder verifies its fragment number. If verification passes, the fragment is stored; if verification fails (e.g., due to a sudden crash of the target controller causing fragment loss), an error response is sent to the control system corresponding to the controller cluster. This error response includes the fragment number that failed verification. The control system then calls a new controller to establish a new long connection with the target forwarder and restarts sending the multiple fragments of the first network configuration information to the target forwarder until the target forwarder has received all fragments. At this point, the target forwarder can reassemble all fragments according to their fragment numbers to obtain the complete first network configuration information.

[0096] As another implementation, the second network configuration information is sent to the target repeater via a long-lived connection, including: determining a sending workflow for the second network configuration information, the sending workflow including multiple steps involved in sending the second network configuration information, including at least one step of interacting with the target repeater; storing the second network configuration information in a database, storing the sending workflow in the local storage space of the target controller, and sharing the database with the controller cluster; sending the second network configuration information to the target repeater according to the execution order of the multiple steps; wherein, when executing at least one step, obtaining the device status information corresponding to the target repeater to execute at least one step based on the device status information; and updating the execution status of the multiple steps and the device status information of the target repeater corresponding to each of the at least one step in the local storage space of the target controller.

[0097] In practical applications, it is first necessary to clarify all the steps involved in sending the second network configuration information (i.e., to determine the workflow for sending the second network configuration information). These steps may include obtaining, verifying, encapsulating, and sending the configuration information. For ease of understanding, the following example illustrates the multiple steps corresponding to the above sending workflow, using the example of the target controller sending a new VPC configuration message to the target forwarder:

[0098] Step 1: Verify the validity of the configuration.

[0099] Step 2: Check the online status of the target repeater.

[0100] Step 3: Establish a long connection with the target repeater.

[0101] Step 4: Deploy routing table rules via long-lived connections.

[0102] Step 5: Send security group rules via long connection.

[0103] Step 6: Confirm that all configurations are in effect and log them.

[0104] After determining the sending workflow steps, the second network configuration information is stored in the database, and the sending workflow is stored in the target controller's local storage space. The database is shared by the controller cluster. Then, the above steps are executed sequentially (the next step can only be triggered after the previous step is successful). When executing at least one step, it is necessary to obtain the device status information corresponding to the target repeater and execute the corresponding steps based on the device status information. For example, before sending the first network configuration information, it may be necessary to check the online or health status of the target repeater. If the target repeater is offline or unhealthy, the sending of the first network configuration information is paused or rescheduled. Furthermore, as the sending workflow progresses, the execution status of multiple steps and the device status information of the target repeater corresponding to at least one step need to be continuously updated in the target controller's local storage space. For example, during the sending of the first network configuration information, the execution result of each step (such as success, failure, retry, etc.) is recorded in the target controller's local storage space. Simultaneously, the device status information of the target repeater (such as online, offline, healthy, unhealthy, etc.) is also updated in the target controller's local storage space as the sending workflow progresses.

[0105] By clearly defining the multiple steps for sending the second network configuration information, a consistent workflow can be ensured for each network configuration information distribution operation, reducing human error and configuration deviations. Storing the second network configuration information in a database and the sending workflow in the target controller's local storage space reduces frequent database I / O operations and lowers I / O overhead. Dynamically acquiring the target repeater's device status information during at least one step allows for real-time adjustment of operational strategies, avoiding sending invalid requests to malfunctioning repeaters. After multiple steps are completed, updating the execution status of each step and the device status information of the target repeater corresponding to each step in the target controller's local storage space facilitates subsequent network configuration information distribution without requiring frequent database I / O operations.

[0106] Based on the above, the network configuration method provided in this application embodiment establishes a short connection mode between the target controller and the target repeater in the initial state, and sends the first network configuration information to the target repeater through the short connection mode. Even if the target controller fails, the unsent first network configuration information can still be sent to the target repeater through other repeaters, ensuring the configuration recovery speed of the target repeater's network configuration information in the event of a target controller failure. Subsequently, the total number of network configuration requests corresponding to the target repeater within the target time window is used to determine whether to switch the connection mode between the target controller and the target repeater. If it is determined that the connection mode between the target controller and the target repeater should be switched to a long connection mode, the second network configuration information corresponding to the second network configuration request received by the target controller within the target time window is sent to the target repeater through the long connection mode, ensuring the performance of the target controller's network configuration information delivery. In other words, this solution flexibly switches the connection mode, balancing the network configuration information delivery performance of the controller with the configuration recovery speed of the repeater's network configuration information in the event of a controller failure.

[0107] Following on from the above, the following section details how to determine whether to switch the connection mode with the target forwarder to persistent connection mode based on the total number of network configuration requests (it can be understood that before counting the total number of network configuration requests, it is necessary to first determine whether all network configuration requests are within the target time window; the total number of network configuration requests mentioned below refers to the number of network configuration requests within the target time window):

[0108] The first implementation method determines whether to switch the connection mode with the target repeater to long connection mode based on the total number of network configuration requests. This includes: determining a mode switching reference value based on the total number of network configuration requests; if the mode switching reference value is greater than or equal to a set threshold, then determining to switch the connection mode with the target repeater to long connection mode; if the mode switching reference value is less than the set threshold, then determining to maintain the connection mode with the target repeater as short connection mode.

[0109] To facilitate understanding, the following will be combined with... Figure 5 For example: In Figure 5The CCP demonstrated four time windows formed by the sliding window sliding once at set intervals: Time Window 1, Time Window 2, Time Window 3, and Time Window 4. Time Window 2 (containing 5 network configuration requests) and Time Window 3 (containing 8 network configuration requests), which have an overlap, are used as the target time windows. Time Window 2 and Time Window 3 have 4 overlapping network configuration requests. Therefore, the total number of network configuration requests within the target time windows is 1 + 4 + 4 = 9. 9 is used as the mode switching reference value. In specific implementation, if the mode switching reference value 9 is greater than or equal to a set threshold, the connection mode with the target repeater is switched to long connection mode; if the mode switching reference value 9 is less than the set threshold, the connection mode with the target repeater is maintained in short connection mode.

[0110] By determining the mode switching reference value based on the total number of network configuration requests and comparing the mode switching reference value with a set threshold, the connection mode between the target controller and the target repeater can be quickly determined (simple implementation, no complex calculation required), laying the foundation for subsequent connection mode switching.

[0111] The second implementation method determines whether to switch the connection mode with the target forwarder to a persistent connection mode based on the total number of network configuration requests. This includes: determining a mode switching reference value based on the contribution value of each network configuration request to the mode switching of the target forwarder, and then using this reference value to determine whether to switch the connection mode with the target forwarder to a persistent connection mode. The mode switching contribution value reflects the impact of network configuration requests on the load level of the target forwarder. By quantifying the load impact (such as resource consumption and computational overhead) of each network configuration request on the target forwarder through the mode switching contribution value, and using persistent connections only when the target forwarder's load is high (reducing TCP handshake overhead), the switching decision can be made more accurate.

[0112] In practical applications, in an optional embodiment, different contribution weights can be set for network configuration requests at different levels, and the total contribution value can be dynamically calculated. Specifically, assume that the network configuration request levels include:

[0113] The root-level network configuration request has a contribution value of 5.

[0114] The second-level network configuration request has a contribution value of 3.

[0115] The contribution value of a Level 3 network configuration request is 1.

[0116] Root configuration is the highest-level configuration in the network architecture, typically involving the definition of global resources. For example, a root-level network configuration request might create a VPC, define core routing policies, or global security rules; therefore, its contribution value is set to the highest. Second-level configuration refers to sub-resources defined under the root configuration. For example, a second-level network configuration request might create a subnet (VSwitch) or configure Border Gateway Protocol (BGP) neighbor relationships. Third-level configuration is a fine-grained configuration for specific network devices or services. For example, a third-level network configuration request might define port security policies or Quality of Service (QoS) rate limiting rules, affecting only the local functionality of a single forwarder.

[0117] In addition, the mode switching contribution value can be the sum of the contribution values ​​corresponding to each network configuration request. The connection mode between the target controller and the target repeater is switched to long connection mode by comparing the mode switching contribution value with a set threshold (assuming it is 100).

[0118] To make it easier to understand, for example, suppose the target repeater receives a total of 10 root-level network configuration requests and 20 secondary-level network configuration requests. The total contribution value (i.e., the mode switching contribution value) is 10×5+20×3=110. It can be seen that the mode switching contribution value is greater than the set threshold of 100. At this time, the connection mode between the target controller and the target repeater is switched to the long connection mode.

[0119] In another optional embodiment, the number of impact paths of the first network configuration information on the target forwarder can be determined based on the different types of network configuration information and the dependencies between different forwarders in the forwarder cluster; the retransmission impact value of the first network configuration information on the target forwarder can be determined based on the retransmission information of the first network configuration information; the mode switching reference value of the first network configuration information on the target forwarder can be determined based on the number of impact paths and the retransmission impact value; the total mode switching reference value of the target forwarder can be updated based on the mode switching reference value of the first network configuration information on the target forwarder, so as to determine whether to switch the connection mode with the target forwarder to a long connection mode based on the total mode switching reference value, wherein the total mode switching reference value is the sum of the mode switching reference values ​​of multiple network configuration requests on the target forwarder.

[0120] It should be noted that the different types of network configuration information and the dependencies between different forwarders in the forwarder cluster can be contained in the first network configuration request directly issued by the application, or they can be established based on the information contained in the first network configuration request. The method of obtaining the dependencies is not limited here.

[0121] To facilitate understanding, the following will be combined with... Figures 6a-6d and Figure 7 Here are some specific examples:

[0122] Figure 6a This is a schematic diagram illustrating the application of different types of network configuration information and the dependencies between different repeaters in a repeater cluster, as provided in an embodiment of this application. Figure 6a The document contains three different types of network configuration information:

[0123] Root-level network configuration information (Child conf#20), such as bandwidth packet information, is the first-level configuration information;

[0124] Secondary network configuration information (Child conf#10, Child conf#11, Child conf#12), such as IP address information, is sub-resource information defined under the root-level network configuration information. Figure 6a In the code, Child conf#20 has dependencies on Child conf#10 and Child conf#11;

[0125] Level 3 network configuration information (Root conf#1, Root conf#2, Root conf#3), such as routing rules. In Figure 6a In the code, Child conf#10 has dependencies on Root conf#1 and Repeater 1, Child conf#11 has dependencies on Root conf#2 and Repeater 1, and Child conf#12 has dependencies on Root conf#3 and Repeater 2.

[0126] Based on the above dependencies, the number of impact paths of various types of network configuration information on any forwarder in the forwarder cluster can be determined. Assuming the first network configuration information is the root-level network configuration information, then... Figure 6a In this context, the number of impact paths on the target repeater (repeater 1) is 2. These two paths are:

[0127] Path 1: Child conf#20, Child conf#10, Root conf#1, Repeater 1;

[0128] Path 2: Child conf#20, Child conf#11, Root conf#2, Repeater 1.

[0129] It should be understood that due to the aforementioned dependencies, modifications to upper-layer network configuration information often affect lower-layer network configuration information. For example, suppose the root-level network configuration information Child conf#20 is a bandwidth packet, and its associated IP address 1 is Child conf#10, and its associated IP address 2 is Child conf#11. Then, if this bandwidth packet is upgraded (e.g., increasing the bandwidth packet's rate limit from 10M to 100M), it is necessary to configure the root-level network configuration information Child conf#20 first, then configure Child conf#10 and Child conf#11 separately, and then configure the lower layers from Child conf#10 and Child conf#11.

[0130] Additionally, it's understandable that regardless of the type of network configuration information the target controller operates on based on the network configuration request, it may affect the number of impact paths for the target forwarder. Figure 6b For example, Figure 6b This is a schematic diagram illustrating an application of manipulating network configuration information, provided in an embodiment of this application. Figure 6b In the above process, the target controller operates on the third-level network configuration information according to the network configuration request. Based on the above dependencies, it can be determined that: if Root conf#1 is operated, the number of paths affected by Root conf#1 on the target repeater (i.e., repeater 1) is 1; if Root conf#2 is operated, the number of paths affected by Root conf#2 on the target repeater is 1; neither of these operations will affect repeater 2. If Root conf#3 is operated, Root conf#3 has no effect on repeater 1, but the number of paths affected by repeater 2 is 1.

[0131] Continue with Figure 6c For example, Figure 6c This is a schematic diagram illustrating another application of network configuration information provided in an embodiment of this application. Figure 6c In this process, the target controller operates on the secondary network configuration information according to the network configuration request. Based on the above dependencies, it can be determined that: if Child conf#10 is operated, the number of paths affected by Child conf#10 on the target repeater (i.e., repeater 1) is 1; if Child conf#11 is operated, the number of paths affected by Child conf#11 on the target repeater is 1; neither of these operations will affect repeater 2. If Child conf#12 is operated, the number of paths affected by Child conf#12 on both repeater 1 and repeater 2 is 1.

[0132] Continue with Figure 6d For example, Figure 6dThis is a schematic diagram illustrating another application of network configuration information provided in an embodiment of this application. Figure 6d In the process, the target controller operates on the root-level network configuration information according to the network configuration request. Based on the above dependencies, it can be determined that if Child conf#20 is operated, then the number of paths affected by Child conf#20 on the target forwarder (i.e., forwarder 1) is 2 (e.g., ...). Figure 6d The dotted part in the text will not affect repeater 2.

[0133] In summary, when a target controller receives a network configuration request, it first needs to determine what network configuration information the request involves, which repeaters this information will affect, and then determine the number of impact paths for each network configuration information on these repeaters. After determining the number of impact paths, it then determines the retransmission impact value of the first network configuration information on the target repeater.

[0134] There are several ways to determine the impact of the first network configuration information on the retransmission of the target repeater:

[0135] One implementation method is to use historical network configuration information and the probability of historical network configuration information transmission failure as training samples to train a prediction model. This model then predicts the number of retransmissions of the network configuration information, and the retransmission impact value is determined based on the predicted number of retransmissions. The specific formula is as follows:

[0136] The impact of retransmissions = the expected number of retransmissions × the weight.

[0137] Assuming a weight of 3, in specific implementation, the first network configuration information is input into the prediction model to obtain the expected number of retransmissions of the first network configuration information output by the prediction model (assumed to be 2). Based on the above formula, it can be determined that the retransmission impact of the first network configuration information on the target repeater is 3×2=6.

[0138] As another implementation, the retransmission impact value of the first network configuration information on the target repeater is determined based on the retransmission information of the first network configuration information. This includes: if it is determined that the first network configuration information was successfully sent to the target repeater, the retransmission impact value is determined to be a first value; if it is determined that the first network configuration information was not successfully sent to the target repeater, and the target controller does not support retransmission of the first network configuration information using a set backoff algorithm, the retransmission impact value is determined to be a second value, which is greater than the first value. The second value is used to reflect whether there will be a retransmission of the first network configuration information in the future; if it is determined that the first network configuration information was not successfully sent to the target repeater, and the target controller supports retransmission of the first network configuration information using a set backoff algorithm, the retransmission impact value is determined to be a third value based on the retransmission parameters set in the backoff algorithm. The third value is used to reflect whether the first network configuration information will be retransmitted in the next time window of the target time window.

[0139] To facilitate understanding, the following will be combined with... Figure 7 To illustrate, if the first network configuration information is successfully sent to the target repeater, the retransmission impact value is determined to be 1 (it should be understood that if the first network configuration information is successfully sent, only one information transmission is required, resulting in a small impact on the load of the target repeater; therefore, the retransmission impact value is low). If the first network configuration information is not successfully sent to the target repeater, and the target controller does not support retransmission of the first network configuration information using a set backoff algorithm, the retransmission impact value is determined to be 2 (it should be understood that if the first network configuration information fails to be sent, it will inevitably increase the load on the target repeater in the future; therefore, the retransmission impact value is high). If the first network configuration information is not successfully sent to the target repeater, and the target controller supports retransmission of the first network configuration information using a set backoff algorithm, then a third value for the retransmission impact value is determined based on the retransmission parameters set in the backoff algorithm. This third value reflects whether the first network configuration information will be retransmitted in the next time window after the target time window; its value may be 1 or 2.

[0140] The following example illustrates the retransmission parameters set in the backoff algorithm: Assume the initial retry interval is 1000ms, and for each additional failure, the retry step size increases by 500ms, with a maximum retry interval of 30s.

[0141] The formula for predicting the next retransmission time based on the backoff algorithm is as follows:

[0142] retry_timing_predict = now + (init_interval + max(number of retries × step size, longest retry interval))

[0143] Here, retry_timing_predict represents the predicted time of the next retransmission, now represents the time when the network configuration information is currently being sent, and init_interval represents the initial retry interval.

[0144] Furthermore, the backoff algorithm also includes the following constraints:

[0145] if retry_timing_predict>now+hcs_window: retransmission impact value = 1. This condition means that if it is predicted that a retransmission will not be triggered in the next sliding window, the retransmission impact value will be reduced from 2 to 1 (because the interval is long, the impact of retransmission can be ignored).

[0146] if retry_timing_predict ≤ now + hcs_window: retransmission impact value = 2. This condition means that if a retransmission is predicted to occur within the next sliding window, it will inevitably increase the load on the target repeater. In this case, the retransmission impact value will be kept at 2.

[0147] To facilitate understanding of the above formulas, the following examples are provided:

[0148] When the first network configuration information fails to be sent: the predicted next retransmission time is now + (1000ms + max(0×500ms, 30000ms)) = now + 1000ms. If the next time window length is 5s, then the predicted next retransmission time is less than now + 5s, the retransmission impact value is 2, and the retransmission will be triggered immediately after the current time window ends. ...

[0150] When the first network configuration information fails to be sent for the 5th time (the number of retries is 4): the predicted next retransmission time is now + (1000ms + max(4×500ms, 30000ms)) = now + 30000ms (i.e., 30s). If the next time window length is 5s, then the predicted next retransmission time is greater than now + 5s, and the retransmission impact value is 1. At this point, the retransmission has exceeded the next time window.

[0151] By distinguishing between three scenarios—successful transmission of the first network configuration information, transmission failure but the target controller does not support retransmission of the first network configuration information using the set backoff algorithm, and transmission failure but the target controller supports retransmission of the first network configuration information using the set backoff algorithm—the retransmission impact value can be determined more accurately, reflecting the load status of the target repeater. This ensures that it can subsequently interact with the target controller through long connection mode under high load and through short connection mode under low load.

[0152] Following the above, after determining the number of affected paths and the retransmission impact value, the mode switching reference value for the target repeater based on the number of affected paths and the retransmission impact value can be determined. As one implementation method, the calculation formula for this mode switching reference value is as follows:

[0153] Mode switching reference value = number of affected paths + retransmission impact value

[0154] For example, suppose the current first network configuration information is a root-level network configuration request, which affects 6 paths, and it is successfully retransmitted after the initial failure. Then the mode switching reference value = 6 + 3 = 9.

[0155] As another implementation method, the formula for calculating the mode switching reference value is as follows:

[0156] Mode switching reference value = (Number of affected paths × Path number weight) + (Retransmission impact value × Retransmission weight)

[0157] The path number weight and retransmission weight can be determined according to the actual situation. Assuming the path number weight is 2, the retransmission weight in the case of network configuration information failure is 2, and the retransmission weight in the case of successful network configuration information transmission is 1. In specific implementation, for example, assuming that the current first network configuration information is a root-level network configuration request, which affects 6 paths, and retransmission is successful after the first failure, then the mode switching reference value = (6×2) + (3×1) = 15.

[0158] Next, the mode switching reference value of the first network configuration information for the target repeater is updated to the total mode switching reference value of the target repeater. This total mode switching reference value refers to the sum of the mode switching reference values ​​of the target repeater for each of the multiple network configuration requests. For example, assuming the mode switching reference value of the first network configuration request for the target repeater is 15, the mode switching reference value of the second network configuration request for the target repeater is 8, and the mode switching reference value of the third network configuration request for the target repeater is 5, then the total mode switching reference value = 15 + 8 + 5 = 28.

[0159] Based on the above, by quantifying the number of impact paths and retransmission impact values ​​of network configuration requests on the target forwarder, the load pressure on the target forwarder can be assessed in real time. This allows for dynamic adjustment of the connection mode, using long connections only when the load is high (reducing TCP handshake overhead and ensuring the performance of network configuration information delivery to the target controller), and maintaining short connections when the load is low (ensuring the speed of network configuration information recovery for the target forwarder in case of target controller failure). Furthermore, predicting future load and optimizing the connection mode in advance by using retransmission impact values ​​can reduce the impact of sudden traffic surges on the system.

[0160] The third implementation method determines a mode switching reference value based on the total number of network configuration requests and the contribution values ​​of each network configuration request to the mode switching of the target forwarder. This reference value is then used to determine whether to switch the connection mode with the target forwarder to a persistent connection mode. Specifically, determining whether to switch the connection mode with the target forwarder to a persistent connection mode based on the mode switching reference value includes: determining the number of impact paths of the first network configuration information on the target forwarder based on the dependencies between different types of network configuration information and different forwarders in the forwarder cluster; determining the retransmission impact value of the first network configuration information on the target forwarder based on the retransmission information of the first network configuration information; determining the mode switching reference value of the first network configuration information on the target forwarder based on the number of impact paths and the retransmission impact value; and updating the total mode switching reference value of the target forwarder based on the first network configuration information's mode switching reference value. The total mode switching reference value is the sum of the mode switching reference values ​​of each network configuration request to the target forwarder.

[0161] In practical applications, the formula for calculating the total mode switching reference value HCS_count is as follows:

[0162] HCS_count=SUM(if API is EXPIRE?0:f_root_layer(API->conf)+f_retry_predict(API_RESP))

[0163] Here, EXPIRE = now_time (the time the network configuration request was received) + window_time_length (the length of the time window). "if API is EXPIRE?" represents the condition "Is the network configuration request within a valid time window?". If the result is yes, it means the network configuration request is within a valid time window, and its value is "f_root_layer(API->conf) + f_retry_predict(API_RESP)". This value represents the reference value for mode switching of the repeater based on the network configuration information corresponding to a network configuration request determined by the number of affected paths and the retransmission impact value. If the result is no, it means the network configuration request is not within a valid time window, and the network configuration request is invalid; in this case, the value is 0.

[0164] It should be noted that the above calculation result only represents the mode switching reference value of the repeater corresponding to the network configuration information of a single network configuration request, while HCS_count represents the total mode switching reference value, which needs to be calculated by summing the mode switching reference values ​​of the repeaters corresponding to the network configuration information of all network configuration requests. In summary, the third implementation method is a combination of the first and second implementation methods. For the parts of the third implementation method that involve the first and second implementation methods, the specific execution process can be found in the above embodiments, and will not be repeated here.

[0165] Figure 8 Another flowchart of a network configuration method provided in this application embodiment is shown below. Figure 8 As shown, the method includes the following steps:

[0166] 801. The target controller responds to receiving a first network configuration request sent by the application within the target time window, determines the first network configuration information corresponding to the first network configuration request and the target forwarder corresponding to the first network configuration information, and the target forwarder belongs to the forwarder cluster controlled by the controller cluster.

[0167] 802. The target controller sends the first network configuration information to the target repeater through a short connection with the target repeater.

[0168] 803. The target controller responds to the triggering of the preheating event corresponding to the target transponder and determines the mode switching preheating value corresponding to the preheating event.

[0169] 804. The target controller updates the total number of network configuration requests corresponding to the target repeater within the target time window, and determines the mode switching reference value based on the total number of network configuration requests and the mode switching warm-up value. The mode switching reference value is used to determine whether to switch the connection mode with the target repeater to the long connection mode. The mode switching warm-up value is used to accelerate the switch of the connection mode with the repeater to the long connection mode.

[0170] 805. The target controller responds to receiving a second network configuration request sent by the application within the target time window, determines the second network configuration information corresponding to the second network configuration request and the target repeater corresponding to the second network configuration information, wherein the second network configuration request is received later than the first network configuration request.

[0171] 806. If the target controller determines to switch the connection mode with the target repeater to a long connection mode, it sends the second network configuration information to the target repeater through the long connection with the target repeater.

[0172] It should be noted that in practical applications, there are often special scenarios where a large amount of network configuration information can be sent from the controller to the target repeater in a short period of time, such as hourly ticket purchases or hourly flash sales of goods. In order to avoid the target repeater being delayed or timed out due to the performance issues of short connection mode in these special scenarios, this application embodiment introduces a preheating mechanism.

[0173] Specifically, after sending the first network configuration information to the target repeater, in response to the triggering of the warm-up event corresponding to the target repeater, a mode switching warm-up value corresponding to the warm-up event is determined. Then, based on the total number of network configuration requests and the mode switching warm-up value, a mode switching reference value is determined. This reference value is used to determine whether to switch the connection mode with the target repeater to a persistent connection mode. The mode switching warm-up value is used to accelerate the switch of the connection mode with the repeater to a persistent connection mode. The formula for determining the mode switching reference value HCS counter is as follows:

[0174] HCS counter=INIT_HCS_COUNT+SUM(if API is EXPIRE?0:f_root_layer(API->conf)+f_retry_predict(API_RESP))

[0175] Here, "INIT_HCS_COUNT" refers to the mode switching warm-up value, while SUM(if API is EXPIRE?0:f_root_layer(API->conf)+f_retry_predict(API_RESP)) represents the mode switching reference value for all network configuration requests within the valid time window.

[0176] To facilitate understanding, let's consider an example scenario: A website is holding a flash sale. Five minutes before the sale begins, a warm-up period is implemented to ensure the forwarder has switched to long-connection mode when the sale starts. The mode-switching warm-up value `INIT_HCS_COUNT` is 30, the threshold is set to 50, and the effective time window is 10 seconds. In practice:

[0177] S1. During the warm-up phase (5 minutes before the start of the event): The mode switching warm-up value of the target repeater participating in the flash sale can be set to 30. Substituting the mode switching warm-up value of 30 into the above formula, we can get: HCS counter = 30, which is less than the set threshold of 50. At this time, the short connection mode is maintained.

[0178] S2. One minute before the start of the activity (when traffic gradually increases): Based on the number of affected paths and the retransmission impact value, the mode switching reference value is determined to be 6. Then, the mode switching warm-up value of 30 and the mode switching reference value of 6 are substituted into the above formula to obtain: HCScounter = 36, which is less than the set threshold of 50. At this time, the short connection mode is maintained.

[0179] S3. At the moment the activity starts (sudden increase in traffic): Based on the number of affected paths and the retransmission impact value, the mode switching reference value is determined to be 24. Then, by substituting the mode switching warm-up value of 30 and the mode switching reference value of 24 into the above formula, we can get: HCS counter = 54, which is less than the set threshold of 50. At this time, the mode is immediately switched to long connection mode.

[0180] By setting up the aforementioned warm-up mechanism, the average latency of the target repeater can be reduced from 500ms to 200ms, and the throughput can be increased from 3000TPS to 500TPS. In summary, by setting up this warm-up mechanism, not only can the performance issues of short-connection mode in certain special scenarios be avoided, but the corresponding latency or timeout of the target repeater can also be improved, thereby increasing throughput and improving the processing efficiency of network configuration information.

[0181] Figure 9 Another flowchart of a network configuration method provided in this application embodiment is shown below. Figure 9 As shown, the method includes the following steps:

[0182] 901. The target controller responds to receiving a first network configuration request sent by the application within the target time window, determines the first network configuration information corresponding to the first network configuration request and the target forwarder corresponding to the first network configuration information, and the target forwarder belongs to the forwarder cluster controlled by the controller cluster.

[0183] 902. The target controller sends the first network configuration information to the target repeater through a short connection with the target repeater.

[0184] 903. The target controller responds to the triggering of a cooling event corresponding to the target transponder and determines the mode switching cooling value corresponding to the cooling event.

[0185] 904. The target controller updates the total number of network configuration requests corresponding to the target repeater within the target time window, and determines the mode switching reference value based on the total number of network configuration requests and the mode switching cooldown value. The mode switching reference value is used to determine whether to switch the connection mode with the target repeater to the long connection mode. The mode switching warm-up value is used to delay the switch of the connection mode with the repeater to the long connection mode.

[0186] 905. The target controller responds to receiving a second network configuration request sent by the application within the target time window, determines the second network configuration information corresponding to the second network configuration request and the target repeater corresponding to the second network configuration information, wherein the second network configuration request is received later than the first network configuration request.

[0187] 906. If the target controller determines to switch the connection mode with the target repeater to a long connection mode, it sends the second network configuration information to the target repeater through the long connection.

[0188] It should be noted that in practical applications, there are often special scenarios where it can be predicted that the controller will crash at a certain time in the future. For example, if the current temperature in the computer room is too high and a power outage is expected within 10 minutes, the controller will crash. In order to ensure the speed of configuration recovery of the network configuration information of the repeater in the event of a controller failure and to enable the repeater to quickly switch back to short connection mode, this application embodiment introduces a cooling mechanism.

[0189] Specifically, after sending the first network configuration information to the target repeater, in response to the triggering of a cooling event corresponding to the target repeater, a mode switching cooldown value corresponding to the cooling event is determined. Then, based on the total number of network configuration requests and the mode switching cooldown value, a mode switching reference value is determined. This reference value is used to determine whether to switch the connection mode with the target repeater to a persistent connection mode. A mode switching warm-up value is used to delay switching the connection mode with the repeater to a persistent connection mode. The formula for determining the mode switching reference value HCS counter is as follows:

[0190] HCS counter=SUM(if API is EXPIRE?COLD_DOWN_VALUE:f_root_layer(API->conf)+f_retry_predict(API_RESP))

[0191] Here, "COLD_DOWN_VALUE" refers to the mode switching cooling value, which supports two modes: Mode 1, normal cooling, COLD_DOWN_VALUE = 0; Mode 2, rapid cooling, COLD_DOWN_VALUE = -1.

[0192] SUM(if API is EXPIRE? 0: f_root_layer(API->conf)+f_retry_predict(API_RESP)) represents the mode switching reference value for all network configuration requests within the valid time window.

[0193] To make it easier to understand, let's take an example and assume the current scenario is: after the target controller fails, it is necessary to quickly switch back to the short connection.

[0194] The mode switching cooling value COLD_DOWN_VALUE is set to -1, with a threshold of 50. In practice:

[0195] S1. Before the fault occurs: HCS counter = 60, which is greater than the set threshold. At this time, the long connection mode is maintained.

[0196] S2. Target controller crashes: The new controller takes over, marks all incomplete requests as expired, and calculates the expired request mode switching reference value for all incomplete network configuration requests as -1×N (where N is the number of expired network configuration requests).

[0197] S3, HCS counter reset: If N=20, then HCS counter=60-20=40. At this time, the HCS counter is less than the set threshold of 50, and the connection is immediately switched back to short connection mode.

[0198] By setting up the aforementioned cooling mechanism, in the event of a controller failure, the system can quickly switch back to short-connection mode, prioritizing disaster recovery capabilities. During this process, by using the mode-switching cooling value corresponding to the cooling event, the rate of decrease in the mode-switching reference value can be accelerated, allowing for the timely release of long-connection resources.

[0199] Figure 10 Another flowchart of a network configuration method provided in an embodiment of this application is shown below. Figure 10 As shown, the method includes the following steps:

[0200] 1001. The target controller responds to receiving a first network configuration request sent by the application within the target time window, determines the first network configuration information corresponding to the first network configuration request and the target forwarder corresponding to the first network configuration information, and the target forwarder belongs to the forwarder cluster controlled by the controller cluster.

[0201] 1002. The target controller sends the first network configuration information to the target repeater through a short connection with the target repeater.

[0202] 1003. The target controller updates the total number of network configuration requests corresponding to the target repeater within the target time window, and determines whether to switch the connection mode with the target repeater to long connection mode based on the total number of network configuration requests.

[0203] 1004. The target controller responds to receiving a second network configuration request sent by the application within the target time window, determines the second network configuration information corresponding to the second network configuration request and the target repeater corresponding to the second network configuration information, and the second network configuration request is received later than the first network configuration request.

[0204] 1005. If the target controller determines to switch the connection mode with the target repeater to a long connection mode, it sends the second network configuration information to the target repeater through the long connection with the target repeater.

[0205] 1006. Send the mode switching reference value to the target repeater so that the target repeater can establish a communication connection with another controller based on the mode switching reference value after the connection with the target controller is interrupted. The target connection mode corresponding to the communication connection corresponds to the mode switching reference value. The target connection mode is either long connection mode or short connection mode.

[0206] For the specific execution process of steps 1001-1005, please refer to the above embodiments, which will not be repeated here.

[0207] Regarding step 1006, in practical applications, during the process of the target controller sending network configuration information to the target repeater, the mode switching reference value can also be sent to the target repeater. This way, when the target controller suddenly crashes, the target repeater can establish a communication connection with another controller based on the mode switching reference value. For example, if the mode switching reference value in the target repeater is 40, and the set threshold is 50, the mode switching reference value is less than the set threshold, then the target repeater communicates with the other controller through a short connection mode. Conversely, if the mode switching reference value in the target repeater is 50 or 60, and the set threshold is 50, the mode switching reference value is greater than or equal to the set threshold, then the target repeater communicates with the other controller through a long connection mode.

[0208] Specifically, the reference value for mode switching can be represented as a field.

[0209] As one implementation method, a custom header field can be added based on the Hypertext Transfer Protocol (HTTP) protocol, with the field named "X-Hcs-Counter". For example, this field can be X-Hcs-Counter: 100.

[0210] As an alternative implementation, an HCS counter protocol field can be added based on the data structure serialization and deserialization framework (ProtoBuffer, or ProtoBuf). A specific example is as follows:

[0211] PushNetworkConfMessage is a request structure for interaction between the controller and the forwarder. A new "HCS counter protocol field" has been added to this structure.

[0212] syntax="proto3";

[0213] message PushNetworkConfMessage{...int64hcs_counter=4; / / HCS counter protocol field...

[0214] }

[0215] syntax="proto3";

[0216] message PushNetworkConfMessage{ ...

[0218] int64hcs_counter = 4; / / HCS counter protocol field ...

[0220] By sending the mode switching reference value to the target repeater during the network configuration information transmission process from the target controller, the mode switching reference value can be permanently stored in the target repeater. If the target controller fails in the future, the target repeater can select the connection mode based on this mode switching reference value to establish a communication connection with the new controller. This avoids the need to re-determine the connection mode after the target repeater has established a communication connection with the new controller, thus improving efficiency. It should be understood that if the target controller does not have a mode switching reference value, then when the target controller fails, the target repeater will default to using a long-lived connection mode with the new controller.

[0221] To facilitate understanding of this solution, a specific scenario example is provided below for detailed illustration:

[0222] It should be noted that the network configuration method provided in this application embodiment can be applied to the target controller in the controller cluster, or to a control device used for global management. In actual application, the controller needs to report all information to the control device, and then issue control commands through the control device to complete the interaction with the target forwarding device.

[0223] In practical implementation, for example, region A has 3000 repeaters managed by 4 controllers. Normally, all 3000 repeaters interact with the 4 controllers using short-connection mode. However, when a user's network configuration requests suddenly increase (e.g., the burst lasts 10 minutes), assuming these network configuration requests are distributed to 8 repeaters through one controller, the connection mode between that controller and the 8 repeaters can be switched to long-connection mode to optimize performance.

[0224] In summary, such as Figure 11 As shown, during the first 0-1 minutes, network configuration requests are few. At this time, the controller can use short-connection mode to distribute network configuration information, ensuring rapid recovery of the repeater's network configuration information in case of controller failure. During the first 1-10 minutes, network configuration requests are more frequent. At this time, the controller can use long-connection mode to distribute network configuration information, ensuring optimized performance in this process. After 11 minutes, network configuration requests decrease again. At this point, the controller can revert to short-connection mode to distribute network configuration information, ensuring optimized disaster recovery switching.

[0225] The parameter consumption in this scheme is analyzed from multiple aspects below:

[0226] I. Resource consumption of network configuration requests:

[0227] Taking the creation of a VPC network interface (ENI) as an example, the resource consumption of a network configuration request is mainly concentrated on database interaction and workflow management. The following is a detailed analysis:

[0228] 1. In terms of database interaction, there are a total of 10 read and write operations (such as checking VPC CIDR conflicts, updating the routing table, etc.).

[0229] 2. The workflow execution consists of 13 steps (such as assigning IP addresses and binding security groups), and the status of each step needs to be recorded in the workflow table. Specifically, if multiple steps in the workflow execute normally, it includes 13 steps × 2 database operations (read + write) = 26 interactions. If a step in the workflow fails and needs to be retried, a rollback retry will be performed, increasing the number of database operations.

[0230] 3. Send the network configuration information corresponding to the network configuration request to the target repeater. During this process, the target repeater device status is updated 5 times.

[0231] Summarizing the above operations, there are 10 network configuration information related operations (Stateless), mainly database-related interactions. There are 31 device-related operations (Stateful), mainly workflow and device status-related operations. From these operations, it can be seen that if 100 requests are processed simultaneously in a certain period, 100 × 41 = 4100 operations are required in short connection mode, which cannot meet performance requirements. Therefore, by using the network configuration method provided in this application embodiment, the number of operations can be dynamically balanced (long connection mode is used when network configuration requests are dense, and short connection mode is used when network configuration requests are sparse), reducing the resource consumption of network configuration requests.

[0232] II. Round-Trip Time (RTT):

[0233] It should be noted that RTT is a key indicator for measuring network latency, and the differences are significant under different connection modes. In long-connection mode, the initial network configuration request takes 2 RTTs, and subsequent network configuration requests take 1 RTT. In short-connection mode, both the initial and subsequent network configuration requests take 3 RTTs. By using the network configuration method provided in this application embodiment, long-connection mode and short-connection mode can be flexibly switched, reducing the total RTT.

[0234] III. In terms of fault recovery and disaster recovery:

[0235] This application embodiment can automatically allocate connection modes based on the density of network configuration requests within a target time window. In specific implementation, a long-lived connection mode can be used for devices with high-density requests, while a long-lived connection mode can be used for ordinary devices with normal or low request densities. Specific performance data comparisons are as follows:

[0236]

[0237] In summary, 20% of the high-density request devices in all repeaters can be used in long-connection mode, while 80% of the ordinary devices in all repeaters can be used in short-connection mode. With this configuration, other controllers can quickly take over when the controller goes down due to a failure, meaning that 80% of the repeaters can recover quickly and the impact of the failure is relatively small.

[0238] This application also provides a network configuration system, which includes: an application device running an application, a controller cluster, and a repeater cluster controlled by the controller cluster. The application device is used to send a network configuration request to a target controller in the controller cluster via the application, and the network configuration request includes at least a first network configuration request and a second network configuration request.

[0239] In response to receiving a first network configuration request from an application within a target time window, the target controller in the controller cluster determines the first network configuration information corresponding to the first network configuration request and the target forwarder corresponding to the first network configuration information. It then sends the first network configuration information to the target forwarder via a short connection. The controller updates the total number of network configuration requests corresponding to the target forwarder within the target time window to determine whether to switch the connection mode with the target forwarder to a long connection mode based on the total number of network configuration requests. In response to receiving a second network configuration request from an application within the target time window, the controller determines the second network configuration information corresponding to the second network configuration request and the target forwarder corresponding to the second network configuration information. If it determines to switch the connection mode with the target forwarder to a long connection mode, it sends the second network configuration information to the target forwarder via a long connection. The second network configuration request is received later than the first network configuration request.

[0240] The network configuration system described above can execute the steps in the network configuration method in the foregoing embodiments. For detailed execution process and technical effects, please refer to the description in the foregoing embodiments, which will not be repeated here.

[0241] Figure 12 This is a schematic diagram of a network configuration device provided in an embodiment of this application. The device is applied to a target controller in a controller cluster. The device includes: a response module 11, a sending module 12, an update module 13, and a determination module 14.

[0242] The response module 11 is used to respond to receiving a first network configuration request sent by an application within a target time window, and to determine the first network configuration information corresponding to the first network configuration request and the target forwarder corresponding to the first network configuration information, wherein the target forwarder belongs to the forwarder cluster controlled by the controller cluster.

[0243] The sending module 12 is used to send the first network configuration information to the target repeater through a short connection with the target repeater.

[0244] The update module 13 is used to update the total number of network configuration requests corresponding to the target repeater within the target time window, so as to determine whether to switch the connection mode with the target repeater to a long connection mode based on the total number of network configuration requests.

[0245] The determination module 14 is configured to, in response to receiving a second network configuration request sent by the application within the target time window, determine the second network configuration information corresponding to the second network configuration request and the target forwarder corresponding to the second network configuration information, wherein the second network configuration request is received later than the first network configuration request, and if it is determined that the connection mode with the target forwarder will be switched to a long connection mode, then send the second network configuration information to the target forwarder through the long connection with the target forwarder.

[0246] Optionally, the update module 13 is specifically configured to: determine a mode switching reference value based on the total number of network configuration requests; if the mode switching reference value is greater than or equal to a set threshold, determine to switch the connection mode with the target forwarder to a long connection mode; if the mode switching reference value is less than the set threshold, determine to maintain the connection mode with the target forwarder as a short connection mode; and determine a mode switching reference value based on the mode switching contribution value of each of the multiple network configuration requests corresponding to the total number of network configuration requests to the target forwarder, so as to determine whether to switch the connection mode with the target forwarder to a long connection mode based on the mode switching reference value, wherein the mode switching contribution value is used to reflect the impact of network configuration requests on the load level of the target forwarder.

[0247] Optionally, the update module 13 is further configured to: determine the number of impact paths of the first network configuration information on the target forwarder based on the dependencies between different types of network configuration information and different forwarders in the forwarder cluster; determine the retransmission impact value of the first network configuration information on the target forwarder based on the retransmission information of the first network configuration information; determine the mode switching reference value of the first network configuration information on the target forwarder based on the number of impact paths and the retransmission impact value; update the total mode switching reference value of the target forwarder based on the mode switching reference value of the first network configuration information on the target forwarder, so as to determine whether to switch the connection mode with the target forwarder to a long connection mode based on the total mode switching reference value, wherein the total mode switching reference value is the sum of the mode switching reference values ​​of the multiple network configuration requests on the target forwarder. The values ​​are summed, and if it is determined that the first network configuration information was successfully sent to the target repeater, the retransmission impact value is determined to be a first value; if it is determined that the first network configuration information was not successfully sent to the target repeater, and the target controller does not support retransmission of the first network configuration information using a set backoff algorithm, the retransmission impact value is determined to be a second value, the second value being greater than the first value, the second value being used to reflect whether there will be a retransmission of the first network configuration information in the future; if it is determined that the first network configuration information was not successfully sent to the target repeater, and the target controller supports retransmission of the first network configuration information using a set backoff algorithm, the retransmission impact value is determined to be a third value according to the retransmission parameters set in the backoff algorithm, the third value being used to reflect whether the first network configuration information will be retransmitted in the next time window of the target time window.

[0248] Optionally, the response module 11 is specifically configured to: determine a mode switching preheating value corresponding to the preheating event in response to the triggering of a preheating event corresponding to the target repeater, and determine a mode switching cooling value corresponding to the cooling event in response to the triggering of a cooling event corresponding to the target repeater; the update module 13 is further configured to: determine a mode switching reference value based on the total number of network configuration requests and the mode switching preheating value, so as to determine whether to switch the connection mode with the target repeater to a long connection mode based on the mode switching reference value, wherein the mode switching preheating value is used to accelerate the switch of the connection mode with the repeater to a long connection mode; and determine a mode switching reference value based on the total number of network configuration requests and the mode switching cooling value, so as to determine whether to switch the connection mode with the target repeater to a long connection mode based on the mode switching reference value, wherein the mode switching preheating value is used to delay the switch of the connection mode with the repeater to a long connection mode.

[0249] Optionally, the device further includes: a communication establishment module, configured to send the mode switching reference value to the target repeater, so that the target repeater establishes a communication connection with another controller based on the mode switching reference value after the connection with the target controller is interrupted, wherein the target connection mode corresponding to the communication connection corresponds to the mode switching reference value, and the target connection mode is the long connection mode or the short connection mode.

[0250] Optionally, the sending module 12 is specifically configured to: determine a sending workflow for the first network configuration information, the sending workflow including multiple steps involved in sending the first network configuration information, the multiple steps including at least one step of interacting with the target repeater; store the multiple steps and the first network configuration information in a database, the database being shared by the controller cluster; send the first network configuration information to the target repeater according to the execution order of the multiple steps; wherein, when executing the at least one step, obtain device status information corresponding to the target repeater to execute the at least one step according to the device status information; and update the execution status of the multiple steps and the device status information of the target repeater corresponding to each of the at least one step in the database.

[0251] Optionally, the determining module 14 is specifically configured to: determine the sending workflow of the second network configuration information, the sending workflow including multiple steps involved in sending the second network configuration information, the multiple steps including at least one step of interacting with the target repeater; store the second network configuration information in a database, store the sending workflow in the local storage space of the target controller, the database being shared by the controller cluster; send the second network configuration information to the target repeater according to the execution order of the multiple steps; wherein, when the at least one step is executed, obtain the device status information corresponding to the target repeater to execute the at least one step according to the device status information; and update the execution status of the multiple steps and the device status information of the target repeater corresponding to each of the at least one step to the local storage space of the target controller.

[0252] Figure 12 The device shown can perform the steps in the network configuration method in the foregoing embodiments. For detailed execution process and technical effects, please refer to the description in the foregoing embodiments, which will not be repeated here.

[0253] Figure 13 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application, such as... Figure 13 As shown, in practice, this electronic device includes a memory 21 and a processor 22.

[0254] Memory 21 is used to store computer programs and can be configured to store various other data to support operation on the electronic device. Examples of this data include instructions for any application or method used to operate on the electronic device, data structures, contact data, phone book data, messages, pictures, videos, etc.

[0255] The processor 22, coupled to the memory 21, is used to execute the computer program in the memory 21 to implement the network configuration method provided in the foregoing embodiments.

[0256] Furthermore, such as Figure 13 As shown, the electronic device also includes other components such as a communication component 23, a display 24, a power supply component 25, and an audio component 26. Figure 13 The diagram only shows some components and does not mean that the electronic device includes only these components. Figure 9 The components shown are as follows. The electronic device in this embodiment can be a terminal device such as a desktop computer, laptop computer, smartphone, or IoT device, or a server device such as a conventional server, cloud server, or server array.

[0257] The aforementioned memory can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random-Access Memory (SRAM), Electrically Erasable Programmable Read Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0258] The aforementioned communication component is configured to facilitate wired or wireless communication between the device containing the communication component and other devices. The device containing the communication component can access wireless networks based on communication standards, such as 2G, 3G, 4G / LTE, 5G, or combinations thereof. In one exemplary embodiment, the communication component receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel.

[0259] The aforementioned display includes a screen, which may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a Touch Panel, the screen can be implemented as a touchscreen to receive input signals from the user. The Touch Panel includes one or more touch sensors to sense touches, swipes, and gestures on the Touch Panel. The touch sensors can sense not only the boundaries of touch or swipe actions but also the duration and pressure associated with the touch or swipe operation.

[0260] The aforementioned power supply components provide power to various components within the device in which they reside. These power supply components may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power to the device in which they reside.

[0261] The aforementioned audio component can be configured to output and / or input audio signals. For example, the audio component includes a microphone (MIC) configured to receive external audio signals when the device containing the audio component is in an operating mode, such as call mode, recording mode, or voice recognition mode. The received audio signals can be further stored in memory or transmitted via a communication component. In some embodiments, the audio component also includes a speaker for outputting audio signals.

[0262] Accordingly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, enables the processor to implement the steps in the above-described method embodiments. The computer-readable storage medium includes volatile or non-volatile components, or a combination thereof, and can be removable or non-removable. Examples of computer-readable storage media include, but are not limited to, phase-change random access memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random-access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), flash memory or other memory technologies, CD-ROM, Digital Video Disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium.

[0263] Accordingly, this application also provides a computer program product, which includes a computer program or instructions that, when executed by a processor, cause the processor to implement the steps in the above method embodiments. It should be understood that each step or combination of steps in the above method flow can be implemented by the computer program or instructions. Furthermore, these computer programs or instructions can be applied to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device, enabling the processor of the general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing device to function as an apparatus for implementing the corresponding functions in the above method embodiments.

[0264] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A network configuration method, characterized in that, The method, applied to a target controller in a controller cluster, includes: In response to receiving a first network configuration request sent by an application within a target time window, the system determines the first network configuration information corresponding to the first network configuration request and the target forwarder corresponding to the first network configuration information, wherein the target forwarder belongs to a forwarder cluster controlled by the controller cluster. The first network configuration information is sent to the target repeater via a short connection. Update the total number of network configuration requests corresponding to the target forwarder within the target time window, so as to determine whether to switch the connection mode with the target forwarder to long connection mode based on the total number of network configuration requests; In response to receiving a second network configuration request sent by the application within the target time window, the second network configuration information corresponding to the second network configuration request and the target forwarder corresponding to the second network configuration information are determined, wherein the second network configuration request is received later than the first network configuration request; If it is determined that the connection mode with the target repeater will be switched to a long connection mode, then the second network configuration information will be sent to the target repeater through the long connection.

2. The method according to claim 1, characterized in that, The step of determining whether to switch the connection mode with the target repeater to a long-lived connection mode based on the total number of network configuration requests includes: The mode switching reference value is determined based on the total number of network configuration requests. If the mode switching reference value is greater than or equal to the set threshold, then it is determined that the connection mode with the target repeater will be switched to long connection mode. If the mode switching reference value is less than the set threshold, then the connection mode to be maintained with the target repeater is determined to be short connection mode.

3. The method according to claim 1, characterized in that, The step of determining whether to switch the connection mode with the target repeater to a long-lived connection mode based on the total number of network configuration requests includes: Based on the contribution values ​​of each of the multiple network configuration requests corresponding to the total number of network configuration requests to the mode switching of the target forwarder, a mode switching reference value is determined. The mode switching reference value is used to determine whether to switch the connection mode with the target forwarder to a long connection mode. The mode switching contribution value is used to reflect the impact of network configuration requests on the load level of the target forwarder.

4. The method according to claim 3, characterized in that, The step of determining a mode switching reference value based on the contribution value of each of the multiple network configuration requests corresponding to the total number of network configuration requests to the mode switching of the target repeater, and determining whether to switch the connection mode with the target repeater to a long connection mode based on the mode switching reference value, includes: Based on the different types of network configuration information set and the dependencies between different forwarders in the forwarder cluster, the number of influence paths of the first network configuration information on the target forwarder is determined. Based on the retransmission information of the first network configuration information, determine the retransmission impact value of the first network configuration information on the target repeater; Based on the number of affected paths and the retransmission impact value, determine the mode switching reference value of the first network configuration information for the target repeater; Based on the first network configuration information, the mode switching reference value of the target forwarder is updated to the total mode switching reference value of the target forwarder. The total mode switching reference value is used to determine whether to switch the connection mode with the target forwarder to a long connection mode. The total mode switching reference value is the sum of the mode switching reference values ​​of the target forwarder for each of the multiple network configuration requests.

5. The method according to claim 4, characterized in that, The step of determining the retransmission impact value of the first network configuration information on the target repeater based on the retransmission information of the first network configuration information includes: If it is determined that the first network configuration information was successfully sent to the target repeater, then the retransmission impact value is determined to be a first value; If it is determined that the first network configuration information was not successfully sent to the target repeater, and the target controller does not support retransmission of the first network configuration information using a set backoff algorithm, then the retransmission impact value is determined to be a second value, which is greater than the first value. The second value is used to reflect that there will be a retransmission of the first network configuration information at a future time. If it is determined that the first network configuration information was not successfully sent to the target repeater, and the target controller supports retransmitting the first network configuration information with a set backoff algorithm, then the retransmission impact value is determined as a third value according to the retransmission parameters set in the backoff algorithm. The third value is used to reflect whether the first network configuration information will be retransmitted in the next time window of the target time window.

6. The method according to claim 1, characterized in that, After sending the first network configuration information to the target repeater, the method further includes: In response to the triggering of a preheating event corresponding to the target transponder, a mode switching preheating value corresponding to the preheating event is determined; The step of determining whether to switch the connection mode with the target repeater to a long-lived connection mode based on the total number of network configuration requests includes: Based on the total number of network configuration requests and the mode switching warm-up value, a mode switching reference value is determined to determine whether to switch the connection mode with the target repeater to a long connection mode. The mode switching warm-up value is used to accelerate the switch of the connection mode with the repeater to a long connection mode.

7. The method according to claim 1, characterized in that, After sending the first network configuration information to the target repeater, the method further includes: In response to the triggering of a cooling event corresponding to the target repeater, a mode switching cooling value corresponding to the cooling event is determined; The step of determining whether to switch the connection mode with the target repeater to a long-lived connection mode based on the total number of network configuration requests includes: Based on the total number of network configuration requests and the mode switching cooldown value, a mode switching reference value is determined to determine whether to switch the connection mode with the target repeater to a long connection mode. The mode switching warm-up value is used to delay switching the connection mode with the repeater to a long connection mode.

8. The method according to any one of claims 2-7, characterized in that, The method further includes: The mode switching reference value is sent to the target repeater so that the target repeater can establish a communication connection with another controller based on the mode switching reference value after the connection with the target controller is interrupted. The target connection mode corresponding to the communication connection corresponds to the mode switching reference value, and the target connection mode is the long connection mode or the short connection mode.

9. The method according to any one of claims 1-7, characterized in that, The step of sending the first network configuration information to the target repeater via a short connection includes: Determine the sending workflow for the first network configuration information, the sending workflow including multiple steps involved in sending the first network configuration information, the multiple steps including at least one step of interacting with the target repeater; The multiple steps and the first network configuration information are stored in a database, which is shared by the controller cluster. The first network configuration information is sent to the target repeater in the order of execution of the multiple steps. Specifically, when executing at least one step, the device status information corresponding to the target repeater is obtained to execute the at least one step according to the device status information; and the execution status of the plurality of steps and the device status information of the target repeater corresponding to each of the at least one step are updated in the database.

10. The method according to any one of claims 1-7, characterized in that, The step of sending the second network configuration information to the target repeater via a long-lived connection includes: Determine the sending workflow for the second network configuration information, the sending workflow including multiple steps involved in sending the second network configuration information, the multiple steps including at least one step of interacting with the target repeater; The second network configuration information is stored in the database, and the sending workflow is stored in the local storage space of the target controller. The database is shared by the controller cluster. The second network configuration information is sent to the target repeater in the order of execution of the multiple steps. Specifically, when executing the at least one step, the device status information corresponding to the target repeater is obtained so as to execute the at least one step according to the device status information; and the execution status of the plurality of steps and the device status information of the target repeater corresponding to each of the at least one step are updated in the local storage space of the target controller.

11. A network configuration system, characterized in that, include: The application device running the application, the controller cluster, and the repeater cluster controlled by the controller cluster; The application device is used to send a network configuration request to a target controller in the controller cluster through an application, and the network configuration request includes at least a first network configuration request and a second network configuration request. In response to receiving a first network configuration request sent by the application within a target time window, the target controller in the controller cluster determines the first network configuration information corresponding to the first network configuration request and the target forwarder corresponding to the first network configuration information, and sends the first network configuration information to the target forwarder through a short connection with the target forwarder. Update the total number of network configuration requests corresponding to the target repeater within the target time window, and determine whether to switch the connection mode with the target repeater to a long connection mode based on the total number of network configuration requests. In response to receiving a second network configuration request sent by the application within the target time window, determine the second network configuration information corresponding to the second network configuration request and the target forwarder corresponding to the second network configuration information; If it is determined that the connection mode with the target repeater will be switched to a long connection mode, the second network configuration information will be sent to the target repeater through the long connection, and the second network configuration request will be received later than the first network configuration request.

12. An electronic device, characterized in that, include: The system includes a memory, a processor, and a communication interface; wherein the memory stores executable code, which, when executed by the processor, causes the processor to perform the network configuration method as described in any one of claims 1-10.

13. A non-transitory machine-readable storage medium, characterized in that, The non-transitory machine-readable storage medium stores executable code that, when executed by a processor of an electronic device, causes the processor to perform the network configuration method as described in any one of claims 1-10.

14. A computer program product, characterized in that, include: A computer program, when executed by a processor of an electronic device, causes the processor to perform the network configuration method as described in any one of claims 1-10.