Cluster node horizontal expansion method, device, electronic device and storage medium

By determining the number of target expansion nodes and the upper limit of nodes in the cluster node horizontal scale and selecting the appropriate expansion mode to insert new nodes, the problems of data delivery delay and low communication efficiency in the prior art are solved, and efficient data communication and rapid troubleshooting are achieved.

CN119172253BActive Publication Date: 2025-03-1452ND RES INST AT CHINA ELECTRONICS TECH GRP CORP
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411650926.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-19
Publication Date
2025-03-14
Estimated Expiration
2044-11-19

AI Technical Summary

Technical Problem

The existing cluster node scale-out method is inefficient and fails to effectively consider the impact of the increase in the number of cluster nodes on data delivery delay, resulting in low data communication efficiency and affecting the efficiency of fault detection and service switching.

Method used

By obtaining the target expansion instructions, determining the number of target expansion nodes, and determining the upper limit of the node of a single delivery ring based on the preset delay tolerance, selecting an appropriate expansion mode (first expansion mode or second expansion mode) to insert a new cluster node, ensuring parallel transmission of data communication and avoiding a single delivery chain.

Benefits of technology

It improves the data communication efficiency between cluster nodes, quickly locates and switches fault points, and improves the system expansion effect of the entire cluster.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119172253B_ABST
    Figure CN119172253B_ABST
Patent Text Reader

Abstract

The embodiments of this specification disclose a method, device, electronic device and storage medium for horizontal expansion of cluster nodes. The method includes determining the number of target expansion nodes by analyzing the acquired target expansion instructions, and comparing it with the determined upper limit of the nodes in a single transmission ring, selecting different expansion modes according to the comparison results, and when the number of nodes increases, the main cluster ring is mainly expanded by connecting each sub-cluster ring through the main node. Through the above expansion method, when the number of cluster nodes increases, the data communication between cluster nodes is transmitted in parallel in each sub-cluster ring, and no longer relies on a single transmission chain, thereby improving the data communication efficiency between cluster nodes, and when a cluster node fails, the fault point can be quickly located and switched to rebuild a new transmission ring without the need to redistribute all nodes, further improving the system expansion effect of the entire cluster.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] One or more embodiments of the present specification relate to the field of computer technology, and in particular, to a cluster node horizontal expansion method, device, electronic device, and storage medium. Background Art

[0002] When building large-scale, high-concurrency distributed systems in the field of computer clusters, it is necessary to horizontally expand cluster nodes, that is, by adding more cluster nodes to disperse the request load from the client, avoid a single node from becoming a performance bottleneck, thereby improving the overall throughput and response speed of the system, and further improving the availability and fault tolerance of the system. However, the existing horizontal expansion of cluster nodes often either uses manual intervention expansion, which has low expansion efficiency, or uses the original number of hosts to adaptively expand the current cluster, but does not consider the impact of the increase in the number of cluster nodes on the data transmission delay between nodes in the cluster. As the scale of cluster nodes increases, the data communication efficiency between cluster nodes will be low, which will affect the fault detection and service switching efficiency of cluster nodes, and affect the system expansion effect of the entire cluster. Summary of the invention

[0003] The embodiments of this specification provide a cluster node horizontal expansion method, device and electronic device, and the technical solution thereof is as follows:

[0004] In a first aspect, an embodiment of the present specification provides a cluster node horizontal expansion method, the method comprising:

[0005] Obtaining a target extension instruction, and determining the number of target extension nodes in the target extension instruction;

[0006] Determine the node upper limit of the single transmission ring based on the preset delay tolerance, and determine the expansion mode of the newly added cluster node based on the difference between the number of target expanded nodes and the node upper limit, wherein the expansion mode includes a first expansion mode corresponding to when the number difference is not a positive value and a second expansion mode when the number difference is a positive value;

[0007] When the expansion mode is the first expansion mode, inserting the newly added cluster node into the main cluster ring;

[0008] When the expansion mode is the second expansion mode, the excess nodes in the newly added cluster nodes are inserted into the sub-cluster rings, each of the sub-cluster rings is connected to the main cluster ring through a master node, the excess nodes are nodes in the newly added cluster points that exceed the node upper limit, and the master node is an elected node in the sub-cluster ring.

[0009] In a second aspect, a cluster node horizontal expansion device is provided, the device comprising:

[0010] An acquisition module, used for acquiring a target extension instruction and determining the number of target extension nodes in the target extension instruction;

[0011] A determination module, configured to determine the node upper limit of a single transmission ring based on a preset delay tolerance, and determine an expansion mode of a newly added cluster node based on a difference between the number of target expansion nodes and the node upper limit, wherein the expansion mode includes a first expansion mode corresponding to when the number difference is not a positive value and a second expansion mode when the number difference is a positive value;

[0012] A main cluster module, configured to insert the newly added cluster node into the main cluster ring when the expansion mode is the first expansion mode;

[0013] The subset module is used to insert the excess nodes in the newly added cluster nodes into the sub-cluster ring when the expansion mode is the second expansion mode. Each sub-cluster ring is connected to the main cluster ring through a master node. The excess nodes are nodes in the newly added cluster points that exceed the node upper limit. The master node is an elected node in the sub-cluster ring.

[0014] In a third aspect, an electronic device is provided, including a device processor and a memory;

[0015] The device processor is connected to the memory;

[0016] The memory is used to store executable program code;

[0017] The device processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to execute the steps of the method provided in the first aspect or any possible implementation manner of the first aspect.

[0018] In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored, and the computer-readable storage medium stores instructions, which, when the instructions are executed on a computer or a device processor, cause the computer or the device processor to execute the method provided in the first aspect or any possible implementation of the first aspect.

[0019] The beneficial effects brought by the technical solutions provided by some embodiments of this specification include at least:

[0020] In one or more embodiments of the present specification, when a target expansion instruction is received to perform horizontal expansion of the cluster nodes, it is necessary to first determine the number of target expansion nodes and compare it with the determined upper limit of the single transmission ring nodes. Different expansion modes are selected according to the comparison results. When the number of nodes continues to increase, the main cluster ring is mainly expanded by connecting each sub-cluster ring through the main node. Through the above expansion method, when the number of cluster nodes increases, the data communication between cluster nodes is transmitted in parallel through each sub-cluster ring, and no longer relies on a single transmission chain, which improves the data communication efficiency between cluster nodes. When a cluster node fails, the fault point can be quickly located and switched to rebuild a new transmission ring without the need to re-allocate all nodes, further improving the system expansion effect of the entire cluster. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0022] Figure 1 A flowchart of a cluster node horizontal expansion method provided in an embodiment of this specification;

[0023] Figure 2 A schematic diagram of an architecture for connecting cluster rings provided in an embodiment of this specification;

[0024] Figure 3 A schematic diagram of cluster link node failure processing provided in an embodiment of this specification;

[0025] Figure 4 A schematic diagram of the structure of a cluster node horizontal expansion device provided in an embodiment of this specification;

[0026] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of this specification. DETAILED DESCRIPTION

[0027] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.

[0028] The terms "first", "second", "third", etc. in the description and claims of this specification and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.

[0029] The following description provides examples and does not limit the scope, applicability or examples set forth in the claims. Changes may be made to the functions and arrangements of the elements described without departing from the scope of the present specification. Various processes or components may be appropriately omitted, substituted or added to each example. For example, the described method may be performed in an order different from the order described, and various steps may be added, omitted or combined. In addition, features described with respect to some examples may be combined in other examples.

[0030] See next Figure 1 , Figure 1 An overall flow chart of a cluster node horizontal expansion method provided in an embodiment of this specification is shown.

[0031] like Figure 1 As shown, the cluster node horizontal expansion method may at least include the following steps:

[0032] Step 101: Obtain a target extension instruction, and determine the number of target extension nodes in the target extension instruction.

[0033] In the embodiments of this specification, in order to build a large-scale, high-concurrency distributed system, it is necessary to expand the cluster nodes horizontally, so as to effectively disperse the request load from the client, avoid a single node from becoming a performance bottleneck, improve the overall throughput and response speed of the system, and the horizontal expansion of the cluster nodes can also improve the availability and fault tolerance of the system, and automatically switch to other normal nodes when some nodes fail to function, so as to ensure the continuity and stability of the service. In addition, the horizontal expansion of the cluster nodes can also support elastic expansion with different requirements, dynamically adjust the scale of the system according to actual needs, and quickly add more nodes to meet the load requirements when business needs increase. Therefore, when the server obtains the target expansion instruction of the cluster node, it is necessary to first determine the number of nodes to be increased in the target expansion instruction. Then, obtain the initial number of nodes when it is not expanded in the original state. Further, the initial number of nodes is added to the number of nodes to be increased, and the target number of nodes to be expanded after the target expansion instruction is determined.

[0034] Step 102: determine the node upper limit of the single transmission ring based on a preset delay tolerance, and determine the expansion mode of the newly added cluster nodes based on the difference between the target expansion node number and the node upper limit.

[0035] The expansion mode includes a first expansion mode corresponding to when the quantity difference is not a positive value and a second expansion mode corresponding to when the quantity difference is a positive value.

[0036] In the embodiment of the present specification, after determining the number of target expansion nodes, since different systems have different tolerances for data transmission delays, the preset tolerance for delays corresponding to the target expansion system can be obtained first. Then, since in the node transfer ring, as the number of nodes increases, the delay during actual data transmission is higher, the node upper limit of the single transfer ring depends on the delay tolerance of the target expansion system, and the node upper limit of the single transfer ring can be obtained by directly inputting the preset experimental tolerance in the determined database or fitting function. Further, since the number of target expansion nodes corresponding to different target expansion instructions is different, and when the number of target expansion nodes exceeds the node upper limit of the corresponding single transfer ring, a new transfer ring needs to be constructed to meet the node expansion requirements, the expansion mode of the newly added cluster nodes can be determined by the difference between the number of target expansion nodes and the node upper limit. Among them, when the number difference is not a positive value, the first expansion mode is adopted to expand the newly added cluster nodes, and when the number difference is a positive value, the second expansion mode is adopted to expand the newly added cluster nodes.

[0037] Among them, the node upper limit of a single transmission ring is characterized by the maximum number of nodes in the transmission ring. When the node upper limit is exceeded, a new transmission ring needs to be built to meet the node expansion requirements.

[0038] In one possible implementation, determining the node upper limit of a single transmission ring based on a preset delay tolerance includes:

[0039] Build a tolerance-node quantity database based on historical expansion test data;

[0040] The single transmission ring node upper limit corresponding to the preset delay tolerance is determined based on the tolerance-node quantity database.

[0041] In the embodiments of the present specification, when determining the node upper limit of a single transmission ring by a preset delay tolerance, a sufficient amount of historical expansion test data can be obtained first. The historical expansion test data can be obtained by continuously expanding nodes in a single transmission ring and testing the average delay of actual data transmission. Then, the one-to-one correspondence between tolerance and node upper limit is screened out from the historical expansion test data, and a tolerance-node quantity database is constructed based on this. Furthermore, the preset delay tolerance in the current expansion system is input into the tolerance-node quantity database to obtain the corresponding single transmission ring node upper limit.

[0042] In one possible implementation, the determining of the expansion mode of the newly added cluster nodes based on the difference between the number of target expansion nodes and the node upper limit, the expansion mode including a first expansion mode corresponding to when the number difference is not a positive value and a second expansion mode when the number difference is a positive value, includes:

[0043] Determine the difference between the target number of expansion nodes and the upper limit of the number of nodes based on difference calculation;

[0044] When the quantity difference is not a positive value, determining that the expansion mode of the newly added cluster node is the first expansion mode, where the first expansion mode is a mode indicating that the number of the target expansion nodes is not greater than the node upper limit;

[0045] When the quantity difference is a positive value, it is determined that the expansion mode is the second expansion mode, and the second expansion mode is a mode representing that the number of the target expansion nodes is greater than the node upper limit.

[0046] In the embodiments of the present specification, the difference between the target number of expansion nodes and the node upper limit can be calculated to obtain the difference between the two. When the calculated difference is not a positive value, it is characterized as the target number of expansion nodes is less than or equal to the node upper limit, and thus it can be determined that the expansion mode of the newly added cluster nodes at this time is the first expansion mode. When the calculated difference is a positive value, it is characterized as the target number of expansion nodes is greater than the node upper limit, and it is determined that the expansion mode of the newly added cluster nodes at this time is the second expansion mode.

[0047] Step 103: When the expansion mode is the first expansion mode, insert the newly added cluster node into the main cluster ring.

[0048] In the embodiments of this specification, the cluster node horizontal expansion method corresponding to the present invention is intended to adopt the following Figure 2 In the expansion structure shown, it is assumed that the upper limit of nodes obtained at this time is 5, and the main cluster ring is connected to each sub-cluster ring to perform node expansion. Among them, the upper limit of nodes of the main cluster ring and the sub-cluster ring is set to the same value, and a transfer token is set between each node of the main cluster ring and the sub-cluster ring, and each transfer token rotates in the transfer ring in sequence. In each transfer ring, only the node that obtains the token can send data. Therefore, when performing horizontal node expansion and determining that the expansion mode is the first expansion mode, the newly added cluster node can be randomly and directly inserted in the main cluster ring.

[0049] In an implementable manner, when the expansion mode is the first expansion mode, inserting the newly added cluster node into the main cluster ring includes:

[0050] When the expansion mode is the first expansion mode, determining the insertable segment corresponding to the newly added cluster node based on a token passing algorithm;

[0051] The newly added cluster node is randomly inserted into the main cluster ring based on the insertable segment.

[0052] In the embodiment of the present specification, when the expansion mode is the first expansion mode, the initial token position in the main cluster ring can be determined by the token passing algorithm. Then, after the main cluster ring is divided into multiple segments, the idle segments in each stage are determined based on the initial token position, and defined as the insertable segments corresponding to the newly added cluster nodes. Furthermore, a certain segment of each insertable segment is randomly selected and used as the initial insertion node, and all the newly added cluster nodes are inserted into the main cluster ring according to the token passing order.

[0053] Step 104: When the expansion mode is the second expansion mode, the excess nodes in the newly added cluster nodes are inserted into sub-cluster rings, and each of the sub-cluster rings is connected to the main cluster ring through a master node.

[0054] The excess nodes are nodes in the newly added cluster points that exceed the node upper limit, and the master node is an elected node in the sub-cluster ring.

[0055] In an embodiment of the present specification, when it is determined that the expansion mode is the second expansion mode, it is characterized by the fact that the number of target expansion nodes exceeds the node upper limit of the main cluster transmission ring. Among them, it may be that the initial number of nodes has exceeded the node upper limit, that is, when the node expansion is not performed, the main cluster transmission ring is full and a new sub-cluster ring is constructed. It is also possible that the initial number of nodes does not exceed the node upper limit, and the node upper limit will be exceeded after the target node expansion, so the sub-cluster ring needs to be rebuilt. In any of the above situations, after determining that the expansion mode is the second expansion mode, the nodes exceeding the node upper limit in the newly added cluster nodes need to be inserted into the sub-cluster ring, and the sub-cluster ring may be originally existing or newly constructed. Among them, when the number of nodes in each sub-cluster ring exceeds the node upper limit, it is necessary to reconstruct a new sub-cluster ring if the node needs to be expanded later. Among them, the election node is determined by configuring parameters or load capacity in each constructed sub-cluster ring, and serves as the master node in the sub-cluster ring, and each sub-cluster ring is connected to the main cluster ring through each master node.

[0056] In one possible implementation, when the expansion mode is the second expansion mode, the excess nodes in the newly added cluster nodes are inserted into the sub-cluster rings, each of the sub-cluster rings is connected to the main cluster ring through a master node, the excess nodes are nodes in the newly added cluster points that exceed the node upper limit, and the master node is an election node in the sub-cluster ring, including:

[0057] When the expansion mode is the second expansion mode, the newly added cluster points are divided into a first expansion node group and a second expansion node group based on the expansion order, the first expansion node group includes the newly added cluster points that do not exceed the node upper limit among the newly added cluster points, and the second expansion node group includes the newly added cluster points that exceed the node upper limit among the newly added cluster points;

[0058] Expanding the first expansion node group according to the first expansion mode;

[0059] Each sub-cluster ring is constructed based on the node upper limit, the second extended node group is inserted into each sub-cluster ring, and the master node in each sub-cluster ring is determined based on an election strategy, and each master node is used to connect each sub-cluster ring with the main cluster ring.

[0060] In the embodiment of the present specification, when the expansion mode is the second expansion mode, and the number of initial nodes does not exceed the node upper limit, that is, when the target node is horizontally expanded, the node is first expanded in the main cluster ring, and after the number of nodes in the main cluster ring is expanded to the node upper limit, a new sub-cluster ring is constructed. Therefore, the newly added cluster points can be divided into two parts according to the expansion order, one part is the newly added cluster points when the node upper limit is not exceeded, and is defined as the first expansion point group, and the other part is the newly added cluster points that exceed the node upper limit, and is defined as the second expansion point group. Then, the first expansion point group is expanded according to the first expansion mode determined before, and the number of nodes of the second expansion node group is determined, and then the number of sub-cluster rings to be constructed is determined based on the node upper limit. Further, the second expansion node group is inserted into each constructed sub-cluster ring in sequence. Among them, it is necessary to determine the master node in each sub-cluster ring through the election strategy, and connect each sub-cluster ring to the main cluster ring through the master node. Other standby nodes in the sub-cluster ring can only communicate with the main cluster ring through the master node.

[0061] Optionally, when the number of initial nodes exceeds the node upper limit, there is no first expansion point, and all newly added cluster points are second expansion points.

[0062] In one embodiment, the method further comprises:

[0063] The number of IP network segments is set corresponding to the cluster size, the IP network segments include a first IP network segment and a second IP network segment, and the bandwidth corresponding to the first IP network segment is smaller than the bandwidth corresponding to the second IP network segment;

[0064] When the expansion mode is the first expansion mode, allocating the newly added cluster node to the first IP network segment;

[0065] When the extension mode is the second extension mode, the excess node is allocated to the second IP network segment.

[0066] In the embodiments of the present specification, when the scale of the expanded cluster is too large, in order to avoid conflicts between the main cluster IP segment and the sub-cluster IP segment, the number of IP segments can be set based on the cluster scale after the node expansion. When it is necessary to rebuild the sub-cluster ring, two IP segments can be set, which are defined as the first IP segment and the second IP segment, and the bandwidth corresponding to the second IP segment is set much larger than the bandwidth corresponding to the first IP segment. Then, when the expansion mode is determined to be the first expansion mode, all newly added cluster nodes are allocated to the first IP segment. When the expansion mode is the second expansion mode, after allocating the nodes of the newly added cluster nodes that do not exceed the limit to the first IP segment, all the remaining nodes that exceed the limit are allocated to the second IP segment.

[0067] In one embodiment, the method further comprises:

[0068] Determine the data receiving interval of each cluster node, and determine the fault point in the current cluster based on the data receiving interval and the data packet loss tolerance time;

[0069] When the fault point is the master node, a corresponding master node is reselected in the cluster where the fault point is located based on an election strategy to build a new cluster ring;

[0070] When the fault point is a standby node, the fault point is removed and the remaining nodes are regrouped to build a new cluster ring.

[0071] In the embodiment of the present specification, after the horizontal expansion of the cluster nodes is completed, fault detection and fault handling can also be implemented on the basis of the expansion structure. First, in the actual data transmission process, the data reception interval of each cluster node after the horizontal expansion can be determined first. Then, the data reception interval is compared with the data packet loss tolerance time in real time to determine the fault point in the current cluster. As an example, when the data reception interval of a certain node exceeds the data packet loss tolerance time, the node can be determined as the fault point. In general, the probability of a fault belongs to a node in a sub-cluster. Therefore, if a node in a sub-cluster fails, it is necessary to determine whether the determined fault point is a master node or a standby node. If the fault point is determined to be a master node, after removing the master node, the other remaining standby nodes automatically gather to form a new cluster ring, and in the remaining standby nodes, a new master node is re-elected based on the election strategy to form a new cluster ring. When the fault point is a standby node, the fault point is directly removed and the remaining nodes are re-aggregated to build a new cluster ring.

[0072] Optionally, if a special situation occurs, that is, the fault point does not belong to any sub-cluster ring, a new main cluster ring needs to be rebuilt, and each sub-cluster ring connected to it is sequentially rebuilt.

[0073] As an example, Figure 3 As shown in the figure, a node in sub-cluster ring 1 fails. If the failed node is the master node C of sub-cluster ring 1, the nodes of sub-cluster ring 1 enter the aggregation state to form a new sub-cluster ring, and successfully elect a node as the master node (for example, node B1) according to the master node election strategy, and re-add the newly elected master node B1 to the main cluster ring 0. At this time, node B1 will regenerate a new main cluster ring with other nodes in the main cluster ring 0.

[0074] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0075] See next Figure 4 , Figure 4 The schematic diagram of the structure of a cluster node horizontal expansion device provided in the embodiment of this specification is shown. It should be noted that: Figure 4 The cluster node horizontal expansion device shown is used to execute the present application Figure 1 For the convenience of explanation, only the part related to the embodiment of the present application is shown. For the specific technical details not disclosed, please refer to the present application. Figure 1 The embodiment shown.

[0076] like Figure 4 As shown, the cluster node horizontal expansion device may at least include:

[0077] The acquisition module 401 is used to acquire a target extension instruction and determine the number of target extension nodes in the target extension instruction;

[0078] A determination module 402 is used to determine the node upper limit of a single transmission ring based on a preset delay tolerance, and determine an expansion mode of a newly added cluster node based on a difference between the number of target expansion nodes and the node upper limit, wherein the expansion mode includes a first expansion mode corresponding to when the number difference is not a positive value and a second expansion mode when the number difference is a positive value;

[0079] A main cluster module 403, configured to insert the newly added cluster node into the main cluster ring when the expansion mode is the first expansion mode;

[0080] The subset module 404 is used to insert the excess nodes in the newly added cluster nodes into the sub-cluster ring when the expansion mode is the second expansion mode. Each sub-cluster ring is connected to the main cluster ring through a master node. The excess nodes are nodes in the newly added cluster points that exceed the node upper limit. The master node is an elected node in the sub-cluster ring.

[0081] In one possible implementation, the determination module 402 is specifically configured to:

[0082] Build a tolerance-node quantity database based on historical expansion test data;

[0083] The single transmission ring node upper limit corresponding to the preset delay tolerance is determined based on the tolerance-node quantity database.

[0084] In one possible implementation, the determination module 402 is further configured to:

[0085] Determine the difference between the target number of expansion nodes and the upper limit of the number of nodes based on difference calculation;

[0086] When the quantity difference is not a positive value, determining that the expansion mode of the newly added cluster node is the first expansion mode, where the first expansion mode is a mode indicating that the number of the target expansion nodes is not greater than the node upper limit;

[0087] When the quantity difference is a positive value, it is determined that the expansion mode is the second expansion mode, and the second expansion mode is a mode representing that the number of the target expansion nodes is greater than the node upper limit.

[0088] In one possible implementation, the master module 403 is specifically used to:

[0089] When the expansion mode is the first expansion mode, determining the insertable segment corresponding to the newly added cluster node based on a token passing algorithm;

[0090] The newly added cluster node is randomly inserted into the main cluster ring based on the insertable segment.

[0091] In one possible implementation, the subset module 404 is specifically configured to:

[0092] When the expansion mode is the second expansion mode, the newly added cluster points are divided into a first expansion node group and a second expansion node group based on the expansion order, the first expansion node group includes the newly added cluster points that do not exceed the node upper limit among the newly added cluster points, and the second expansion node group includes the newly added cluster points that exceed the node upper limit among the newly added cluster points;

[0093] Expanding the first expansion node group according to the first expansion mode;

[0094] Each sub-cluster ring is constructed based on the node upper limit, the second extended node group is inserted into each sub-cluster ring, and the master node in each sub-cluster ring is determined based on an election strategy, and each master node is used to connect each sub-cluster ring with the main cluster ring.

[0095] In one possible implementation, the subset module 404 is specifically configured to:

[0096] The number of IP network segments is set corresponding to the cluster size, the IP network segments include a first IP network segment and a second IP network segment, and the bandwidth corresponding to the first IP network segment is smaller than the bandwidth corresponding to the second IP network segment;

[0097] When the expansion mode is the first expansion mode, allocating the newly added cluster node to the first IP network segment;

[0098] When the extension mode is the second extension mode, the excess node is allocated to the second IP network segment.

[0099] In one possible implementation, the subset module 404 is specifically configured to:

[0100] Determine the data receiving interval of each cluster node, and determine the fault point in the current cluster based on the data receiving interval and the data packet loss tolerance time;

[0101] When the fault point is the master node, a corresponding master node is reselected in the cluster where the fault point is located based on an election strategy to build a new cluster ring;

[0102] When the fault point is a standby node, the fault point is removed and the remaining nodes are regrouped to build a new cluster ring.

[0103] Those skilled in the art can clearly understand that the technical solutions of the embodiments of the present application can be implemented with the help of software and / or hardware. The "unit" and "module" in this specification refer to software and / or hardware that can independently complete or cooperate with other components to complete specific functions, where the hardware can be, for example, a field programmable gate array (FPGA), an integrated circuit (IC), etc.

[0104] Each processing unit and / or module of the embodiments of the present application may be implemented by an analog circuit that implements the functions described in the embodiments of the present application, or may be implemented by software that executes the functions described in the embodiments of the present application.

[0105] See next Figure 5 , Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of this specification is shown.

[0106] like Figure 5 As shown, the electronic device 500 may include: at least one device processor 501 , at least one network interface 504 , a user interface 505 , a memory 505 and at least one communication bus 502 .

[0107] The communication bus 502 may be used to realize the connection and communication among the above-mentioned components.

[0108] The user interface 505 may include buttons, and the optional user interface may also include a standard wired interface or a wireless interface.

[0109] The network interface 504 may include, but is not limited to, a Bluetooth module, an NFC module, a Wi-Fi module, etc.

[0110] Among them, the device processor 501 may include one or more processing cores. The device processor 501 uses various interfaces and lines to connect various parts within the entire electronic device 500, and executes various functions and processes data of the electronic device 500 by running or executing instructions, programs, code sets or instruction sets stored in the memory 505, and calling data stored in the memory 505. Optionally, the device processor 501 can be implemented in at least one hardware form of DSP, FPGA, and PLA. The device processor 501 can integrate one or a combination of CPU, GPU, modem, etc. Among them, the CPU mainly processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the device processor 501, and it can be implemented separately through a chip.

[0111] The memory 505 may include a RAM or a ROM. Optionally, the memory 505 includes a non-transitory computer-readable medium. The memory 505 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 505 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 505 may optionally be at least one storage device located away from the aforementioned device processor 501. As Figure 5 As shown, the memory 505 as a computer storage medium may include an operating system, a network communication module, a user interface module, and program instructions.

[0112] Specifically, the device processor 501 may be used to call the cluster node horizontal expansion application stored in the memory 505, and specifically perform the following operations:

[0113] Obtaining a target extension instruction, and determining the number of target extension nodes in the target extension instruction;

[0114] Determine the node upper limit of the single transmission ring based on the preset delay tolerance, and determine the expansion mode of the newly added cluster node based on the difference between the number of target expanded nodes and the node upper limit, wherein the expansion mode includes a first expansion mode corresponding to when the number difference is not a positive value and a second expansion mode when the number difference is a positive value;

[0115] When the expansion mode is the first expansion mode, inserting the newly added cluster node into the main cluster ring;

[0116] When the expansion mode is the second expansion mode, the excess nodes in the newly added cluster nodes are inserted into the sub-cluster rings, each of the sub-cluster rings is connected to the main cluster ring through a master node, the excess nodes are nodes in the newly added cluster points that exceed the node upper limit, and the master node is an elected node in the sub-cluster ring.

[0117] As an option of an embodiment of this specification, determining the node upper limit of a single transmission ring based on a preset delay tolerance includes:

[0118] Build a tolerance-node quantity database based on historical expansion test data;

[0119] The single transmission ring node upper limit corresponding to the preset delay tolerance is determined based on the tolerance-node quantity database.

[0120] As an optional embodiment of this specification, the expansion mode of the newly added cluster node is determined based on the difference between the number of target expansion nodes and the number of node upper limits, and the expansion mode includes a first expansion mode corresponding to when the number difference is not a positive value and a second expansion mode when the number difference is a positive value, including:

[0121] Determine the difference between the target number of expansion nodes and the upper limit of the number of nodes based on difference calculation;

[0122] When the quantity difference is not a positive value, determining that the expansion mode of the newly added cluster node is the first expansion mode, where the first expansion mode is a mode indicating that the number of the target expansion nodes is not greater than the node upper limit;

[0123] When the quantity difference is a positive value, it is determined that the expansion mode is the second expansion mode, and the second expansion mode is a mode representing that the number of the target expansion nodes is greater than the node upper limit.

[0124] As an optional embodiment of this specification, when the expansion mode is the first expansion mode, inserting the newly added cluster node into the main cluster ring includes:

[0125] When the expansion mode is the first expansion mode, determining the insertable segment corresponding to the newly added cluster node based on a token passing algorithm;

[0126] The newly added cluster node is randomly inserted into the main cluster ring based on the insertable segment.

[0127] As an optional embodiment of this specification, when the expansion mode is the second expansion mode, the excess nodes in the newly added cluster nodes are inserted into the sub-cluster ring, each of the sub-cluster rings is connected to the main cluster ring through the master node, the excess nodes are nodes in the newly added cluster points that exceed the node upper limit, and the master node is an election node in the sub-cluster ring, including:

[0128] When the expansion mode is the second expansion mode, the newly added cluster points are divided into a first expansion node group and a second expansion node group based on the expansion order, the first expansion node group includes the newly added cluster points that do not exceed the node upper limit among the newly added cluster points, and the second expansion node group includes the newly added cluster points that exceed the node upper limit among the newly added cluster points;

[0129] Expanding the first expansion node group according to the first expansion mode;

[0130] Each sub-cluster ring is constructed based on the node upper limit, the second extended node group is inserted into each sub-cluster ring, and the master node in each sub-cluster ring is determined based on an election strategy, and each master node is used to connect each sub-cluster ring with the main cluster ring.

[0131] As an option of the embodiment of this specification, the method further includes:

[0132] The number of IP network segments is set corresponding to the cluster size, the IP network segments include a first IP network segment and a second IP network segment, and the bandwidth corresponding to the first IP network segment is smaller than the bandwidth corresponding to the second IP network segment;

[0133] When the expansion mode is the first expansion mode, allocating the newly added cluster node to the first IP network segment;

[0134] When the extension mode is the second extension mode, the excess node is allocated to the second IP network segment.

[0135] As an option of the embodiment of this specification, the method further includes:

[0136] Determine the data receiving interval of each cluster node, and determine the fault point in the current cluster based on the data receiving interval and the data packet loss tolerance time;

[0137] When the fault point is the master node, a corresponding master node is reselected in the cluster where the fault point is located based on an election strategy to build a new cluster ring;

[0138] When the fault point is a standby node, the fault point is removed and the remaining nodes are regrouped to build a new cluster ring.

[0139] The embodiments of this specification also provide a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the steps of the above method are implemented. The computer-readable storage medium may include, but is not limited to, any type of disk, including a floppy disk, an optical disk, a DVD, a CD-ROM, a micro drive, and a magneto-optical disk, a ROM, a RAM, an EPROM, an EEPROM, a DRAM, a VRAM, a flash memory device, a magnetic card or an optical card, a nanosystem (including a molecular memory IC), or any type of medium or device suitable for storing instructions and / or data.

[0140] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0141] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0142] In the several embodiments provided in the present application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of the units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some service interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.

[0143] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0144] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0145] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a memory, including a number of instructions to enable a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned memory includes: U disk, read-only memory (ROM), random access memory (RAM), mobile hard disk, disk or optical disk and other media that can store program codes.

[0146] A person skilled in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by entering a program to instruct related hardware, and the program may be stored in a computer-readable memory, which may include a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0147] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

Claims

1. A cluster node horizontal expansion method, characterized in that: The method comprises: Obtaining a target extension instruction, and determining the number of target extension nodes in the target extension instruction; Determine the node upper limit of the single transmission ring based on the preset delay tolerance, and determine the expansion mode of the newly added cluster node based on the difference between the number of target expanded nodes and the node upper limit, wherein the expansion mode includes a first expansion mode corresponding to when the number difference is not a positive value and a second expansion mode when the number difference is a positive value; When the expansion mode is the first expansion mode, inserting the newly added cluster node into the main cluster ring; When the expansion mode is the second expansion mode, the excess nodes in the newly added cluster nodes are inserted into the sub-cluster rings, each of the sub-cluster rings is connected to the main cluster ring through a master node, the excess nodes are nodes in the newly added cluster nodes that exceed the node upper limit, and the master node is an elected node in the sub-cluster ring; The determining of the expansion mode of the newly added cluster node based on the difference between the number of the target expansion nodes and the node upper limit, wherein the expansion mode includes a first expansion mode corresponding to when the number difference is not a positive value and a second expansion mode when the number difference is a positive value, includes: Determine the difference between the target number of expansion nodes and the upper limit of the number of nodes based on difference calculation; When the quantity difference is not a positive value, determining that the expansion mode of the newly added cluster node is the first expansion mode, where the first expansion mode is a mode indicating that the number of the target expansion nodes is not greater than the node upper limit; When the quantity difference is a positive value, it is determined that the expansion mode is the second expansion mode, and the second expansion mode is a mode representing that the number of the target expansion nodes is greater than the node upper limit.

2. The method according to claim 1, characterized in that: The determining of the node upper limit of the single transmission ring based on the preset delay tolerance includes: Build a tolerance-node quantity database based on historical expansion test data; The single transmission ring node upper limit corresponding to the preset delay tolerance is determined based on the tolerance-node quantity database.

3. The method according to claim 1, characterized in that When the expansion mode is the first expansion mode, inserting the newly added cluster node into the main cluster ring includes: When the expansion mode is the first expansion mode, determining the insertable segment corresponding to the newly added cluster node based on a token passing algorithm; The newly added cluster node is randomly inserted into the main cluster ring based on the insertable segment.

4. The method according to claim 1, characterized in that: When the expansion mode is the second expansion mode, the excess nodes in the newly added cluster nodes are inserted into the sub-cluster rings, each of the sub-cluster rings is connected to the main cluster ring through a master node, the excess nodes are nodes in the newly added cluster nodes that exceed the node upper limit, and the master node is an elected node in the sub-cluster ring, including: When the expansion mode is the second expansion mode, the newly added cluster nodes are divided into a first expansion node group and a second expansion node group based on the expansion order, the first expansion node group includes the newly added cluster nodes when the number of newly added cluster nodes does not exceed the node upper limit, and the second expansion node group includes the newly added cluster nodes when the number of newly added cluster nodes exceeds the node upper limit; Expanding the first expansion node group according to the first expansion mode; Each sub-cluster ring is constructed based on the node upper limit, the second extended node group is inserted into each sub-cluster ring, and the master node in each sub-cluster ring is determined based on an election strategy, and each master node is used to connect each sub-cluster ring with the main cluster ring.

5. The method according to claim 1, characterized in that The method further comprises: The number of IP network segments is set corresponding to the cluster size, the IP network segments include a first IP network segment and a second IP network segment, and the bandwidth corresponding to the first IP network segment is smaller than the bandwidth corresponding to the second IP network segment; When the expansion mode is the first expansion mode, allocating the newly added cluster node to the first IP network segment; When the extension mode is the second extension mode, the excess node is allocated to the second IP network segment.

6. The method according to claim 1, characterized in that The method further comprises: Determine the data receiving interval of each cluster node, and determine the fault point in the current cluster based on the data receiving interval and the data packet loss tolerance time; When the fault point is the master node, a corresponding master node is reselected in the cluster where the fault point is located based on an election strategy to build a new cluster ring; When the fault point is a standby node, the fault point is removed and the remaining nodes are regrouped to build a new cluster ring.

7. A cluster node horizontal expansion device, characterized in that: The device comprises: An acquisition module, used for acquiring a target extension instruction and determining the number of target extension nodes in the target extension instruction; A determination module, configured to determine the node upper limit of a single transmission ring based on a preset delay tolerance, and determine an expansion mode of a newly added cluster node based on a difference between the number of target expansion nodes and the node upper limit, wherein the expansion mode includes a first expansion mode corresponding to when the number difference is not a positive value and a second expansion mode when the number difference is a positive value; A main cluster module, configured to insert the newly added cluster node into the main cluster ring when the expansion mode is the first expansion mode; A subset module, used for inserting the excess nodes in the newly added cluster nodes into a sub-cluster ring when the expansion mode is the second expansion mode, each of the sub-cluster rings is connected to the main cluster ring through a master node, the excess nodes are nodes in the newly added cluster nodes that exceed the node upper limit, and the master node is an elected node in the sub-cluster ring; The determination module is specifically used for: Determine the difference between the target number of expansion nodes and the upper limit of the number of nodes based on difference calculation; When the quantity difference is not a positive value, determining that the expansion mode of the newly added cluster node is the first expansion mode, where the first expansion mode is a mode indicating that the number of the target expansion nodes is not greater than the node upper limit; When the quantity difference is a positive value, it is determined that the expansion mode is the second expansion mode, and the second expansion mode is a mode representing that the number of the target expansion nodes is greater than the node upper limit.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, wherein the computer-readable storage medium has instructions stored therein, and when the instructions are executed on a computer or a processor, the computer or the processor executes the steps of the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Multistage wavelength-division-multiplexing ring light network

    CN104993903A

  • Decentralized cluster storage system

    CN106055276A