Cluster capacity expansion method and device, equipment and storage medium
By obtaining and matching the configuration information of the target cluster and the source cluster, the node matching relationship is automatically determined and resource migration is carried out, which solves the problems of complex expansion operations and high error rates in the existing technology, and realizes efficient automatic expansion of the cluster.
Patent Information
- Application Number
- CN202310723489.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-16
- Publication Date
- 2024-12-17
AI Technical Summary
When network service personnel expand the network management system or bare metal cloud platform, the existing methods are complex to operate and need to manually configure node parameters, resulting in large resource migration, long time and error-prone.
By obtaining the configuration information of the target cluster and the source cluster, determining the node matching relationship, and migrating resources based on the relationship, realizing automatic cluster expansion and avoiding manual modification of node configuration parameters.
The capacity expansion process is simplified, the resource migration difficulty and error rate are reduced, the migration efficiency is improved, and the cluster's automatic capacity expansion is realized.
Smart Images

Figure CN119155185A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a cluster expansion method, device, equipment and storage medium. Background Art
[0002] When network service personnel expand the capacity of the network management system (and other systems based on the bare metal cloud platform), they need to refer to the resource configuration template used during deployment, and manually configure the deployment parameters of the newly added nodes (including node labels, storage volumes, etc.) based on experience. At the same time, they need to modify the deployment parameters of each original node in the cluster one by one, and even manually migrate the middleware services statically bound to the nodes to other nodes.
[0003] It can be seen that the existing method has a complicated operation process, requires high technical level of network service personnel, and manual selection is usually not optimal, which will lead to large amount of resource migration, long time consumption and easy errors during the expansion process. Summary of the invention
[0004] The present disclosure provides a cluster capacity expansion method, device, equipment and storage medium.
[0005] A first aspect of the present disclosure provides a cluster capacity expansion method, comprising:
[0006] Obtain the configuration information of each target node from the target cluster plan, and extract the configuration information of each source node from the source cluster to be expanded;
[0007] According to the configuration information of each source node and the configuration information of each target node, the target node matching the configuration information corresponding to each source node is determined to obtain a matching relationship between the source node and the target node;
[0008] The resources of the source node are migrated according to the matching relationship, so that the source node is expanded to become the matching target node.
[0009] A second aspect of the present disclosure provides a cluster capacity expansion device, including:
[0010] The acquisition module is used to obtain the configuration information of each target node corresponding to the plan from the plan of the target cluster, and to extract the configuration information of each source node from the source cluster to be expanded;
[0011] A determination module, configured to determine the target node that matches the configuration information corresponding to each source node according to the configuration information of each source node and the configuration information of each target node, and obtain a matching relationship between the source node and the target node;
[0012] An expansion module is used to migrate resources of the source node according to the matching relationship so as to expand the source node to the matching target node.
[0013] A third aspect of the present disclosure provides an electronic device, including:
[0014] at least one processor;
[0015] A memory having one or more programs stored thereon, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method according to the first aspect;
[0016] At least one I / O interface is connected between the processor and the memory and is configured to implement information interaction between the processor and the memory.
[0017] A fourth aspect of the present disclosure provides a computer-readable medium having a computer program stored thereon, wherein when the program is executed by a processor, the method according to the first aspect is implemented.
[0018] The present disclosure has the following advantages:
[0019] According to the configuration information of each source node in the source cluster to be expanded and the corresponding planned configuration information of each target node in the planning of the target cluster, the target node matching the configuration information corresponding to each source node is determined, and the matching relationship between the source node and the target node is obtained. According to the matching relationship, resources of the source node are migrated to expand the source node to the matching target node, thereby realizing automatic cluster expansion without the need for network service personnel to manually modify the configuration parameters of each node in the source cluster. The operation method is simple and efficient, and the configuration information of the source node and the target node are optimally paired, which reduces the difficulty of resource migration during the expansion process, minimizes the amount of resource migration, improves migration efficiency, and avoids the error rate caused by manual operation. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 A schematic diagram of an application scenario of a cluster expansion method provided in an embodiment of the present disclosure;
[0021] Figure 2 A schematic diagram of a cluster expansion method provided in an embodiment of the present disclosure;
[0022] Figure 3 A schematic diagram of a row-by-row search process provided in an embodiment of the present disclosure;
[0023] Figure 4 A schematic diagram of a global search process provided in an embodiment of the present disclosure;
[0024] Figure 5A schematic diagram of a bare metal server cluster expansion process provided in an embodiment of the present disclosure;
[0025] Figure 6 A schematic diagram of matching a source cluster and a target cluster provided in an embodiment of the present disclosure;
[0026] Figure 7 A schematic diagram of matching another source cluster and a target cluster provided in an embodiment of the present disclosure;
[0027] Figure 8 A schematic diagram of the structure of a cluster expansion device provided in an embodiment of the present disclosure;
[0028] Fig. 9 A schematic diagram of the structure of another cluster capacity expansion device provided in an embodiment of the present disclosure;
[0029] Fig.10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0030] The specific implementation of the present disclosure is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described herein is only used to illustrate and explain the present disclosure, and is not used to limit the present disclosure.
[0031] As used in this disclosure, the term "and / or" includes any and all combinations of one or more of the associated listed items.
[0032] The terms used in the present disclosure are only used to describe specific embodiments and are not intended to limit the present disclosure.As used in the present disclosure, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
[0033] When the terms “comprising” and / or “made of…” are used in the present disclosure, it specifies the existence of the stated features, integers, steps, operations, elements and / or components, but does not exclude the existence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof.
[0034] Unless otherwise defined, all terms (including technical and scientific terms) used in this disclosure have the same meaning as those commonly understood by those of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and this disclosure, and will not be interpreted as having an idealized or overly formal meaning unless explicitly defined in this disclosure.
[0035] The disclosed embodiment provides a cluster expansion method, which can be applied to the expansion of a bare metal server cluster, and can also be applied to the expansion of a virtual machine cluster, etc.
[0036] A bare metal server (BMS) is a hardware device that has both the characteristics of a traditional physical server and the virtualization service function of cloud computing technology. It is a product of the combination of hardware and software advantages. Its essence is a server that has both cloud computing service functions and the performance of physical equipment.
[0037] Figure 1 The application scenario diagram of a cluster expansion method provided by an embodiment of the present disclosure is shown, and the application scenario includes a control node 100 and a cluster 110, wherein the control node 100 includes one or more processors for implementing the cluster expansion method provided by the embodiment of the present disclosure when executing a computer program; a storage device for storing one or more programs; and a communication interface that can be set to receive and send data. The processor, the memory, and the communication interface can be connected through a bus or other means. The cluster 110 registers and manages one or more nodes, such as one or more bare metal servers. The configuration information of each node in the cluster 110 can be collected in a non-invasive manner and transmitted to the control node 100 for storage through network communication between the control node and the cluster. Among them, the cluster 110 can be managed based on a cloud platform based on Kubernetes, such as a communication platform cloud service (Communication Platform as a Service, cPaaS), a platform as a service (Platform as aService, PaaS), and a precision cloud base cloud platform system (TECS Cloud Foundation PaaS, TCF PaaS).
[0038] Figure 2 The figure shows a flow chart of a cluster expansion method provided by an embodiment of the present disclosure. The cluster expansion method flow chart mainly includes the following steps:
[0039] Step 201 : acquiring the configuration information of each target node corresponding to the plan from the plan of the target cluster, and extracting the configuration information of each source node from the source cluster to be expanded.
[0040] The configuration information of the node may be described in a variety of ways, for example, using different labels, roles or descriptors to describe the configuration information of the node such as hardware specifications, running services, functions undertaken, etc. The labels, roles or descriptors may specifically be a collection of short strings.
[0041] Exemplarily, the configuration information of each source node in the source cluster may be read from each source node of the original cluster through an interface provided by a cloud platform that manages the source cluster.
[0042] Exemplarily, the configuration information corresponding to the planning of each target node in the planning of the target cluster can be obtained by obtaining an imported target cluster configuration template, and obtained from the configuration template. The target cluster configuration template can be obtained through human-computer interaction, and the information in the configuration template can be pre-configured by a technician according to the format in the template.
[0043] Step 202: According to the configuration information of each source node and the planned configuration information of each target node, the target node matching the configuration information corresponding to each source node is determined to obtain a matching relationship between the source node and the target node.
[0044] In some embodiments, before determining the target nodes that match the configuration information corresponding to each source node, the configuration information of each source node in the source cluster and the corresponding planned configuration information of each target node in the target cluster are sorted according to the agreed format, so that the format of the sorted configuration information of the source node is the same as the format of the corresponding planned configuration information of the target node, so as to facilitate the comparison of the configuration information of the source node and the corresponding planned configuration information of the target node. For example, based on the configuration information of each node in the source cluster, an assembly diagram of the source cluster is generated, in which the expression format of the configuration information of each source node is agreed upon, and based on the corresponding planned configuration information of each target node in the target cluster, an assembly diagram of the target cluster is generated, in which the expression format of the planned configuration information of the target node is agreed upon, and the assembly diagram of the source cluster and the assembly diagram of the target cluster have the same agreed format. The file format of the assembly diagram of the source cluster and the assembly diagram of the target cluster is in xls format, and can also be in xlsx, json, xml, txt and other formats.
[0045] In some embodiments, according to the configuration information of each source node and the configuration information of each target node, the target node that matches the configuration information corresponding to each source node is determined to obtain the matching relationship between the source node and the target node, including: according to the configuration information of each source node and the configuration information of each target node, the similarity between each source node and each target node is determined; the target node with the highest similarity corresponding to each source node is used as the target node that matches the source node to obtain the matching relationship between the source node and the target node. Selecting the target node with the highest similarity corresponding to the source node as the target node that best matches the source node can optimize the adjustment of node labels during expansion and reduce resource migration during cluster expansion.
[0046] In some embodiments, in order to avoid two source nodes matching the same target node, the embodiments of the present disclosure solve such conflicts by selecting the optimal node pair with the most similar configuration information. There are multiple solutions, including but not limited to the following two solutions:
[0047] Scheme A uses a row-by-row search method to select the optimal node pair.
[0048] The target node with the highest similarity corresponding to each source node is used as the target node that matches the source node to obtain a matching relationship between the source node and the target node, including: adding each target node to a target node list; traversing each source node, obtaining the maximum value of the similarity between the currently traversed source node and each target node in the target node list during each traversal process, using the target node corresponding to the maximum value as the target node that matches the configuration information corresponding to the currently traversed source node, establishing a matching relationship between the currently traversed source node and the matched target node, and deleting the target node corresponding to the maximum value from the target node list.
[0049] Exemplarily, in the first step, for a source node, the similarity between the source node and all nodes in the target node list is calculated. In the second step, the target node with the greatest similarity is found, and the source node and the target node with the greatest similarity are set as a matching node pair, that is, the configuration information is most similar, and the target node is removed from the target node list. In the third step, all remaining source nodes are traversed in turn, and the first and second steps are repeated.
[0050] Figure 3 The figure shows a schematic diagram of the row-by-row search process. In step S200, the similarity between the source node R1 and each target node in the target node list is obtained, and the target node D3 with the largest similarity is obtained. The source node R1 and the target node D3 are matched as the optimal node pair, and D3 is deleted from the target node list; in step S201, the similarity between the source node R2 and each target node in the target node list is obtained, and the target node D4 with the largest similarity is obtained. The source node R2 and the target node D4 are matched as the optimal node pair, and D4 is deleted from the target node list; in step S202, the similarity between the source node R3 and each target node in the target node list is obtained, and the target node D2 with the largest similarity is obtained. The source node R3 and the target node D2 are matched as the optimal node pair, and D2 is deleted from the target node list. At this time, the source node traversal is completed and the process ends.
[0051] Solution B uses a global search method to select the optimal node pair.
[0052] The target node with the highest similarity corresponding to each source node is used as the target node matched with the source node to obtain the matching relationship between the source node and the target node, including: constructing a similarity matrix with each source node as a column and each target node as a row, wherein the value of any element in the similarity matrix is the similarity between the source node in the column and the target node in the row; in a matching process, extracting the maximum value from the similarity matrix, using the target node in the row where the maximum value is located as the target node that matches the configuration information corresponding to the source node in the column where the maximum value is located, obtaining the matching relationship between the source node in the column where the maximum value is located and the matched target node, deleting the row and column where the maximum value is located from the similarity matrix, and executing the matching process again until the target node that matches the configuration information corresponding to each source node is obtained.
[0053] Exemplarily, in the first step, the similarity of all source nodes and all target nodes is calculated. In the second step, the source node and target node corresponding to the current maximum similarity are found, set as the matching node pair, and the similarity of the source node row and the target node column of the best matching node pair is removed. In the third step, the second step is repeated until all source nodes are matched.
[0054] Figure 4 The figure shows a schematic diagram of the global search process. In step s300, the maximum similarity corresponds to the source node R2 and the target node D4, R2 and D4 are set as the optimal node pair, and the row where R2 is located and the column where D4 is located are deleted; in step s301, the maximum similarity corresponds to the source node R3 and the target node D2, R3 and D2 are set as the optimal node pair, and the row where R3 is located and the column where D2 is located are deleted; in step s302, the maximum similarity corresponds to the source node R1 and the target node D3, R1 and D3 are set as the optimal node pair, and the row where R1 is located and the column where D3 is located are deleted. At this time, all source nodes have been matched and the process ends.
[0055] It should be noted that the row-by-row search and global search provided by Scheme A and Scheme B are greedy methods, and the local optimal solution is obtained, which is close to the global optimal solution. In addition, other methods can be used to obtain the optimal node pair, for example, the N Queens method is a backtracking method, which can obtain the global optimal solution, but the time complexity is high, and the calculation time is very long when the number of nodes is large, which will not be described in detail here.
[0056] In some embodiments, the similarity between each source node and each target node is determined based on the configuration information of each source node and the corresponding planned configuration information of each target node, including: determining the similarity between each source node and each target node based on the label set corresponding to each source node and the label set corresponding to each target node; wherein the label set is used to refer to the configuration information of the corresponding node, the similarity is proportional to the overlap, and the overlap is used to indicate the degree of overlap between the label set corresponding to the source node and the label set corresponding to the target node; wherein the label set includes at least one label.
[0057] For example, in a bare metal server cluster, the hardware specifications, running services, and functions of each node may be different, and they are distinguished by the node label set. The node label set includes at least one label. A label can be a string. For example, a set of key-value pairs is used as a label. Different labels use different strings. Different parameters of the node use different labels. The label set composed of the labels of each parameter can be used to describe the configuration information of the node. For example, the hardware rules of the node use one label, the business running the node uses another label, and the function undertaken by the node uses another label.
[0058] In some embodiments, the similarity between each source node and each target node is determined based on the tag set corresponding to each source node and the tag set corresponding to each target node. Various schemes may be used, including but not limited to the similarity calculation schemes listed below:
[0059] Solution 1, Jaccard similarity
[0060] According to the label set corresponding to each source node and the label set corresponding to each target node, the similarity between each source node and each target node is determined, including: for each source node and any group of source nodes and target nodes in each target node, the following process is performed: the intersection of the label set corresponding to the source node and the label set corresponding to the target node is obtained, and the union of the label set corresponding to the source node and the label set corresponding to the target node is obtained; the ratio of the number of labels contained in the intersection to the number of labels contained in the union is used as the similarity between the source node and the target node.
[0061] Exemplarily, the Jaccard similarity calculation formula is used to calculate the similarity between a source node and a target node. L1 represents a label set of a source node, and L2 represents a label set of a target node. The Jaccard similarity sim is defined as the ratio of the number of labels in the intersection of L1 and L2 to the number of labels in the union. The calculation formula is formula (1):
[0062] sim=|L1∩L2| / |L1∪L2|(1)
[0063] Solution 2, optimized Jaccard similarity
[0064] According to the label set corresponding to each source node and the label set corresponding to each target node, the similarity between each source node and each target node is determined, including: for each source node and any group of source nodes and target nodes in each target node, the following process is performed: the intersection of the label set corresponding to the source node and the label set corresponding to the target node is obtained, and the union of the label set corresponding to the source node and the label set corresponding to the target node is obtained; when the intersection is empty, the similarity between the source node and the target node is set to a negative value; when the intersection is not empty, the middle value is obtained by taking the square root of the number of labels contained in the union, and the ratio of the number of labels contained in the intersection to the middle value is used as the similarity between the source node and the target node.
[0065] For example, the Jaccard optimized similarity calculation formula increases the weight of the intersection relative to the Jaccard similarity, and introduces negative values to distinguish the case where the intersection is zero, which is more in line with the business scenario. L1 represents the source node label set, L2 represents the target node label set, and the Jaccard optimized similarity calculation formula is formula (2):
[0066]
[0067] Solution 3, cosine similarity
[0068] According to the label set corresponding to each source node and the label set corresponding to each target node, the similarity between each source node and each target node is determined, including: merging and sorting the labels in the label set corresponding to each source node and the label set of each target node to obtain an ordered set; performing the following process for any group of source nodes and target nodes in each source node and each target node: obtaining the first number of occurrences of each label of the ordered set in the label set corresponding to the source node and the second number of occurrences in the label set of the target node; respectively obtaining the product value of the first number and the second number corresponding to each label in the ordered set, and accumulating the product value corresponding to each label in the ordered set as a first sum value; respectively obtaining the square value of the first number corresponding to each label in the ordered set and summing them to obtain a first sum value, and respectively obtaining the square value of the second number corresponding to each label in the ordered set and summing them to obtain a second sum value, and taking the product value of the first sum value and the second sum value as the second sum value; taking the ratio of the first sum value to the second sum value as the similarity between the source node and the target node.
[0069] Exemplarily, the label sets of all source nodes and all target nodes are unioned and sorted to obtain an ordered set G; Ni represents the number of times the i-th label in the ordered set G appears on the source node, Mi represents the number of times the i-th label in the ordered set G appears on the target node, and n represents the number of labels in the ordered set. The cosine similarity calculation formula is formula (3):
[0070]
[0071] Step 203: perform resource migration on the source node according to the matching relationship, so as to expand the source node to a matching target node.
[0072] In some embodiments, the cluster expansion method further includes: configuring the newly added node as a target node that does not match the source node according to the configuration information of the target node that does not match the source node in the target cluster.
[0073] In an exemplary embodiment, Figure 5 The following is a schematic diagram of the bare metal server cluster expansion process, which mainly includes the following steps:
[0074] Step 501, obtaining configuration information of a bare metal server source cluster;
[0075] Step 502, generating a source cluster assembly graph;
[0076] Step 503: read the resource description file of the expansion target scale to obtain the configuration information of the target cluster;
[0077] Step 504, generating a target cluster assembly graph;
[0078] Among them, the execution order of step 501 to step 502 and step 503 to step 504 is not limited. Step 501 to step 502 can be executed first, and then step 503 to step 504, or step 503 to step 504 can be executed first, and then step 501 to step 502, or step 503 to step 504 can be executed in parallel while step 501 to step 502 is executed.
[0079] Step 505, calculating the similarity between the source node in the source cluster assembly graph and the target node in the target cluster assembly graph;
[0080] Step 506, determining the best node pair matching the source node and the target node based on the similarity;
[0081] Step 507, outputting the matching result, which includes the information of each optimal node pair and the information of the source node and the target node in the optimal node pair; the matching result may be saved in a file in a format such as json, xls, xlsx, xml, txt, etc.;
[0082] Step 508, the newly added server is used as an unmatched target node and incorporated into the cluster management;
[0083] Step 509 , updating the node labels of all nodes in the cluster, that is, updating the label set of the nodes in the cluster according to the matching result and the resource description file of the target cluster.
[0084] In an exemplary embodiment, Figure 6 The diagram shows the matching diagram of the source cluster and the target cluster. A wireless network unified management system (UME) network management system has 2 source nodes for computing and 1 source node for distributed database in the source cluster. Now it is planned to expand the capacity of the system, and the expansion target template has 2 target nodes for computing and 2 target nodes for distributed storage. The configuration of one of the source nodes for computing in the source cluster remains unchanged, that is, the source node 1 for computing in the source cluster is directly used as the target node 1 for computing in the target cluster; another source node for computing in the source cluster has a new middleware service (represented by a new label), that is, the source node 2 for computing in the source cluster is added with a new middleware service and the label set is modified to obtain the target node 2-1 for computing in the target cluster; the source node 1 for distributed database in the source cluster is directly used as the target node 1 for distributed storage in the target cluster. After the cluster expansion method provided by the embodiment of the present disclosure is used for operation, the original 2 source nodes for computing and one source node for distributed database in the source cluster can be accurately matched, and the target node 2 for distributed storage that is not matched in the source cluster is identified as a new node. In the process of expanding the source cluster to obtain the target cluster, it is only necessary to slightly adjust the source node 2 used for calculation and add a new target node to complete the expansion.
[0085] In an exemplary embodiment, Figure 7 The diagram shows the matching of the source cluster and the target cluster. In a telecommunications cloud system, the source cluster has two source nodes for computing and has deployed product A. It is now planned to expand the system and deploy product B, and it is hoped that the same set of templates will be used for the expansion and the new deployment. The expanded target cluster has three target nodes for computing, two of which are allocated to product A, and the other is allocated to product B. After operating using the cluster expansion method provided in the embodiment of the present disclosure, it is possible to accurately match the two source nodes used by product A in the source cluster, namely source node 1 of product A and source node 2 of product A, and identify the target node used by product B as a newly added node. To expand from the source cluster to the target cluster, it is only necessary to add target node 1 of product B to complete the expansion.
[0086] In the disclosed embodiment, according to the configuration information of each source node in the source cluster to be expanded and the corresponding planned configuration information of each target node in the planning of the target cluster, the target node matching the configuration information corresponding to each source node is determined, and the matching relationship between the source node and the target node is obtained. According to the matching relationship, resources of the source node are migrated so that the source node is expanded to a matching target node, thereby realizing automatic cluster expansion without the need for network service personnel to manually modify the configuration parameters of each node in the source cluster. The operation method is simple and efficient, and the configuration information of the source node and the target node are optimally paired, which reduces the difficulty of resource migration during the expansion process, minimizes the amount of resource migration, improves the migration efficiency, and avoids the error rate caused by manual operation.
[0087] The cluster expansion method provided by the embodiment of the present disclosure can automatically identify the newly added nodes and automatically generate the configuration parameters of the newly added nodes, replacing the original manual identification and operation, improving the operation efficiency and reducing the operation complexity. The source nodes in the current cluster are matched with the target nodes in the expansion template, so that the amount of resource migration during the expansion process is significantly less than manual allocation, improving the efficiency and reliability of the expansion. Moreover, using the matching results, the parameter configuration of the source node is automatically updated, replacing the original manual identification and operation, improving the operation efficiency and reducing the operation complexity. In addition, it is also possible to provide a quantitative method for measuring the similarity between the source node and the target node before and after the expansion, to help users evaluate whether the expansion ladder is feasible.
[0088] The step division of the above various methods is only for clear description. When implemented, they can be combined into one step or some steps can be split and decomposed into multiple steps. As long as they include the same logical relationship, they are all within the protection scope of this disclosure. Adding insignificant modifications to the algorithm or process or introducing insignificant designs without changing the core design of the algorithm and process are all within the protection scope of this disclosure.
[0089] An embodiment of the present disclosure provides a cluster expansion device. The specific implementation of the device can refer to the relevant description of the method embodiment, which will not be repeated here. Figure 8 The schematic diagram of the structure of the device is shown, which mainly includes:
[0090] The acquisition module 801 is used to acquire the configuration information of each target node corresponding to the plan from the plan of the target cluster, and to extract the configuration information of each source node from the source cluster to be expanded;
[0091] A determination module 802 is used to determine the target node that matches the configuration information corresponding to each source node according to the configuration information of each source node and the configuration information of each target node, so as to obtain a matching relationship between the source node and the target node;
[0092] The expansion module 803 is used to migrate resources of the source node according to the matching relationship, so as to expand the source node to the matching target node.
[0093] In an exemplary embodiment, Fig. 9 It is a schematic diagram of the structure of a cluster expansion device, where the acquisition module 801 includes a query submodule 901 and a file input submodule 902 , and the determination module 802 includes a calculation submodule 903 , a selection submodule 904 and an output submodule 905 .
[0094] The query submodule 901 is used to query the configuration information of the source cluster and generate the source cluster assembly diagram through the network interface provided by the cloud platform. The file input submodule 902 is used to parse the resource configuration template file used when deploying the target scale system, obtain the configuration information of the target cluster, and generate the target cluster assembly diagram. The calculation submodule 903 is used to input the source cluster assembly diagram and the target cluster assembly diagram, and calculate the similarity between the original node and the target node based on the node label. The selection submodule 904 is used to determine the optimal matching node pair based on the similarity of the nodes. The output submodule 905 is used to output the matching results, including the information of all matching node pairs, and the information of the matching node pairs includes the configuration information of the source node with the most similar configuration information and the configuration information of the target node.
[0095] The functions or modules included in the device provided in the embodiments of the present disclosure can be used to execute the method described in the method embodiments. The specific implementation and technical effects thereof can be referred to the description of the method embodiments above, and will not be described again here for the sake of brevity.
[0096] It should be noted that all modules involved in this embodiment are logic modules. In practical applications, a logic unit may be a physical unit, or a part of a physical unit, or may be implemented as a combination of multiple physical units. In addition, in order to highlight the innovative part of the present disclosure, this embodiment does not introduce units that are not closely related to solving the technical problems proposed by the present disclosure, but this does not mean that there are no other units in this embodiment.
[0097] Reference Fig.10 , an embodiment of the present disclosure provides an electronic device, comprising:
[0098] at least one processor 1001;
[0099] A memory 1002 having at least one program stored thereon, and when the at least one program is executed by the at least one processor, the at least one processor implements the above method;
[0100] At least one I / O interface 1003 is connected between the processor and the memory and is configured to implement information exchange between the processor and the memory.
[0101] Among them, the processor 1001 is a device with data processing capabilities, including but not limited to a central processing unit (CPU); the memory 1002 is a device with data storage capabilities, including but not limited to random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory (FLASH); the I / O interface (read-write interface) 1003 is connected between the processor 1001 and the memory 1002, and can realize information interaction between the processor 1001 and the memory 1002, including but not limited to a data bus (Bus), etc.
[0102] In some embodiments, the processor 1001 , the memory 1002 , and the I / O interface 1003 are connected to each other through a bus, and further connected to other components of the computing device.
[0103] This embodiment further provides a computer-readable medium on which a computer program is stored. When the program is executed by a processor, the method provided by this embodiment is implemented. To avoid repeated description, the specific steps of the method are not repeated here.
[0104] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods applied for above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those skilled in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
[0105] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0106] Those skilled in the art will understand that although some embodiments described herein include certain features included in other embodiments but not other features, the combination of features from different embodiments is meant to be within the scope of the present embodiment and to form different embodiments.
[0107] It is to be understood that the above embodiments are merely exemplary embodiments used to illustrate the principles of the present disclosure, but the present disclosure is not limited thereto. For those of ordinary skill in the art, various modifications and improvements can be made without departing from the spirit and substance of the present disclosure, and these modifications and improvements are also considered to be within the scope of protection of the present disclosure.
Claims
1. A cluster expansion method, characterized in that: include: Obtain the configuration information of each target node from the target cluster plan, and extract the configuration information of each source node from the source cluster to be expanded; According to the configuration information of each source node and the configuration information of each target node, the target node matching the configuration information corresponding to each source node is determined to obtain a matching relationship between the source node and the target node; The resources of the source node are migrated according to the matching relationship, so that the source node is expanded to become the matching target node.
2. The cluster expansion method according to claim 1, characterized in that: The step of determining the target node that matches the configuration information corresponding to each source node according to the configuration information of each source node and the configuration information of each target node, and obtaining the matching relationship between the source node and the target node includes: Determine the similarity between each of the source nodes and each of the target nodes according to the configuration information of each of the source nodes and the configuration information of the corresponding plan of each of the target nodes; The target node with the highest similarity corresponding to each source node is used as the target node matched with the source node, so as to obtain a matching relationship between the source node and the target node.
3. The cluster expansion method according to claim 2, characterized in that: The step of taking the target node with the highest similarity corresponding to each of the source nodes as the target node matched with the source node to obtain a matching relationship between the source node and the target node includes: Add each of the target nodes to a target node list; Traverse each of the source nodes, and in each traversal process obtain the maximum value of the similarities between the currently traversed source node and each target node in the target node list, use the target node corresponding to the maximum value as the target node that matches the configuration information corresponding to the currently traversed source node, establish a matching relationship between the currently traversed source node and the matched target node, and delete the target node corresponding to the maximum value from the target node list.
4. The cluster expansion method according to claim 2, characterized in that: The step of taking the target node with the highest similarity corresponding to each of the source nodes as the target node matched with the source node to obtain a matching relationship between the source node and the target node includes: A similarity matrix is constructed with each source node as a column and each target node as a row, wherein the value of any element in the similarity matrix is the similarity between the source node in the column and the target node in the row; In a matching process, the maximum value is extracted from the similarity matrix, and the target node in the row where the maximum value is located is used as the target node that matches the configuration information corresponding to the source node in the column where the maximum value is located, so as to obtain the matching relationship between the source node in the column where the maximum value is located and the matched target node, and delete the row and column where the maximum value is located from the similarity matrix, and perform the matching process again until the target node that matches the configuration information corresponding to each source node is obtained.
5. The cluster expansion method according to claim 2, characterized in that: Determining the similarity between each of the source nodes and each of the target nodes according to the configuration information of each of the source nodes and the configuration information of the corresponding plan of each of the target nodes includes: Determine the similarity between each source node and each target node according to the label set corresponding to each source node and the label set corresponding to each target node; Among them, the label set is used to refer to the configuration information of the corresponding node, the similarity is proportional to the overlap, and the overlap is used to indicate the overlap degree between the label set corresponding to the source node and the label set corresponding to the target node; wherein the label set includes at least one label.
6. The cluster expansion method according to claim 5, characterized in that: The determining, according to the label set corresponding to each source node and the label set corresponding to each target node, the similarity between each source node and each target node, comprises: For any group of the source nodes and the target nodes among the source nodes and the target nodes, the following process is performed: Obtaining the intersection of the label set corresponding to the source node and the label set corresponding to the target node, and obtaining the union of the label set corresponding to the source node and the label set corresponding to the target node; The ratio of the number of labels included in the intersection to the number of labels included in the union is used as the similarity between the source node and the target node.
7. The cluster expansion method according to claim 5, characterized in that: The determining, according to the label set corresponding to each source node and the label set corresponding to each target node, the similarity between each source node and each target node, comprises: For any group of the source nodes and the target nodes among the source nodes and the target nodes, the following process is performed: Obtaining the intersection of the label set corresponding to the source node and the label set corresponding to the target node, and obtaining the union of the label set corresponding to the source node and the label set corresponding to the target node; When the intersection is empty, the similarity between the source node and the target node is set to a negative value; When the intersection is not empty, the square root of the number of labels included in the union is obtained to obtain an intermediate value, and the ratio of the number of labels included in the intersection to the intermediate value is used as the similarity between the source node and the target node.
8. The cluster expansion method according to claim 5, characterized in that: The determining, according to the label set corresponding to each source node and the label set corresponding to each target node, the similarity between each source node and each target node, comprises: Merge and sort the label sets corresponding to the source nodes and the labels in the label sets of the target nodes to obtain an ordered set; For any group of the source nodes and the target nodes among the source nodes and the target nodes, the following process is performed: Obtain the first number of times each label of the ordered set appears in the label set corresponding to the source node and the second number of times each label appears in the label set of the target node; Respectively obtain the product value of the first number of times and the second number of times corresponding to each tag in the ordered set, and accumulate the product value corresponding to each tag in the ordered set as a first sum value; Respectively obtain the square value of the first times corresponding to each tag in the ordered set and sum them to obtain a first sum value, and respectively obtain the square value of the second times corresponding to each tag in the ordered set and sum them to obtain a second sum value, and use the product of the first sum value and the second sum value as the second sum value; The ratio of the first sum value to the second sum value is used as the similarity between the source node and the target node.
9. The cluster expansion method according to claim 1, characterized in that: The cluster capacity expansion method further includes: According to the configuration information of the target node that is not matched to the source node in the target cluster, the newly added node is configured as the target node that is not matched to the source node.
10. A cluster expansion device, characterized in that: include: The acquisition module is used to obtain the configuration information of each target node corresponding to the plan from the plan of the target cluster, and to extract the configuration information of each source node from the source cluster to be expanded; A determination module, configured to determine the target node that matches the configuration information corresponding to each source node according to the configuration information of each source node and the configuration information of each target node, and obtain a matching relationship between the source node and the target node; An expansion module is used to migrate resources of the source node according to the matching relationship so as to expand the source node to the matching target node.
11. An electronic device, characterized in that: include: at least one processor; A memory having one or more programs stored thereon, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 9; At least one I / O interface is connected between the processor and the memory and is configured to implement information interaction between the processor and the memory.
12. A computer readable medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the method according to any one of claims 1 to 9.
