Proxy node determination method and device, equipment and storage medium
By obtaining the proxy priority of the computing nodes in the network domain and electing the proxy nodes by themselves, solving the problems of complex configuration and low flexibility in the existing technology, and achieving efficient and accurate proxy node elections.
Patent Information
- Application Number
- CN202311604653.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-27
- Publication Date
- 2025-05-27
AI Technical Summary
The prior art requires obtaining complex configuration files when determining proxy nodes, which are prone to errors, have low accuracy, and a unified decisive algorithm leads to low flexibility.
By obtaining the proxy priority of multiple computing nodes in the domain, the proxy nodes are elected by themselves, with low operation complexity, high accuracy and high flexibility.
It realizes efficient self-election of proxy nodes within the domain, improves accuracy and flexibility, and reduces configuration complexity and error rate.
Smart Images

Figure CN120050152A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technologies, and particularly to a method, apparatus, device, and storage medium for determining a proxy node. Background Art
[0002] With the development of communication technologies, multiple computing nodes in a network can process tasks in parallel to improve processing efficiency. For a domain including multiple computing nodes, a management node can be introduced to detect the status of the computing nodes and perform task scheduling. For example, a domain in a high performance computing (HPC) scenario includes a master node and computing nodes. As the number of computing nodes increases, communication bottlenecks occur between the computing nodes and the management node. Therefore, a proxy node needs to be used in each domain to be responsible for communication between the management node and the computing nodes.
[0003] In related technologies, all computing nodes in a cluster and a partitioning method are first obtained through a configuration file. The partitioning method indicates the way of partitioning the computing nodes included in the cluster into the computing nodes included in multiple domains. After that, a deterministic algorithm can be used to calculate the proxy node within each domain according to the configuration file.
[0004] However, the above method needs to obtain a configuration file, which is complex to configure, error-prone, has low accuracy, and uses a unified deterministic algorithm to uniformly determine the proxy nodes of multiple domains, making it difficult to change and having low flexibility. Summary of the Invention
[0005] This application provides a method, apparatus, device, and storage medium for determining a proxy node to solve the problems existing in related technologies. The technical solutions are as follows:
[0006] In a first aspect, a method for determining a proxy node is provided. The method is applied to a first node and includes: obtaining the proxy priorities of multiple computing nodes in a domain, determining a setting result of the first node according to the proxy priorities of the multiple computing nodes, where the first node is any one of the multiple computing nodes, the proxy priority indicates the priority of setting a computing node as a proxy node, and the setting result of the first node indicates whether the first node is set as a proxy node; obtaining the setting results of each second node in at least one second node, where the second node is a computing node different from the first node in the domain, and the setting result of the second node indicates whether the second node is set as a proxy node; and selecting at least one proxy node from the multiple computing nodes according to the obtained setting results of the multiple computing nodes.
[0007] After determining the setting result, each computing node in the network domain will also obtain the setting results of other computing nodes, select a proxy node based on the setting results, and the self-election of the proxy node in the network domain can be achieved through the computing nodes included in the network domain, with low operation complexity, high accuracy, and high determination efficiency. The proxy nodes of different network domains are self-elected by the computing nodes within different network domains, with high flexibility. The above method for determining proxy nodes can be applied to any network domain, and can select any number of proxy nodes, such as one or more, with high flexibility and wide generality.
[0008] In a possible implementation manner, obtaining the proxy priorities of multiple computing nodes in the network domain includes: obtaining the node identifiers of multiple computing nodes in the network domain; sorting the node identifiers of the multiple computing nodes, and determining the proxy priorities of the multiple computing nodes according to the sorting result. By sorting according to the node identifiers, the proxy priorities of the computing nodes can be determined, and the process of determining the proxy priorities is simple and efficient.
[0009] In a possible implementation manner, obtaining the node identifiers of multiple computing nodes in the network domain includes: for any second node, receiving the first heartbeat information broadcast by the second node according to the first period, where the first heartbeat information includes the node identifier of the second node; parsing the first heartbeat information, and determining the node identifier of the second node according to the parsing result. The second node broadcasts the first heartbeat information to notify the first node that receives the first heartbeat information that the second node is operating normally. Since the node identifier is carried in the first heartbeat information, the first node can obtain the node identifier through the first heartbeat information, with high acquisition efficiency.
[0010] In a possible implementation manner, determining the setting result of the first node according to the proxy priorities of multiple computing nodes includes: determining the proxy order value corresponding to the first node according to the proxy priorities of the multiple computing nodes; comparing the proxy order value corresponding to the first node with the first quantity, where the first quantity indicates the number of proxy nodes to be selected; in the case where the proxy order value is not greater than the first quantity, setting the first node as a proxy node to obtain the setting result of the first node, or, in the case where the proxy order value is greater than the first quantity, setting the first node as a non-proxy node to obtain the setting result of the first node. The setting results of each computing node in the network domain are obtained by each computing node according to the proxy order value and the first quantity. The proxy order value is determined according to the proxy priorities, and the nodes are set according to the same rule to reduce the setting conflicts between different computing nodes. The setting conflict is, for example, setting more than the first quantity of computing nodes as proxy nodes.
[0011] In a possible implementation, obtaining the setting results of each of the at least one second node includes: for any second node, receiving the second heartbeat information sent by any second node, where the second heartbeat information of any second node includes the setting result of any second node; parsing the second heartbeat information, and determining the setting result of any second node according to the parsing result. Since the second nodes that can normally send second heartbeat information are the second nodes operating normally, the setting results are obtained through the second heartbeat information to select a proxy node from the second nodes and the first node that send the second heartbeat information, ensuring that the selected proxy node is a computing node operating normally, and the reliability of the selected proxy node is high.
[0012] In a possible implementation, when the second node is set as a proxy node, the second node broadcasts the second heartbeat information according to a second period, or when the second node is set as a non-proxy node, the second node broadcasts the second heartbeat information according to a third period, and the second period is shorter than the third period. The second period for the computing node set as a proxy node to broadcast is shorter than the third period for the computing node set as a non-proxy node to broadcast. By sending the second heartbeat information based on a shorter period, in the case where the computing node set as a proxy node malfunctions, the proxy node can be adjusted in a timely manner, and the anomaly detection timeliness is high.
[0013] In a possible implementation, when the second node set as a non-proxy node is a candidate node, the second node broadcasts the second heartbeat information according to a first sub-period included in the third period, or when the second node set as a non-proxy node is a reference node, the second node broadcasts the second heartbeat information according to a second sub-period included in the third period. The proxy priority of the candidate node is higher than that of the reference node, and the first sub-period is shorter than the second sub-period. Since the proxy priority of the candidate node is higher than that of the reference node, in the case where the computing node set as a proxy node malfunctions, a computing node is preferentially selected from the candidate nodes as the proxy node. Therefore, the period for the candidate node to send the second heartbeat information is shorter than the period for the reference node to send the second heartbeat information. Computing nodes with different proxy priorities broadcast the second heartbeat information using different periods, and the flexibility is high.
[0014] In a possible implementation, selecting at least one proxy node from multiple computing nodes according to the setting results of the multiple computing nodes includes: determining a second quantity of the computing nodes set as proxy nodes according to the setting results of the multiple computing nodes; and selecting at least one proxy node from the computing nodes set as proxy nodes according to the second quantity and a first quantity, where the first quantity indicates the number of proxy nodes to be selected. The first quantity indicates the number of proxy nodes to be set in the network domain, and the second quantity indicates the number of currently set proxy nodes in the network domain. According to the first quantity and the second quantity, proxy nodes can be selected with low operation complexity and high efficiency.
[0015] In a possible implementation, selecting at least one proxy node from the computing nodes set as proxy nodes according to the second quantity and the first quantity includes: when the second quantity is greater than the first quantity, obtaining the proxy priorities of the computing nodes set as proxy nodes, and determining the computing nodes with proxy priorities not greater than the first quantity as proxy nodes to obtain the first quantity of proxy nodes; or, when the second quantity is less than the first quantity, determining the computing nodes set as proxy nodes as proxy nodes, and selecting computing nodes from the computing nodes set as non-proxy nodes as proxy nodes according to the proxy priorities of the computing nodes set as non-proxy nodes to obtain the first quantity of proxy nodes. By comparing the first quantity and the second quantity, adjustments can be made in a timely manner when there are too many or too few currently set proxy nodes, and the number of proxy nodes in the network domain can be precisely controlled.
[0016] In a possible implementation, after determining the setting result of the first node according to the proxy priorities of the multiple computing nodes, it further includes: when the setting result indicates that the first node is set as a proxy node, performing the proxy service of the network domain. After being set as a proxy node, the proxy service is performed in a timely manner to ensure the normal operation of the computing nodes in the network domain.
[0017] In a possible implementation, after determining the setting result of the first node according to the proxy priorities of the multiple computing nodes, it further includes: when the setting result indicates that the first node is set as a proxy node, broadcasting the third heartbeat information of the first node to multiple second nodes in the network domain according to a second period, where the third heartbeat information includes the setting result of the first node; or, when the setting result indicates that the first node is set as a non-proxy node, broadcasting the third heartbeat information of the first node to multiple second nodes in the network domain according to a third period, and the second period is shorter than the third period. Different periods are selected to broadcast the third heartbeat information according to different setting results, so that in the case of low demand for running detection, that is, when the first node is set as a non-proxy node, a long third period is used for broadcasting to control the number and frequency of broadcasts and reduce the interaction cost between computing nodes.
[0018] In a second aspect, a determining device for a proxy node is provided. The device is applied to a first node and includes: a processing module, configured to obtain the proxy priorities of multiple computing nodes in a network domain, determine a setting result of the first node according to the proxy priorities of the multiple computing nodes, where the first node is any one of the multiple computing nodes, the proxy priority indicates the priority of setting a computing node as a proxy node, and the setting result of the first node indicates whether the first node is set as a proxy node; a transceiver module, configured to obtain the setting results of each of at least one second node, where the second node is a computing node different from the first node in the network domain, and the setting result of the second node indicates whether the second node is set as a proxy node; the processing module is further configured to select at least one proxy node from the multiple computing nodes according to the obtained setting results of the multiple computing nodes.
[0019] In a possible implementation, the processing module is configured to obtain the node identifiers of multiple computing nodes in the network domain; sort the node identifiers of the multiple computing nodes, and determine the proxy priorities of the multiple computing nodes according to the sorting result.
[0020] In a possible implementation, for any second node, the processing module is configured to receive first heartbeat information broadcast by any second node at a first period, where the first heartbeat information includes the node identifier of any second node; parse the first heartbeat information, and determine the node identifier of any second node according to the parsing result.
[0021] In a possible implementation, the processing module is configured to determine a proxy order value corresponding to the first node according to the proxy priorities of the multiple computing nodes; compare the proxy order value corresponding to the first node with a first quantity, where the first quantity indicates the number of proxy nodes to be selected; in the case where the proxy order value is not greater than the first quantity, set the first node as a proxy node to obtain the setting result of the first node, or, in the case where the proxy order value is greater than the first quantity, set the first node as a non - proxy node to obtain the setting result of the first node.
[0022] In a possible implementation, for any second node, the transceiver module is configured to receive second heartbeat information sent by any second node, where the second heartbeat information of any second node includes the setting result of any second node; parse the second heartbeat information, and determine the setting result of any second node according to the parsing result.
[0023] In a possible implementation, when the second node is set as a proxy node, the second node broadcasts second heartbeat information at a second period, or, when the second node is set as a non - proxy node, the second node broadcasts second heartbeat information at a third period, and the second period is shorter than the third period.
[0024] In a possible implementation, when the second node set as a non-proxy node is a candidate node, the second node broadcasts second heartbeat information according to the first sub-period included in the third period; or, when the second node set as a non-proxy node is a reference node, the second node broadcasts second heartbeat information according to the second sub-period included in the third period. The proxy priority of the candidate node is higher than that of the reference node, and the first sub-period is shorter than the second sub-period.
[0025] In a possible implementation, a processing module is configured to determine a second quantity of computing nodes set as proxy nodes according to the setting results of multiple computing nodes; and select at least one proxy node from the computing nodes set as proxy nodes according to the second quantity and a first quantity, where the first quantity indicates the number of proxy nodes to be selected.
[0026] In a possible implementation, when the second quantity is greater than the first quantity, the processing module is configured to obtain the proxy priorities of the computing nodes set as proxy nodes, and determine the computing nodes with proxy priorities not greater than the first quantity as proxy nodes to obtain the first quantity of proxy nodes; or, when the second quantity is less than the first quantity, the processing module is configured to determine the computing nodes set as proxy nodes as proxy nodes, and select computing nodes from the computing nodes set as non-proxy nodes as proxy nodes according to the proxy priorities of the computing nodes set as non-proxy nodes to obtain the first quantity of proxy nodes.
[0027] In a possible implementation, the processing module is further configured to perform proxy services for the network domain when the setting result indicates that the first node is set as a proxy node.
[0028] In a possible implementation, the transceiver module is further configured to, when the setting result indicates that the first node is set as a proxy node, broadcast third heartbeat information of the first node to multiple second nodes in the network domain according to a second period, where the third heartbeat information includes the setting result of the first node; or, when the setting result indicates that the first node is set as a non-proxy node, broadcast third heartbeat information of the first node to multiple second nodes in the network domain according to a third period, and the second period is shorter than the third period.
[0029] In a third aspect, a device for determining a proxy node is provided. The device includes a processor configured to load and execute at least one instruction to enable the device for determining a proxy node to perform the method in the first aspect or any possible implementation manner of the first aspect.
[0030] In a possible implementation, the device includes a memory coupled to the processor, and the memory stores at least one instruction.
[0031] Fourthly, a computer-readable storage medium is provided. At least one instruction is stored in the computer-readable storage medium, and the instruction is loaded and executed by a processor to implement the method for determining an agent node in the first aspect or any possible implementation manner of the first aspect.
[0032] Fifthly, a computer program (product) is provided. The computer program (product) includes a computer program / instructions, and the computer program / instructions are executed by a processor to enable a computer to implement the method for determining an agent node in the first aspect or any possible implementation manner of the first aspect.
[0033] Sixthly, a communication device is provided. The device includes a transceiver, a memory, and a processor. Among them, the transceiver, the memory, and the processor communicate with each other through an internal connection path. The memory is used to store instructions, and the processor is used to execute the instructions stored in the memory to control the transceiver to receive signals and control the transceiver to send signals. And when the processor executes the instructions stored in the memory, the processor is caused to execute the method in the first aspect or any possible implementation manner of the first aspect.
[0034] Optionally, there is one or more processors, and there is one or more memories.
[0035] Optionally, the memory may be integrated with the processor, or the memory is separately arranged from the processor.
[0036] In a specific implementation process, the memory may be a non-transitory memory, such as a read only memory (ROM). It may be integrated with the processor on the same chip or may be separately arranged on different chips. The present application does not limit the type of the memory and the setting manner of the memory and the processor.
[0037] Seventhly, a chip is provided, including a processor for calling and running the running program instructions or code stored in a memory, so that a communication device installed with the chip executes the methods in the above aspects.
[0038] Eighthly, another chip is provided, including an input interface, an output interface, a processor, and a memory. The input interface, the output interface, the processor, and the memory are connected through an internal connection path. The processor is used to execute the code in the memory. When the code is executed, the processor is used to execute the methods in the above aspects.
[0039] It should be understood that the beneficial effects obtained by the technical solutions and corresponding possible implementation manners of the second aspect to the eighth aspect of the present application can refer to the technical effects of the first aspect and its corresponding possible implementation manners described above, and will not be elaborated here. Brief Description of the Drawings
[0040] Figure 1 A schematic diagram of an implementation environment provided by an embodiment of the present application;
[0041] Figure 2 A schematic diagram of another implementation environment provided by an embodiment of the present application;
[0042] Figure 3 A flowchart of a method for determining an agent node provided by an embodiment of the present application;
[0043] Figure 4 A schematic diagram of the structure of a network domain provided by an embodiment of the present application;
[0044] Figure 5 A schematic diagram of adjusting the state of a node provided by an embodiment of the present application;
[0045] Figure 6 A schematic diagram of the structure of a device for determining an agent node provided by an embodiment of the present application;
[0046] Figure 7 A schematic diagram of the structure of a network device provided by an embodiment of the present application;
[0047] Figure 8 A schematic diagram of the structure of another network device provided by an embodiment of the present application. Detailed Implementation Manner
[0048] The terms used in the implementation part of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application. To make the purpose, technical solution and advantages of the present application clearer, the following will further describe the implementation manner of the present application in detail with reference to the drawings.
[0049] With the development of communication technology, more and more data in the network needs to be processed. During the data processing process, multiple computing nodes are used for parallel processing. For example, for a multi-dimensional data set including a large amount of data, multiple computing nodes are used for parallel processing to improve the data processing efficiency. During the process of using multiple computing nodes for parallel processing, a management node can be introduced to detect the state of the computing nodes and perform task scheduling. As the number of computing nodes increases, the communication between the management node and the computing nodes becomes a bottleneck. Based on this, it is necessary to use agent nodes in the network domain to be responsible for the message communication between the management node and the computing nodes.
[0050] In the related art, for a cluster including multiple computing nodes, a device for determining a proxy node obtains a configuration file of the cluster. The configuration file includes all the computing nodes in the cluster and the partitioning method of each network domain in the cluster. The device uniformly calculates the proxy nodes in each network domain according to the configuration file by using a deterministic algorithm to implement the selection of the proxy nodes. The above method for selecting a proxy node needs to obtain a configuration file, which is complex in configuration and low in accuracy. By using a unified deterministic algorithm to determine the proxy nodes in multiple network domains, the selection process is not easy to change and has low flexibility.
[0051] An embodiment of the present application provides a method for determining a proxy node, which is used to select a proxy node from multiple computing nodes. Please refer to Figure 1 , which shows a schematic diagram of an implementation environment of the method for determining a proxy node provided by an embodiment of the present application. The implementation environment includes a management node 01 and multiple computing nodes 02. Among them, a communication connection is established between the management node 01 and the multiple computing nodes 02 in a wired or wireless network manner. In a possible case, a communication connection is also established between the multiple computing nodes 02 in a wired or wireless network manner. For example Figure 2 as shown in Figure 2 , the cluster includes multiple subnets, namely subnet 1, subnet 2,... subnet N, where N is a positive integer greater than 3. Any subnet includes multiple computing nodes 02. For example, subnet 1 includes multiple computing nodes 02, and a communication connection is established between the multiple computing nodes 02.
[0052] For Figure 1 or Figure 2 in the case of the multiple computing nodes 02 shown, the method for determining a proxy node provided by an embodiment of the present application can be executed by any one of the computing nodes 02. That is, the first node can be any one of the computing nodes 02. The first node can be Figure 2 the computing node A in Figure 2 , or can be
[0053] the computing node B in
[0054] After the first node determines whether to set the first node as a proxy node according to the proxy priorities of the multiple computing nodes 02 in the network domain, it obtains the setting results of other computing nodes 02, that is, the second nodes, and selects at least one proxy node from the multiple computing nodes 02 according to the obtained multiple setting results.
[0053] In a possible implementation manner, the management node 01 and the computing node 02 can be any device with data processing functions. The management node 01 and the computing node 02 can be terminal devices such as a desktop computer, a laptop computer, or a smart phone, or can also be a server that processes data in an interaction process, such as a central server, an edge server, or a local server in a local data center. The server can be a physical server or can also be a cloud server that provides cloud computing services, etc.
[0054] The method for determining a proxy node provided by an embodiment of this application can be applied to the above Figure 1 or Figure 2 shown implementation environment. The flowchart of this method is as shown in Figure 3 and includes S301 - S303.
[0055] S301. Obtain the proxy priorities of multiple computing nodes in a network domain, and determine the setting result of a first node according to the proxy priorities of the multiple computing nodes. The first node is any one of the multiple computing nodes, the proxy priority indicates the priority of setting a computing node as a proxy node, and the setting result of the first node indicates whether the first node is set as a proxy node.
[0056] Exemplarily, the first node refers to a computing node included in a network domain, which can be any computing node. For the case where there are multiple computing nodes included in the network domain where the first node is located, other computing nodes different from the first node can be understood as second nodes. Figure 2 It is a schematic diagram of a network domain structure provided by an embodiment of this application. Figure 2 One subnet in it indicates a network domain. Subnet 1 includes multiple computing nodes such as computing node A, computing node B, computing node C, computing node D, and computing node E. The embodiment of this application does not limit the division process of the multiple computing nodes included in the network domain. Taking the multiple computing nodes belonging to a cluster as an example, the multiple computing nodes included in the cluster can be determined first, and the multiple computing nodes can be divided into multiple network domains according to the node addresses of each computing node. The number of computing nodes included in different network domains can be the same or different. In a possible case, the number of computing nodes included in the network domain is between 32 and 512. By controlling the number of computing nodes included in the network domain, the network domain scale is controlled to avoid the complexity of operations caused by a complex network domain structure. The above network domain can be called a subnet in some cases. The cluster can be a high performance computing (HPC) cluster (such as a Slurm cluster), or can also be a container orchestration system (such as a K8s cluster), etc.
[0057] In a possible implementation manner, the multiple computing nodes can communicate with each other for data processing. For example, the computing nodes within the same network domain communicate through a layer - 2 switch, while the computing nodes between different network domains communicate through a layer - 3 router. In addition, since the computing nodes need to communicate through a proxy node during the interaction with the management node. For example Figure 4 shown Figure 4The blank oval in the middle represents the computing nodes. A communication connection is established between the computing nodes and the proxy nodes, and a communication connection is established between the proxy nodes and the management nodes. The communication between the management nodes and the computing nodes is implemented based on the proxy nodes. Therefore, each computing node in the network domain will set up the proxy nodes, that is, determine whether a node is a proxy node. Since the setting processes of different computing nodes are similar, next, take any computing node, that is, the first node as an example for illustration.
[0058] Exemplarily, the process for the first node to obtain the proxy priorities of multiple computing nodes includes but is not limited to: the first node obtains the node identifiers of multiple computing nodes in the network domain; sorts the node identifiers of the multiple computing nodes, and determines the proxy priorities of the multiple computing nodes according to the sorting result. Among them, the multiple computing nodes include the first node and the second node, and the second node is a computing node different from the first node in the network domain. Taking the computing node A in Figure 2 as an example, the second node is Figure 2 computing node B, computing node C, computing node D, computing node E, etc. in. Optionally, for any second node, the process for the first node to obtain the node identifier of any second node includes: the first node receives the first heartbeat information broadcast by any second node according to the first period, and the first heartbeat information includes the node identifier of any second node; parses the first heartbeat information, and determines the node identifier of any second node according to the parsing result.
[0059] In a possible case, each computing node in the network domain broadcasts the first heartbeat information to each other so that other computing nodes can count the computing nodes included in the network domain according to the received first heartbeat information. Among them, broadcasting the first heartbeat information means sending the first heartbeat information to multiple computing nodes included in the network domain, and the multiple computing nodes can be other computing nodes in the network domain except the broadcasting computing node. Taking the first node broadcasting the first heartbeat information as an example, the destination address of the first heartbeat information is all 1 in binary, or other addresses indicating sending to all computing nodes. The first node sends the first heartbeat information through the network, and the network copies and forwards the first heartbeat information to send the first heartbeat information to the second node. Next, take the first node as an example to introduce the process of broadcasting the first heartbeat information. In a possible case, the first node sets the node state to the initial (init) state, and this init state indicates that the proxy node election is currently in progress. Based on the node state being the init state, the first node broadcasts the first heartbeat information in the network domain so that the second nodes in this network domain receive the first heartbeat information. Exemplarily, the first node broadcasts the first heartbeat information according to the first period, and the first period can be any time set according to experience, such as 1 second (s), and the first heartbeat information includes the node identifier of the first node.
[0060] The second node can also broadcast the first heartbeat information based on a similar operation to that of the first node. The first node parses the received first heartbeat information to obtain the node identifier included in the first heartbeat information. The node identifier can be a hostname, or other information used to identify a computing node, including but not limited to the identity document (ID) of the computing node and the node address, etc. The node address is, for example, an Internet Protocol (IP) address and a Media Access Control (MAC) address, etc.
[0061] The first node can count the first heartbeat information received within the first time period, determine the second nodes included in the network domain, and determine the node identifiers of each second node according to the node identifiers included in the first heartbeat information. The first time period can be any duration set according to experience, such as 3s. The first node will also obtain the node identifier of the first node. The obtaining process is, for example, accessing the storage space of the first node to obtain the node identifier of the first node. In addition, the first node can obtain the node identifier before setting whether the first node is an agent node, or can obtain the node identifier before broadcasting the first heartbeat information to the second node, so as to broadcast the first heartbeat information including the node identifier.
[0062] Regardless of when the first node obtains the node identifier of the first node, the first node can use the obtained node identifiers of the second nodes and the node identifier of the first node as the node identifiers of multiple computing nodes in the network domain, sort the node identifiers of the multiple computing nodes to obtain a sorting result, and determine the proxy priority of the first node according to the sorting result.
[0063] The first node can sort the multiple node identifiers based on any rule. For example, sort them in order according to the characters included in the node identifier. Taking the node identifiers of multiple computing nodes as Node B, Node D, Node C, and Node A as an example, the sorting result obtained by sorting in order according to the characters A, B, C, and D included in the node identifier is Node A, Node B, Node C, and Node D. Optionally, the first node can also sort them in order according to the numbers included in the node identifier, etc. Taking the node identifiers of multiple computing nodes as Node 1, Node 2, Node 3, Node 4, and Node 5 as an example, the sorting result obtained by sorting in order according to the numbers 1, 2, 3, 4, and 5 included in the node identifier is Node 1, Node 2, Node 3, Node 4, and Node 5. For the case where the first node is any computing node, that is, each computing node in the network domain needs to obtain the node identifiers of multiple computing nodes in the network domain and sort them according to the node identifiers, different computing nodes sort according to the same rule during the process of sorting the node identifiers. The same rule is, for example, sorting in order according to the characters included in the node identifier.
[0064] In a possible scenario, after the first node obtains the sorting result, it can determine the proxy priorities of multiple computing nodes according to the sorting result. The sorting result can be positively correlated with the proxy priority. The higher the proxy priority of the computing node with a more forward sorting, for example, the proxy priority of node A in the above embodiment is higher than that of node B. The sorting result can also be negatively correlated with the proxy priority. The higher the proxy priority of the computing node with a more backward sorting, for example, the proxy priority of node D in the above embodiment is higher than that of node C.
[0065] After the first node obtains the proxy priorities of multiple computing nodes, it can determine the proxy order value corresponding to the first node according to the proxy priorities of the multiple computing nodes; compare the proxy order value with the first quantity, and determine the setting result according to the comparison result. For example, in the case where the proxy order value is not greater than the first quantity, set the first node as the proxy node, or, in the case where the proxy order value is greater than the first quantity, set the first node as a non-proxy node. Among them, the proxy order value indicates which computing node the first node is when selecting proxy nodes among multiple computing nodes. Since the proxy priority indicates the priority of setting a computing node as a proxy node, the higher the proxy priority of a computing node, the more forward its proxy order value. The first node can arrange the multiple computing nodes in descending order of proxy priority and determine the serial number of the first node in the arrangement as the proxy order value. Taking the sorting result of proxy priorities including node A, node B, node C, node D, and node E as an example, when the first node is node A, the proxy order value corresponding to the first node is 1, and when the first node is node D, the proxy order value corresponding to the first node is 4.
[0066] After the first node determines the proxy order value, it can compare the size of the proxy order value with the first quantity. Among them, the first quantity indicates the number of proxy nodes to be set in the network domain, that is, the number of proxy nodes to be selected. The first quantity can be a fixed value set according to experience. For example, the first quantity of proxy nodes in any network domain is 2 set based on experience, as Figure 2 shown. The first quantity can also be an empirical value set according to the number of computing nodes included in the network domain. For example, determine the first quantity according to the number of computing nodes included in the network domain and the proxy ratio. The proxy ratio is an empirical value indicating the proportion of proxy nodes among multiple computing nodes. The proxy ratio is, for example, 1 / 32. Taking the number of computing nodes included in the network domain as 128 as an example, the first quantity is 128×1 / 32 = 4. In this case, the number of proxy nodes included in different network domains can be the same or different.
[0067] After the first node obtains the first quantity, it compares the proxy order value of the first node with the first quantity. If the proxy order value is greater than the first quantity, it indicates that the proxy priority of the first node is low, and the first node is set as a non-proxy node. Taking the first node as node D in the above embodiment, the proxy order is 4, and the first quantity is 3 as an example. Since only three proxy nodes need to be set in the network domain, and the proxy priorities of node A, node B, and node C are all higher than that of node D, therefore, node A, node B, and node C are set as proxy nodes, and node D is set as a non-proxy node. If the proxy order value of the first node is not greater than the first quantity, it indicates that the priority of the first node is high, and the first node can be set as a proxy node. Continuing with the example where the first quantity is 3, when the first node is node A in the above embodiment, since the proxy order value of node A is 1, which is the computing node with the highest proxy priority among multiple computing nodes, therefore, node A is preferentially set as a proxy node.
[0068] In a possible case, the first node sets itself as a proxy node or a non-proxy node by adjusting the node state of the first node. The first node adjusts the node state to the leader state to set itself as a proxy node, and the first node adjusts the node state to the follower state to set itself as a non-proxy node. Among them, the leader state indicates that the computing node executes the proxy service, that is, it is responsible for the communication between the computing node and the management node. The follower state indicates that the computing node is an ordinary node that does not need to execute the proxy service, that is, it is used to receive information sent by the proxy node or send information to the proxy node to achieve communication with the management node.
[0069] S302. Obtain the setting results of each of at least one second node. The second node is a computing node in the network domain that is different from the first node, and the setting result of the second node indicates whether the second node is set as a proxy node.
[0070] In a possible implementation, other computing nodes in the network domain, that is, each second node except the first node, also set whether to be a proxy node according to the proxy priorities of multiple computing nodes to obtain a setting result. In a possible case, each computing node also exchanges its setting results with each other, that is, the first node obtains the setting results of the second nodes. Taking any second node as an example, the process for the first node to obtain the setting results includes but is not limited to: receiving the second heartbeat information sent by any second node, where the second heartbeat information of any second node includes the setting result of any second node; parsing the second heartbeat information and determining the setting result of any second node according to the parsing result. Each second node in the network domain broadcasts the second heartbeat information so that the first node that receives the second heartbeat information determines that the second node corresponding to the second heartbeat information is operating normally, thereby realizing the operation detection of the second node. Moreover, the second heartbeat information includes the setting result of the second node, and the first node that receives the second heartbeat information can parse the received second heartbeat information and extract the setting result carried in the second heartbeat information.
[0071] Optionally, the way for the second node to broadcast the second heartbeat information is related to whether the second node is set as a proxy node. When the second node is set as a proxy node, the second node broadcasts the second heartbeat information according to the second period, while when the second node is set as a non-proxy node, the second node broadcasts the second heartbeat information according to the third period, and the second period is shorter than the third period. For the second node set as a proxy node, since the second node undertakes the proxy service of the network domain, in the case of an abnormality of this second node, it needs to be processed in time to avoid affecting the communication between the computing node and the management node. Therefore, the second period of the second node set as a proxy node needs to be shorter than the third period of the second node set as a non-proxy node to realize the timely detection of the operation status of the second node set as a proxy node.
[0072] Exemplarily, the second period and the third period can be any duration set according to experience. The second period can be 1 s, and the third period can be any duration longer than the second period, such as 3 s and 10 s. In addition, the third periods of multiple computing nodes set as non-agent nodes can be the same or different. For example, the second node set as a non-agent node can be further divided into a candidate node and a reference node according to the agent priority. The agent priority of the candidate node is higher than that of the reference node. The candidate node is used to be set as an agent node to carry the agent service when the second node set as an agent node runs abnormally. The embodiment of the present application does not limit the division process of the candidate node and the reference node, which can be determined according to the candidate number set based on experience. Determine the difference between the corresponding agent order and the first number of the second node set as a non-agent node, compare the size of the difference and the candidate number. When the difference is not greater than the candidate number, determine that the second node is a candidate node with a high agent priority. When the difference is greater than the candidate number, determine that the second node is a reference node with a low agent priority. Taking the candidate number as 2, the agent order of the second node set as a non-agent node as 5, and the first number as 4 as an example, the difference of the second node is 5 minus 4 equals 1, which is less than the candidate number 2. Therefore, the second node belongs to the candidate node.
[0073] Since it is necessary to preferentially select a computing node from candidate nodes to be set as an agent node to execute the agent service of the network domain when the computing node set as an agent node runs abnormally, it is also necessary to detect the running state of the candidate node, that is, the detection timeliness of the candidate node is higher than that of the reference node. Exemplarily, for the case where the third period includes a first sub-period and a second sub-period, when the second node set as a non-agent node is a candidate node, the second node broadcasts the second heartbeat information according to the first sub-period. When the second node set as a non-agent node is a reference node, the second node broadcasts the second heartbeat information according to the second sub-period. The first sub-period is shorter than the second sub-period. The first sub-period is, for example, 3 s, and the second sub-period is, for example, 10 s.
[0074] In a possible scenario, in addition to receiving the second heartbeat information broadcast by the second node, the first node also broadcasts third heartbeat information to the second node. The third heartbeat information includes the setting result of the first node, so that the second node that receives the third heartbeat information can determine the setting result of the first node. Similar to the broadcast process of the second node, the period of the first node broadcasting the third heartbeat information is also related to the setting result of the first node. For example, when the setting result indicates that the first node is set as an agent node, the first node broadcasts its third heartbeat information to multiple second nodes in the network domain according to the second period. Or, when the setting result indicates that the first node is set as a non-agent node, the first node broadcasts its third heartbeat information to multiple second nodes in the network domain according to the third period.
[0075] Exemplarily, after determining the setting result, each computing node in the network domain will operate according to the setting result. Taking the first node as an example, when the setting result indicates that the first node is an agent node, it executes the proxy service of the network domain. Among them, executing the proxy service of the network domain is, for example, responsible for the communication between the management node in the network domain and the computing nodes set as non-agent nodes. For example, it receives the task information sent by the management node and sends the task information to the computing nodes set as non-agent nodes respectively.
[0076] S303, select at least one agent node from multiple computing nodes according to the obtained setting results of the multiple computing nodes.
[0077] Exemplarily, the setting results of multiple computing nodes obtained by the first node are the setting results sent by the second node and the setting result of the first node. For example, the setting result of the second node is carried by the second heartbeat information, and the second heartbeat information is the information broadcast by the second node when it is running normally. If the first node receives the second heartbeat information broadcast by the second node, it means that the second node is running normally. If the first node does not receive the second heartbeat information broadcast by the second node, it means that the second node is running abnormally. Therefore, the first node can obtain the setting result of the second node according to the received second heartbeat information, and the computing nodes corresponding to the obtained multiple setting results are the computing nodes running normally. The first node selects an agent node that can carry the proxy service from the multiple computing nodes corresponding to the obtained multiple setting results, so as to avoid selecting a computing node with abnormal operation as the agent node, resulting in the failure of the election.
[0078] Among them, the multiple computing nodes referred to by the first node for selecting a proxy node can be the same as the multiple computing nodes referred to during the process of determining the setting result in S301. For example, the second node includes the second node A, the second node B, the second node C, the second node D, and the second node E. The first node receives the first heartbeat information of the second node A, the second node B, the second node C, the second node D, and the second node E. In this case, the computing nodes referred to by the first node for determining the setting result of the first node are the first node, the second node A, the second node B, the second node C, the second node D, and the second node E. After that, the first node receives the second heartbeat information of the second node A, the second node B, the second node C, the second node D, and the second node E. In this case, the multiple computing nodes referred to by the first node for selecting a proxy node are also the first node, the second node A, the second node B, the second node C, the second node D, and the second node E.
[0079] The multiple computing nodes referred to by the first node for selecting a proxy node can also be different from the multiple computing nodes referred to during the process of determining the setting result in S301. Continuing with the example where the second node includes the second node A, the second node B, the second node C, the second node D, and the second node E, and the computing nodes referred to by the first node for determining the setting result of the first node are the first node, the second node A, the second node B, the second node C, the second node D, and the second node E. Since the second node A fails and cannot broadcast the second heartbeat information normally, the first node receives the second heartbeat information of the second node B, the second node C, the second node D, and the second node E, and obtains the setting results of the second node B, the second node C, the second node D, and the second node E. In this case, the computing nodes referred to by the first node during the process of selecting a proxy node are the first node, the second node B, the second node C, the second node D, and the second node E.
[0080] Regardless of the above situations of the multiple computing nodes, the first node can select a proxy node from the multiple computing nodes according to the setting results of each computing node. Exemplarily, the first node determines the second quantity of the computing nodes set as proxy nodes according to the setting results of the multiple computing nodes; and selects at least one proxy node from the computing nodes set as proxy nodes according to the second quantity and the first quantity.
[0081] After obtaining multiple setting results, the first node may count the number of computing nodes whose setting results indicate being set as proxy nodes as the second quantity. The first node may also count the second quantity during the process of obtaining the setting results. Exemplarily, the first node parses the received second heartbeat information. When the parsing result indicates that the second node is set as a proxy node, the first node writes the node identifier of the second node into the proxy set. For the case where the first node is also set as a proxy node, the first node will also write the node identifier of the first node into the proxy set. After that, the first node can count the number of computing nodes included in the proxy set to obtain the second quantity of computing nodes set as proxy nodes in the network domain. The proxy set can be a list or other data structures, and in some cases, the proxy set can be referred to as a leader list or a leader set.
[0082] In a possible case, the process of the first node selecting proxy nodes according to the second quantity and the first quantity includes: when the second quantity is greater than the first quantity, obtaining the proxy priorities of the computing nodes set as proxy nodes, and determining the computing nodes with proxy priorities not greater than the first quantity as proxy nodes to obtain the first quantity of proxy nodes; or, when the second quantity is less than the first quantity, determining the computing nodes set as proxy nodes as proxy nodes, and selecting computing nodes as proxy nodes from the computing nodes set as non - proxy nodes according to the proxy priorities of the computing nodes set as non - proxy nodes to obtain the first quantity of proxy nodes.
[0083] In a possible implementation manner, there will be a case where the second quantity is greater than the first quantity. Taking the first quantity as 2 as an example, computing node A receives the first heartbeat information of computing nodes B, C, and D within the first time period. According to the sorting result, the proxy order of computing node A is determined to be 1. Since 1 is less than 2, computing node A sets itself as a proxy node. Computing node B receives the first heartbeat information of computing nodes A and D within the first time period. According to the sorting result, the proxy order of computing node B is determined to be 2, which is not greater than the first quantity 2, so computing node B sets itself as a proxy node. Since the first heartbeat information broadcast between computing node B and computing node C does not arrive within the first time period, computing node C receives the first heartbeat information of computing nodes A and D within the first time period. The sorting result obtained by computing node C is computing nodes A, C, and D, and the corresponding proxy order of the computing nodes is 2, which is not greater than the first quantity 2, so computing node C sets itself as a proxy node. In this case, there are three computing nodes set as proxy nodes in the network domain, and the second quantity is equal to 3, which is greater than the first quantity 2.
[0084] When the second quantity of computing nodes set as proxy nodes is greater than the first quantity, the first node elects the computing nodes set as proxy nodes, thereby controlling the quantity of computing nodes that execute proxy services in the network domain. The first node sorts the computing nodes set as proxy nodes in descending order according to the proxy priority. Continuing with the example in the above embodiment where computing node A, computing node B, and computing node C are set as proxy nodes, the sorting result is computing node A, computing node B, and computing node C. After that, the first node selects the first quantity of computing nodes from the sorting result as proxy nodes. The first quantity means the first 2, and the selected proxy nodes are computing node A and computing node B.
[0085] Exemplarily, the above sorting process can be executed separately or during the process of counting the computing nodes set as proxy nodes. For example, when the first node writes the node identifiers of the computing nodes set as proxy nodes into the proxy set, it can be written in descending order according to the proxy priority of each computing node. This proxy set is also the sorting result of the proxy priorities of the computing nodes set as proxy nodes. In this case, the process for the first node to select proxy nodes can be to remove the computing nodes with a proxy priority greater than the first quantity from the proxy set. For example, delete the node identifier of computing node C written in the proxy set. In addition, the computing nodes set as proxy nodes can include the first node. For example, the first node is computing node A, or may not include the first node. For example, the first node is computing node D. That is, regardless of whether the first node is set as a proxy node, proxy node selection will be performed.
[0086] For the case where the first node is set as a proxy node, but the first quantity of proxy nodes selected later does not include the first node. For example, the first node is computing node C in the above embodiment. After the first node selects proxy nodes, it will re-determine the setting result, set the first node from a proxy node to a non-proxy node, that is, adjust the node state from the leader state to the follower state.
[0087] In a possible implementation, the second quantity of computing nodes set as proxy nodes in the network domain may also be less than the first quantity. Taking the first quantity as 4 as an example, the computing nodes in the network domain are computing node 1, computing node 2, computing node 3, computing node 4, computing node 5... computing node 32. Among them, computing node 1, computing node 2, computing node 3, and computing node 4 are set as proxy nodes, and computing node 5... computing node 32 are set as non-proxy nodes. During operation, computing node 2 and computing node 3 fail, and the communication links with other computing nodes are disconnected, and they cannot continue to broadcast the second heartbeat information to other computing nodes. Based on not receiving the second heartbeat information of computing node 2 and computing node 3 within the time threshold, computing node 1, as the first node, deletes the node identifiers of computing node 2 and computing node 3 in the proxy set. The time threshold can be set based on experience. Taking the second period broadcast by the computing nodes set as proxy nodes as 1 s as an example, the time threshold can be any value not less than the second period. For example, based on experience, the time threshold is set to 1 s or 2 s, etc.
[0088] Due to the failures of computing node 2 and computing node 3, in this case, the computing nodes set as proxy nodes counted by computing node 1, as the first node, include computing node 1 and computing node 4, and the second quantity is equal to 2, which is less than the first quantity 4. Since the proxy nodes are set for each computing node according to the proxy priority of the computing node in the network domain, the proxy priority of the computing nodes set as proxy nodes is higher than that of the computing nodes set as non-proxy nodes. Based on this, the first node first determines the computing nodes set as proxy nodes as proxy nodes. Also, since the second quantity of the computing nodes currently set as proxy nodes is less than the first quantity, the first node also needs to select computing nodes from the computing nodes set as non-proxy nodes as proxy nodes so that the quantity of proxy nodes in the network domain meets the first quantity.
[0089] Exemplarily, the first node can also be sorted in descending order according to the proxy priority of each computing node set as a non-proxy node. Similar to the process of determining the sorting result of the proxy priority of the computing nodes set as proxy nodes, the first node can perform the sorting of the proxy priority during the process of determining the computing nodes set as non-proxy nodes. For example, the first node also maintains a non-proxy set. When the setting result of any second node is a non-proxy node, the first node writes the node identifier of the any second node into the non-proxy set, and writes it in descending order of the proxy priority during the writing process. The non-proxy set can be called a follower set or a follower list in some cases.
[0090] In a possible scenario, after obtaining the sorting result of the computing nodes set as non-proxy nodes, the first node can determine the candidate order of each computing node set as a non-proxy node according to the sorting result. When the candidate order is not greater than the difference between the second quantity and the first quantity, the computing node corresponding to the candidate order is determined as a proxy node. Taking the first quantity as 4 and the second quantity as 2 in the above embodiment as an example, the difference is 4 minus 2 which equals 2. As the computing node 1, which is any computing node, determines the candidate order of computing nodes 5... computing node 32, where the candidate of computing node 5 is 1, the candidate order of computing node 6 is 2, the candidate order of computing node 7 is 3..., since the difference between the second quantity and the first quantity is 2, computing node 1 selects computing node 5 and computing node 6 as proxy nodes, and the first quantity of proxy nodes obtained are computing node 1, computing node 4, computing node 5, and computing node 6 respectively. Optionally, for the case where the second quantity is equal to the first quantity, the first node determines the computing nodes set as proxy nodes in the network domain as proxy nodes.
[0091] Since each computing node in the network domain will execute the above method for determining proxy nodes, and the proxy priorities followed by each computing node during the selection of proxy nodes are determined according to the same rules, the proxy nodes selected by multiple computing nodes are the same. That is, for the computing node whose selection result of the proxy node by the first node indicates that the setting result needs to be adjusted, even if the first node does not send an adjustment instruction, this computing node can adjust the setting result according to the selected proxy node. Taking the computing node 5 in the above embodiment as the computing node that needs to adjust the setting result as an example, since computing nodes 2 and 3 have operating failures, computing node 5 cannot receive the second heartbeat information broadcast by computing nodes 2 and 3 either. Therefore, when computing node 5 determines that the candidate order of computing node 5 is less than the difference between the second quantity and the first quantity, it will set computing node 5 as a proxy node.
[0092] The embodiments of the present application do not limit the at least one proxy node selected by each computing node. The at least one proxy node selected by different computing nodes may be the same or different. For example, the failures of computing node 2 and computing node 3 in the above embodiments belong to partial node failures, that is, there are some computing nodes in the network domain that can receive the second heartbeat information broadcast by computing node 2 and computing node 3, and there are also some computing nodes that cannot receive the second heartbeat information broadcast by computing node 2 and computing node 3. In this case, the proxy nodes selected by the computing nodes that receive the second heartbeat information broadcast by computing node 2 and computing node 3 are different from the proxy nodes selected by the computing nodes that do not receive the second heartbeat information broadcast by computing node 2 and computing node 3. Since each computing node in the network domain continuously monitors the number of proxy nodes in the network domain according to the received heartbeat information and adjusts in a timely manner according to the monitoring results, for the case where there are differences in the proxy nodes selected by multiple computing nodes, the computing nodes will adjust in a timely manner according to the broadcast heartbeat information in the subsequent process, that is, the duration of the differences in the proxy nodes selected by different computing nodes is short, the impact on the data processing services of the computing nodes is small, and the reliability is high.
[0093] In a possible implementation manner, after the first node selects a proxy node, it may send the selection result of the proxy node. For example, the first node sends the selection result to the computing node selected as the proxy node so that the computing node checks whether it has been set as the proxy node to ensure the smooth execution of the proxy service. For example, as the first node, computing node 7 sends the selection result to computing node 1, and computing node 1 then checks whether its node status is the leader status according to the received selection result. In addition, the first node may also send the selection result to the computing node with a device result change so that the computing node adjusts the setting result in a timely manner according to the received selection result. The setting result change may be from a proxy node to a non-proxy node, such as computing node 2 in the above embodiments, or from a non-proxy node to a computing node, such as computing node 5 in the above embodiments.
[0094] Exemplarily, the first node may also send the selection result to a supervision device, which is used to supervise the selection of proxy nodes in the network domain. The supervision device counts the proxy nodes selected by different computing nodes to determine whether there is a node anomaly based on the selection result of the proxy nodes. The supervision device is, for example, a terminal operated by an operation and maintenance personnel, or a server connected to multiple computing nodes, etc. Since multiple computing nodes select proxy nodes according to a unified rule, when the computing nodes are operating normally, the proxy nodes selected by multiple computing nodes will also be the same. Therefore, the supervision device can determine that there is an abnormal operation of a computing node in the network domain when the selection results are different based on the selection results of different computing nodes, and determine the abnormal computing node according to the selection result. For example, in the above embodiment, computing node 2 and computing node 3 are in the case of partial node failures. The supervision device can further detect the operation conditions of computing node 2 and computing node 3 based on that the selection results of the proxy nodes of some computing nodes include computing node 2 and computing node 3, and the selection results of the proxy nodes of some computing nodes do not include computing node 2 and computing node 3, determine that computing node 2 and computing node 3 are operating failures, and deactivate them in time.
[0095] In a possible case, the first node may execute the steps of S302 - S303 within a second time period, that is, the first node receives the second heartbeat information broadcast by the second node within the second time period and performs the selection of the proxy node. The second time period can be any duration set based on experience, such as one day. The first node may also continuously execute the steps of S302 - S303. Continuously executing can be understood as regularly executing the steps of S302 - S303 during the operation of multiple computing nodes included in the network domain, regularly broadcasting heartbeat information to each other, and counting the computing nodes set as proxy nodes in the network domain to make timely adjustments when the number of computing nodes set as proxy nodes is more or less.
[0096] Figure 5 This is a schematic diagram for adjusting the node state provided by the embodiment of the present application, showing the situation where multiple computing nodes in the network domain continuously execute S302 - S303. Figure 5In it, each computing node is set to the init state to broadcast the first heartbeat information. After the first period, that is, after the init state times out, each computing node determines whether to be set as a proxy node according to the obtained first heartbeat information, that is, adjusts the node state from the init state to the follower state or the leader state. After the setting is completed, each computing node counts the second quantity of the computing nodes set to the leader state and compares it with the first quantity. In the case where the second quantity is greater than the first quantity, the computing node with a lower proxy priority set to the leader state adjusts its node state from the leader state to the follower state. In the case where the second quantity is less than the first quantity, the computing node with a higher proxy priority set to the follower state adjusts its node state from the follower state to the leader state. Moreover, the computing node can also periodically restart the operations of S301 - S303, that is, as Figure 5 shown, restore the node state to the init state, start broadcasting the first heartbeat information, and select the proxy node.
[0097] Exemplarily, in the case where at least one proxy node selected for the first node does not include the first node, the first node can select a proxy node for carrying the proxy service from at least one proxy node, that is, the proxy node responsible for the communication between the first node and the management node. The first node can select randomly or calculate the proxy node through the consistent hashing algorithm.
[0098] In summary, the method for determining the proxy node provided by the embodiment of the present application realizes the selection of the proxy node through the interaction between computing nodes, with low operation complexity, without the need for other devices, simplifies the network domain configuration, and can proceed smoothly even when the number of computing nodes included in the network domain is large, effectively eliminating the communication bottleneck between computing nodes, and can be applied to any network domain, and can select any number of proxy nodes such as one or more, with high flexibility. After determining the proxy node, it is also possible to detect the running status of the proxy node by broadcasting heartbeat information, so as to make timely adjustments in the case where the number of computing nodes set as proxy nodes in the network domain is too large or too small, so as to ensure the communication quality between multiple computing nodes and the management node in the network domain.
[0099] The method for determining the proxy node in the embodiment of the present application is introduced above. Corresponding to the above method, the embodiment of the present application also provides a device for determining the proxy node. Figure 6 is a schematic structural diagram of a device for determining a proxy node provided by an embodiment of the present application. Based on Figure 6 the following multiple modules shown, the Figure 6 shown device for determining the proxy node can execute the above Figure 3All or part of the operations shown. It should be understood that the device may include more additional modules than the modules shown or omit some of the modules shown, and the embodiments of the present application do not limit this. As Figure 6 As shown, the device is applied to a first node, and the device includes:
[0100] A processing module 601, configured to obtain the proxy priorities of multiple computing nodes in a network domain, determine a setting result of the first node according to the proxy priorities of the multiple computing nodes, where the first node is any one of the multiple computing nodes, the proxy priority indicates the priority of setting a computing node as a proxy node, and the setting result of the first node indicates whether the first node is set as a proxy node;
[0101] A transceiver module 602, configured to obtain the setting results of each second node in at least one second node, where the second node is a computing node different from the first node in the network domain, and the setting result of the second node indicates whether the second node is set as a proxy node;
[0102] The processing module 601 is further configured to select at least one proxy node from the multiple computing nodes according to the obtained setting results of the multiple computing nodes.
[0103] In a possible implementation manner, the processing module 601 is configured to obtain the node identifiers of multiple computing nodes in a network domain; sort the node identifiers of the multiple computing nodes, and determine the proxy priorities of the multiple computing nodes according to the sorting result.
[0104] In a possible implementation manner, the processing module 601 is configured to, for any second node, receive first heartbeat information broadcast by any second node at a first period, where the first heartbeat information includes the node identifier of any second node; parse the first heartbeat information, and determine the node identifier of any second node according to the parsing result.
[0105] In a possible implementation manner, the processing module 601 is configured to determine a proxy order value corresponding to the first node according to the proxy priorities of the multiple computing nodes; compare the proxy order value corresponding to the first node with a first quantity, where the first quantity indicates the number of proxy nodes to be selected; in the case that the proxy order value is not greater than the first quantity, set the first node as a proxy node to obtain the setting result of the first node, or, in the case that the proxy order value is greater than the first quantity, set the first node as a non-proxy node to obtain the setting result of the first node.
[0106] In a possible implementation manner, the transceiver module 602 is configured to, for any second node, receive second heartbeat information sent by any second node, where the second heartbeat information of any second node includes the setting result of any second node; parse the second heartbeat information, and determine the setting result of any second node according to the parsing result.
[0107] In a possible implementation, when the second node is set as the proxy node, the second node broadcasts the second heartbeat information according to the second period, or when the second node is set as a non-proxy node, the second node broadcasts the second heartbeat information according to the third period, and the second period is shorter than the third period.
[0108] In a possible implementation, when the second node set as a non-proxy node is a candidate node, the second node broadcasts the second heartbeat information according to the first sub-period included in the third period, or when the second node set as a non-proxy node is a reference node, the second node broadcasts the second heartbeat information according to the second sub-period included in the third period. The proxy priority of the candidate node is higher than that of the reference node, and the first sub-period is shorter than the second sub-period.
[0109] In a possible implementation, the processing module 601 is configured to determine the second quantity of the computing nodes set as proxy nodes according to the setting results of multiple computing nodes; select at least one proxy node from the computing nodes set as proxy nodes according to the second quantity and the first quantity, where the first quantity indicates the number of proxy nodes to be selected.
[0110] In a possible implementation, the processing module 601 is configured to, when the second quantity is greater than the first quantity, obtain the proxy priorities of the computing nodes set as proxy nodes, and determine the computing nodes with proxy priorities not greater than the first quantity as proxy nodes to obtain the first quantity of proxy nodes; or, when the second quantity is less than the first quantity, determine the computing nodes set as proxy nodes as proxy nodes, and select computing nodes from the computing nodes set as non-proxy nodes as proxy nodes according to the proxy priorities of the computing nodes set as non-proxy nodes to obtain the first quantity of proxy nodes.
[0111] In a possible implementation, the processing module 601 is further configured to execute the proxy service of the network domain when the setting result indicates that the first node is set as the proxy node.
[0112] In a possible implementation, the transceiver module 602 is further configured to, when the setting result indicates that the first node is set as the proxy node, broadcast the third heartbeat information of the first node to multiple second nodes in the network domain according to the second period, where the third heartbeat information includes the setting result of the first node; or, when the setting result indicates that the first node is set as a non-proxy node, broadcast the third heartbeat information of the first node to multiple second nodes in the network domain according to the third period, and the second period is shorter than the third period.
[0113] After determining the setting result, the above device will also obtain the setting results of other computing nodes, select proxy nodes based on the setting results, and the self-election of the proxy nodes of the network domain can be achieved through the computing nodes included in the network domain, with low operation complexity and high determination efficiency. The above method for determining proxy nodes can be applied to any network domain, and can select any number of proxy nodes, such as one or more, with high flexibility and wide generality.
[0114] It should be understood that when the above Figure 6 provided device realizes its functions, only the above division of each functional module is used for illustration. In actual applications, the above functions can be allocated to different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device provided in the above embodiment and the method embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment and will not be repeated here.
[0115] See Figure 7 , Figure 7 shows a schematic structural diagram of a network device 700 provided by an exemplary embodiment of the present application. Figure 7 The network device 700 shown is used to execute the operations involved in the above Figure 3 shown method for determining proxy nodes. The network device 700 is, for example, a switch, a router, etc., and the network device 700 can be implemented by a general bus architecture.
[0116] As Figure 7 shown, the network device 700 includes at least one processor 701, a memory 703, and at least one communication interface 704.
[0117] The processor 701 is, for example, a general-purpose central processing unit (CPU), a digital signal processor (DSP), a network processor (NP), a graphics processing unit (GPU), a neural-network processing unit (NPU), a data processing unit (DPU), a microprocessor, or one or more integrated circuits for implementing the solution of this application. For example, the processor 701 includes an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. The PLD is, for example, a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof. It can implement or execute various logic blocks, modules, and circuits described in connection with the disclosed content of the embodiments of this application. The processor can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and so on.
[0118] Optionally, the network device 700 further includes a bus. The bus is used to transfer information between the components of the network device 700. The bus can be a peripheral component interconnect (PCI) bus, an extended industry standard architecture (EISA) bus, or the like. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 only a thick line is shown in the figure, but it does not mean that there is only one bus or one type of bus.
[0119] The memory 703 is, for example, a read-only memory (ROM) or other type of static storage device that can store static information and instructions, or a random access memory (RAM) or other type of dynamic storage device that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 703 is, for example, independent and connected to the processor 701 via a bus. The memory 703 can also be integrated with the processor 701.
[0120] The communication interface 704 uses any device such as a transceiver to communicate with other devices or communication networks, which can be an Ethernet, a radio access network (RAN) or a wireless local area network (WLAN), etc. The communication interface 704 can include a wired communication interface and can also include a wireless communication interface. Specifically, the communication interface 704 can be an Ethernet interface, a fast ethernet (FE) interface, a gigabit ethernet (GE) interface, an asynchronous transfer mode (ATM) interface, a wireless local area network (WLAN) interface, a cellular network communication interface or a combination thereof. The Ethernet interface can be an optical interface, an electrical interface or a combination thereof. In the embodiments of the present application, the communication interface 704 can be used for the network device 700 to communicate with other devices.
[0121] In a specific implementation, as an embodiment, the processor 701 can include one or more CPUs, such as Figure 7 the CPU0 and CPU1 shown therein. Each of these processors can be a single-CPU processor or a multi-CPU processor. Here, the processor can refer to one or more devices, circuits, and / or processing cores for processing data (such as computer program instructions).
[0122] In a specific implementation, as an example, the network device 700 may include multiple processors, such as Figure 7 the processors 701 and 705 shown in Figure 7 . Each of these processors may be a single-core processor (single-CPU) or a multi-core processor (multi-CPU). The processors here may refer to one or more devices, circuits, and / or processing cores for processing data (such as computer program instructions).
[0123] In a specific implementation, as an example, the network device 700 may further include an output device and an input device. The output device communicates with the processor 701 and can display information in various ways. For example, the output device may be a liquid crystal display (LCD), a light emitting diode (LED) display device, a cathode ray tube (CRT) display device, or a projector, etc. The input device communicates with the processor 701 and can receive user input in various ways. For example, the input device may be a mouse, a keyboard, a touch screen device, or a sensing device, etc.
[0124] In some embodiments, the memory 703 is used to store the program code 710 for executing the solution of this application, and the processor 701 can execute the program code 710 stored in the memory 703. That is, the network device 700 can implement the method for determining the proxy node provided by the method embodiment through the processor 701 and the program code 710 in the memory 703. The program code 710 may include one or more software modules. Optionally, the processor 701 itself may also store the program code or instructions for executing the solution of this application.
[0125] In a specific embodiment, the network device 700 of the embodiment of this application may correspond to the computing device in each of the above method embodiments.
[0126] Among them, Figure 3 each step of the method for determining the proxy node shown in Figure 3 is completed by the integrated logic circuit in the hardware of the processor of the network device 700 or the instructions in software form. The steps of the method disclosed in combination with the embodiments of this application can be directly embodied as being executed and completed by the hardware processor, or executed and completed by the combination of the hardware and software modules in the processor. The software modules may be located in mature storage media in the art such as random access memory, flash memory, read-only memory, programmable read-only memory, or electrically erasable programmable memory, registers, etc. This storage medium is located in the memory, and the processor reads the information in the memory and combines its hardware to complete the steps of the above method. To avoid repetition, it will not be described in detail here.
[0127] Refer to Figure 8 , Figure 8 which shows a schematic structural diagram of a network device 800 provided by another exemplary embodiment of the present application. Figure 8 The network device 800 shown is used to perform all or part of the operations involved in the method for determining the proxy node shown above. Figure 3 The network device 800 is, for example, a switch, a router, etc., and the network device 800 can be implemented by a general bus architecture.
[0128] As Figure 8 shown, the network device 800 includes: a main control board 810 and an interface board 830.
[0129] The main control board is also called a main processing unit (MPU) or a route processor card. The main control board 810 is used for controlling and managing each component in the network device 800, including routing calculation, device management, device maintenance, and protocol processing functions. The main control board 810 includes: a central processing unit 811 and a memory 812.
[0130] The interface board 830 is also called a line processing unit (LPU), a line card, or a service board. The interface board 830 is used to provide various service interfaces and implement packet forwarding. The service interfaces include, but are not limited to, Ethernet interfaces, POS (Packet over SONET / SDH) interfaces, etc. The Ethernet interface is, for example, a Flexible Ethernet Clients (FlexE Clients). The interface board 830 includes: a central processing unit 831, a network processor 832, a forwarding table entry memory 834, and a physical interface card (PIC) 833.
[0131] The central processing unit 831 on the interface board 830 is used to control and manage the interface board 830 and communicate with the central processing unit 811 on the main control board 810.
[0132] The network processor 832 is used to implement the forwarding processing of packets. The form of the network processor 832 can be a forwarding chip. The forwarding chip can be a network processor (NP). In some embodiments, the forwarding chip can be implemented by an application-specific integrated circuit (ASIC) or a field programmable gate array (FPGA). Specifically, the network processor 832 is used to forward the received packets based on the forwarding table entries stored in the forwarding table entry memory 834. If the destination address of the packet is the address of the network device 800, the packet is sent to the CPU (such as the central processor 831) for processing; if the destination address of the packet is not the address of the network device 8100, the next hop and output interface corresponding to the destination address are found from the forwarding table according to the destination address, and the packet is forwarded to the output interface corresponding to the destination address. Among them, the processing of the upstream packets can include: the processing of the packet input interface, the forwarding table lookup; the processing of the downstream packets can include: the forwarding table lookup, etc. In some embodiments, the central processor can also execute the functions of the forwarding chip, such as implementing software forwarding based on a general-purpose CPU, so that there is no need for a forwarding chip in the interface board.
[0133] The physical interface card 833 is used to implement the docking function at the physical layer. The original traffic enters the interface board 830 from here, and the processed packets are sent out from the physical interface card 833. The physical interface card 833 is also called a daughter card and can be installed on the interface board 830. It is responsible for converting optical and electrical signals into packets, performing a legality check on the packets, and then forwarding them to the network processor 832 for processing. In some embodiments, the central processor 831 can also execute the functions of the network processor 832, such as implementing software forwarding based on a general-purpose CPU, so that there is no need for the network processor 832 in the physical interface card 833.
[0134] Optionally, the network device 800 includes multiple interface boards. For example, the network device 800 further includes an interface board 840. The interface board 840 includes: a central processor 841, a network processor 842, a forwarding table entry memory 844, and a physical interface card 843. The functions and implementation manners of the components in the interface board 840 are the same as or similar to those of the interface board 830, and will not be described in detail here.
[0135] Optionally, the network device 800 further includes a switching fabric board 820. The switching fabric board 820 can also be called a switch fabric unit (SFU). In the case where the network device 800 has multiple interface boards, the switching fabric board 820 is used to complete the data exchange between the interface boards. For example, the interface board 830 and the interface board 840 can communicate through the switching fabric board 820.
[0136] The main control board 810 is coupled to the interface board. For example, the main control board 810, the interface board 830, the interface board 840, and the switching fabric board 820 are interconnected through a system bus and a system backplane. In a possible implementation, an inter-process communication (IPC) channel is established between the main control board 810 and the interface board 830 and the interface board 840, and the main control board 810 communicates with the interface board 830 and the interface board 840 through the IPC channel.
[0137] Logically, the network device 800 includes a control plane and a forwarding plane. The control plane includes the main control board 810 and the central processing unit 811. The forwarding plane includes various components that perform forwarding, such as the forwarding table entry memory 834, the physical interface card 833, and the network processor 832. The control plane performs functions such as acting as a router, generating a forwarding table, processing signaling and protocol messages, and configuring and maintaining the state of the network device. The control plane sends the generated forwarding table to the forwarding plane. In the forwarding plane, the network processor 832 looks up the table and forwards the packets received by the physical interface card 833 based on the forwarding table sent by the control plane. The forwarding table sent by the control plane can be stored in the forwarding table entry memory 834. In some embodiments, the control plane and the forwarding plane can be completely separated and not on the same network device.
[0138] It should be noted that there may be one or more main control boards. When there are multiple main control boards, they may include an active main control board and a standby main control board. There may be one or more interface boards. The stronger the data processing ability of the network device, the more interface boards are provided. There may also be one or more physical interface cards on the interface board. There may be no switching fabric board, or there may be one or more switching fabric boards. When there are multiple switching fabric boards, they can jointly achieve load sharing and redundancy backup. In a centralized forwarding architecture, the network device may not require a switching fabric board, and the interface board undertakes the function of processing the service data of the entire system. In a distributed forwarding architecture, the network device may have at least one switching fabric board, and data exchange between multiple interface boards is achieved through the switching fabric board, providing a large-capacity data exchange and processing ability. Therefore, the data access and processing ability of the network device in the distributed architecture is greater than that of the network device in the centralized architecture. Optionally, the form of the network device can also be a single board card, that is, there is no switching fabric board, and the functions of the interface board and the main control board are integrated on this single board card. At this time, the central processing unit on the interface board and the central processing unit on the main control board can be combined into one central processing unit on this single board card to execute the functions after the superposition of the two. The data exchange and processing ability of this form of network device is relatively low (for example, network devices such as low-end switches or routers). Which architecture is specifically adopted depends on the specific networking deployment scenario and is not limited here.
[0139] In a specific embodiment, the network device 800 corresponds to the aboveFigure 6 The determining device of the proxy node shown. In some embodiments, Figure 6 The processing module 601 in the determining device of the proxy node shown is equivalent to the central processing unit 811 or the network processor 832 in the network device 800.
[0140] The embodiment of the present application further provides a communication device, which includes: a transceiver, a memory, and a processor. Among them, the transceiver, the memory, and the processor communicate with each other through an internal connection path. The memory is used to store instructions, and the processor is used to execute the instructions stored in the memory to control the transceiver to receive signals and control the transceiver to send signals. And when the processor executes the instructions stored in the memory, the processor executes the method for determining the proxy node.
[0141] It should be understood that the above-mentioned processor can be a CPU, or other general-purpose processors, DSPs, ASICs, FPGAs or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc. It is worth noting that the processor can be a processor that supports the advanced RISC machines (ARM) architecture.
[0142] Further, in an alternative embodiment, the above-mentioned memory may include a read-only memory and a random access memory, and provide instructions and data to the processor. The memory may also include a non-volatile random access memory. For example, the memory may also store information about the device type.
[0143] The memory may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a ROM, a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an EEPROM, or a flash memory. The volatile memory may be a RAM, which is used as an external cache. By way of example but not limitation, many forms of RAM are available. For example, static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchlink dynamic random access memory (SLDRAM), and direct rambus random access memory (DR RAM).
[0144] An embodiment of the present application further provides a device for determining a proxy node. The device includes a processor configured to load and run at least one instruction, so that the device for determining a proxy node implements the method for determining a proxy node provided by the embodiment of the present application. Optionally, the device further includes a memory coupled to the processor, and the memory is configured to store at least one instruction.
[0145] An embodiment of the present application further provides a computer-readable storage medium storing at least one instruction, which is loaded and executed by a processor to enable a computer to implement the method for determining a proxy node as described in any one of the above.
[0146] An embodiment of the present application further provides a computer program (product), which, when executed by a computer, can cause the processor or the computer to execute the corresponding steps and / or processes in the above method embodiments.
[0147] An embodiment of the present application further provides a chip including a processor configured to call and run an instruction stored in a memory, so that a communication device installed with the chip executes the method for determining a proxy node as described in any one of the above.
[0148] An embodiment of the present application further provides another chip, including: an input interface, an output interface, a processor, and a memory. The input interface, the output interface, the processor, and the memory are connected through an internal connection path. The processor is configured to execute the code in the memory. When the code is executed, the processor is configured to execute the determination method of any one of the above-mentioned proxy nodes.
[0149] In the above embodiment, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the present application are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (such as coaxial cable, optical fiber, digital subscriber line) or wirelessly (such as infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that can be accessed by a computer, or a data storage device such as a server or data center that includes one or more integrated available media. The available medium may be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk).
[0150] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data for analysis, stored data, displayed data, etc.), and signals involved in the present application are all authorized by the user or fully authorized by all parties. The collection, use, and processing of relevant data need to comply with relevant laws, regulations, and standards in relevant countries and regions. For example, the setting results involved in the present application are obtained under full authorization.
[0151] Those of ordinary skill in the art can realize that, in combination with the method steps and modules described in the embodiments disclosed herein, they can be implemented in software, hardware, firmware, or any combination thereof. To clearly illustrate the interchangeability of hardware and software, the steps and components of each embodiment have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Those of ordinary skill in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.
[0152] Those of ordinary skill in the art can understand that all or part of the steps for implementing the above embodiments can be completed by hardware, or can be completed by a program instructing the relevant hardware. The program can be stored in a computer-readable storage medium, and the above-mentioned storage medium can be a read-only memory, a magnetic disk, an optical disk, or the like.
[0153] When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer program instructions. As an example, the method of the embodiments of this application can be described in the context of machine-executable instructions, such as program modules executed in devices included in a target real or virtual processor. Generally speaking, program modules include routines, programs, libraries, objects, classes, components, data structures, etc., which perform specific tasks or implement specific abstract data structures. In each embodiment, the functions of the program modules can be combined or divided among the described program modules. The machine-executable instructions for the program modules can be executed within a local or distributed device. In a distributed device, the program modules can be located in both local and remote storage media.
[0154] The computer program code for implementing the method of the embodiments of this application can be written in one or more programming languages. These computer program codes can be provided to the processor of a general-purpose computer, a special-purpose computer, or a determining device of other programmable agents, such that when the program code is executed by the computer or the determining device of other programmable agents, the functions / operations specified in the flowchart and / or block diagram are implemented. The program code can be executed entirely on the computer, partially on the computer, as an independent software package, partially on the computer and partially on a remote computer, or entirely on a remote computer or server.
[0155] In the context of the embodiments of this application, the computer program code or relevant data can be carried by any suitable carrier so that the device, apparatus, or processor can execute the various processes and operations described above. Examples of the carrier include signals, computer-readable media, and the like.
[0156] Examples of signals can include electrical, optical, radio, acoustic, or other forms of propagated signals, such as carrier waves, infrared signals, and the like.
[0157] A machine-readable medium can be any tangible medium that contains or stores a program for or relevant to an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any suitable combination thereof. More specific examples of machine-readable storage media include electrical connections with one or more wires, portable computer disks, hard disks, random access memories (RAMs), read-only memories (ROMs), erasable programmable read-only memories (EPROMs or flash memories), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0158] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices, and modules described above can refer to the corresponding processes in the foregoing method embodiments and will not be elaborated herein.
[0159] In several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the modules is only a logical function division, and there can be other division methods in actual implementation. For example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed couplings, direct couplings, or communication connections to each other can be indirect couplings or communication connections through some interfaces, devices, or modules, and can also be electrical, mechanical, or other forms of connections.
[0160] The modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they can be located in one place or distributed to multiple network modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of the embodiments of this application.
[0161] In addition, the functional modules in each embodiment of this application can be integrated into one processing module, or each module can exist physically alone, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of hardware or in the form of software functional modules.
[0162] When the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of this technical solution can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods in various embodiments of this application. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs that can store program codes.
[0163] In this application, terms such as "first" and "second" are used to distinguish identical or similar items with basically the same functions and effects. It should be understood that there is no logical or temporal dependence between "first", "second", and "nth", nor are the quantity and execution order limited. It should also be understood that although the following description uses terms such as first and second to describe various elements, these elements should not be limited by the terms. These terms are only used to distinguish one element from another. For example, without departing from the scope of various described examples, the first image can be referred to as the second image, and similarly, the second image can be referred to as the first image. Both the first image and the second image can be images, and in some cases, they can be separate and different images.
[0164] It should also be understood that in various embodiments of this application, the magnitudes of the sequence numbers of each process do not mean the sequence of execution. The execution sequence of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of this application.
[0165] In this application, the meaning of the term "at least one" refers to one or more, and the meaning of the term "a plurality of" refers to two or more. For example, a plurality of second messages refers to two or more second messages. In this article, the terms "system" and "network" are often used interchangeably.
[0166] It should be understood that the terms used in the description of various described examples in this article are only for describing specific examples and are not intended to be restrictive. As used in the description of various described examples and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
[0167] It should also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items. The term "and / or" is a correlative relationship describing associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. Additionally, the character " / " in this application generally represents an "or" relationship between the associated objects before and after.
[0168] It should also be understood that the term "comprises" (also known as "includes", "including", "comprises", and / or "comprising") when used in this specification specifies the presence of the stated features, integers, steps, operations, elements, and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or their groups.
[0169] It should also be understood that the terms "if" and "when" can be interpreted to mean "when" ("when" or "upon") or "in response to determining" or "in response to detecting". Similarly, depending on the context, the phrase "if determined..." or "if [the stated condition or event] is detected" can be interpreted to mean "when determining..." or "in response to determining..." or "when [the stated condition or event] is detected" or "in response to detecting [the stated condition or event]".
[0170] It should be understood that determining B based on A does not mean determining B solely based on A, and B can also be determined based on A and / or other information.
[0171] It should also be understood that the "one embodiment", "an embodiment", "a possible implementation" mentioned throughout the specification means that the specific features, structures, or characteristics related to the embodiment or implementation are included in at least one embodiment of this application. Therefore, the "in one embodiment" or "in an embodiment", "a possible implementation" that appears throughout the specification do not necessarily refer to the same embodiment. In addition, these specific features, structures, or characteristics can be combined in one or more embodiments in any suitable manner.
Claims
1. A method for determining a proxy node, characterized in that, the method is applied to a first node, and the method includes: obtaining the proxy priorities of multiple computing nodes in a network domain, determining the setting result of the first node according to the proxy priorities of the multiple computing nodes, the first node being any one of the multiple computing nodes, the proxy priority indicating the priority of setting a computing node as a proxy node, and the setting result of the first node indicating whether the first node is set as a proxy node; obtaining the setting results of each second node in at least one second node, the second node being a computing node different from the first node in the network domain, and the setting result of the second node indicating whether the second node is set as a proxy node; selecting at least one proxy node from the multiple computing nodes according to the obtained setting results of the multiple computing nodes.
2. The method according to claim 1, characterized in that, the obtaining the proxy priorities of multiple computing nodes in a network domain includes: obtaining the node identifiers of multiple computing nodes in the network domain; sorting the node identifiers of the multiple computing nodes, and determining the proxy priorities of the multiple computing nodes according to the sorting result.
3. The method according to claim 2, characterized in that, the obtaining the node identifiers of multiple computing nodes in the network domain includes: for any second node, receiving the first heartbeat information broadcast by the any second node according to a first period, the first heartbeat information including the node identifier of the any second node; analyzing the first heartbeat information, and determining the node identifier of the any second node according to the analysis result.
4. The method according to any one of claims 1-3, characterized in that, the determining the setting result of the first node according to the proxy priorities of the multiple computing nodes includes: determining the proxy order value corresponding to the first node according to the proxy priorities of the multiple computing nodes; comparing the proxy order value corresponding to the first node with a first quantity, the first quantity indicating the number of proxy nodes to be selected; when the proxy order value is not greater than the first quantity, setting the first node as a proxy node to obtain the setting result of the first node, or when the proxy order value is greater than the first quantity, setting the first node as a non-proxy node to obtain the setting result of the first node.
5. The method according to any one of claims 1-4, characterized in that, the obtaining the setting results of each second node in at least one second node includes: for any second node, receiving the second heartbeat information sent by the any second node, the second heartbeat information of the any second node including the setting result of the any second node; analyzing the second heartbeat information, and determining the setting result of the any second node according to the analysis result.
6. The method according to claim 5, characterized in that, When the second node is set as a proxy node, the second node broadcasts the second heartbeat information according to a second period, or when the second node is set as a non-proxy node, the second node broadcasts the second heartbeat information according to a third period, and the second period is shorter than the third period.
7. The method according to claim 6, wherein, when the second node set as a non-proxy node is a candidate node, the second node broadcasts the second heartbeat information according to a first sub-period included in the third period, or when the second node set as a non-proxy node is a reference node, the second node broadcasts the second heartbeat information according to a second sub-period included in the third period, the proxy priority of the candidate node is higher than that of the reference node, and the first sub-period is shorter than the second sub-period.
8. The method according to any one of claims 1-7, wherein, the selecting at least one proxy node from the plurality of computing nodes according to the obtained setting results of the plurality of computing nodes includes: determining a second number of computing nodes set as proxy nodes according to the setting results of the plurality of computing nodes; selecting the at least one proxy node from the computing nodes set as proxy nodes according to the second number and a first number, and the first number indicates the number of proxy nodes to be selected.
9. The method according to claim 8, wherein, the selecting the at least one proxy node from the computing nodes set as proxy nodes according to the second number and the first number includes: when the second number is greater than the first number, obtaining the proxy priorities of the computing nodes set as proxy nodes, and determining the computing nodes with proxy priorities not greater than the first number as the proxy nodes to obtain the first number of proxy nodes; or when the second number is less than the first number, determining the computing nodes set as proxy nodes as the proxy nodes, and selecting computing nodes from the computing nodes set as non-proxy nodes as the proxy nodes according to the proxy priorities of the computing nodes set as non-proxy nodes to obtain the first number of proxy nodes.
10. The method according to any one of claims 1-9, wherein, after determining the setting result of the first node according to the proxy priorities of the plurality of computing nodes, further comprising: when the setting result indicates that the first node is set as a proxy node, performing the proxy service of the network domain.
11. The method according to any one of claims 1-10, wherein, after determining the setting result of the first node according to the proxy priorities of the plurality of computing nodes, further comprising: when the setting result indicates that the first node is set as a proxy node, broadcasting third heartbeat information of the first node to a plurality of second nodes in the network domain according to a second period, and the third heartbeat information includes the setting result of the first node. Alternatively, when the setting result indicates that the first node is set as a non-proxy node, broadcast the third heartbeat information of the first node to multiple second nodes in the network domain according to a third period, where the second period is shorter than the third period.
12. An apparatus for determining a proxy node, characterized in that the apparatus is applied to a first node, and the apparatus includes: a transceiver module, configured to perform operations related to reception and / or transmission in any of the methods recited in claims 1-11; a processing module, configured to perform other operations other than the operations related to reception and / or transmission in any of the methods recited in claims 1-11.
13. A device for determining a proxy node, characterized in that the device includes a processor, and the processor is configured to load and execute at least one instruction to enable the device for determining a proxy node to implement the method for determining a proxy node as recited in any of claims 1-11.
14. A computer-readable storage medium, characterized in that at least one instruction is stored in the computer-readable storage medium, and the instruction is loaded and executed by a processor to implement the method for determining a proxy node as recited in any of claims 1-11.
15. A chip, characterized in that the chip includes a processor, and the processor is configured to run program instructions or code to enable a device including the chip to execute the method for determining a proxy node as recited in any of claims 1-11.