A distributed deployment method and system of an application system
Patent Information
- Application Number
- CN202211557664.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-06
- Publication Date
- 2026-10-30
- Estimated Expiration
- 2042-12-06
AI Technical Summary
但是针对地市装置规模不同要规划模块数量,各地市可视化监拍后台系统为多机部署,存在硬件资源不足或硬件资源浪费的不匹配问题,并且部署过程较为繁杂,需要较多的人工干预
[0021]本公开中,首先通过打分,将资源需求和资源进行量化,通过统一的量化标准实现资源的计算比较,能够提高计算机处理的效率及分布式部署效率;并且,将资源分配问题转化为装箱问题,按照资源箱的维度数据以及遍历顺序,得到多个部署方案,从而提高服务器资源的利用率,可以减少服务器的硬件部署。
Smart Images

Figure CN115994030B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the technical field of application system deployment, specifically to a distributed deployment method for application systems, which is particularly suitable for the system deployment of visual monitoring systems in power systems. Background Technology
[0002] The statements in this section are merely background information relating to this disclosure and do not necessarily constitute prior art.
[0003] Over the past decade, power grid construction has experienced rapid development, with transmission line construction progressing in parallel. This has led to significant imbalances in the number and structure of personnel. The traditional, manpower-based inspection model is inefficient and has limited capacity for improvement, making it unsuitable for current power grid operations. Utilizing visual monitoring devices is an effective solution. By installing these devices on transmission towers, photos are periodically taken and transmitted back to the operation and maintenance center. Intelligent identification then notifies maintenance personnel of potential damage locations, greatly improving inspection efficiency. Visual monitoring systems for transmission channels have been widely deployed in municipal and prefecture-level power operation and maintenance units.
[0004] The inventors discovered in their research that the visual monitoring system, as a backend application (i.e., the application system), primarily adopts a mainstream microservice architecture. This architecture places each functional element of the application system into multiple separate service processes. By distributing different service modules across different servers, it achieves distributed deployment and expands by replicating services on demand, resulting in a high degree of modularity. However, considering the varying scale of devices in different cities and the need to plan the number of modules, the multi-machine deployment of the visual monitoring backend system in each city leads to mismatches such as insufficient or wasted hardware resources. Furthermore, the deployment process is relatively complex and requires significant manual intervention. Summary of the Invention
[0005] To address the aforementioned issues, this disclosure proposes a distributed deployment method and system for application systems. The deployment problem of each module of the application system is planned as a bin packing problem, and the optimal resource deployment scheme is found through dynamic programming algorithm, thereby improving the utilization rate of server resources and reducing the waste of server hardware resources.
[0006] To achieve the above objectives, the present disclosure adopts the following technical solution:
[0007] One or more embodiments provide a distributed deployment method for an application system, including the following steps:
[0008] Obtain the server resource deployment requirements of each microservice module of the application system;
[0009] Microservice modules are tested and scored to obtain resource scores, and resource bins containing multi-dimensional data are built based on these resource scores.
[0010] Using a dynamic programming algorithm, resource bins are matched to each microservice module according to the set traversal order and deployment requirements, resulting in deployment schemes for different dimensions of data and different traversal orders.
[0011] The optimal deployment scheme is the one that yields the most remaining server resources when comparing deployment schemes obtained from different traversal orders.
[0012] One or more embodiments provide a distributed deployment system for an application system, including: a deployment server, a switch, and multiple application servers, wherein the deployment server is communicatively connected to the multiple application servers through the switch; the deployment server is configured to perform the steps described in the above method to distribute the application system to be deployed to the application servers.
[0013] One or more embodiments provide a distributed deployment system for an application system, including:
[0014] Demand Score Calculation Module: Configured to obtain the deployment requirements of each microservice module of the application system for server resources;
[0015] Resource bin building module: It is configured to test and score microservice modules to obtain resource scores, and build resource bins containing multi-dimensional data based on the resource scores;
[0016] Deployment module: It is configured to use a dynamic programming algorithm to match the corresponding resource bins for each microservice module according to the set traversal order and deployment requirements, so as to obtain the deployment scheme under different traversal orders for different dimensions of data of resources.
[0017] The optimal deployment scheme selection module is configured to compare deployment schemes obtained from different traversal orders, and the deployment scheme with the most remaining server resources is the optimal deployment scheme.
[0018] An electronic device includes a memory and a processor, as well as computer instructions stored in the memory and running on the processor, wherein the computer instructions, when executed by the processor, perform the steps described in the above method.
[0019] A computer-readable storage medium for storing computer instructions, which, when executed by a processor, perform the steps described in the above method.
[0020] Compared with the prior art, the beneficial effects of this disclosure are as follows:
[0021] In this disclosure, resource requirements and resources are first quantified by scoring. Resource calculation and comparison are achieved through a unified quantification standard, which can improve the efficiency of computer processing and distributed deployment. Furthermore, the resource allocation problem is transformed into a bin packing problem. According to the dimensional data of the resource bins and the traversal order, multiple deployment schemes are obtained, thereby improving the utilization rate of server resources and reducing the hardware deployment of servers.
[0022] The advantages of this disclosure, as well as its additional advantages, will be described in detail in the following specific embodiments. Attached Figure Description
[0023] The accompanying drawings, which form part of this disclosure, are used to provide a further understanding of this disclosure. The illustrative embodiments of this disclosure and their descriptions are used to explain this disclosure and do not constitute a limitation thereof.
[0024] Figure 1 This is a flowchart of the method according to Embodiment 1 of this disclosure;
[0025] Figure 2 This is a system block diagram of Embodiment 2 of this disclosure; Detailed Implementation
[0026] The present disclosure will be further described below with reference to the accompanying drawings and embodiments.
[0027] It should be noted that the following detailed descriptions are exemplary and intended to provide further illustration of this disclosure. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this disclosure pertains.
[0028] It should be noted that the terminology used herein is for descriptive purposes only and is not intended to limit the exemplary embodiments according to this disclosure. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof. It should be noted that, without conflict, the various embodiments and features within those embodiments can be combined with each other. The embodiments will now be described in detail with reference to the accompanying drawings.
[0029] This disclosure improves upon traditional distributed deployment, which requires placing the installation package on each server and, for servers with varying performance, evaluating server models before deciding which components to deploy. This method, however, requires no intervention on the target server, automatically calculating and installing the system modules that can be deployed on each server, improving resource utilization and reducing deployment complexity. Furthermore, by calculating a score for each server individually, server performance differences can be ignored during deployment.
[0030] Example 1
[0031] In one or more of the technical solutions disclosed in the implementation methods, such as Figure 1 As shown, a distributed deployment method for an application system includes the following steps:
[0032] Step 1: Obtain the server resource deployment requirements of each microservice module of the application system;
[0033] Step 2: Test and score the microservice modules to obtain resource scores, and build a resource bin containing multi-dimensional data based on the resource scores;
[0034] Step 3: Using a dynamic programming algorithm, according to the set traversal order, the corresponding resource bins are matched for each microservice module according to the deployment requirements, resulting in deployment schemes for different dimensions of data and different traversal orders.
[0035] Step 4: Compare the deployment schemes obtained from different traversal orders. The deployment scheme with the most remaining server resources is the optimal deployment scheme.
[0036] In this embodiment, resource requirements and resources are first quantified by scoring. Resource calculation and comparison are achieved through a unified quantification standard, which can improve the efficiency of computer processing and distributed deployment. Furthermore, the resource allocation problem is transformed into a bin packing problem. According to the dimensional data of the resource bins and the traversal order, multiple deployment schemes are obtained, thereby improving the utilization rate of server resources and reducing the hardware deployment of servers.
[0037] In step 1, each microservice module is run on the deployment server. During the operation, the system's CPU, memory, GPU, and hard disk usage are monitored, and the microservice module's requirements for CPU, memory, hard disk, and GPU resources are calculated.
[0038] Optionally, in step 2, a probe program can be used to test and score the target server. The test calculates the CPU, memory, hard disk, and GPU scores of each server, forming a resource bin that includes data in four dimensions: CPU, memory, hard disk, and GPU scores.
[0039] The process of testing and scoring the target server may include the following steps:
[0040] Step 21: Execute the computationally intensive code in the probe program, and then calculate the CPU score.
[0041] Step 22: Execute the memory statistics code in the probe program and calculate the memory score;
[0042] Step 23: Execute the file write and read code in the probe program, and then calculate the hard disk score.
[0043] Step 24: Execute the GPU performance test code in the probe program, and then calculate the GPU score.
[0044] In practice, packing problems can be categorized into three types: one-dimensional, two-dimensional, and three-dimensional. Three-dimensional packing problems are the most common in real life. One-dimensional packing problems consider only one factor, such as weight, volume, or length. Two-dimensional packing problems consider two factors—given a rectangular piece of paper (fabric, leather), the task is to cut out shapes of varying sizes from this paper, finding a cutting method that minimizes the total area of waste material. Common applications include dividing storage areas into functional zones based on length and width, parking lot layout, minimizing material waste when cutting packaging materials, and cutting clothing fabrics and leather in shoemaking. Three-dimensional packing problems consider three factors, generally length, width, and height. Loading trucks, ships, and containers requires ensuring that all three dimensions are within acceptable limits.
[0045] In this embodiment, each application server is considered as a four-dimensional box as a resource box, with the four dimensions being: the server's CPU score, memory score, hard disk score, and GPU score.
[0046] In this embodiment, a dynamic programming algorithm is used to perform bin packing calculations on resource modules to obtain the optimal deployment scheme. In step 3, the dynamic programming algorithm is used to match the corresponding resource bins for each microservice module according to the set traversal order and deployment requirements, thereby obtaining the deployment scheme for different dimensions of data and different traversal orders for resources. The steps include the following:
[0047] Step 31: Sort each microservice module and server resource according to the set dimension data;
[0048] Optionally, the sorting can be done in ascending or descending order according to the corresponding dimension data.
[0049] Step 32: Set the starting point of the traversal, traverse the server resources in the order of arrangement, configure the server resources for the microservice modules, and update the server resource box after each microservice module is configured; obtain the configuration scheme under different sorting and different traversal starting points.
[0050] Optionally, the starting point for traversal can be any server, including the first server, the last server, or any server in between.
[0051] Optionally, the server resource bin can be updated after configuration. Specifically, after the microservice module configures the server resources, the remaining resources of the current target server are added back to the resource bin.
[0052] Step 33: Determine if there is a microservice module configured. If not, obtain a deployment plan. If there is, reset the traversal starting point, restore the resource box to the original resource box, and execute step 32 until the set number of traversal rounds under the current sorting ends. Change the sorting method and execute step 31 to configure.
[0053] The number of traversal rounds under the current sorting is determined by the number of starting points set. If there are two starting points, such as the first server or the last server, two traversals will be performed. In one traversal, server resources can be configured for all microservice modules to obtain a deployment plan. If a microservice module fails to be configured, the configuration will fail in this traversal and no deployment plan can be obtained in this round.
[0054] Change the dimensions and reorder the data, then execute steps 31-33 above to obtain the deployment plan for each round of traversal.
[0055] The following is a specific example illustrating the above process. The example includes three dimensions: CPU, memory, and GPU.
[0056] Given a set of programs to be deployed, with resource requirements [CPU, memory, GPU] of [c0,m0,g0], [c1,m1,g1], ..., [cn,mn,gn], where c is the CPU requirement score, m is the memory requirement score, and g is the GPU requirement score, and the server resources are divided into resource bins of [sc0,sm0,sg0], [sc1,sm1,sg1], ..., [scn,smn,sgn], where each data set represents a score result, sc is the server CPU score, sm is the server memory score, and sg is the server GPU score; and the server resources must be greater than the program deployment requirements, as follows:
[0057] sum(c) <= sum(sc)
[0058] Sum(m) <= sum(sm)
[0059] sum(g) <= sum(sg).
[0060] The dynamic programming process described above seeks the optimal deployment solution within a controllable timeframe, specifically as follows: The program resource group is used to set...
[0061] 1) Configure program resource groups, resource bins, and result sets;
[0062] Program resource group: Used to store the microservice modules of the program to be deployed;
[0063] Resource Box: Used to store server resource groups;
[0064] Result set: Used to store the configuration server resource schemes for each microservice module;
[0065] 2) Sort the program resource group and server resource group in ascending order of CPU usage, respectively;
[0066] 3) Check if the program resource group is an empty set. If it is, end the process.
[0067] 4) From the first resource [c0,m0,g0] in the program's resource group, if a server resource group can be found that satisfies sc0>=c0, sm0>=m0, sg0>=g0, remove the program resource group [c0,m0,g0] from the resource bin. Add a tuple (0,0) to the result set to store a configuration result. Remove the server resource group [sc0,sm0,sg0] from the resource bin and insert the server resource group [sc0-c0,sm0-m0,sg0-g0] into the resource bin. Match server resources for each microservice module in the program resource group according to this step. If all microservice modules are successfully configured, a deployment plan is obtained; otherwise, proceed to step 5).
[0068] 5) Sort the program resource group and server resource group in ascending order of CPU, and clear the result set;
[0069] 6) Check if the program resource group is an empty set. If it is, end.
[0070] 7) Starting from the first resource [c0,m0,g0] in the program's resource group, if the last resource in the server resource group that satisfies sc0>=c0, sm0>=m0, sg0>=g0 can be found, remove the program resource group [c0,m0,g0] from the resource bin, add a tuple (0,0) to the result set, remove the server resource group [sc0,sm0,sg0] from the resource bin, and insert [sc0-c0,sm0-m0,sg0-g0] into the resource bin. Match server resources for each microservice module in the program resource group according to this step. If all microservice modules are successfully configured, a deployment scheme is obtained.
[0071] Replace the sorting metrics in steps 1-7 above with memory and GPU to obtain the corresponding deployment schemes. Compare the results. If the result set is empty, there is no reasonable deployment scheme. If there are multiple schemes, the best one is the one with more remaining elements in the server resource group after execution.
[0072] Example 2
[0073] Based on Embodiment 1, this embodiment provides a distributed deployment system for an application system, such as... Figure 2 As shown, it includes: a deployment server, a switch, and multiple application servers. The deployment server communicates with the multiple application servers through the switch. The deployment server is configured to execute the steps of the distributed deployment method of an application system described in Embodiment 1, and to distribute the application system to be deployed to the application servers.
[0074] Example 3
[0075] Based on Embodiment 1, this embodiment provides a distributed deployment system for an application system, including:
[0076] Demand Score Calculation Module: Configured to obtain the deployment requirements of each microservice module of the application system for server resources;
[0077] Resource bin building module: It is configured to test and score microservice modules to obtain resource scores, and build resource bins containing multi-dimensional data based on the resource scores;
[0078] Deployment module: It is configured to use a dynamic programming algorithm to match the corresponding resource bins for each microservice module according to the set traversal order and deployment requirements, so as to obtain the deployment scheme under different traversal orders for different dimensions of data of resources.
[0079] The optimal deployment scheme selection module is configured to compare deployment schemes obtained from different traversal orders, and the deployment scheme with the most remaining server resources is the optimal deployment scheme.
[0080] It should be noted that each module in this embodiment corresponds one-to-one with each step in embodiment 1, and their specific implementation process is the same, so it will not be repeated here.
[0081] Example 4
[0082] This embodiment provides an electronic device, including a memory and a processor, as well as computer instructions stored in the memory and running on the processor. When the processor executes the computer instructions, it performs the steps described in the method of Embodiment 1.
[0083] Example 5
[0084] This embodiment provides a computer-readable storage medium for storing computer instructions, which, when executed by a processor, complete the steps described in the method of Embodiment 1.
[0085] The above description is merely a preferred embodiment of this disclosure and is not intended to limit this disclosure. Various modifications and variations can be made to this disclosure by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
[0086] While the specific embodiments of this disclosure have been described above in conjunction with the accompanying drawings, this is not intended to limit the scope of protection of this disclosure. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art without creative effort based on the technical solutions of this disclosure are still within the scope of protection of this disclosure.
Claims
1. A distributed deployment method for an application system, characterized in that, Includes the following steps: Obtain the server resource deployment requirements of each microservice module of the application system; The target server of the microservice module is tested and scored to obtain a resource score, and a resource bin containing multi-dimensional data is constructed based on the resource score. Using a dynamic programming algorithm, resource bins are matched to each microservice module according to the set traversal order and deployment requirements, resulting in deployment schemes for different dimensions of data and different traversal orders. The optimal deployment scheme is the one that yields the most remaining server resources when comparing deployment schemes obtained from different traversal orders.
2. The distributed deployment method for an application system as described in claim 1, characterized in that: Run each microservice module on the deployment server, monitor the system's CPU, memory, GPU, and hard disk usage during operation, and calculate the microservice module's requirements for CPU, memory, hard disk, and GPU resources; Alternatively, a probe program can be used to test and score the target server, calculating the CPU, memory, hard disk, and GPU scores for each server, forming a resource bin that includes data from four dimensions: CPU, memory, hard disk, and GPU scores.
3. The distributed deployment method for an application system as described in claim 1, characterized in that: Using a dynamic programming algorithm, resource bins are matched to each microservice module according to the set traversal order and deployment requirements, resulting in deployment schemes for different dimensions of data and different traversal orders. The steps include: Sort the microservice modules and server resources according to the defined dimensions of data; Set the starting point for the traversal, traverse the server resources in the order they are arranged, configure the server resources for each microservice module, and update the server resource bin after each microservice module is configured. Determine if a microservice module exists for configuration. If not, obtain a deployment plan. If it does, reset the traversal starting point, restore the resource bin to its original state, and traverse the server resources sequentially according to the sorted order, configuring server resources for the microservice module until the set number of traversal rounds under the current sorting is completed.
4. The distributed deployment method for an application system as described in claim 3, characterized in that: The starting point for traversal includes the first server and the last server.
5. The distributed deployment method for an application system as described in claim 3, characterized in that: The data is sorted in ascending or descending order according to the corresponding dimension.
6. The distributed deployment method for an application system as described in claim 3, characterized in that, After configuration, update the server resource bin. Specifically, after configuring server resources in the microservice module, add the remaining resources of the current target server back to the resource bin.
7. A distributed deployment system for an application system, characterized in that, include: Deploy servers, switches, and multiple application servers. The deployment server communicates with the multiple application servers through the switch. The deployment server is configured to perform the steps of any one of claims 1-6 to distribute the application system to be deployed to the application server.
8. A distributed deployment system for an application system, characterized in that, include: Demand Score Calculation Module: Configured to obtain the deployment requirements of each microservice module of the application system for server resources; Resource bin building module: It is configured to test and score the target server of the microservice module to obtain resource score, and build a resource bin containing multi-dimensional data based on the resource score; Deployment module: It is configured to use a dynamic programming algorithm to match the corresponding resource bins for each microservice module according to the set traversal order and deployment requirements, so as to obtain the deployment scheme under different traversal orders for different dimensions of data of resources. The optimal deployment scheme selection module is configured to compare deployment schemes obtained from different traversal orders, and the deployment scheme with the most remaining server resources is the optimal deployment scheme.
9. An electronic device, characterized in that, It includes a memory and a processor, as well as computer instructions stored in the memory and running on the processor, which, when executed by the processor, perform the steps of any one of claims 1-6.
10. A computer-readable storage medium, characterized in that, Used to store computer instructions, which, when executed by a processor, perform the steps of any one of claims 1-6.
Citation Information
Patent Citations
Radar software component deployment strategy based on improved dynamic programming
CN110018832A
Micro-service combination deployment and scheduling method under multi-objective optimization
CN111027736A