Intelligent deployment method and device of to-be-deployed service and computer equipment

Through cluster analysis and service dependency optimization, the problems of latency and load imbalance in server deployment are solved, and intelligent and efficient server deployment is realized, reducing network latency and improving high availability.

CN119201139APending Publication Date: 2024-12-27CHINA TELECOM DIGITAL INTELLIGENCE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411374371.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-29
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

Existing server deployment methods lead to longer delays when network transmission is not considered, and manual partitioning of servers in unknown network topology increases latency and load imbalance, lacks high availability.

Method used

By clustering analysis of the response time between servers, build a service dependency link, select the available clustering interval and server IP list that are the fastest away from the container IP, match the available IP according to the service specifications, and optimize the deployment order to reduce the response time.

Benefits of technology

Reduce network delay, improve load balancing, realize intelligent and high availability of service deployment, reduce graph computing complexity, and improve deployment efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119201139A_ABST
    Figure CN119201139A_ABST
Patent Text Reader

Abstract

The invention relates to an intelligent deployment method and device for a to-be-deployed service and computer equipment. The method comprises the following steps: clustering response time key value pairs of each server according to response time intervals to obtain a plurality of clustering intervals; selecting a container IP of a deployed service according to the constructed dependency relationship triple, searching for an available clustering interval fastest to the container IP and a corresponding server IP list, and determining a to-be-matched service according to upstream and downstream of the deployed service, matching the server IP with the most available specifications from the server IP list according to the specification key value pair of the to-be-matched service to obtain a corresponding deployment result; sequencing the serial numbers in the dependency relationship triad to obtain a serial number linear table, calculating total response time according to deployment key value pairs corresponding to the serial numbers in the serial number linear table to obtain a minimum response time linear table, and performing service deployment according to the minimum response time linear table. By adopting the method, the network delay can be reduced, the balanced distribution of the load is improved, and intelligent service deployment is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to an intelligent deployment method, device and computer equipment for a service to be deployed. Background Art

[0002] Servers provide high-capacity, high-performance storage solutions to ensure data security and reliability. As business expands, the amount of data increases dramatically. Servers can effectively manage and store this data, while supporting data backup and recovery to ensure data security and rapid recovery when necessary. Enterprises need servers to host websites, provide email services, and share files. At the same time, enterprise applications developed or used independently also need to run on servers. For enterprises, deploying servers is not only an inevitable trend in technological development, but also an important means to improve efficiency, ensure data security, and achieve business continuity.

[0003] Currently, there are two ways to implement server deployment. The first is to use the deployment system to randomly select servers for services to be deployed in one or more computer rooms, regions, or racks. The second is to use an existing fixed server IP to deploy a specified service on the server.

[0004] However, the first solution mentioned above is random deployment, which does not take into account the network transmission conditions between servers, and will cause the network transmission delay between multiple services to be deployed to increase. The second solution mentioned above requires manual division of servers because it requires a fixed server IP. This is done on the premise of obtaining a network topology diagram. In the case of an unknown network topology, manual division of servers will increase the delay between multiple services, load imbalance, lack of high availability, and other issues. Summary of the invention

[0005] Based on this, it is necessary to provide an intelligent deployment method, device and computer equipment for the service to be deployed in order to solve the above technical problems.

[0006] A method for intelligent deployment of a service to be deployed, the method comprising:

[0007] Clustering the response time key-value pairs between the servers in the deployment area according to the preset response time interval to obtain multiple clustering intervals; the response time key-value pairs use the IP addresses of the sender and receiver as keys and the response time as values;

[0008] Construct dependency triples corresponding to each service on the link according to the linear relationship link of the service to be deployed; the dependency triples include the service serial number, service name and container IP of the deployed service;

[0009] Select the container IP of the deployed service according to the dependency triplet, find the fastest available clustering interval from the container IP and the corresponding server IP list, determine the service to be matched according to the upstream and downstream of the deployed service, and match the server IP with the most available specifications from the server IP list according to the specification key-value pair of the service to be matched, and obtain the corresponding deployment result; the specification key-value pair uses the specification of the service to be matched as the key and the corresponding quantity as the value;

[0010] Sort the serial numbers in the dependency triples to obtain a linear list of serial numbers corresponding to the deployment order of each candidate service, calculate the total response time under the corresponding candidate service deployment order according to the deployment key-value pairs corresponding to each serial number in the linear list of serial numbers, obtain a linear list of minimum response time, and deploy services according to the linear list of minimum response time; the deployment key-value pair uses the serial number of each service as the key and the corresponding deployment result as the value.

[0011] An intelligent deployment device for a service to be deployed, the device comprising:

[0012] A time clustering module is used to cluster the response time key-value pairs between the servers in the deployment area according to the preset response time intervals to obtain multiple clustering intervals; the response time key-value pairs use the IP addresses of the sender and receiver as the key and the response time as the value;

[0013] A relationship determination module, used to construct a dependency triple corresponding to each service on the link according to the linear relationship link of the service to be deployed; the dependency triple includes the service serial number, service name and container IP of the deployed service;

[0014] A specification matching module is used to select the container IP of the deployed service according to the dependency triplet, find the fastest available clustering interval from the container IP and the corresponding server IP list, determine the service to be matched according to the upstream and downstream of the deployed service, and match the server IP with the most available specifications from the server IP list according to the specification key-value pair of the service to be matched, and obtain the corresponding deployment result; the specification key-value pair uses the specification of the service to be matched as the key and the corresponding quantity as the value;

[0015] The service deployment module is used to sort the serial numbers in the dependency triples to obtain a linear list of serial numbers corresponding to the deployment order of each candidate service, calculate the total response time under the corresponding candidate service deployment order according to the deployment key-value pairs corresponding to each serial number in the linear list of serial numbers, obtain a linear list of minimum response time, and perform service deployment according to the linear list of minimum response time; the deployment key-value pairs use the serial number of each service as the key and the corresponding deployment result as the value.

[0016] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0017] Clustering the response time key-value pairs between the servers in the deployment area according to the preset response time interval to obtain multiple clustering intervals; the response time key-value pairs use the IP addresses of the sender and receiver as keys and the response time as values;

[0018] Construct dependency triples corresponding to each service on the link according to the linear relationship link of the service to be deployed; the dependency triples include the service serial number, service name and container IP of the deployed service;

[0019] Select the container IP of the deployed service according to the dependency triplet, find the fastest available clustering interval from the container IP and the corresponding server IP list, determine the service to be matched according to the upstream and downstream of the deployed service, and match the server IP with the most available specifications from the server IP list according to the specification key-value pair of the service to be matched, and obtain the corresponding deployment result; the specification key-value pair uses the specification of the service to be matched as the key and the corresponding quantity as the value;

[0020] Sort the serial numbers in the dependency triples to obtain a linear list of serial numbers corresponding to the deployment order of each candidate service, calculate the total response time under the corresponding candidate service deployment order according to the deployment key-value pairs corresponding to each serial number in the linear list of serial numbers, obtain a linear list of minimum response time, and deploy services according to the linear list of minimum response time; the deployment key-value pair uses the serial number of each service as the key and the corresponding deployment result as the value.

[0021] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:

[0022] Clustering the response time key-value pairs between the servers in the deployment area according to the preset response time interval to obtain multiple clustering intervals; the response time key-value pairs use the IP addresses of the sender and receiver as keys and the response time as values;

[0023] Construct dependency triples corresponding to each service on the link according to the linear relationship link of the service to be deployed; the dependency triples include the service serial number, service name and container IP of the deployed service;

[0024] Select the container IP of the deployed service according to the dependency triplet, find the fastest available clustering interval from the container IP and the corresponding server IP list, determine the service to be matched according to the upstream and downstream of the deployed service, and match the server IP with the most available specifications from the server IP list according to the specification key-value pair of the service to be matched, and obtain the corresponding deployment result; the specification key-value pair uses the specification of the service to be matched as the key and the corresponding quantity as the value;

[0025] Sort the serial numbers in the dependency triples to obtain a linear list of serial numbers corresponding to the deployment order of each candidate service, calculate the total response time under the corresponding candidate service deployment order according to the deployment key-value pairs corresponding to each serial number in the linear list of serial numbers, obtain a linear list of minimum response time, and deploy services according to the linear list of minimum response time; the deployment key-value pair uses the serial number of each service as the key and the corresponding deployment result as the value.

[0026] The intelligent deployment method, device and computer equipment of the above-mentioned services to be deployed, by obtaining the network response time between servers and performing cluster analysis, is conducive to the subsequent server selection and deployment order optimization. The user establishes the linear dependency relationship between multiple services, which can reduce the computational complexity brought by graph calculation, and realizes more refined and dynamic server selection based on the cluster analysis results, which can reduce network delay, improve deployment efficiency and high availability of services, and adopt recursive calculation methods in the server deployment process to achieve low memory usage. The embodiments of the present invention can reduce network delay, improve the balanced distribution of load, and realize intelligent service deployment. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 A schematic diagram of a process of an intelligent deployment method for a service to be deployed in one embodiment;

[0028] Figure 2 A structural block diagram of an intelligent deployment device for a service to be deployed in one embodiment;

[0029] Figure 3 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0030] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0031] In one embodiment, Figure 1 As shown, a method for intelligent deployment of a service to be deployed is provided, comprising the following steps:

[0032] Step 102: cluster the response time key-value pairs between the servers in the to-be-deployed area according to the preset response time intervals to obtain a plurality of clustering intervals.

[0033] The response time key-value pair uses the IP addresses of the sender and receiver as the key and the response time as the value. The response time refers to the difference between the time when the sending server receives the network data packet returned by the receiving server and the time when the sending server sends the network data packet.

[0034] Step 104: construct dependency triples corresponding to each service on the link according to the linear relationship link of the services to be deployed.

[0035] A service to be deployed usually refers to a software service to be deployed on a server, such as an application, database, microservice, etc. These services need to rely on the server's hardware resources and network environment to run normally.

[0036] A linear relationship link refers to a dependency structure followed by services during deployment, which is characterized by a series of services that are interdependent and arranged in order. This dependency is linear and has no branches or complex network structures. The dependency triplet includes the service serial number, service name, and container IP of the deployed service. The service serial number is the sorting serial number of each service in the linear relationship link.

[0037] A host machine has a host machine IP. A host machine can have multiple containers for deploying services. Each deployed container has a container IP. The container IP is the IP that actually provides external application access capabilities. The corresponding host machine IP can be queried through a container IP. The present invention selects the deployment order with the fastest communication according to the network speed between different hosts, and balances different services by the number of containers that can be divided into specifications on the host machine. If the service information of the deployed service is a domain name, the corresponding IP address obtained by querying the domain name system is the container IP.

[0038] Step 106, select the container IP of the deployed service according to the dependency triplet, find the available clustering interval with the fastest distance to the container IP and the corresponding server IP list, determine the service to be matched according to the upstream and downstream of the deployed service, match the server IP with the most available specifications from the server IP list according to the specification key-value pair of the service to be matched, and obtain the corresponding deployment result.

[0039] The specification key-value pair uses the specification of the service to be matched as the key and the corresponding quantity as the value. Each service has its own specific specifications and resource requirements, such as CPU, memory, bandwidth, etc. For each service, a separate key-value pair is established, with the "key" representing a certain resource type and the "value" representing the service's demand for this resource. In this way, resources can be managed and allocated more flexibly to ensure that the dependencies between services can run smoothly.

[0040] Step 108, sort the serial numbers in the dependency triples to obtain a linear list of serial numbers corresponding to the deployment order of each candidate service, calculate the total response time under the corresponding candidate service deployment order according to the deployment key-value pairs corresponding to each serial number in the linear list of serial numbers, obtain the minimum response time linear list, and deploy the service according to the minimum response time linear list.

[0041] The deployment key-value pair uses the sequence number of each service as the key and the corresponding deployment result as the value.

[0042] In the above-mentioned intelligent deployment method for services to be deployed, by obtaining the network response time between servers and performing cluster analysis, it is beneficial to the subsequent server selection and deployment order optimization. The linear dependency between multiple services is established by the user, which can reduce the computational complexity brought by graph calculations. Based on the cluster analysis results, more refined and dynamic server selection can be achieved, which can reduce network delays, improve deployment efficiency and high availability of services, and use recursive calculation methods in the server deployment process to achieve lower memory usage. The embodiments of the present invention can reduce network delays, improve the balanced distribution of loads, and realize intelligent service deployment.

[0043] In one embodiment, the step of setting the response time interval includes: setting the lower bound of the response time interval to 2^(n-1) ms, and setting the upper bound of the response time interval to 2^n ms. In this embodiment, the response time interval is divided in a non-uniform manner, so that the faster server can be effectively found. The faster server clustering accuracy is high, and the slower server clustering accuracy is low.

[0044] In one embodiment, clustering response time key-value pairs between servers in the area to be deployed according to preset response time intervals to obtain multiple clustering intervals includes: obtaining server information in the area to be deployed, constructing corresponding response time key-value pairs according to the response time between each server, and clustering the response time key-value pairs in each response time interval to obtain multiple clustering intervals.

[0045] The steps of constructing the response time key-value pair specifically include: obtaining the server information on each rack in each area under all computer rooms, the information including login authentication and IP address, logging in to the aforementioned server A one by one, sending fixed-length network data packets to all other servers B except itself one by one on server A, recording the sending time of server A before sending the data packet, after server B receives the network data packet of server A, returning the data packet to server A as it is, obtaining the network data packets returned by other servers B on server A, after server A receives the network data packet, verifying whether it is consistent with the original data packet sent, if not, it is recorded as failure, and the response time directly takes the set maximum value; if consistent, it is recorded as success, if it is recorded as success, taking the receiving time of server A, the difference between the receiving time and the aforementioned sending time, and recording it as the response time, the response time unit is ms, according to the preset number of repetitions, repeatedly executing the sending of data packets from server A to server B and calculating the response time of the data packet, and finally taking the median of multiple response times of server A to server B as the final response time. Update server B, and repeat the aforementioned calculation process of server A to server B again. Update server A and repeat the above process again until all the calculations between servers are completed. This preprocessing process can greatly reduce the amount of calculations during actual deployment.

[0046] All the aforementioned servers A to server B and the response time are taken as a response time key-value pair, with server A's IP (the IPs in the present invention are all physical machine IPs, the same below) - server B's IP as the key and the response time as the value.

[0047] After obtaining each response time key-value pair, the step of clustering the response time key-value pairs includes: clustering the response time by 2^n (n starts from 1). 0ms to less than 2ms is a cluster, 2ms to less than 4ms is a cluster, 4ms to less than 8ms is a cluster. And so on, until all key-value pairs are calculated. If the cluster is empty, the cluster interval is discarded. If the cluster is not empty, the cluster interval is retained.

[0048] A new triple structure is established, {IP of server A, lower bound value of interval - upper bound value, IP information of all server B in the clustering interval}. Through this structure, the relationship between server A and multiple servers B can be associated.

[0049] In one embodiment, selecting a container IP of a deployed service according to a dependency triplet includes: if the container IP of a deployed service in the dependency triplet is an empty set, randomly selecting a service to be deployed from a linear relationship link of the service to be deployed, and deploying the service to be deployed to a newly generated container IP.

[0050] Specifically, the relevant service information includes the IP or domain name information of one or more services to be deployed. Optionally, the relevant service depends on the IP or domain name information of one or more upstream and downstream servers. The user enters a linear dependency relationship between services, such as service A->service B to be deployed->service C to be deployed->service D. According to the service information in the aforementioned linear service dependency relationship, a triple {serial number, service name, deployed IP (empty if not deployed)} is established to describe the deployment order. According to the service information in the aforementioned linear service dependency relationship, a key-value pair about specifications is established, with the key being the specification and the value being the quantity. During the deployment process, the system matches the corresponding server according to the resource requirements of each service to ensure that all services can run efficiently. In this way, a suitable server resource configuration can be found for each service to be deployed.

[0051] In one embodiment, searching for the fastest available clustering interval from the container IP and the corresponding server IP list includes: obtaining the server IP corresponding to the deployed service according to the container IP, obtaining the fastest clustering interval from the container IP according to the response time key-value pair corresponding to the server IP of the deployed service, and searching whether the server IP corresponding to the fastest clustering interval meets the specifications and quantity of the service to be matched. If so, obtaining the available clustering interval; if not, calculating the second fastest clustering interval from the container IP, repeating the above steps until the available clustering interval is found, otherwise, returning to the state of no available server.

[0052] Specifically, if both the upper and lower nodes of the linear relationship are deployed services, a bidirectional search is performed from the IPs corresponding to the upper and lower services (the IPs are container IPs). If only one service in the linear relationship link is a deployed service, other IPs (the IPs are container IPs) are established forward and backward from the IP corresponding to the service (the IPs are container IPs). If there is no deployed service in the linear relationship link, a service IP (the IP is a new IP address generated by the host host) is randomly selected as IP address A. IP address A (the IP is a container IP) queries the aforementioned key-value pair data to obtain a list of all server IPs in the clustering interval with the fastest distance from IP address A (upstream and downstream bidirectional search) (the IP in the server IP list refers to the IP of the host machine).

[0053] Matching the corresponding IPs of the upstream and downstream services to be deployed of IP address A (hereinafter referred to as host IPs) specifically includes: obtaining the available specification data of the corresponding IPs. If there is no available specification data of the corresponding IPs, obtaining the available specification data of the corresponding IPs in the operation and maintenance system, determining whether the IPs in the server IP list are available (meeting the user's specification requirements) one by one, and removing the unavailable IPs. Select the IP with the most available server specifications in the filtered server IP list as the IP of the server to be deployed.

[0054] If there is no available IP in the current fastest clustering interval, then obtain the list of all server IPs in the second fastest clustering interval and repeat the above steps until an available IP address is found. If not found, the status of no available server is returned.

[0055] After a valid IP is found, the number of specifications in the corresponding specification key-value pair is reduced by 1, and the available specifications of the corresponding IP are reduced until the number of all specifications is 0.

[0056] Finally, two new key-value pairs are generated for all services to be deployed. The key of the first key-value pair is the sequence number and the value is the selected IP; the key of the second key-value pair is the sequence number and the value is the service name list. Multiple services may be deployed on one IP. The purpose of building the second key-value pair is to merge multiple services under the same IP with the same sequence number. The external network delay of the same physical machine is consistent, which reduces the subsequent calculation amount, but it will be restored to multiple services during the final deployment.

[0057] In one embodiment, the sequence numbers in the dependency triples are sorted to obtain a sequence number linear list corresponding to each candidate service deployment order, and the total response time under the corresponding candidate service deployment order is calculated according to the deployment key-value pairs corresponding to each sequence number in the sequence number linear list to obtain the minimum response time linear list, including: establishing an initial sequence number linear list according to the size relationship of the sequence numbers corresponding to each service on the linear relationship link, calculating the response time between adjacent services according to the candidate service deployment order corresponding to the initial sequence number linear list and the deployment key-value pairs corresponding to each sequence number to obtain a two-dimensional array of response times, calculating the total response time according to the two-dimensional array of response times, and recording the initial sequence number linear list as the minimum response time linear list; recursively traversing the remaining candidate service deployment orders, updating the minimum response time linear list according to the recursive result, until the traversal is completed, and outputting the current minimum response time linear list.

[0058] In this embodiment, a linear list is established for the service serial numbers from small to large, and the IP corresponding to the serial number is obtained (including deployed services and IPs to be selected). The response time between two serial number elements (IPs) is calculated in pairs according to the serial number linear list to generate a two-dimensional array of response time (to speed up subsequent calculations). Specifically, the first and second IPs in the linear list are taken to obtain the response time from the first IP to the second IP, and then the second to third IPs in the linear list are taken to obtain the response time from the second IP to the third IP, until the response time from the second to last to the last in the linear list is calculated. The response time between adjacent ones is accumulated to obtain the total response time, and the total response time is used as the estimated total response time. At the same time, the order of the current linear list is recorded as the linear list with the minimum response time.

[0059] In one embodiment, the remaining candidate service deployment sequences are recursively traversed, and the minimum response time linear table is updated according to the recursive result, including: constructing a historical linear table and a linear table to be selected; initializing the historical linear table to be empty, and initializing the linear table to be selected to be an initial sequence number linear table; traversing each sequence number in the linear table to be selected as the first sequence number of the candidate service deployment sequence and moving it into the historical linear table, and updating the linear table to be selected; in each traversal process, recursively traversing each sequence number in the current linear table to be selected as the 2nd, ..., N-2nd sequence number of the candidate service deployment sequence and moving it into the corresponding historical linear table, and updating the linear table to be selected after each recursion ends, and after the N-2nd recursion ends, combining the sequence number sequence in the current historical linear table with the two sequence numbers in the current linear table to be selected to obtain a first combination sequence and a second combination sequence, and judging whether to update the minimum response time linear table according to the total response time corresponding to the first combination sequence and the second combination sequence; wherein N is the number of sequence numbers in the initial sequence number linear table; when the traversal ends, outputting the current minimum response time linear table.

[0060] In this embodiment, although there is a fixed dependency order between services, it is still very important to select the optimal order. The dependency order only ensures that the services are started as required, but does not take into account the performance of the overall system. For example, although service A depends on service B to start, A may start faster than B, which will affect the overall response efficiency of the system. Even with a dependency order, optimizing the service startup order can better allocate and utilize resources, avoid service competition for resources or bottlenecks. The optimal order can reduce the chain reaction when service dependency fails. By optimizing the order, it is ensured that key services are started or restored first, reducing the impact on users.

[0061] Specifically, each sequence number in the linear list is taken as the first sequence number to be selected in a loop, and the remaining sequence numbers except the previously selected sequence numbers are written into a new linear list in order. For example, when 2 is selected from {1, 2, 3, 4}, the remaining {1, 3, 4} form a new linear list to be selected, and the selected sequence numbers are added to the new historical linear list. The new linear list to be selected then selects each sequence number as the first sequence number to be selected, repeats the above process, and calculates recursively until the last two sequence numbers are left. The total response time of the historical linear list with the last two sequence numbers is calculated, and the remaining two sequence numbers are exchanged, and the total response time of the historical linear list with the last two sequence numbers is calculated. If the total response time is less than the total response time corresponding to the current minimum response time linear list, the value of the estimated total response time is updated, and the minimum response time linear list is updated at the same time.

[0062] In the same recursive level, before selecting the next sequence number as the first sequence number to be selected, the history linear list deletes the last element and the linear list to be selected is cleared (to ensure the calculation logic is correct and the stack is balanced). By converting the two-dimensional space calculation into one-dimensional space at multiple levels, the calculation efficiency is improved and the space occupation is reduced.

[0063] Take the sequence {1,2,3,4,5} as an example:

[0064] (1) Initial state: the history linear table is empty.

[0065] (2) Select 2 as the first sequence number, the historical linear list becomes {2}, and the linear list to be selected is {1,3,4,5}.

[0066] (3) Recursively continue, select 1, the historical linear table becomes {2,1}, and the linear table to be selected is {3,4,

[0067] 5}.

[0068] (4) Recursively select 3, the history linear list becomes {2,1,3}, and the linear list to be selected is {4,5}.

[0069] (5) After processing {4,5}, the algorithm needs to return to the previous state. At this time, delete the last element 3 in the history table and restore to {2,1}.

[0070] (6) Continue to process the next sequence number 4, change the history table to {2,1,4}, and then process the remaining 5.

[0071] In this way, the algorithm is able to correctly record state during recursion while maintaining logical consistency when backtracking.

[0072] When calculating the estimated total response time in the recursion, if the estimated total response time in the historical linear table is greater than the calculated estimated total response time, the current sequence number is skipped as the first sequence number to be selected (skipping the current loop to shorten the calculation time). This continues until each sequence number is used as the first sequence number to be selected and the corresponding recursion is calculated. The final minimum response time linear table is the optimal service deployment order.

[0073] Since loop traversal is used before recursive operation, each item in the loop can be distributed to different processes to achieve distributed computing, which can further accelerate the calculation.

[0074] In one embodiment, service deployment according to the minimum response time linear table includes: obtaining the optimal service deployment order according to the minimum response time linear table, constructing a deployment triplet according to the sequence number, service name and deployment result of the service to be deployed in the optimal service deployment order; and sending the deployment triplet to the host computer to complete the service deployment.

[0075] In this embodiment, first obtain the serial number in the minimum response time linear table, filter out the deployed IPs, select the corresponding service name of the service to be deployed according to the serial number, select the corresponding IP of the service to be deployed according to the serial number, and finally generate multiple triples {service name, IP, specification} and send them to the deployment application to complete the deployment of the service.

[0076] It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0077] In one embodiment, Figure 2 As shown, a smart deployment device for a service to be deployed is provided, comprising:

[0078] The time clustering module 202 is used to cluster the response time key-value pairs between the servers in the deployment area according to the preset response time interval to obtain multiple clustering intervals; the response time key-value pairs use the IP addresses of the sender and receiver as the key and the response time as the value;

[0079] The relationship determination module 204 is used to construct the dependency triplet corresponding to each service on the link according to the linear relationship link of the service to be deployed; the dependency triplet includes the service serial number, service name and container IP of the deployed service;

[0080] The specification matching module 206 is used to select the container IP of the deployed service according to the dependency triplet, find the available clustering interval with the fastest distance to the container IP and the corresponding server IP list, determine the service to be matched according to the upstream and downstream of the deployed service, match the server IP with the most available specifications from the server IP list according to the specification key-value pair of the service to be matched, and obtain the corresponding deployment result; the specification key-value pair uses the specification of the service to be matched as the key and the corresponding quantity as the value;

[0081] The service deployment module 208 is used to sort the serial numbers in the dependency triples to obtain a linear list of serial numbers corresponding to the deployment order of each candidate service, calculate the total response time under the corresponding candidate service deployment order according to the deployment key-value pairs corresponding to each serial number in the linear list of serial numbers, obtain the minimum response time linear list, and perform service deployment according to the minimum response time linear list; the deployment key-value pairs use the serial number of each service as the key and the corresponding deployment result as the value.

[0082] In one of the embodiments, the lower bound of the response time interval is set to 2^(n-1) ms, and the upper bound of the response time interval is set to 2^n ms.

[0083] In one of the embodiments, it is also used to obtain server information in the area to be deployed, build corresponding response time key-value pairs according to the response time between each server, cluster the response time key-value pairs in each response time interval, and obtain multiple clustering intervals.

[0084] In one of the embodiments, if the container IP of the deployed service in the dependency triplet is an empty set, a service to be deployed is randomly selected from the linear relationship link of the service to be deployed, and the service to be deployed is deployed to the newly generated container IP.

[0085] In one of the embodiments, it is also used to obtain the server IP corresponding to the deployed service according to the container IP, obtain the clustering interval with the fastest distance from the container IP according to the response time key-value pair corresponding to the server IP of the deployed service, and find out whether the server IP corresponding to the fastest clustering interval meets the specifications and quantity of the service to be matched. If so, the available clustering interval is obtained; if not, the clustering interval with the second fastest distance from the container IP is calculated, and the above steps are repeated until the available clustering interval is found, otherwise, the state of no available server is returned.

[0086] In one of the embodiments, it is also used to establish an initial sequence number linear list according to the size relationship of the sequence numbers corresponding to each service on the linear relationship link, calculate the response time between adjacent services according to the candidate service deployment order corresponding to the initial sequence number linear list and the deployment key-value pairs corresponding to each sequence number, and obtain a two-dimensional array of response times. The total response time is calculated according to the two-dimensional array of response times, and the initial sequence number linear list is recorded as the minimum response time linear list; recursively traverse the remaining candidate service deployment order, update the minimum response time linear list according to the recursive result, and output the current minimum response time linear list when the traversal is completed.

[0087] In one of the embodiments, it is also used to construct a historical linear list and a linear list to be selected; initialize the historical linear list to be empty, and initialize the linear list to be selected to be an initial sequence number linear list; traverse each sequence number in the linear list to be selected and move it into the historical linear list as the first sequence number of the candidate service deployment sequence, and update the linear list to be selected; in each traversal process, recursively traverse each sequence number in the current linear list to be selected and move it into the corresponding historical linear list as the 2nd, ..., N-2nd sequence number of the candidate service deployment sequence, and update the linear list to be selected after each recursion. After the N-2th recursion, the first combination sequence and the second combination sequence are combined according to the sequence number sequence in the current historical linear list and the two sequence numbers in the current linear list to be selected, and whether to update the minimum response time linear list is determined according to the total response time corresponding to the first combination sequence and the second combination sequence; wherein N is the number of sequence numbers in the initial sequence number linear list; when the traversal is completed, the current minimum response time linear list is output.

[0088] In one of the embodiments, it is also used to obtain the optimal service deployment order according to the minimum response time linear table, and to construct a deployment triplet according to the sequence number, service name and deployment result of the service to be deployed in the optimal service deployment order; and send the deployment triplet to the host computer to complete the service deployment.

[0089] For the specific definition of the intelligent deployment device for the service to be deployed, please refer to the definition of the intelligent deployment method for the service to be deployed above, which will not be repeated here. Each module in the above-mentioned intelligent deployment device for the service to be deployed can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0090] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 3As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a smart deployment method for a service to be deployed is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.

[0091] Those skilled in the art will understand that Figure 3 The structure shown in the figure is only a block diagram of a part of the structure related to the scheme of the present invention, and does not constitute a limitation on the computer device to which the scheme of the present invention is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0092] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method in the above embodiment when executing the computer program.

[0093] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method in the above embodiment are implemented.

[0094] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0095] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0096] The above-mentioned embodiments only express several implementation modes of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the invention. It should be pointed out that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the attached claims.

Claims

1. A method for intelligent deployment of a service to be deployed, characterized in that: The method comprises: Clustering the response time key-value pairs between the servers in the deployment area according to the preset response time interval to obtain multiple clustering intervals; the response time key-value pairs use the IP addresses of the sender and receiver as keys and the response time as values; Construct dependency triples corresponding to each service on the link according to the linear relationship link of the service to be deployed; the dependency triples include the service serial number, service name and container IP of the deployed service; Select the container IP of the deployed service according to the dependency triplet, find the fastest available clustering interval from the container IP and the corresponding server IP list, determine the service to be matched according to the upstream and downstream of the deployed service, and match the server IP with the most available specifications from the server IP list according to the specification key-value pair of the service to be matched, and obtain the corresponding deployment result; the specification key-value pair uses the specification of the service to be matched as the key and the corresponding quantity as the value; Sort the serial numbers in the dependency triples to obtain a linear list of serial numbers corresponding to the deployment order of each candidate service, calculate the total response time under the corresponding candidate service deployment order according to the deployment key-value pairs corresponding to each serial number in the linear list of serial numbers, obtain a linear list of minimum response time, and deploy services according to the linear list of minimum response time; the deployment key-value pair uses the serial number of each service as the key and the corresponding deployment result as the value.

2. The method according to claim 1, characterized in that The steps to set the response time interval include: Set the lower bound of the response time interval to 2^(n-1)ms and the upper bound of the response time interval to 2^nms.

3. The method according to claim 1, characterized in that The response time key-value pairs between the servers in the deployment area are clustered according to the preset response time intervals to obtain multiple clustering intervals including: The server information in the area to be deployed is obtained, corresponding response time key-value pairs are constructed according to the response time between each server, and the response time key-value pairs are clustered in each response time interval to obtain multiple clustering intervals.

4. The method according to claim 1, characterized in that The selecting the container IP of the deployed service according to the dependency triplet includes: If the container IP of the deployed service in the dependency triplet is an empty set, a service to be deployed is randomly selected from the linear relationship link of the service to be deployed, and the service to be deployed is deployed to the newly generated container IP.

5. The method according to claim 1 or 4, characterized in that: The searching for the fastest available clustering interval from the container IP and the corresponding server IP list includes: Obtain the server IP corresponding to the deployed service according to the container IP, obtain the clustering interval with the fastest distance from the container IP according to the response time key-value pair corresponding to the server IP of the deployed service, and find out whether the server IP corresponding to the fastest clustering interval meets the specifications and quantity of the service to be matched. If so, obtain the available clustering interval; If not, calculate the cluster interval that is the second fastest from the container IP, and repeat the above steps until an available cluster interval is found. Otherwise, return to the state of no available server.

6. The method according to claim 1, characterized in that The sequence numbers in the dependency triples are sorted to obtain a linear list of sequence numbers corresponding to the deployment order of each candidate service, and the total response time under the corresponding candidate service deployment order is calculated according to the deployment key-value pairs corresponding to each sequence number in the linear list of sequence numbers to obtain a linear list of minimum response time, which includes: An initial sequence number linear table is established according to the size relationship of the sequence numbers corresponding to the services on the linear relationship link, and the response time between adjacent services is calculated according to the candidate service deployment order corresponding to the initial sequence number linear table and the deployment key-value pairs corresponding to the sequence numbers to obtain a two-dimensional array of response time, and the total response time is calculated according to the two-dimensional array of response time, and the initial sequence number linear table is recorded as the minimum response time linear table; Recursively traverse the remaining candidate service deployment order, and update the minimum response time linear table according to the recursive result until the traversal is completed, and then output the current minimum response time linear table.

7. The method according to claim 6, characterized in that The recursive traversal of the remaining candidate service deployment order and updating the minimum response time linear table according to the recursive result include: Constructing a historical linear list and a linear list to be selected; initializing the historical linear list to be empty, and initializing the linear list to be selected to be the initial sequence number linear list; Traversing each sequence number in the to-be-selected linear list and moving it into the historical linear list as the first sequence number of the candidate service deployment order, and updating the to-be-selected linear list; In each traversal process, recursively traverse each sequence number in the current to-be-selected linear list and move the 2nd, ..., N-2th sequence numbers in the candidate service deployment order into the corresponding historical linear list. After each recursion, update the to-be-selected linear list. After the N-2th recursion, combine the sequence number sequence in the current historical linear list with the two sequence numbers in the current to-be-selected linear list to obtain the first combination sequence and the second combination sequence. Determine whether to update the minimum response time linear list based on the total response time corresponding to the first combination sequence and the second combination sequence; wherein N is the number of sequence numbers in the initial sequence number linear list; At the end of the traversal, the current minimum response time linear table is output.

8. The method according to claim 1, characterized in that Deploying services according to the minimum response time linear table includes: Obtain an optimal service deployment sequence according to the minimum response time linear table, and construct a deployment triple according to the sequence number, service name and deployment result of the service to be deployed in the optimal service deployment sequence; The deployment triplet is sent to the host computer to complete the service deployment.

9. An intelligent deployment device for a service to be deployed, characterized in that: The device comprises: A time clustering module is used to cluster the response time key-value pairs between the servers in the deployment area according to the preset response time intervals to obtain multiple clustering intervals; the response time key-value pairs use the IP addresses of the sender and receiver as the key and the response time as the value; A relationship determination module, used to construct a dependency triple corresponding to each service on the link according to the linear relationship link of the service to be deployed; the dependency triple includes the service serial number, service name and container IP of the deployed service; A specification matching module is used to select the container IP of the deployed service according to the dependency triplet, find the fastest available clustering interval from the container IP and the corresponding server IP list, determine the service to be matched according to the upstream and downstream of the deployed service, and match the server IP with the most available specifications from the server IP list according to the specification key-value pair of the service to be matched, and obtain the corresponding deployment result; the specification key-value pair uses the specification of the service to be matched as the key and the corresponding quantity as the value; The service deployment module is used to sort the serial numbers in the dependency triples to obtain a linear list of serial numbers corresponding to the deployment order of each candidate service, calculate the total response time under the corresponding candidate service deployment order according to the deployment key-value pairs corresponding to each serial number in the linear list of serial numbers, obtain a linear list of minimum response time, and perform service deployment according to the linear list of minimum response time; the deployment key-value pairs use the serial number of each service as the key and the corresponding deployment result as the value.

10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.