An application scaling method, device, storage medium and electronic device

By determining the target host according to the network communication weight between the target application and other applications and the number of applications in the host when the application is expanded, the problem of failing to effectively consider the communication relationship between multiple applications in the existing technology is solved, and the effect of improving the communication efficiency between applications is achieved.

CN114253726BActive Publication Date: 2025-06-27PINGAN YIQIANBAO E COMMERCE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111564867.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-20
Publication Date
2025-06-27
Estimated Expiration
2041-12-20

AI Technical Summary

Technical Problem

When expanding and scaling the application, the prior art fails to effectively consider the communication relationship between multiple applications, resulting in low communication efficiency.

Method used

By determining the host queue corresponding to the target application, the host queue is traversed to determine the other applications deployed in each host and their number, and the target host is determined from the host queue based on the network communication weight between the target application and other applications and the number of applications in the host, so as to perform the scaling operation of the application in the target host.

Benefits of technology

This method can take into account the communication relationship between multiple applications in the host and deploy different applications with close communication relationships on the same host while the application is expanded and scaled, thereby improving the communication efficiency between applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114253726B_ABST
    Figure CN114253726B_ABST
Patent Text Reader

Abstract

An embodiment of the present invention relates to artificial intelligence, and provides an application scaling method, device, storage medium, and electronic device. The method includes: determining a host queue corresponding to a target application; where the host queue includes information of at least two hosts capable of deploying the target application; traversing the host queue, determining all other applications deployed in the hosts corresponding to each host information, and respectively determining the number of all other applications deployed in the hosts corresponding to each host information; determining target host information from the host queue according to the network communication weights between each application in all other applications and the target application, and the number of all other applications deployed in the hosts corresponding to each host information; performing a scaling operation on the target application in the host corresponding to the target host information. With this solution, different applications with close communication relationships can be deployed on the same host, improving the communication efficiency between applications.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of artificial intelligence technology, and in particular, to an application scaling method, device, storage medium, and electronic device. Background Art

[0002] For a certain application, usually to prevent the single host failure from affecting the application service, when scaling the application, the application is distributed as evenly as possible on different hosts. For example, for an application A1 with a scaling-up requirement, there are currently 3 available hosts H1, H2, and H3. Case 1: There are 3 applications A1 deployed on H1, 2 applications A1 deployed on H2, and no application A1 deployed on H3. At this time, when scaling up the application A1, priority will be given to scaling up the application A1 on H3. Case 2: There are 3 applications A1 deployed on H1, 1 application A1 deployed on H2, and 1 application A1 deployed on H3. At this time, when scaling up the application A1, it will be considered to scale up the application A1 on H2 or H3. Usually, H2 or H3 can be randomly selected to scale up the application A1.

[0003] However, the above scheme only considers the distribution of a single application and does not take multiple applications into account. Now, in the case where microservices and big data have become mainstream, the east-west traffic (referring to the communication between applications) of the communication between applications in the computer room has far exceeded the north-south traffic (referring to the communication between the application and the outside). How to reasonably scale the application cluster to improve the communication efficiency has become crucial. Summary of the Invention

[0004] Embodiments of the present invention provide an application scaling method, device, storage medium, and electronic device. When scaling the application, different applications with close communication relationships can be deployed on the same host, which can better improve the communication efficiency between applications.

[0005] In a first aspect, embodiments of the present invention provide an application scaling method, including:

[0006] Determine the host queue corresponding to the target application; wherein, the host queue contains at least two host information capable of deploying the target application;

[0007] Traverse the host queue, determine all other applications deployed on the hosts corresponding to each host information, and respectively determine the number of all other applications deployed on the hosts corresponding to each host information; wherein, all the other deployed applications are applications other than the target application;

[0008] Determine target host information from the host queue according to the network communication weights between each of all other deployed applications and the target application, and the number of all other deployed applications in the host corresponding to each host information;

[0009] Perform scaling operations on the target application in the host corresponding to the target host information.

[0010] In a second aspect, an embodiment of the present invention further provides an application scaling device, including:

[0011] A host queue determination module, configured to determine a host queue corresponding to a target application; wherein, the host queue includes at least two pieces of host information capable of deploying the target application;

[0012] An application deployment information determination module, configured to traverse the host queue, determine all other deployed applications in the host corresponding to each host information, and respectively determine the number of all other deployed applications in the host corresponding to each host information; wherein, all other deployed applications are applications other than the target application;

[0013] A target host determination module, configured to determine target host information from the host queue according to the network communication weights between each of all other deployed applications and the target application, and the number of all other deployed applications in the host corresponding to each host information;

[0014] A scaling module, configured to perform scaling operations on the target application in the host corresponding to the target host information.

[0015] In a third aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, it implements the application scaling method provided by the embodiment of the present invention.

[0016] In a fourth aspect, an embodiment of the present invention provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the computer program, it implements the application scaling method provided by the embodiment of the present invention.

[0017] The application scaling solution provided by the embodiments of the present invention determines the host queue corresponding to the target application; wherein, the host queue contains information of at least two hosts capable of deploying the target application; traverses the host queue, determines all other applications deployed in the hosts corresponding to each host information, and respectively determines the number of all other applications deployed in the hosts corresponding to each host information; wherein, all the other deployed applications are applications other than the target application; determines the target host information from the host queue according to the network communication weights between each application in all the other deployed applications and the target application, and the number of all other applications deployed in the hosts corresponding to each host information; performs a scaling operation on the target application in the host corresponding to the target host information. Through the technical solution provided by the embodiments of the present invention, the target host is determined according to the network communication weights and the number of other applications deployed in each host for the target application, so as to perform scaling on the target application in the target host, which can take into account the communication relationships among multiple applications in the host when scaling the application, deploy different applications with close communication relationships on the same host, and can better improve the communication efficiency among applications. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 is a flowchart of an application scaling method provided by an embodiment of the present invention;

[0019] Figure 2 is a flowchart of an application expansion method in another embodiment of the present invention;

[0020] Figure 3 is a flowchart of an application scaling-down method in another embodiment of the present invention;

[0021] Figure 4 is a schematic structural diagram of an application scaling device in another embodiment of the present invention;

[0022] Figure 5 is a schematic structural diagram of an electronic device in another embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0023] The embodiments of the present invention will be described in more detail with reference to the accompanying drawings. Although some embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be construed as limited to the embodiments described herein. On the contrary, these embodiments are provided to more thoroughly and completely understand the present invention. It should be understood that the drawings and embodiments of the present invention are only for exemplary purposes and are not used to limit the protection scope of the present invention.

[0024] It should be understood that the various steps described in the method embodiments of the present invention can be executed in different orders and / or executed in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present invention is not limited in this regard.

[0025] As used herein, the term "comprising" and its variations are open-ended, that is, "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

[0026] It should be noted that the concepts such as "first" and "second" mentioned in the present invention are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0027] It should be noted that the modifications of "one" and "a plurality" mentioned in the present invention are illustrative rather than restrictive. Those skilled in the art should understand that, unless otherwise clearly specified in the context, it should be understood as "one or more".

[0028] The names of the messages or information exchanged between multiple devices in the embodiments of the present invention are only for illustrative purposes and are not used to limit the scope of these messages or information.

[0029] Figure 1 A flowchart of an application scaling method provided for an embodiment of the present invention. The embodiments of the present invention are applicable to the situation of scaling an application. This method can be executed by an application scaling device, which can be composed of hardware and / or software and is generally integrated in an electronic device. As Figure 1 shown, the method specifically includes the following steps:

[0030] Step 110, determine the host queue corresponding to the target application; wherein, the host queue contains at least two pieces of host information capable of deploying the target application.

[0031] Among them, the target application is the application to be scaled. An application can be understood as a microservice. Different applications provide different microservices. In the embodiments of the present invention, the scaling applications distributed on each host can be called an application cluster. That is, the applications in the application cluster can be deployed on different hosts by means of single-point replication.

[0032] In an embodiment of the present invention, the host queue corresponding to the target application can be determined according to the input information of the user; or the host queue corresponding to the target application can be determined according to the relevant information of the target application and the configuration information of the host. Among them, the host queue corresponding to the target application contains at least two pieces of host information capable of deploying the target application, that is, the host queue corresponding to the target application contains the information of the host capable of deploying the resources corresponding to the target application. In an embodiment of the present invention, the information of at least two hosts capable of deploying the target application included in the host queue may include the configuration information and deployment information of the host. Among them, the configuration information may include the identification information capable of uniquely identifying the host and the relevant configurations such as the memory of the host, and the deployment information may include the various applications deployed in the host and the corresponding quantities and other relevant information.

[0033] Step 120: Traverse the host queue, determine all other applications deployed in the hosts corresponding to each piece of host information, and respectively determine the quantities of all other applications deployed in the hosts corresponding to each piece of host information.

[0034] In an embodiment of the present invention, traverse each host in the host queue corresponding to the target application, and respectively determine all other applications that have been deployed in the hosts corresponding to each piece of host information in the host queue and the quantities corresponding to all other applications. Among them, all other applications can be understood as applications other than the target application, and all other applications can be one or multiple. In addition, the types and corresponding quantities of other applications deployed in the hosts corresponding to each piece of host information in the host queue may be the same or different, and the embodiment of the present invention does not limit this. Exemplarily, it is possible to traverse the hosts corresponding to each piece of host information in the host queue corresponding to the target application, obtain the application deployment table stored in the current host, where the application deployment table includes each application currently deployed in the current host and its corresponding quantity, and find and obtain other applications other than the target application that have been deployed in the current host and the corresponding quantities according to the application deployment table.

[0035] Step 130: Determine the target host information from the host queue according to the network communication weights between each application in all other applications that have been deployed and the target application, and the quantities of all other applications deployed in the hosts corresponding to each piece of host information.

[0036] Among them, the network communication weight between the target application and other applications reflects the closeness or frequency of the communication relationship between the target application and other applications. The greater the network communication weight between the target application and a certain application, the closer the communication relationship between the target application and the application, or the more frequent the communication.

[0037] In an embodiment of the present invention, according to the network communication weights between each application among all other deployed applications in the host corresponding to each host information in the host queue, and the number of all other deployed applications in the host corresponding to each host information, the target host information is determined from the host queue. Exemplarily, for each host information in the host queue, calculate the product of the network communication weight between each application among all other deployed applications in the current host corresponding to the current host information and the number of the current applications deployed in the current host, sort the products in the current host, determine the maximum value among the products, and use the maximum product as the score of the current host information, so as to calculate the scores of all host information in the host queue through the above method. Determine the target host information from the host queue according to the scores of all host information. Among them, the host corresponding to the target host information can be understood as the host to be scaled in or out for the target application. For example, when scaling out the target application, the host information with the highest score in the host queue can be used as the target host information, that is, scale out the target application in the host corresponding to the host information with the highest score in the host queue. When scaling in the target application, the host information with the lowest score in the host queue can be used as the target host information, that is, scale in the target application in the host corresponding to the host information with the lowest score in the host queue.

[0038] Step 140, perform a scaling operation on the target application in the host corresponding to the target host information.

[0039] In an embodiment of the present invention, perform a scaling operation on the target application in the host corresponding to the target host information. Among them, the host corresponding to the target host information can be referred to as the target host. Exemplarily, performing a scaling-out operation on the target application in the target host can be understood as deploying the target application in the target host. Performing a scaling-in operation on the target application in the target host can be understood as canceling the deployment of the target application in the target host.

[0040] The application scaling method provided by the embodiments of the present invention determines a host queue corresponding to a target application; wherein, the host queue contains information of at least two hosts capable of deploying the target application; traverses the host queue, determines all other applications deployed in the hosts corresponding to each host information, and respectively determines the number of all other applications deployed in the hosts corresponding to each host information; wherein, all the other deployed applications are applications other than the target application; determines target host information from the host queue according to the network communication weights between each application in all the other deployed applications and the target application, and the number of all other applications deployed in the hosts corresponding to each host information; performs a scaling operation on the target application in the host corresponding to the target host information. Through the technical solution provided by the embodiments of the present invention, the target host is determined according to the network communication weights and the number of other applications deployed in each host for the target application, so as to perform scaling on the target application in the target host, which can take into account the communication relationship between multiple applications in the host when scaling the application, deploy different applications with close communication relationships on the same host, and can better improve the communication efficiency between applications.

[0041] In some embodiments, before traversing the host queue, determining all other applications deployed in the hosts corresponding to each host information, and respectively determining the number of all other applications deployed in the hosts corresponding to each host information, it further includes: respectively determining the number of the target application deployed in the hosts corresponding to each host information in the host queue; determining a sub-host queue from the host queue according to the number of the target application deployed in the hosts corresponding to each host information in the host queue; traversing the host queue, determining all other applications deployed in the hosts corresponding to each host information, and respectively determining the number of all other applications deployed in the hosts corresponding to each host information, including: traversing the sub-host queue, determining all other applications deployed in the hosts corresponding to each host information, and respectively determining the number of all other applications deployed in the hosts corresponding to each host information. The advantage of such a setting is that it can start from a global perspective, not only consider the decentralized deployment of single applications, but also take into account the communication relationship between multiple applications, prevent service unavailability caused by single application failures, and effectively improve the communication efficiency between applications.

[0042] In an embodiment of the present invention, the host queue corresponding to the target application contains host information capable of deploying the target application. Therefore, in the hosts corresponding to the host information in the host queue, one or more target applications may already be deployed, or the target application may not be deployed yet (i.e., the current number of deployed target applications is 0). Traverse the host queue to determine the current number of deployed target applications in the hosts corresponding to the host information in the host queue. Determine a sub-host queue from the host queue according to the number of deployed target applications in the hosts corresponding to the host information in the host queue. It can be understood that the queue composed of the host information in which the number of deployed target applications meets the preset conditions in the host queue is used as the sub-host queue. For example, when performing an expansion operation on the target application, the queue composed of the host information corresponding to the host with the fewest deployed target applications in the host queue can be used as the sub-host queue; when performing a contraction operation on the target application, the queue composed of the host information corresponding to the host with the most deployed target applications in the host queue can be used as the sub-host queue. Traverse the sub-host queue to determine all other deployed applications and their corresponding quantities in the hosts corresponding to the host information, and determine the target host information from the sub-host queue according to the network communication weights between each application in all other applications and the target application, and the number of all other deployed applications in the hosts corresponding to the host information.

[0043] Optionally, determining a host sub-queue from the host queue according to the number of the target applications deployed in the hosts corresponding to the respective host information in the host queue includes: determining a first host sub-queue or a second host sub-queue from the host queue according to the number of the target applications deployed in the hosts corresponding to the respective host information in the host queue; wherein, the first host sub-queue is a queue composed of the host information of the hosts with the least number of the target applications deployed, and the second host sub-queue is a queue composed of the host information of the hosts with the most number of the target applications deployed; traversing the host sub-queue to determine all other applications deployed in the hosts corresponding to the respective host information, and respectively determining the number of all other applications deployed in the hosts corresponding to the respective host information, including: traversing the first host sub-queue or the second host sub-queue to determine all other applications deployed in the hosts corresponding to the respective host information, and respectively determining the number of all other applications deployed in the hosts corresponding to the respective host information; determining target host information from the host queue according to the network communication weights between each of the other applications deployed and the target application, and the number of all other applications deployed in the hosts corresponding to the respective host information, including: determining first target host information from the first host sub-queue or determining second target host information from the second host sub-queue according to the network communication weights between each of the other applications deployed and the target application, and the number of all other applications deployed in the hosts corresponding to the respective host information; performing a scaling operation on the target application in the host corresponding to the target host information, including: performing an expansion operation on the target application in the host corresponding to the first target host information, or performing a contraction operation on the target application in the host corresponding to the second target host information.

[0044] Optionally, determining first target host information from the first host sub-queue or second target host information from the second host sub-queue according to the network communication weights between each of all other deployed applications and the target application, and the number of all other deployed applications in the hosts corresponding to each of the host information, includes: calculating the scores of each host information in the first host sub-queue or the second host sub-queue according to the network communication weights between each of all other applications and the target application and the number of all other deployed applications in the hosts corresponding to each of the host information; determining first target host information from the first host sub-queue or second target host information from the second host sub-queue according to the scores; wherein, using the host information with the highest score in the first host sub-queue as the first target host information, and using the host information with the lowest score in the second host sub-queue as the second target host information.

[0045] Exemplarily, traverse the host queue H1 corresponding to the target application, determine the number of target applications deployed in the hosts corresponding to each host information in the host queue H1, determine the host information with the least number of target applications deployed from the host queue H1, and use the queue composed of the host information with the least number of target applications deployed in the host queue H1 as the first host sub-queue H2. Traverse the first host sub-queue H2, determine all other deployed applications in each host and the corresponding first quantity, and determine the first target host information from the first host sub-queue H2 according to the network communication weights between the target application and each of all other applications and the corresponding first quantity. Then, perform an expansion operation on the target application on the host corresponding to the first target host information, that is, deploy the target application in the host corresponding to the first target host information.

[0046] Among them, determining a first target host from the first host sub-queue according to the network communication weights between each application in all other applications and the target application, and the number of all other applications already deployed in the host corresponding to each host information, includes: calculating the scores of each host information in the first host sub-queue according to the network communication weights between each application in the already deployed all other applications and the target application, and the number of all other applications already deployed in the host corresponding to each host information; determining the first target host information from the first host sub-queue according to the scores; wherein, taking the host information with the highest score in the first host sub-queue as the first target host information. The advantage of such a setting is that when performing an expansion operation on the target application, it can not only consider the decentralized deployment of a single application and expand the target application on the host where the target application is already deployed less, but also take into account the communication relationship between the target application and other applications, and try to deploy applications with a direct communication relationship or a close communication relationship on the same host, thereby reducing the cross-host communication between applications, not only effectively improving the communication efficiency between applications, but also reducing the pressure on the switch and improving the application response speed.

[0047] Alternatively, traverse the host queue H1 corresponding to the target application, determine the number of target applications already deployed in the host corresponding to each host information in the host queue H1, determine the host information with the most target applications already deployed from the host queue H1, and use the queue composed of the host information with the most target applications already deployed in the host queue H1 as the second host sub-queue H3. Traverse the second host sub-queue H3, determine all other applications already deployed in the host corresponding to each host information and the corresponding first quantity, and determine the second target host information from the second host sub-queue H3 according to the network communication weights between each application in all other applications and the target application and the corresponding first quantity. Then, perform a scaling-down operation on the target application on the host corresponding to the second target host information, that is, reduce the deployment of the target application in the host corresponding to the second target host information.

[0048] Among them, determining the second target host information from the second host sub-queue according to the network communication weights between each of all other deployed applications and the target application, and the number of all other deployed applications in the host corresponding to each host information, includes: calculating the scores of each host information in the second host sub-queue according to the network communication weights between each of all other deployed applications and the target application and the number of all other deployed applications in each host; determining the second target host information from the second host sub-queue according to the scores; wherein, the host information with the lowest score in the second host sub-queue is used as the second target host information. The advantage of this setting is that when performing the scaling-down operation on the target application, it can not only consider the decentralized deployment of a single application and scale down the target application on the host where the target application has been deployed more currently, but also take into account the communication relationship between the target application and other applications, and try to deploy the applications with direct communication relationships or close communication relationships on the same host, thereby reducing the cross-host communication between applications, not only effectively improving the communication efficiency between applications, but also reducing the pressure on the switch and improving the application response speed.

[0049] Optionally, calculating the scores of each host information in the first host sub-queue or the second host sub-queue according to the network communication weights between each of all other deployed applications and the target application, and the number of all other deployed applications in the host corresponding to each host information, includes: calculating the scores of each host information in the first host sub-queue or the second host sub-queue according to the following formula: wherein, S h represents the score of the host information h in the first host sub-queue or the second host sub-queue, W i represents the network communication weight between the i-th application among all other deployed applications in the host corresponding to the host information h and the target application, N i represents the first quantity of the i-th application among all other deployed applications in the host corresponding to the host information h, and n represents the total quantity of all other deployed applications in the host corresponding to the host information h.

[0050] Exemplarily, in the host queue corresponding to the target application A, the hosts with the least number of target application A are h1 and h2. That is, the first host sub-queue H2 contains the host information of two hosts h1 and h2. In the host corresponding to the host information h1, there are other applications B and C deployed in addition to the target application A. Among them, the number of application B deployed in the host corresponding to the host information h1 is 2, and the number of application C deployed is 1. In the host corresponding to the host information h2, there are other applications C and D deployed in addition to the target application A. Among them, the number of application C deployed in the host corresponding to the host information h2 is 1, and the number of application D deployed is 1. The network communication weights of the target application A with applications B, C, and D are b, c, and d respectively. Then the score of the host information h1 in the first host sub-queue H1 is S1 = b * 2 + c * 1, and the score of the host information h2 is S2 = c * 1 + d * 1.

[0051] Also exemplarily, in the host queue corresponding to the target application A, the host information with the most number of target application A is h3, h4, and h5. That is, the second host sub-queue H3 contains the host information of three hosts h3, h4, and h5. In the host corresponding to the host information h3, there are other applications B, C, and D deployed in addition to the target application A. Among them, the number of application B deployed in the host corresponding to the host information h3 is 1, the number of application C deployed is 2, and the number of application D deployed is 4. In the host corresponding to the host information h4, there are other applications D and E deployed in addition to the target application A. Among them, the number of application D deployed in the host corresponding to the host information h4 is 3, and the number of application E deployed is 1. In the host corresponding to the host information h5, there are other applications B and F deployed in addition to the target application A. Among them, the number of application B deployed in the host corresponding to the host information h5 is 2, and the number of application F deployed is 3. The network communication weights of the target application A with applications B, C, D, E, and F are b, c, d, e, and f respectively. Then the score of the host information h3 in the second host sub-queue H2 is S3 = b * 1 + c * 2 + d * 4, the score of the host information h4 is S4 = d * 3 + e * 1, and the score of the host information h5 is S5 = b * 2 + f * 3.

[0052] In some embodiments, before determining the target host information from the host queue according to the network communication weights between each of all other deployed applications and the target application, and the number of all other deployed applications in the host corresponding to each host information, it further includes: obtaining a communication weight table corresponding to the target application; wherein, the communication weight table corresponding to the target application includes the network communication weights between the target application and each of the other applications; and searching for the network communication weights between each of all other deployed applications and the target application from the communication weight table. The advantage of this setting is that the network communication weights between the target application and each of the other applications can be accurately and quickly obtained.

[0053] Exemplarily, the communication weight table corresponding to the target application can be obtained from the weight table database according to the identification information of the target application. Among them, different target applications correspond to different communication weight tables, that is, each application corresponds to a unique communication weight table. The communication weight table corresponding to the target application includes the network communication weights between the target application and each of the other applications. It should be noted that for applications not recorded in the communication weight table corresponding to the target application, it can be considered that the network communication weight between the target application and this application is 0. Then, from the communication weight table corresponding to the target application, search for the network communication weights between the target application and each of all other deployed applications in each host of the host queue, so as to determine the target host information from the host queue based on the network communication weights and the corresponding first quantity, so as to scale the target application on the host corresponding to the target host information.

[0054] Optionally, the obtaining method of the communication weight table corresponding to the target application includes: counting the historical communication data between the target application and each of the other applications within a preset time period; determining the network communication weights between the target application and each of the other applications based on the historical communication data; and recording the communication network weights between the target application and each of the other applications in a preset data table to generate the communication weight table corresponding to the target application. Exemplarily, count the historical communication data between the target application and each of the other applications within a preset time period. Among them, the historical communication data can include the number of communications or communication traffic. Then, based on a preset network communication weight calculation strategy and the historical communication data, determine the network communication weights between the target application and each of the other applications, so as to generate the communication weight table corresponding to the target application. The network communication weight values in the communication weight table can be integers within the range of 0-100. The network communication volume weight ScoreB between target application A and application B can be 80, and the network communication weight ScoreC between target application A and application C can be 20. The remaining unrecorded applications can be defaulted to be irrelevant, that is, the network communication weight between the target application and this application is 0.

[0055] Among them, the embodiments of the present invention can acquire and process relevant data based on artificial intelligence technology. Among them, Artificial Intelligence (AI) is a theory, method, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use knowledge to obtain the best results.

[0056] Artificial intelligence basic technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, and mechatronics. Artificial intelligence software technologies mainly include several major directions such as computer vision technology, robotics, biometric technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0057] Figure 2 The flowchart of the application expansion method provided by an embodiment of the present invention is as follows. The method includes:

[0058] Step 210, determine the host queue corresponding to the target application; among them, the host queue contains information of at least two hosts that can deploy the target application.

[0059] Step 220, respectively determine the number of the target applications that have been deployed in the hosts corresponding to the host information of each host in the host queue.

[0060] Step 230, according to the number of the target applications that have been deployed in the hosts corresponding to the host information of each host in the host queue, determine the first host sub-queue from the host queue; among them, the first host sub-queue is a queue composed of the host information with the least number of the target applications that have been deployed.

[0061] Step 240, traverse the first host sub-queue, determine all other applications that have been deployed in the hosts corresponding to each host information, and respectively determine the number of all other applications that have been deployed in the hosts corresponding to each host information.

[0062] Step 250, calculate the scores of each host information in the first host sub-queue according to the network communication weights between each application in all other applications and the target application and the number of all other applications that have been deployed in each host.

[0063] Step 260, determine the first target host information from the first host sub-queue according to the scores; among them, the host information with the highest score in the first host sub-queue is used as the first target host information.

[0064] Step 270, perform an expansion operation on the target application in the host corresponding to the first target host information.

[0065] When performing an expansion operation on a target application, it is possible to consider the decentralized deployment of a single application and expand the target application on the host machine with fewer deployed target applications currently. At the same time, it can also take into account the communication relationship between the target application and other applications, and try to deploy applications with a direct communication relationship or a close communication relationship on the same host machine, thereby reducing the cross-host communication between applications. This not only effectively improves the communication efficiency between applications, but also reduces the pressure on the switch and improves the application response speed.

[0066] Figure 3 The flowchart of the application expansion method provided by an embodiment of the present invention, the method includes:

[0067] Step 310, determine the host machine queue corresponding to the target application; wherein, the host machine queue contains at least two pieces of host machine information capable of deploying the target application.

[0068] Step 320, respectively determine the number of deployed target applications in the host machines corresponding to each piece of host machine information in the host machine queue.

[0069] Step 330, according to the number of deployed target applications in the host machines corresponding to each piece of host machine information in the host machine queue, determine the second host machine sub-queue from the host machine queue; wherein, the second host machine sub-queue is a queue composed of the host machine information with the most deployed target applications.

[0070] Step 340, traverse the second host machine sub-queue, determine all other deployed applications in the host machines corresponding to each piece of host machine information, and respectively determine the number of all other deployed applications in the host machines corresponding to each piece of host machine information.

[0071] Step 350, according to the network communication weight between each application in all other applications and the target application and the number of all other deployed applications in each host machine, calculate the scores of each piece of host machine information in the second host machine sub-queue.

[0072] Step 360, determine the second target host machine information from the second host machine sub-queue according to the scores; wherein, the host machine information with the lowest score in the second host machine sub-queue is used as the second target host machine information.

[0073] Step 370, perform a scaling-down operation on the target application in the host machine corresponding to the second target host machine information.

[0074] When performing the operation of scaling down the target application, it is possible to consider the decentralized deployment of a single application and scale down the target application on the host machine where the target application has been deployed more currently. At the same time, it can also take into account the communication relationship between the target application and other applications, and try to deploy the applications with direct communication relationships or close communication relationships on the same host machine, so as to reduce the cross-host communication between applications. This not only effectively improves the communication efficiency between applications, but also reduces the pressure on the switch and improves the application response speed.

[0075] Figure 4 The following is a schematic structural diagram of an application scaling device provided by another embodiment of the present invention. As Figure 4 shown, the device includes: a host machine queue determination module 410, an application deployment information determination module 420, a target host machine determination module 430, and a scaling module 440. Among them,

[0076] The host machine queue determination module 410 is used to determine the host machine queue corresponding to the target application; where the host machine queue contains at least two pieces of host machine information capable of deploying the target application;

[0077] The application deployment information determination module 420 is used to traverse the host machine queue, determine all other applications deployed in the host machines corresponding to each piece of host machine information, and respectively determine the number of all other applications deployed in the host machines corresponding to each piece of host machine information; where all the other deployed applications are applications other than the target application;

[0078] The target host machine determination module 430 is used to determine the target host machine information from the host machine queue according to the network communication weights between each application in all the other deployed applications and the target application, and the number of all other applications deployed in the host machines corresponding to each piece of host machine information;

[0079] The scaling module 440 is used to perform the scaling operation on the target application in the host machine corresponding to the target host machine information.

[0080] The application scaling device provided by the embodiment of the present invention determines the host queue corresponding to the target application; wherein, the host queue contains at least two pieces of host information capable of deploying the target application; traverse the host queue, determine all other applications deployed in the hosts corresponding to each piece of host information, and respectively determine the quantities of all other applications deployed in the hosts corresponding to each piece of host information; wherein, all the other deployed applications are applications other than the target application; according to the network communication weights between each application in all the other deployed applications and the target application, and the quantities of all the other applications deployed in the hosts corresponding to each piece of host information, determine the target host information from the host queue; perform a scaling operation on the target application in the host corresponding to the target host information. Through the technical solution provided by the embodiment of the present invention, the target host is determined according to the network communication weights and quantities of the target application and other applications deployed in each host, so as to perform scaling on the target application in the target host, which can take into account the communication relationships among multiple applications in the host when scaling the application, deploy different applications with close communication relationships on the same host, and can preferably improve the communication efficiency among applications.

[0081] Optionally, the device further includes:

[0082] A quantity determination module, configured to, before traversing the host queue, determining all other applications deployed in the hosts corresponding to each piece of host information, and respectively determining the quantities of all other applications deployed in the hosts corresponding to each piece of host information, determine the quantity of the target application deployed in the hosts corresponding to each piece of host information in the host queue.

[0083] A host sub-queue determination module, configured to determine a host sub-queue from the host queue according to the quantity of the target application deployed in the hosts corresponding to each piece of host information in the host queue.

[0084] The application deployment information determination module includes:

[0085] An application deployment information determination unit, configured to traverse the host sub-queue, determine all other applications deployed in the hosts corresponding to each piece of host information, and respectively determine the quantities of all other applications deployed in the hosts corresponding to each piece of host information.

[0086] Optionally, the host sub-queue determination module is configured to:

[0087] Determine a first host sub-queue or a second host sub-queue from the host queue according to the number of the target applications deployed in the hosts corresponding to each host information in the host queue; wherein, the first host sub-queue is a queue composed of the host information with the least number of the target applications deployed, and the second host sub-queue is a queue composed of the host information with the most number of the target applications deployed;

[0088] The application deployment information determination unit is configured to:

[0089] Traverse the first host sub-queue or the second host sub-queue, determine all other applications deployed in the hosts corresponding to each host information, and respectively determine the number of all other applications deployed in the hosts corresponding to each host information;

[0090] The target host determination module includes:

[0091] The target host determination unit is configured to determine first target host information from the first host sub-queue or second target host information from the second host sub-queue according to the network communication weights between each application in all other deployed applications and the target application, and the number of all other applications deployed in the hosts corresponding to each host information;

[0092] The scaling module is configured to:

[0093] Perform an expansion operation on the target application in the host corresponding to the first target host information, or perform a scaling-down operation on the target application in the host corresponding to the second target host information.

[0094] Optionally, the target host determination unit includes:

[0095] The score calculation sub-unit is configured to calculate the scores of each host information in the first host sub-queue or the second host sub-queue according to the network communication weights between each application in all other deployed applications and the target application, and the number of all other applications deployed in the hosts corresponding to each host information;

[0096] The target host sub-determination unit is configured to determine first target host information from the first host sub-queue or second target host information from the second host sub-queue according to the scores; wherein, the host information with the highest score in the first host sub-queue is used as the first target host information, and the host information with the lowest score in the second host sub-queue is used as the second target host information.

[0097] Optionally, the score calculation subunit is configured to:

[0098] Calculate the scores of each host information in the first host sub-queue or the second host sub-queue according to the following formula:

[0099]

[0100] where S h represents the score of the host information h in the first host sub-queue or the second host sub-queue, W i represents the network communication weight between the i-th application among all other applications deployed in the host corresponding to the host information h and the target application, and N i represents the first quantity of the i-th application among all other applications deployed in the host corresponding to the host information h, and n represents the total quantity of all other applications deployed in the host corresponding to the host information h.

[0101] Optionally, the apparatus further includes:

[0102] A communication weight table acquisition module, configured to acquire the communication weight table corresponding to the target application before determining the target host information from the host queue according to the network communication weights between each application among all other deployed applications and the target application, and the quantities of all other applications deployed in the hosts corresponding to each host information; wherein, the communication weight table corresponding to the target application includes the network communication weights between the target application and each other application.

[0103] A network communication weight lookup module, configured to look up the network communication weights between each application among all other deployed applications and the target application from the communication weight table.

[0104] Optionally, the acquisition method of the communication weight table corresponding to the target application includes:

[0105] Statistical historical communication data of the target application and each other application within a preset time period;

[0106] Determine the network communication weights between the target application and each other application based on the historical communication data;

[0107] Record the communication network weights between the target application and each other application in a preset data table to generate the communication weight table corresponding to the target application.

[0108] The above device can execute the methods provided in all the foregoing embodiments of the present invention, and has corresponding functional modules and beneficial effects for executing the above methods. For technical details not described in detail in the embodiments of the present invention, reference may be made to the methods provided in all the foregoing embodiments of the present invention.

[0109] An embodiment of the present invention further provides a storage medium containing computer-executable instructions, and the computer-executable instructions are used to execute the application scaling method provided by the embodiment of the present invention when executed by a computer processor.

[0110] Storage medium - any of various types of memory devices or storage devices. The term "storage medium" is intended to include: installation media such as CD-ROM, floppy disk or magnetic tape devices; computer system memory or random access memory such as DRAM, DDRRAM, SRAM, EDORAM, Rambus RAM, etc.; non-volatile memory such as flash memory, magnetic media (such as hard disk or optical storage); registers or other similar types of memory elements, etc. The storage medium may also include other types of memory or combinations thereof. Additionally, the storage medium may be located in a first computer system in which the program is executed, or may be located in a different second computer system that is connected to the first computer system through a network (such as the Internet). The second computer system may provide program instructions to the first computer for execution. The term "storage medium" may include two or more storage media that may reside in different locations (such as in different computer systems connected through a network). The storage medium may store program instructions (such as specifically implemented as a computer program) executable by one or more processors.

[0111] Of course, for a storage medium containing computer-executable instructions provided by an embodiment of the present invention, the computer-executable instructions are not limited to the application scaling operations as described above, and can also execute related operations in the application scaling method provided by any embodiment of the present invention.

[0112] An embodiment of the present invention provides an electronic device, and the application scaling device provided by the embodiment of the present invention can be integrated in the electronic device. Figure 5 It is a structural block diagram of an electronic device provided by an embodiment of the present invention. The electronic device 500 may include: a memory 501, a processor 502, and a computer program stored on the memory 501 and executable on the processor. When the processor 502 executes the computer program, the application scaling method described in the embodiment of the present invention is implemented.

[0113] In the electronic device provided in the embodiment of the present invention, a host queue corresponding to a target application is determined; wherein, the host queue includes at least two pieces of host information capable of deploying the target application; traverse the host queue, determine all other applications deployed in the hosts corresponding to each piece of host information, and respectively determine the number of all other applications deployed in the hosts corresponding to each piece of host information; wherein, all the other deployed applications are applications other than the target application; according to the network communication weights between each application in all the other deployed applications and the target application, and the number of all other applications deployed in the hosts corresponding to each piece of host information, determine the target host information from the host queue; perform scaling operations on the target application in the host corresponding to the target host information. Through the technical solution provided in the embodiment of the present invention, by determining the target host according to the network communication weights and the number of other applications deployed in each host for the target application, so as to perform scaling operations on the target application in the target host, it is possible to take into account the communication relationships between multiple applications in the host when performing scaling operations on the application, deploy different applications with close communication relationships on the same host, and can better improve the communication efficiency between applications.

[0114] The application scaling device, storage medium and electronic device provided in the above embodiments can execute the application scaling method provided in any embodiment of the present invention, and have the corresponding functional modules and beneficial effects for executing the method. For technical details not described in detail in the above embodiments, reference can be made to the application scaling method provided in any embodiment of the present invention.

[0115] Note that the above is only a preferred embodiment of the present invention and the technical principles applied. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described here. Various obvious changes, re-adjustments and substitutions can be made by those skilled in the art without departing from the protection scope of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments. Without departing from the concept of the present invention, it can also include more other equivalent embodiments, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. An application scaling method, characterized in that, Including: Determine the host queue corresponding to the target application; wherein, the host queue contains at least two pieces of host information capable of deploying the target application; Respectively determine the number of the target applications that have been deployed in the hosts corresponding to each piece of host information in the host queue; Determine a first host sub-queue or a second host sub-queue from the host queue according to the number of the target applications that have been deployed in the hosts corresponding to each piece of host information in the host queue; wherein, the first host sub-queue is a queue composed of the host information with the least number of the target applications that have been deployed, and the second host sub-queue is a queue composed of the host information with the most number of the target applications that have been deployed; Traverse the first host sub-queue or the second host sub-queue, determine all other applications that have been deployed in the hosts corresponding to each piece of host information, and respectively determine the number of all other applications that have been deployed in the hosts corresponding to each piece of host information; wherein, all other applications that have been deployed are applications other than the target application; Determine a first target host information from the first host sub-queue or a second target host information from the second host sub-queue according to the network communication weights between each application in all other applications that have been deployed and the target application, and the number of all other applications that have been deployed in the hosts corresponding to each piece of host information; Perform an expansion operation on the target application in the host corresponding to the first target host information, or perform a contraction operation on the target application in the host corresponding to the second target host information.

2. The method according to claim 1, characterized in that Determine a first target host information from the first host sub-queue or a second target host information from the second host sub-queue according to the network communication weights between each application in all other applications that have been deployed and the target application, and the number of all other applications that have been deployed in the hosts corresponding to each piece of host information, including: Calculate the scores of each piece of host information in the first host sub-queue or the second host sub-queue according to the network communication weights between each application in all other applications that have been deployed and the target application, and the number of all other applications that have been deployed in the hosts corresponding to each piece of host information; Determine a first target host information from the first host sub-queue or a second target host information from the second host sub-queue according to the scores; wherein, the host information with the highest score in the first host sub-queue is used as the first target host information, and the host information with the lowest score in the second host sub-queue is used as the second target host information.

3. The method according to claim 2, characterized in that Calculate the scores of each piece of host information in the first host sub-queue or the second host sub-queue according to the network communication weights between each application in all other applications that have been deployed and the target application, and the number of all other applications that have been deployed in the hosts corresponding to each piece of host information, including: Calculate the scores of the host information in the first host sub-queue or the second host sub-queue according to the following formula: Among them, S h represents the score of the host information h in the first host sub-queue or the second host sub-queue, and W i represents the network communication weight between the i-th application among all other applications deployed in the host corresponding to the host information h and the target application, and N i represents the first quantity of the i-th application among all other applications deployed in the host corresponding to the host information h, and n represents the total quantity of all other applications deployed in the host corresponding to the host information h.

4. The method according to claim 1, wherein Before determining the first target host information from the first host sub-queue or the second target host information from the second host sub-queue according to the network communication weights between each application in all other deployed applications and the target application, and the number of all other deployed applications in the hosts corresponding to the respective host information, it further includes: Obtain the communication weight table corresponding to the target application; wherein, the communication weight table corresponding to the target application contains the network communication weights between the target application and each other application. Search for the network communication weights between each application in all other deployed applications and the target application from the communication weight table.

5. The method according to claim 4, wherein The obtaining method of the communication weight table corresponding to the target application includes: Statistical historical communication data between the target application and each other application within a preset time period; Determine the network communication weights between the target application and each other application based on the historical communication data; Record the communication network weights between the target application and each other application in a preset data table to generate the communication weight table corresponding to the target application.

6. An application scaling device, characterized in that, It includes: A host queue determination module, configured to determine the host queue corresponding to the target application; wherein, the host queue contains at least two pieces of host information capable of deploying the target application. A quantity determination module, configured to respectively determine the number of the target applications deployed in the hosts corresponding to the respective host information in the host queue. A host sub-queue determination module, configured to determine the first host sub-queue or the second host sub-queue from the host queue according to the number of the target applications deployed in the hosts corresponding to the respective host information in the host queue; wherein, the first host sub-queue is a queue composed of the host information with the least number of deployed target applications, and the second host sub-queue is a queue composed of the host information with the most number of deployed target applications. An application deployment information determination module, configured to traverse the first host sub-queue or the second host sub-queue, determine all other deployed applications in the hosts corresponding to the respective host information, and respectively determine the number of all other deployed applications in the hosts corresponding to the respective host information; wherein, all other deployed applications are applications other than the target application. A target host determination module, configured to determine the first target host information from the first host sub-queue or the second target host information from the second host sub-queue according to the network communication weights between each application in all other deployed applications and the target application, and the number of all other deployed applications in the hosts corresponding to the respective host information. The scaling module is used to perform an expansion operation on the target application in the host corresponding to the first target host information, or perform a scaling-down operation on the target application in the host corresponding to the second target host information.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processing device, it implements the application scaling method as described in any one of claims 1-5.

8. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the application scaling method as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Service scheduling method based on micro-service architecture and implementation system thereof

    CN111880898A