A method for determining network configuration information of a switch
Patent Information
- Application Number
- CN202610894260.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-22
- Publication Date
- 2026-09-18
- Estimated Expiration
- 2046-06-22
AI Technical Summary
[0003]但基于静态的硬件能力评估值选取的第一交换机,由于无法感知第一交换机运行过程中动态变化的负载,可能导致第一交换机在运行中容易达到管理瓶颈;而且在向各第一交换机分配第二交换机时,是根据固定数目进行分配的,容易导致第一交换机单点过载的问题,降低了资源利用率
[0008] According to the method for determining switch network configuration information provided in this embodiment of the invention, the hardware capability assessment value and load assessment value of each switch in the switch network are obtained, and the hardware capability assessment values are sorted to obtain a hardware capability sequence. Based on the overall load value of the switch network determined using the load assessment values of each switch, a positioning index for the hardware capability sequence is determined. Based on the positioning index, a target hardware capability assessment value is determined from the hardware capability sequence, and a first switch to undertake management intelligence and a second switch managed by the first switch are determined according to the target hardware capability assessment value. Based on the management relationship between the first switch and the second switch, the network connection between the switches is configured. Since the hardware capability assessment value and load assessment value change dynamically according to the real-time operating data of the switches during the process of determining the configuration information, the positioning index based on the load assessment value and the target hardware capability assessment value based on the positioning index also change dynamically. Consequently, the first switch and the second switch determined according to the target hardware capability assessment value also change dynamically. This allows the first switch to dynamically perceive load changes during the management process, preventing the first switch from reaching a management bottleneck. On the other hand, since the second switches are allocated based on the target hardware capability assessment value of the first switch, the second switches can be flexibly allocated. The first switch with a higher target hardware capability assessment value can manage more second switches, avoiding the problem of single-point overload of the first switch, and achieving the technical effect of improving resource utilization.
Smart Images

Figure CN122457485B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and more specifically to a method for determining network configuration information of a switch. Background Technology
[0002] With the widespread use of switch networks in data centers, deploying configuration servers to monitor the operational status of switches has become an industry standard practice. Currently, in the process of monitoring switches, the configuration server selects the first switch that assumes management functions based on static hardware capability assessment values, and the second switch managed by the first switch.
[0003] However, the first switch selected based on static hardware capability assessment values cannot perceive the dynamic load changes during the operation of the first switch, which may lead to the first switch easily reaching the management bottleneck during operation. Moreover, when allocating the second switches to each first switch, the allocation is based on a fixed number, which can easily lead to the problem of single-point overload of the first switch and reduce resource utilization. Summary of the Invention
[0004] In view of the above problems, the present invention provides a method for determining switch network configuration information to improve resource utilization.
[0005] One aspect of the present invention provides a method for determining configuration information of a switch network, applied to a configuration server, comprising: acquiring hardware capability assessment values and load assessment values of each switch in the switch network, and sorting the hardware capability assessment values in a predetermined order to obtain a hardware capability sequence, wherein the hardware capability assessment values and load assessment values are determined based on real-time operating data of the switches; determining a location index for the hardware capability sequence based on the overall load value of the switch network determined using the load assessment values of each switch; determining at least one target hardware capability assessment value from the hardware capability sequence based on the location index, and identifying the switch corresponding to the at least one target hardware capability assessment value as a first switch for undertaking management functions; determining at least one second switch managed by each first switch based on the target hardware capability assessment value and its position in the hardware capability sequence; and determining configuration information for the switch network based on the management relationship between the first and second switches, wherein the configuration information is used to configure network connections between switches in the switch network.
[0006] Another aspect of the present invention provides a method for determining network configuration information of a switch, applied to a switch in a switch network, comprising: determining a hardware capability assessment value and a load assessment value of the switch based on real-time operating data of the switch; sending the hardware capability assessment value and the load assessment value to a configuration server; and, in response to receiving configuration information sent by the configuration server, configuring the network connection of the switch according to the configuration information, wherein the configuration information is determined according to the above-described method for determining network configuration information of a switch applied to a configuration server.
[0007] Another aspect of the present invention provides an electronic device, comprising: one or more processors; and a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the method for determining the network configuration information of the switch described above.
[0008] According to the method for determining switch network configuration information provided in this embodiment of the invention, the hardware capability assessment value and load assessment value of each switch in the switch network are obtained, and the hardware capability assessment values are sorted to obtain a hardware capability sequence. Based on the overall load value of the switch network determined using the load assessment values of each switch, a positioning index for the hardware capability sequence is determined. Based on the positioning index, a target hardware capability assessment value is determined from the hardware capability sequence, and a first switch to undertake management intelligence and a second switch managed by the first switch are determined according to the target hardware capability assessment value. Based on the management relationship between the first switch and the second switch, the network connection between the switches is configured. Since the hardware capability assessment value and load assessment value change dynamically according to the real-time operating data of the switches during the process of determining the configuration information, the positioning index based on the load assessment value and the target hardware capability assessment value based on the positioning index also change dynamically. Consequently, the first switch and the second switch determined according to the target hardware capability assessment value also change dynamically. This allows the first switch to dynamically perceive load changes during the management process, preventing the first switch from reaching a management bottleneck. On the other hand, since the second switches are allocated based on the target hardware capability assessment value of the first switch, the second switches can be flexibly allocated. The first switch with a higher target hardware capability assessment value can manage more second switches, avoiding the problem of single-point overload of the first switch, and achieving the technical effect of improving resource utilization. Attached Figure Description
[0009] The above-described features, other objects, and advantages of the present invention will become clearer from the following description of embodiments of the invention with reference to the accompanying drawings, in which:
[0010] Figure 1 A diagram illustrating an application scenario of a method for determining switch network configuration information according to an embodiment of the present invention is provided.
[0011] Figure 2 A flowchart illustrating a method for determining switch network configuration information according to an embodiment of the present invention is shown.
[0012] Figure 3 A system architecture diagram of a method for determining switch network configuration information according to an embodiment of the present invention is shown.
[0013] Figure 4 A flow diagram of a method for determining switch network configuration information according to another embodiment of the present invention is shown.
[0014] Figure 5 A flowchart illustrating a method for determining switch network configuration information according to another embodiment of the present invention is shown.
[0015] Figure 6 A structural block diagram of a device for determining switch network configuration information according to an embodiment of the present invention is shown.
[0016] Figure 7 A structural block diagram of a device for determining switch network configuration information according to another embodiment of the present invention is shown.
[0017] Figure 8 A block diagram of an electronic device suitable for implementing a method for determining network configuration information of a switch according to an embodiment of the present invention is shown schematically. Detailed Implementation
[0018] Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the invention. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of the invention for ease of explanation. However, it will be apparent that one or more embodiments may be practiced without these specific details. Furthermore, descriptions of well-known structures and techniques are omitted in the following description to avoid unnecessarily obscuring the concept of the invention.
[0019] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the invention. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0020] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.
[0021] When using expressions such as "at least one of A, B and C", they should generally be interpreted in accordance with the meaning that is commonly understood by those skilled in the art (e.g., "a system having at least one of A, B and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B and C, etc.).
[0022] As a type of network switching device, white-box switches are widely used in large data centers, and deploying configuration servers in switch networks to monitor switch operation has become an industry standard practice. However, centralized management architectures place high demands on the processing performance, reliability, and scalability of configuration servers. To address this issue, current solutions involve the configuration server selecting a subset of high-performance switches as the primary switches with management functions based on their static proxy capability coefficients. These primary switches then manage and collect data from other switches, effectively distributing the load on the configuration server.
[0023] However, in practical large-scale deployment applications, this solution still has the following limitations.
[0024] Based on static proxy capability coefficients, the system cannot detect dynamic load changes in the first switch during operation, such as sudden traffic spikes or CPU utilization spikes. This could cause the initially elected first switch to become a performance bottleneck during operation. Furthermore, the fixed threshold-based election and one-time allocation strategy for the second switch lacks flexibility, potentially leading to some first switches being idle while others are overloaded. When the switch network status changes or the first switch fails, the network cannot automatically adjust, potentially resulting in uneven load distribution, single-point overload, or even data acquisition interruptions. This results in insufficient robustness of the switch network, uneven load distribution among the first switches, and an inability to achieve optimal utilization of cluster resources.
[0025] In view of this, the present invention aims to solve the problems of how to achieve dynamic election of the first switch, flexible allocation of the second switch, and ensure the continuity of data acquisition during the allocation process. It proposes a method for determining the network configuration information of the first switch and the second switch based on dynamic load balancing, so as to improve data utilization while coping with the complex and ever-changing operating environment of data center networks.
[0026] Figure 1 A diagram illustrating an application scenario of a method for determining switch network configuration information according to an embodiment of the present invention is provided.
[0027] like Figure 1 As shown, application scenario 100 according to this embodiment may include a switch network 101, a network 102, and a configuration server 103. Network 102 serves as the medium for providing a communication link between the switch network 101 and the configuration server 103. Network 102 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.
[0028] The switch network 101 may include multiple switches (e.g., switches 1 to 6). Each switch can interact with the configuration server 103 through network 102, sending hardware capability assessment values and load assessment values to the configuration server 103, and receiving configuration information sent by the configuration server 103. The switches can be connected by a network.
[0029] Configuration server 103 can determine, based on hardware capability assessment values and load assessment values, the first switch (e.g., switch 1 and switch 2) to assume management functions, and the second switches managed by the first switch (e.g., switches 3 and 4 managed by switch 1, and switches 5 and 6 managed by switch 2). Based on the management relationship between the first and second switches, configuration information can be sent to each switch in the switch network.
[0030] It should be understood that Figure 1 The number of switches, network 102, and configuration server 103 shown is merely illustrative. Depending on implementation needs, any number of switches, network 102, and configuration server 103 can be used.
[0031] The following will be based on Figure 1 The described scene, through Figures 2-5 The method for determining switch network configuration information according to an embodiment of the present invention will be described in detail.
[0032] Figure 2 A flowchart illustrating a method for determining switch network configuration information according to an embodiment of the present invention is shown.
[0033] like Figure 2 As shown, the method for determining switch network configuration information in this embodiment is applied to a configuration server, and the method for determining switch network configuration information in this embodiment includes operations S210 to S250.
[0034] In operation S210, the hardware capability assessment value and load assessment value of each switch in the switch network are obtained, and the hardware capability assessment value is sorted in a predetermined order to obtain a hardware capability sequence. The hardware capability assessment value and load assessment value are determined based on the real-time operating data of the switches.
[0035] In operation S220, based on the overall load value of the switch network determined using the load assessment values of each switch, a location index for the hardware capability sequence is determined.
[0036] In operation S230, at least one target hardware capability assessment value is determined from the hardware capability sequence based on the location index, and the switch corresponding to the at least one target hardware capability assessment value is determined as the first switch to assume management functions.
[0037] In operation S240, based on the target hardware capability assessment value and the position of the target hardware capability assessment value in the hardware capability sequence, at least one second switch managed by each first switch is determined.
[0038] In operation S250, configuration information for the switch network is determined based on the management relationship between the first and second switches. This configuration information is used to configure network connections between switches in the switch network.
[0039] In some embodiments, a switch network may consist of all switches managed by a single configuration server. The switches may be white-box switches, i.e., programmable and configurable switches, which can provide a communication path between any two network nodes connected to the switch.
[0040] The hardware capability assessment value of a switch describes its ability to perform a management role and can be determined based on idle data in the switch's real-time operational data. The load assessment value of a switch describes its load level and can be determined based on load data in the switch's real-time operational data.
[0041] Figure 3 A system architecture diagram of a method for determining switch network configuration information according to an embodiment of the present invention is shown.
[0042] like Figure 3 As shown, the architecture includes a load assessment module 1011-1, an information notification module 1011-2, and a management configuration module 1011-3 deployed on the switch 1011 side, and an information receiving module 1031, a management analysis module 1032, a storage module 1033, and a configuration and command issuing module 1034 deployed on the configuration server 103 side.
[0043] The load assessment module 1011-1 can be used to determine the hardware capability assessment value and load assessment value of the switch; the information notification module 1011-2 can transmit the hardware capability assessment value and load assessment value to the configuration server; the management and configuration module 1011-3 can receive the configuration information sent by the configuration server and configure the network connection between switches. The information receiving module 1031 can receive the hardware capability assessment value and load assessment value sent by the switch; the management analysis module 1032 can analyze the received hardware capability assessment value and load assessment value to obtain the configuration information of each switch; the storage module 1033 can store the configuration information analyzed by the management analysis module 1032; and the configuration and command issuance module 1034 can send the configuration information to the management and configuration module 1011-3 according to the stored configuration information.
[0044] In one embodiment, after the switch starts up, a load assessment module can be started to perform an initial assessment and collect load data of the switch, such as average CPU utilization (cpu_utilization), average memory utilization (mem_utilization), average network throughput (throughput_total), and the switch's total theoretical throughput capacity (max_throughput).
[0045] After normalizing these load data and processing them, we can obtain the switch's idle data, such as CPU idle rate (1 - cpu_utilization / 100), memory idle rate (1 - mem_utilization / 100), and network load factor (1 / (1 + (throughput_total / max_throughput))). cpu_utilization / 100 is the normalized cpu_utilization, mem_utilization / 100 is the normalized mem_utilization, and throughput_total / max_throughput is the normalized throughput_total.
[0046] `throughput_total / max_throughput` calculates the proportion of current throughput to the maximum theoretical capacity (network load). This proportion is substituted into the function `1 / (1 + x)`. When the network load rate `x` is 0 (no load), the factor value is 1; as `x` increases, the factor value gradually approaches 0, but never becomes negative. This design smoothly handles the impact of load, avoiding drastic fluctuations in the factor when the load approaches 100%.
[0047] The initial assessment can be based on the CPU idle rate, memory idle rate, and network load factor collected when the load assessment module starts, to calculate a basic hardware capability assessment value. The basic hardware capability assessment value This represents the inherent potential of the switch. This basic hardware capability assessment value can also be sent to the configuration server so that the configuration server can determine the first and second switches based on the basic hardware capability assessment value.
[0048] After the initial assessment, a timer can be started and triggered every 10 minutes. After the timer is triggered, the load assessment module can collect the current dynamic performance indicators of the switch from the database, including: the average CPU utilization (cpu_utilization) in the last 10 minutes, the average memory utilization (mem_utilization) in the last 10 minutes, the average network throughput (throughput_total) in the last 10 minutes, and the total theoretical throughput capacity of the switch (max_throughput), and calculate the hardware capability assessment value through formula (1).
[0049] proxy_score=base_score×(w1×(1-cpu_utilization / 100)+w2×(1-mem_utilization / 100)+w3×(1 / (1+throughput_total / max_throughput))) (1)
[0050] Here, w1, w2, and w3 represent the weights of CPU, memory, and network load factors, respectively. These weights are pre-configured parameters, with w1 + w2 + w3 = 1. For example, in practice, setting w1 = 0.4, w2 = 0.3, and w3 = 0.3 indicates that this embodiment of the invention considers CPU computing power to have the most critical impact on management capabilities, followed by memory and network bandwidth. These weights can be adjusted according to the actual characteristics of network services.
[0051] The switch can also be configured with an alarm module to monitor the switch's operating metrics and issue an alarm when the metrics exceed a set threshold. In one embodiment, in addition to timer triggering, the load assessment module can be invoked by the alarm module. When a metric monitored by the alarm module exceeds a threshold and then returns to normal, the alarm module will actively trigger this load assessment module to reassess the switch's management capabilities.
[0052] In some embodiments, the load assessment value can be calculated using the following formula based on the load data collected by the load assessment module.
[0053] Load_comprehensive = w1×CPU_norm + w2×MEM_norm + w3× THROUGHPUT_norm (2)
[0054] Where Load_comprehensive is the load assessment value of the switch, CPU_norm is the normalized cpu_utilization / 100, MEM_norm is the normalized mem_utilization / 100, and THROUGHPUT_norm is the normalized throughput_total / max_throughput.
[0055] The switch's information announcement module can transmit hardware capability assessment values and load assessment values to the configuration server. For example, this information announcement module can interact with the configuration server using a custom lightweight application layer protocol based on the Internet Protocol (IP). The message data format is JSON. Example: {"ip_address": "1.1.1.1", "proxy_score": 80, "timestamp": 1715511111, "Load_comprehensive": 15}. `ip_address` is the management port address of this switch, `proxy_score` is the hardware capability assessment value, and `timestamp` is the timestamp when the message was sent. The configuration server can have an independent information receiving service, listening on a pre-configured port. The configuration server's IP address and port are obtained through Dynamic Host Configuration Protocol (DHCP) options.
[0056] The configuration server's information receiving module runs as a service on a predetermined port, listening for and receiving data packets reported by the switch, containing its IP address, hardware capability assessment value, and load assessment value. After parsing the packets, the information receiving module updates the hardware capability assessment value and the update time information in the configuration file (e.g., the SWITCH_CONFIG table) using the switch's IP address as the key. The configuration file can be stored in a database.
[0057] The configuration server's management and analysis module is responsible for determining the first switch to assume management functions and assigning it to manage second switches based on the latest status of the switch network. This module can retrieve hardware capability assessment values for the switches from the database, forming a set S, and then arranging them in a predetermined order from low to high to obtain a hardware capability sequence.
[0058] This management and analysis module can also retrieve the switch load assessment values from the database and determine the overall load value of the switch network based on the average of multiple load assessment values. Based on the overall load value, a location index for the hardware sequence can be determined. This location index can be a position in the hardware capability sequence, and may be an integer or a decimal. It serves as a cutoff point in the hardware capability sequence to divide the hardware capability sequence into two parts. For example, if the hardware capability sequence is in ascending order, the position from the maximum hardware capability assessment value in the hardware capability sequence to the cutoff point constitutes the first part, and the position from the cutoff point to the minimum hardware capability assessment value in the hardware capability sequence constitutes the second part.
[0059] The target hardware capability assessment value can be the hardware capability assessment value in the first part, and the switch corresponding to the target hardware capability assessment value can be used as a second switch to undertake management functions.
[0060] The switches corresponding to the hardware capability assessment values in Part Two can be used as second switches. When assigning second switches to the first switch, the allocation can be based on the hardware capability assessment values of the first switch; the first switch with the higher hardware capability assessment value can manage more second switches.
[0061] The management and analysis module can determine the configuration file based on the management relationship between the first and second switches, and store the configuration file in the storage module. The configuration and command issuance module can send the stored configuration information to the management module 1011-3 so that the switches can establish network connections between switches according to relevant instructions.
[0062] According to the method for determining switch network configuration information provided in this embodiment of the invention, the hardware capability assessment value and load assessment value of each switch in the switch network are obtained, and the hardware capability assessment values are sorted to obtain a hardware capability sequence. Based on the overall load value of the switch network determined using the load assessment values of each switch, a positioning index for the hardware capability sequence is determined. Based on the positioning index, a target hardware capability assessment value is determined from the hardware capability sequence, and a first switch to undertake management intelligence and a second switch managed by the first switch are determined according to the target hardware capability assessment value. Based on the management relationship between the first switch and the second switch, the network connection between the switches is configured. Since the hardware capability assessment value and load assessment value change dynamically according to the real-time operating data of the switches during the process of determining the configuration information, the positioning index based on the load assessment value and the target hardware capability assessment value based on the positioning index also change dynamically. Consequently, the first switch and the second switch determined according to the target hardware capability assessment value also change dynamically. This allows the first switch to dynamically perceive load changes during the management process, preventing the first switch from reaching a management bottleneck. On the other hand, since the second switches are allocated based on the target hardware capability assessment value of the first switch, the second switches can be flexibly allocated. The first switch with a higher target hardware capability assessment value can manage more second switches, avoiding the problem of single-point overload of the first switch, and achieving the technical effect of improving resource utilization.
[0063] In some embodiments, the process of determining the location index for the hardware capability sequence based on the overall load value of the switch network determined by the load assessment values of each switch may include the following operations: correcting a preset static preset parameter using the overall load value to obtain a target parameter, wherein the static preset parameter is used to represent a preset proportion of the number of switches that are first switches in the switch network to the total number of switches; and determining the location index for the hardware capability sequence based on the target parameter and the number of hardware capability assessment values in the hardware capability sequence.
[0064] The process of using the overall load value to correct the preset static preset parameters and obtain the target parameters can be shown in formulas (3) to (4).
[0065] P_target = P_base × [1 - a × (Load_comprehensive 均值 - b)](3)
[0066] Where P_target is the target parameter, P_base is a preset static parameter, set to 0.05, which represents the minimum number of switches in the network that should be the first 5%. a is the load sensitivity coefficient, set to 0.6, b is the baseline load point, set to 0.5, and Load_comprehensive... 均值 This is the overall load value obtained by averaging the load assessment values of multiple switching devices.
[0067] Boundary constraints can be applied to the target parameter P_target using formula (4):
[0068] P_target = max(0.02, min(0.08, P_target))(4)
[0069] This is used to ensure that the target parameters are adjusted within a reasonable range (2%~8%) to avoid drastic changes in the system structure due to load fluctuations.
[0070] The process of determining the location index for the hardware capability sequence based on the target parameters and the number of hardware capability evaluation values in the hardware capability sequence can be shown in formula (5).
[0071] position_index = (1 - P_target) × (n - 1) + 1(5)
[0072] Where position_index is the positioning index, n is the number of hardware capability evaluation values in the hardware capability sequence, and position_index is used to accurately locate the target hardware capability evaluation value.
[0073] In some embodiments, the process of determining the target hardware capability evaluation value can be based on a dynamic election threshold. In the hardware capability sequence, the switch corresponding to the hardware capability evaluation value greater than or equal to the dynamic election threshold can be used as the first switch, and the switch corresponding to the hardware capability evaluation value less than the dynamic election threshold can be used as the second switch. The dynamic election threshold can be a quantile obtained by linear interpolation, which is used to quantify the threshold level of the management capability steps in the current switch network environment. The process of determining the dynamic election threshold can be shown in formulas (6) to (8).
[0074] i = floor(position_index) (6)
[0075] f = position_index – i (7)
[0076] T_dynamic = S_sorted[i] + f × (S_sorted[i+1] - S_sorted[i]) (8)
[0077] Where i is the integer part, floor() function is for flooring down, f is the decimal part, T_dynamic is the dynamic election threshold, S_sorted[i] is the hardware capability evaluation value of the i-th position in the hardware capability sequence, and S_sorted[i+1] is the hardware capability evaluation value of the (i+1)-th position in the hardware capability sequence.
[0078] For example, the hardware capability sequence is [15, 22, 35, 42, 50, 58, 65, 73, 85, 95], n=10. If P_target = 0.05, then: position_index = (1 - 0.05) × 9 + 1 = 9.55, i = 9, f = 0.55, T_dynamic = 85 + 0.55 × (95 - 85) = 90.5. Therefore, the switch corresponding to 95 in the hardware capability sequence can be used as the first switch, and the switches corresponding to the remaining 15, 22, 35, 42, 50, 58, 65, 73, and 85 can be used as the second switches.
[0079] According to an embodiment of the present invention, by determining a dynamic election threshold, a dynamic target hardware capability evaluation value can be determined based on the dynamic election threshold, and then a dynamic first switch and second switch can be determined. This enables automatic adaptation to changes in network load, ensuring that the election of the first switch and the allocation of the second switch are always in an optimal state, and avoiding the problem of low load resource utilization caused by static election and allocation schemes.
[0080] In some embodiments, for a given second switch, the second switches can be sorted in descending order according to their hardware capability assessment values and then allocated sequentially to each first switch using a round-robin method to construct a logical region tree. In this logical region tree, a sub-logical region can be constructed with the first switch as the root node and the second switch as the leaf node. With the configuration server as the overall root node and multiple sub-logical regions as leaf nodes, the logical region tree is constructed.
[0081] In one embodiment, the process of allocating at least one second switch managed by each first switch based on the target hardware capability assessment value and the position of the target hardware capability assessment value in the hardware capability sequence may include the following operations: designating at least one switch in the hardware capability sequence corresponding to a hardware capability assessment value that is less than the target hardware capability assessment value as a second switch; and allocating a second switch to each first switch according to the target hardware capability assessment value of each first switch, wherein the number of allocations corresponding to each first switch is proportional to the target hardware capability assessment value.
[0082] The hardware capability assessment value of the second switch may be less than the target hardware capability assessment value of the first switch. The process of allocating a second switch to each first switch based on the target hardware capability assessment value of each first switch may include the following operations: determining at least one second switch managed by each first switch according to the allocation order of the multiple first switches, based on the access time of each second switch to the configuration server and the number of allocations corresponding to each first switch, wherein the allocation order includes the order of the hardware capability assessment values corresponding to the multiple first switches in the hardware capability sequence.
[0083] In some embodiments, a capacity-weighted round-robin allocation strategy can be used for the allocation of the second switch. The second switch is allocated one by one through a dynamic round-robin mechanism. For example, a virtual queue is constructed for the second switches to be allocated based on their access time to the configuration server, and the second switches in the virtual queue are marked sequentially using the first switches arranged in the allocation order, with the number of markings equal to the number of first switches allocated.
[0084] For example, taking 10 first switches and 30 second switches selected from 40 switches as an example, the hardware capability evaluation value of each first switch is used as the weight of the load processing of that first switch.
[0085] For example, the hardware capability evaluation values of these 10 first switches (P1~P10) are P1: 90, P2: 85, P3: 80, P4: 75, P5: 70, P6: 65, P7: 60, P8: 55, P9: 50, and P10: 45. The sum of these 10 hardware capability evaluation values is 670. The allocation order of the first switches can be P1, P2, P3, P4, P5, P6, P7, P8, P9, and P10.
[0086] The allocation number of each first switch is calculated based on the ratio of the hardware capability assessment value of each first switch to the total hardware capability assessment value. The purpose is to adaptively allocate 30 second switches according to the hardware capability assessment values of the first switches.
[0087] For example, the allocation ratio of P1 is 90 / 670≈13.43%, the allocation ratio of P2 is 12.69%, the allocation ratio of P3 is 11.94%, the allocation ratio of P4 is 11.19%, the allocation ratio of P5 is 10.45%, the allocation ratio of P6 is 9.70%, the allocation ratio of P7 is 8.96%, the allocation ratio of P8 is 8.21%, the allocation ratio of P9 is 7.46%, and the allocation ratio of P10 is 6.72%. The allocation number for P1 is 30 × 13.43% ≈ 4.03, rounded to 4. The allocation number for P2 is 3.81, rounded to 4. The allocation number for P3 is 3.58, rounded to 4. The allocation number for P4 is 3.36, rounded to 3. The allocation number for P5 is 3.13, rounded to 3. The allocation number for P6 is 2.91, rounded to 3. The allocation number for P7 is 2.69, rounded to 3. The allocation number for P8 is 2.46, rounded to 2. The allocation number for P9 is 2.24, rounded to 2. The allocation number for P10 is 2.01, rounded to 2.
[0088] For a virtual queue consisting of 30 second switches, the second switches can be labeled sequentially. For example, the first 4 second switches can be labeled as managed by P1, the 5th to 8th second switches as managed by P2, the 9th to 12th second switches as managed by P3, the 13th to 15th second switches as managed by P4, the 16th to 18th second switches as managed by P5, the 19th to 21st second switches as managed by P6, the 22nd to 24th second switches as managed by P7, the 25th to 26th second switches as managed by P8, the 27th to 28th second switches as managed by P9, and the 29th to 30th second switches as managed by P10.
[0089] During the allocation process, a feasibility verification module can be introduced for closed-loop control to ensure that the first switch is not overloaded during operation.
[0090] According to an embodiment of the present invention, by allocating a second switch to the first switch based on the hardware capability assessment value of the first switch, the first switch with a higher hardware capability assessment value can manage more second switches, thereby realizing flexible allocation of the second switches, avoiding the problem of single-point overload of the first switch, and improving resource utilization.
[0091] In some embodiments, the management and analysis module of the configuration server can perform periodic failure detection on the first switch to prevent the first switch from reaching a management bottleneck. For example, if there is a first switch in the switch network that meets the failure conditions, the updated hardware capability assessment value and the updated load assessment value of each switch in the switch network are obtained. The failure conditions include the time difference between the time information of obtaining the hardware capability assessment value and load assessment value of the first switch and the current detection time information exceeding a predetermined duration. Based on the updated hardware capability assessment value and the updated load assessment value, the configuration information for the switch network is updated.
[0092] In some embodiments, the management analysis module can check whether the time difference between the hardware capability assessment value and load assessment value time information (e.g., last_update_time) of the first switch currently performing management functions and the current detection time is within a predetermined time (e.g., 10 minutes) to determine whether the first switch is disconnected. If it is within the predetermined time, it indicates that it is not disconnected; if it is not within the predetermined time, there is no need to wait for the next periodic failure detection task, and the process described in operations S210 to S250 can be directly repeated to obtain the updated hardware capability assessment value and updated load assessment value sent by each switch in the switch network, and update the configuration information according to the updated hardware capability assessment value and updated load assessment value.
[0093] In some embodiments, the periodic detection task can also compare the hardware capability evaluation value received at regular intervals with the currently used dynamic election threshold. If it is still greater than or equal to the currently used dynamic election threshold, the first switch can continue to assume management functions. If the currently used dynamic election threshold is less than the currently used dynamic election threshold, it can indicate that the first switch is currently overloaded. In this case, the sorting operation in operation S210 and operations S220 to S250 can be re-executed to realize the redetering of the first switch and the redistribution of the second switch.
[0094] According to embodiments of the present invention, by periodically detecting failures, when the first switch experiences performance degradation or failure, the system can quickly detect and automatically redetermine the first switch and reassign the second switch, thereby achieving high service availability and reducing the risk of single point of failure.
[0095] In some embodiments, if the following occurs, operations S210 to S250 can be repeated to redetermine the first switch and reassign the second switch.
[0096] The first switch can periodically collect the utilization rates of CPU, memory, and throughput. If the utilization rate of at least one of the CPU, memory, and throughput is >85% for 5 consecutive samplings, it is considered overloaded, and the first switch needs to be reassigned and the second switch needs to be redistributed.
[0097] Measure the time it takes for the data to be reported from the second switch to the first switch, and then for the first switch to report the data to the configuration server. If the average delay is greater than 2 seconds, it is considered a performance bottleneck, and the first switch needs to be reassigned and the second switch needs to be redetermined.
[0098] The first switch can periodically send heartbeat probes. If the timeout or packet loss rate is greater than 5%, it indicates a communication anomaly, and the first switch needs to be reassigned and the second switch needs to be reassigned.
[0099] If the first switch P3 experiences overload, its system load is sent to the configuration server. The configuration server then marks the first switch P3 as "overloaded," triggering a partial reconfiguration. This involves migrating some of the second switches managed by the first switch P3 to a nearby lightly loaded agent (such as the first switch P4 or the first switch P2). If the hardware capability values of all first switches are higher than the dynamic election threshold, the configuration server can update the relevant SWITCH_CONFIG entries, issue new configurations, and directly manage the second switches managed by the first switch P3.
[0100] According to embodiments of the present invention, by switching the first switch in the event of performance overload, reporting delay, or abnormal heartbeat, and by implementing management strategies of partial reconstruction and global management of the configuration server, load balancing between the first switches can be achieved, avoiding single-point overload of the first switch, improving the high availability of the switch network, realizing adaptive elastic adjustment of the first and second switches in the switch network, optimizing the utilization of cluster resources, and effectively dispersing the pressure on the configuration server.
[0101] In some embodiments, the process of determining configuration information for the switch network based on the management relationship between the first switch and the second switch may include the following operations: obtaining a configuration file for the switch network, the configuration file including management fields and basic service collection addresses for each switch in the switch network, the management fields indicating the Internet Protocol address of the switch used to manage each switch, and the basic service collection address used to receive data sent by each switch; setting the field value of the management field of the second switch to the Internet Protocol address of the first switch used to manage the second switch; and setting the field value of the management field of the first switch to the Internet Protocol address of the first switch itself, and setting the basic service collection address of the first switch to the Internet Protocol address of the configuration server, the updated configuration file being configuration information. The configuration file may also include the switch status (e.g., start status, stop status, etc.), load data, and idle data, etc.
[0102] The management analysis module can also update the configuration information determined based on the management relationship between the first and second switches in the database configuration file. For example, for the second switch, the management fields (such as the proxy_switch field) of the second switch can be updated to the IP address of the first switch assigned to the second switch. For instance, the destination IP address for data uploaded by the second switch can be configured to be the IP address of the parent first switch. In this way, the second switch will directly send the data to the parent first switch.
[0103] For the first switch, the management field (e.g., the proxy_switch field) of the first switch can be set to its own IP, and the base service collection address (e.g., the collector_ip of base_service) of the first switch can be set to the IP of the controller, so as to aggregate data to the controller.
[0104] For a switch that is changed from the first switch to the second switch, set the management field of the switch (such as the proxy_switch field) to the IP address of the first switch that was newly assigned to the switch, and change the role of the switch to the second switch.
[0105] The configuration and command delivery module of the configuration server can monitor changes to configuration files (such as the SWITCH_CONFIG table) in the database. Upon detecting changes to the configuration file, it can perform actual configuration based on the file. For example, it can configure the management field of the second switch to the IP address of the first switch assigned to it, configure the management field of the first switch to its own IP address, and configure the basic service collection address to the controller's IP address. The configuration and command delivery module can then send configuration information to the switch's management module based on this configuration.
[0106] According to embodiments of the present invention, by implementing differentiated configuration information based on different switches, the switch network has a clear logical hierarchy, efficient management, high degree of automation, and is easy to maintain, which is conducive to maximizing the utilization of cluster resources.
[0107] Figure 4 A flow diagram of a method for determining switch network configuration information according to another embodiment of the present invention is shown.
[0108] like Figure 4 As shown, the method for determining switch network configuration information in this embodiment can be applied to switches in a switch network. The method includes operations S410 to S430.
[0109] When operating the S410, the hardware capability assessment value and load assessment value of the switch are determined based on the real-time operating data of the switch.
[0110] When operating the S420, send hardware capability assessment values and load assessment values to the configuration server.
[0111] In operation S430, in response to receiving configuration information sent by the configuration server, the network connection of the switch is configured according to the configuration information, wherein the configuration information is determined by the configuration server according to operations S210 to S250.
[0112] The real-time operating data of a switch can include load data and idle data. Load data includes, for example, average CPU utilization, average memory utilization, average network throughput, and the switch's total theoretical throughput capacity. Idle data includes, for example, CPU idle rate, memory idle rate, and network load factor. These data can be obtained by referring to formulas (1) to (2).
[0113] The process of sending hardware capability assessment values and load assessment values to the configuration server can be achieved through the information notification module deployed on the switch side.
[0114] In some embodiments, the process of configuring the network connection of a switch according to configuration information may include the following operations: If the Internet Protocol address indicated by the management field is different from the Internet Protocol address of the switch, the switch corresponding to the Internet Protocol address is designated as the first switch for undertaking management functions, the switch is designated as the second switch managed by the first switch, and a network connection is established with the first switch; If the Internet Protocol address indicated by the management field is the same as the Internet Protocol address of the switch, the switch is designated as the first switch for undertaking management functions, and the network connection between the first switch and the configuration server is maintained, so as to utilize the configuration server to manage the first switch.
[0115] In some embodiments, the Internet Protocol address indicated by the management field is different from the Internet Protocol address of the switch, indicating that the switch does not perform management functions and needs to act as a second switch. The switch corresponding to the Internet Protocol address is then used as the first switch to perform management functions, and a network connection is established between the first switch and the second switch.
[0116] The Internet Protocol address indicated by the management field is the same as the Internet Protocol address of the switch, indicating that the switch is used to perform management functions and needs to act as the first switch to maintain the network connection with the configuration server.
[0117] In some embodiments, when the switch is a second switch and updated configuration information is received from the configuration server, basic data is sent to the first switch and the updated first switch, which is determined based on the updated configuration information, to manage the second switch, so that the first switch and the updated first switch send the processing results of the basic data to the configuration server respectively; upon receiving a disconnect command from the configuration server, the network connection with the first switch is disconnected and a network connection with the updated first switch is established, wherein the disconnect command is sent by the configuration server after receiving the processing results sent by the first switch and the updated first switch respectively within a predetermined time period.
[0118] In some embodiments, the configuration and command delivery module of the configuration server can send a Representational State Transfer Application Programming Interface (REST API) call, such as a POST request, to the switch whose configuration has changed, carrying the updated configuration information.
[0119] Upon receiving updated configuration information, the management module on the switch side does not immediately interrupt the current data flow, such as the data flow between the second switch (e.g., switch 2) and the current first switch (e.g., switch 1). The second switch (e.g., switch 2) can establish a network connection with the updated first switch (e.g., switch 3), which is determined based on the updated configuration information, to manage the second switch. A 60-second buffer transition period is then initiated. During this transition period, the second switch (e.g., switch 2) simultaneously sends basic data (such as timestamp data and log data) to both the current first switch (e.g., switch 1) and the updated first switch (e.g., switch 3).
[0120] The first switch (e.g., switch 1) and the updated first switch (e.g., switch 3) process the received basic data and send the processing results to the configuration server. If the configuration server receives the processing results from the first switch (e.g., switch 1) a predetermined number of times (e.g., 2 to 6) and the updated first switch (e.g., switch 3) a predetermined number of times (e.g., 2 to 6), it indicates that the data flow between the second switch (e.g., switch 2) and the updated first switch (e.g., switch 3) is stable. In this case, a disconnect command can be sent to the first switch (e.g., switch 1) to disconnect the network connection between the second switch (e.g., switch 2) and the first switch (e.g., switch 1), while maintaining the network connection between the second switch (e.g., switch 2) and the updated first switch (e.g., switch 3), thus achieving seamless switching of the second switch (e.g., switch 2) between the first switch (e.g., switch 1) and the updated first switch (e.g., switch 3).
[0121] For example, switch 1 acts as the first switch, and switch 2 acts as the second switch, with switch 1 managing switch 2. If the updated configuration information determines that switch 2 is the first switch responsible for management, then the data flow between switch 2 and switch 1 can be maintained, and a network connection between switch 2 and the configuration server can be established. During the 60-second buffer transition period, if the configuration server receives a predetermined number of processing results from switch 1 (e.g., 2-6) and a predetermined number of processing results from switch 2 (e.g., 2-6), it can send a disconnect command to switch 1 to disconnect the network connection between switch 1 and switch 2, while maintaining the network connection between switch 2 and the configuration server.
[0122] For example, switch 1 acts as the first switch, and switch 2 acts as the second switch, with switch 1 managing switch 2. If the updated configuration information determines that switch 1 is the managed second switch, the data flow between switch 1 and the configuration server can be maintained without interruption. A network connection can be established between switch 1 and the updated first switch (e.g., switch 3) designated as the manager of the second switch based on the updated configuration information. If, within 60 seconds, the configuration server receives a predetermined number of processing results from switch 1 (e.g., 2-6) and a predetermined number of processing results from the updated first switch (e.g., switch 3), indicating that the data flow between switch 1 and the updated first switch (e.g., switch 3) is stable, a disconnect command can be sent to switch 1 to disconnect the network connection between switch 1 and the configuration server, while maintaining the network connection between switch 1 and the updated first switch (e.g., switch 3).
[0123] In some embodiments, for telemetry data (extension_service) with high real-time requirements, the receiving address can be directly switched to the updated receiving address. That is, the 60-second buffer transition period can be omitted, and the switching between the original data receiving end (e.g., switch 1, configuration server) and the updated data receiving end (switch 3, configuration server, etc.) can be directly realized.
[0124] According to an embodiment of the present invention, the seamless migration switching mechanism ensures that the collection of basic data is uninterrupted, thus meeting the high requirements of operation and maintenance work for the continuity of basic data.
[0125] In some embodiments, on the switch side, if the second switch cannot connect to the updated first switch during the buffer transition period, the second switch will log an error and maintain the existing connection with the current first switch, while reporting the error information to the configuration server and waiting for the next decision from the configuration server.
[0126] On the configuration server side, if the configuration and command delivery module detects that the configuration delivery to any switch fails three times in a row, it will mark the state of that switch in the configuration file (e.g., the SWITCH_CONFIG table) as disabled and remove the switch from the current management area. After the fault of the switch is resolved, it will rejoin the selection of the first switch and the allocation of the second switch.
[0127] According to embodiments of the present invention, the switch side can ensure network service continuity by recording second switches that cannot connect to the updated first switch and maintaining existing connections. The configuration server side avoids unlimited resource waste by marking and removing switches that fail to distribute configurations, ensuring the normal operation of other switches in the switch network. After the fault is resolved, the switch is re-added to the selection of the first switch and the allocation of the second switch, thus improving the intelligence level of switch network management.
[0128] Figure 5 A flowchart illustrating a method for determining switch network configuration information according to another embodiment of the present invention is shown.
[0129] like Figure 5 As shown, the method for determining the switch network configuration information in this embodiment may include operations S510 to S560.
[0130] When operating S510, the hardware capability assessment value is determined based on the real-time operating data of the switch. This operation can be obtained by the load assessment module on the switch side according to formulas (1) to (8).
[0131] When operating the S520, the system obtains the Internet Protocol address and port of the configuration server, and then sends a hardware capability assessment value to the configuration server using the port and Internet Protocol address. This operation can be performed by the information announcement module on the switch side, which obtains the Internet Protocol address and port of the configuration server via DHCP and sends the hardware capability assessment value to the configuration server.
[0132] In operation of S530, based on the received hardware capability assessment values, a first switch is determined and a second switch is allocated to the first switch. This operation can be implemented by the information receiving module and management analysis module on the configuration server side.
[0133] When operating the S540, the management relationship between the first and second switches is stored in a configuration file. This operation can be implemented by the storage module on the configuration server side.
[0134] When operating the S550, relevant commands are generated based on the management relationships in the configuration file and sent to the switch. This operation can be implemented by the configuration and command issuance module on the configuration server side.
[0135] When operating the S560, network connections between switches are configured according to relevant instructions sent by the configuration server. This operation can be performed by the management module on the switch side.
[0136] According to embodiments of the present invention, by dynamically determining the hardware capability evaluation value based on the real-time operating data of the switches, and by using this dynamic hardware capability evaluation value to select the first switch and allocate the second switch, the first and second switches can be in an optimal state. This avoids the uneven utilization of cluster resources caused by static solutions, fully exploits and utilizes the computing resources of the entire switch cluster, and improves the overall throughput and efficiency of the system. Furthermore, when a single first switch experiences performance degradation or failure, the switch network and configuration server can quickly detect and automatically complete fault switching and the re-determination of the first switch and the reallocation of the second switch, achieving high service availability and reducing the risk of single points of failure.
[0137] Based on the above-described method for determining switch network configuration information applied to a configuration server, this invention also provides a device for determining configuration information applied to a configuration server. The following will be combined with... Figure 6 The device is described in detail.
[0138] Figure 6 A structural block diagram of a configuration information determination device according to an embodiment of the present invention is shown.
[0139] like Figure 6As shown, the configuration information determination device 600 of this embodiment includes a first acquisition module 610, a first determination module 620, a second determination module 630, a third determination module 640, and a fourth determination module 650.
[0140] The first acquisition module 610 is used to acquire the hardware capability assessment value and load assessment value of each switch in the switch network, and sort the hardware capability assessment value in a predetermined order to obtain a hardware capability sequence. The hardware capability assessment value and load assessment value are determined based on the real-time operating data of the switch.
[0141] The first determining module 620 is used to determine the location index for the hardware capability sequence based on the overall load value of the switch network determined using the load assessment values of each switch.
[0142] The second determining module 630 is used to determine at least one target hardware capability evaluation value from the hardware capability sequence based on the positioning index, and to determine the switch corresponding to the at least one target hardware capability evaluation value as the first switch for undertaking management functions.
[0143] The third determining module 640 is used to determine at least one second switch managed by each first switch based on the target hardware capability assessment value and the position of the target hardware capability assessment value in the hardware capability sequence.
[0144] The fourth determining module 650 is used to determine the configuration information for the switch network based on the management relationship between the first switch and the second switch. The configuration information is used to configure the network connection between switches in the switch network.
[0145] In some embodiments, the third determining module 640 may include a comparison unit and an allocation unit.
[0146] The comparison unit is used to select the switch corresponding to at least one hardware capability evaluation value in the hardware capability sequence that is less than the target hardware capability evaluation value as the second switch.
[0147] The allocation unit is used to allocate a second switch to each first switch according to the target hardware capability assessment value of each first switch, wherein the number of allocations corresponding to each first switch is proportional to the target hardware capability assessment value.
[0148] In some embodiments, the allocation unit may include a determining subunit.
[0149] A determination subunit is used to determine at least one second switch managed by each first switch according to the allocation order of multiple first switches, based on the access time of each second switch and the configuration server, and the number of allocations corresponding to each first switch. The allocation order includes the order of the hardware capability evaluation values corresponding to multiple first switches in the hardware capability sequence.
[0150] In some embodiments, the fourth determining module 650 may include an acquisition unit, a first setting unit, and a second setting unit.
[0151] The acquisition unit is used to acquire the configuration file for the switch network. The configuration file includes management fields and basic service collection addresses for each switch in the switch network. The management fields indicate the Internet Protocol addresses of the switches used to manage each switch, and the basic service collection addresses are used to receive data sent by each switch.
[0152] The first setting unit is used to set the field value of the management field of the second switch to the Internet Protocol address of the first switch used to manage the second switch.
[0153] The second setting unit is used to set the field value of the management field of the first switch to the Internet Protocol address of the first switch itself, and to set the basic service collection address of the first switch to the Internet Protocol address of the configuration server. The updated configuration file contains configuration information.
[0154] In some embodiments, the first determining module 620 may include a correction unit and a determining unit.
[0155] The correction unit is used to correct the preset static preset parameters using the overall load value to obtain the target parameters. The static preset parameters are used to represent the preset proportion of the number of switches that are the first switches in the switch network to the total number of switches.
[0156] The determining unit is used to determine the positioning index for the hardware capability sequence based on the target parameters and the number of hardware capability evaluation values in the hardware capability sequence.
[0157] In some embodiments, the configuration information determining device may further include a second acquisition module and an update module.
[0158] The second acquisition module is used to acquire the updated hardware capability assessment value and the updated load assessment value of each switch in the switch network when there is a first switch in the switch network that meets the failure conditions. The failure conditions include the time difference between the time information of acquiring the hardware capability assessment value and load assessment value of the first switch and the current detection time information exceeding a predetermined duration.
[0159] The update module is used to update the configuration information for the switch network based on the updated hardware capability assessment value and the updated load assessment value.
[0160] Based on the above-described method for determining switch network configuration information applied to switches, this invention also provides a device for determining configuration information for switches. The following will be combined with... Figure 7The device is described in detail.
[0161] Figure 7 A structural block diagram of a configuration information determination device according to another embodiment of the present invention is shown.
[0162] like Figure 7 As shown, the configuration information determination device 700 of this embodiment includes a fifth determination module 710, a first sending module 720, and a configuration module 730.
[0163] The fifth determining module 710 is used to determine the hardware capability assessment value and load assessment value of the switch based on the real-time operating data of the switch.
[0164] The first sending module 720 is used to send hardware capability assessment values and load assessment values to the configuration server.
[0165] The configuration module 730 is used to configure the network connection of the switch according to the configuration information received from the configuration server, wherein the configuration information is determined according to the method for determining the switch network configuration information applied to the configuration server.
[0166] In some embodiments, the configuration module 730 may include a first connection unit and a second connection unit.
[0167] The first connection unit is used to designate the switch corresponding to the Internet Protocol address as the first switch for management functions, and the switch as the second switch managed by the first switch, and establish a network connection with the first switch, when the Internet Protocol address indicated by the management field is different from the Internet Protocol address of the switch.
[0168] The second connection unit is used to designate the switch as the first switch for management functions when the Internet Protocol address indicated by the management field is the same as the Internet Protocol address of the switch, and to maintain the network connection between the first switch and the configuration server so as to manage the first switch using the configuration server.
[0169] In some embodiments, the configuration information determining device 700 may further include a second sending module and a receiving module.
[0170] The second sending module is used to send basic data to the first switch and the updated first switch, which is determined based on the updated configuration information, when the switch is the second switch and updated configuration information is received from the configuration server, so that the first switch and the updated first switch will send the processing results of the basic data to the configuration server respectively.
[0171] The interrupt module is used to disconnect the network connection with the first switch and establish a network connection with the updated first switch when it receives a disconnect command from the configuration server. The disconnect command is sent by the configuration server after receiving the processing results from the first switch and the updated first switch respectively within a predetermined time.
[0172] According to embodiments of the present invention, any plurality of modules among the first acquisition module 610, first determination module 620, second determination module 630, third determination module 640, fourth determination module 650, fifth determination module 710, first sending module 720, and configuration module 730 may be combined into one module, or any one of these modules may be split into multiple modules. Alternatively, at least some of the functions of one or more of these modules may be combined with at least some of the functions of other modules and implemented in one module. According to embodiments of the present invention, at least one of the first acquisition module 610, the first determination module 620, the second determination module 630, the third determination module 640, the fourth determination module 650, the fifth determination module 710, the first transmission module 720, and the configuration module 730 can be at least partially implemented as hardware circuits, such as field-programmable gate arrays (FPGAs), programmable logic arrays (PLAs), systems-on-a-chip, systems-on-a-substrate, systems-on-package, application-specific integrated circuits (ASICs), or any other reasonable means of integrating or packaging circuits, or implemented in hardware or firmware, or in any one of software, hardware, and firmware implementations, or in a suitable combination of any of these. Alternatively, at least one of the first acquisition module 610, the first determination module 620, the second determination module 630, the third determination module 640, the fourth determination module 650, the fifth determination module 710, the first transmission module 720, and the configuration module 730 can be at least partially implemented as a computer program module, which can perform corresponding functions when the computer program module is run.
[0173] Figure 8 A block diagram of an electronic device suitable for implementing a method for determining network configuration information of a switch according to an embodiment of the present invention is shown schematically.
[0174] like Figure 8As shown, an electronic device 800 according to an embodiment of the present invention includes a processor 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage portion 808 into a random access memory (RAM) 803. The processor 801 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 801 may also include onboard memory for caching purposes. The processor 801 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present invention.
[0175] RAM 803 stores various programs and data required for the operation of electronic device 800. Processor 801, ROM 802, and RAM 803 are interconnected via bus 804. Processor 801 executes various operations of the method flow according to embodiments of the present invention by executing programs in ROM 802 and / or RAM 803. It should be noted that the programs may also be stored in one or more memories other than ROM 802 and RAM 803. Processor 801 may also execute various operations of the method flow according to embodiments of the present invention by executing programs stored in said one or more memories.
[0176] According to an embodiment of the present invention, the electronic device 800 may further include an input / output (I / O) interface 805, which is also connected to a bus 804. The electronic device 800 may also include one or more of the following components connected to the input / output (I / O) interface 805: an input section 806 including a keyboard, mouse, etc.; an output section 807 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the input / output (I / O) interface 805 as needed. A removable medium 811, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 810 as needed so that computer programs read from it can be installed into the storage section 808 as needed.
[0177] The present invention also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs, which, when executed, implement the method according to the embodiments of the present invention.
[0178] According to embodiments of the present invention, a computer-readable storage medium may be a non-volatile computer-readable storage medium, such as including, but not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of the present invention, a computer-readable storage medium may include ROM 802 and / or RAM 803 and / or one or more memories other than ROM 802 and RAM 803 described above.
[0179] Embodiments of the present invention also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code is used to cause the computer system to implement the methods provided in the embodiments of the present invention.
[0180] When the computer program is executed by the processor 801, it performs the functions defined in the system / apparatus of this invention. According to embodiments of the invention, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0181] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and may be downloaded and installed via the communication section 809, and / or installed from a removable medium 811. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.
[0182] In such an embodiment, the computer program can be downloaded and installed from a network via communication section 809, and / or installed from removable medium 811. When the computer program is executed by processor 801, it performs the functions defined in the system of this embodiment of the invention. According to embodiments of the invention, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0183] According to embodiments of the present invention, program code for executing the computer programs provided in the embodiments of the present invention can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, languages such as Java, C++, Python, "C", or similar programming languages. The program code can be executed entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0184] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0185] Those skilled in the art will understand that the features described in the various embodiments of the present invention can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in the present invention. In particular, the features described in the various embodiments of the present invention can be combined and / or combined in various ways without departing from the spirit and teachings of the present invention. All such combinations and / or combinations fall within the scope of the present invention.
[0186] The embodiments of the present invention have been described above. However, these embodiments are merely illustrative and not intended to limit the scope of the invention. Although various embodiments have been described above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. Various substitutions and modifications can be made by those skilled in the art without departing from the scope of the invention, and all such substitutions and modifications should fall within the scope of the invention.
Claims
1. A method for determining network configuration information of a switch, characterized in that, Applied to a configuration server, the method includes: The hardware capability assessment value and load assessment value of each switch in the switch network are obtained, and the hardware capability assessment value is sorted in a predetermined order to obtain a hardware capability sequence. The hardware capability assessment value and the load assessment value are determined based on the real-time operating data of the switches. Based on the overall load value of the switch network determined using the load assessment values of each switch, a location index for the hardware capability sequence is determined. Based on the location index, at least one target hardware capability evaluation value is determined from the hardware capability sequence, and the switch corresponding to at least one of the target hardware capability evaluation values is determined as the first switch to undertake management functions. Based on the target hardware capability assessment value and the position of the target hardware capability assessment value in the hardware capability sequence, at least one second switch managed by each first switch is determined. Based on the management relationship between the first switch and the second switch, configuration information for the switch network is determined, and the configuration information is used to configure the network connection between switches in the switch network; The step of determining the positioning index for the hardware capability sequence based on the overall load value of the switch network determined using the load assessment values of each switch includes: correcting a preset static preset parameter using the overall load value to obtain a target parameter, wherein the static preset parameter is used to represent a preset proportion of the number of switches that are first switches in the switch network to the total number of switches; and determining the positioning index for the hardware capability sequence based on the target parameter and the number of hardware capability assessment values in the hardware capability sequence. The step of determining at least one second switch managed by each first switch based on the target hardware capability assessment value and its position in the hardware capability sequence includes: The switch corresponding to at least one hardware capability evaluation value in the hardware capability sequence that is less than the target hardware capability evaluation value shall be designated as the second switch; Based on the target hardware capability assessment value of each first switch, a second switch is allocated to each first switch, wherein the number of allocations corresponding to each first switch is proportional to the target hardware capability assessment value.
2. The method according to claim 1, characterized in that, The step of allocating a second switch to each of the first switches based on the target hardware capability assessment value of each of the first switches includes: Based on the allocation order of the multiple first switches, and the access time of each second switch to the configuration server, and the number of allocations corresponding to each first switch, at least one second switch managed by each first switch is determined. The allocation order includes the order of the hardware capability evaluation values corresponding to the multiple first switches in the hardware capability sequence.
3. The method according to claim 1, characterized in that, The step of determining the configuration information for the switch network based on the management relationship between the first switch and the second switch includes: Obtain a configuration file for the switch network. The configuration file includes management fields and basic service collection addresses for each switch in the switch network. The management fields indicate the Internet Protocol addresses of the switches used to manage each switch, and the basic service collection addresses are used to receive data sent by each switch. Set the value of the management field of the second switch to the Internet Protocol address of the first switch used to manage the second switch; and Set the value of the management field of the first switch to the Internet Protocol address of the first switch itself, and set the basic service collection address of the first switch to the Internet Protocol address of the configuration server. The updated configuration file is the configuration information.
4. The method according to claim 1, characterized in that, The method further includes: If there is a first switch in the switch network that meets the failure conditions, the updated hardware capability assessment value and the updated load assessment value of each switch in the switch network are obtained. The failure conditions include the time difference between the time information of obtaining the hardware capability assessment value and the load assessment value of the first switch and the current detection time information exceeding a predetermined time. The configuration information for the switch network is updated based on the updated hardware capability assessment value and the updated load assessment value.
5. A method for determining network configuration information of a switch, characterized in that, The method, applied to switches in a switch network, includes: Based on the real-time operating data of the switch, determine the hardware capability assessment value and load assessment value of the switch; Send the hardware capability assessment value and the load assessment value to the configuration server; In response to receiving configuration information sent by the configuration server, the network connection of the switch is configured according to the configuration information, wherein the configuration information is determined by the method according to any one of claims 1-4.
6. The method according to claim 5, characterized in that, The configuration file includes management fields for each switch in the switch network, the management fields indicating the Internet Protocol address of the switch used to manage each switch; Configuring the network connection of the switch according to the configuration information includes: If the Internet Protocol address indicated by the management field is different from the Internet Protocol address of the switch, the switch corresponding to the Internet Protocol address shall be designated as the first switch for undertaking management functions, the switch shall be designated as the second switch managed by the first switch, and a network connection shall be established with the first switch. If the Internet Protocol address indicated by the management field is the same as the Internet Protocol address of the switch, the switch is designated as the first switch for undertaking management functions, and the network connection between the first switch and the configuration server is maintained so that the configuration server can be used to manage the first switch.
7. The method according to claim 6, characterized in that, The method further includes: When the switch is the second switch and updated configuration information is received from the configuration server, basic data is sent to the first switch and the updated first switch, which is determined based on the updated configuration information and is used to manage the second switch, so that the first switch and the updated first switch will send the processing results of the basic data to the configuration server respectively. Upon receiving a disconnect command from the configuration server, the network connection with the first switch is disconnected, and a network connection is established with the updated first switch. The disconnect command is sent by the configuration server after receiving the processing results from the first switch and the updated first switch respectively within a predetermined time period.
8. An electronic device, comprising: One or more processors; Memory, used to store one or more computer programs. The characteristic feature is that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Switch load balancing test method and system based on cloud computing
CN119342055A
Dynamic Path Selection Policy for Multipathing in a Virtualized Environment
US20150095445A1