Micro-service deployment method and related device
By adopting passive deployment and dynamic resource recycling methods on the cloud platform, the problem of waste of non-core low-frequency service resources is solved and more efficient resource utilization is achieved.
Patent Information
- Application Number
- CN202510296246.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-12
- Publication Date
- 2025-06-20
AI Technical Summary
When the existing cloud platform deployment architecture pursues the high availability of microservices, it leads to wasting resources for non-core low-frequency services.
Provide a microservice deployment method, by obtaining passive service configuration, determine the access record and deployment status of the microservices, and if the number of accesses exceeds the threshold, resource deployment is performed; if the resource is not used for a long time, resource recycling is performed.
Passive deployment of non-core low-frequency services has been realized, reducing the waste of cloud platform resources and improving resource utilization efficiency.
Smart Images

Figure CN120179262A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of cloud platform deployment and architecture design, and particularly relates to a microservice deployment method and related devices. Background Art
[0002] In order to pursue the maximum availability of microservices, the current deployment architecture of cloud platforms adopts a mode of deploying first and then requesting for use, deploying in advance and covering all resources on which the microservices depend, and ensuring that all network requests can be normally returned to the greatest extent.
[0003] However, in the real environment, not all microservices need to pursue high availability. For example, non-core and low-frequency services such as customer service robots, report summarization, and business degradation compensation. The existing deployment method will cause great waste of cloud platform resources. Summary of the Invention
[0004] In view of the above problems, this application provides a microservice deployment method and related devices to achieve the purpose of passive deployment of non-core and low-frequency services. The specific solutions are as follows:
[0005] The first aspect of this application provides a microservice deployment method, and the microservice deployment method includes:
[0006] Obtain a passive service configuration, where the passive service configuration can indicate a first microservice for passive deployment;
[0007] Determine the access record and deployment status of the first microservice;
[0008] If the deployment status is not deployed, calculate the access quantity of the first microservice according to the access record, and perform resource deployment on the first microservice when the access quantity is greater than the corresponding quantity threshold.
[0009] In a possible implementation, the obtaining of the passive service configuration includes:
[0010] Obtain a passive service list; wherein, the request entry of the first microservice is recorded in the passive service list.
[0011] In a possible implementation, the determining of the access record and deployment status of the first microservice includes:
[0012] Determine a second microservice that invokes the first microservice based on the service topology and call chain;
[0013] Monitor the network requests of the second microservice to the first microservice, and generate the access record of the first microservice according to the monitoring result;
[0014] Obtain the return information of the first microservice for the network request, and determine whether the first microservice is reachable according to the return information; wherein, the deployment status when the first microservice is unreachable is undeployed, and the deployment status when the first microservice is reachable is deployed.
[0015] In a possible implementation, the resource deployment of the first microservice includes:
[0016] Obtain the delivery information of the first microservice from the delivery warehouse, where the delivery information includes the deployment location and resource information;
[0017] Generate a resource instance of the first microservice based on the resource information, and deploy the resource instance according to the deployment location.
[0018] In a possible implementation, the microservice deployment method further includes:
[0019] If the deployment status is deployed, calculate the idle duration of the first microservice according to the access record, and recycle the resources of the first microservice when the idle duration is greater than the corresponding duration threshold.
[0020] A second aspect of the present application provides a microservice deployment device, and the microservice deployment device includes:
[0021] A configuration acquisition module, configured to acquire a passive service configuration, and the passive service configuration can indicate a first microservice for passive deployment;
[0022] A service deployment module, configured to determine the access record and deployment status of the first microservice; if the deployment status is undeployed, calculate the access quantity of the first microservice according to the access record, and perform resource deployment on the first microservice when the access quantity is greater than the corresponding quantity threshold.
[0023] In a possible implementation, the configuration acquisition module is specifically configured to:
[0024] Obtain a passive service list; wherein, the passive service list records the request entry of the first microservice.
[0025] A third aspect of the present application provides a computer program product, including computer-readable instructions, which, when running on an electronic device, enable the electronic device to implement the microservice deployment method in the first aspect or any implementation manner of the first aspect.
[0026] A fourth aspect of the present application provides an electronic device, including at least one processor and a memory connected to the processor, wherein:
[0027] The memory is used to store a computer program;
[0028] The processor is used to execute the computer program, so that the electronic device can implement the microservice deployment method of the above-mentioned first aspect or any implementation manner of the first aspect.
[0029] A fifth aspect of the present application provides a computer storage medium, which carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement the microservice deployment method of the above-mentioned first aspect or any implementation manner of the first aspect.
[0030] With the above technical solutions, the microservice deployment method and related devices provided by the present application obtain a passive service configuration, and the passive service configuration can indicate a first microservice for passive deployment; determine the access record and deployment status of the first microservice; if the deployment status is undeployed, calculate the access quantity of the first microservice according to the access record, and perform resource deployment on the first microservice when the access quantity is greater than the corresponding quantity threshold. The present application can avoid deploying non-core low-frequency services in advance and deploy services when the actual access quantity reaches a certain threshold, which can achieve the passive deployment of non-core low-frequency services and reduce the waste of cloud platform resources. Description of the Drawings
[0031] In combination with the drawings and with reference to the following specific embodiments, the above and other features, advantages and aspects of the embodiments of the present disclosure will become more obvious. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the original elements and elements are not necessarily drawn to scale.
[0032] Figure 1 It is a schematic flowchart of a microservice deployment method provided by an embodiment of the present application;
[0033] Figure 2 It is another schematic flowchart of a microservice deployment method provided by an embodiment of the present application;
[0034] Figure 3 It is a partial schematic flowchart of a microservice deployment method provided by an embodiment of the present application;
[0035] Figure 4 It is a business scenario example diagram provided by an embodiment of the present application;
[0036] Figure 5 It is another partial schematic flowchart of a microservice deployment method provided by an embodiment of the present application;
[0037] Figure 6 It is another schematic flowchart of a microservice deployment method provided by an embodiment of the present application;
[0038] Figure 7 The structural schematic diagram of a microservice deployment device provided by an embodiment of the present application;
[0039] Figure 8 The structural schematic diagram of an electronic device provided by an embodiment of the present application. Detailed implementation manners
[0040] The embodiments of the present application will be described below with reference to the accompanying drawings in the embodiments of the present application. The terms used in the implementation part of the present application are only used to explain the specific embodiments of the present application, rather than to limit the present application.
[0041] The embodiments of the present application will be described below with reference to the accompanying drawings. Those skilled in the art know that with the development of technology and the emergence of new scenarios, the technical solutions provided by the embodiments of the present application are also applicable to similar technical problems.
[0042] The terms "first", "second", etc. in the specification of the present application and the above accompanying drawings are used to distinguish similar objects, and do not have to be used to describe a specific order or sequence. It should be understood that such terms can be interchanged under appropriate circumstances, which is only a way of distinguishing when describing objects with the same attributes in the embodiments of the present application. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusion, so that a process, method, system, product or device including a series of units does not have to be limited to those units, but may include other units that are not clearly listed or are inherent to these processes, methods, products or devices.
[0043] See Figure 1 , Figure 1 The flowchart of a microservice deployment method provided by an embodiment of the present application. As Figure 1 shown, a microservice deployment method provided by an embodiment of the present application may include the following steps S10 to S30, and these steps will be described in detail below.
[0044] S10, obtaining a passive service configuration, where the passive service configuration can indicate a first microservice to be passively deployed.
[0045] In the embodiments of the present application, passive deployment can be understood as delayed deployment or lazy deployment, etc. The microservice to be passively deployed (i.e., the first microservice) can be a non-core low-frequency service, that is, a microservice that is deployed when there is a call requirement. By sorting out the business scenarios, architects or operation and maintenance personnel can use non-core low-frequency services in the business scenarios as the first microservice and generate corresponding passive service configurations for the first microservice.
[0046] The description information of the first microservice is included in the passive service configuration, and the first microservice can be determined based on this description information. For example, the non-core low-frequency services in a business scenario include Microservice 1, Microservice 2, and Microservice 3, and passive deployment needs to be performed on Microservice 1, Microservice 2, and Microservice 3. In this regard, the description information of Microservice 1 (i.e., description information A), the description information of Microservice 2 (i.e., description information B), and the description information of Microservice 3 (i.e., description information C) are included in the passive service configuration. Microservice 1 can be determined through description information A, Microservice 2 can be determined through description information B, and Microservice 3 can be determined through description information C.
[0047] It should be noted that non-core low-frequency services are microservices with low request frequencies and low guarantee levels. They can be registered first but not deployed in advance.
[0048] In a possible implementation, the passive service configuration of the first microservice can be performed by configuring a passive service list. See Figure 2 , Figure 2 Another process schematic diagram of a microservice deployment method provided by an embodiment of the present application. As Figure 2 shown, a microservice deployment method provided by an embodiment of the present application, where in step S10, "obtain passive service configuration", the following step S101 can be adopted, and this step will be described in detail below.
[0049] S101, obtain a passive service list; where the request entry of the first microservice is recorded in the passive service list.
[0050] In an embodiment of the present application, a passive service list can be configured for the first microservice, and the request entry of the first microservice is recorded in this passive service list, and this request entry is the interface address exposed by the first microservice.
[0051] Specifically, the request entry in the passive service list can be the domain name of the first microservice, or it can also be a VIP address (the full English name is Virtual IP Address). See Table 1, which is an example of a passive service list provided by an embodiment of the present application. As shown in Table 1, the passive service list includes the numbers, request entries, and types of request entries of Microservice 1, Microservice 2, and Microservice 3 respectively. Among them, the request entry of Microservice 1 is the domain name "bot.demo.com", the request entry of Microservice 2 is the domain name "report.demo.com", and the request entry of Microservice 3 is the VIP address "10.30.7.101".
[0052] Table 1
[0053]
[0054] For microservices in the passive service list, the entire service topology no longer allocates resources to them and initializes the deployment. When initializing microservices in a business scenario, it is determined whether a microservice to be initialized is the first microservice for passive deployment by matching the request entry of the microservice to be initialized with the request entry recorded in the passive service list; if not, the service deployment is performed; if so, it directly ends.
[0055] S20. Determine the access record and deployment status of the first microservice.
[0056] In an embodiment of the present application, for the first microservice indicated by the passive service configuration, the access record of its downstream microservices and the current deployment status of the first microservice can be determined, where the access record includes the access target, access time, access frequency, etc. of the downstream microservices, and the deployment status includes deployed or not deployed.
[0057] In a possible implementation, the access record and deployment status of the first microservice can be determined by listening to the downstream microservices. Refer to Figure 3 , Figure 3 which is a partial flowchart of a microservice deployment method provided by an embodiment of the present application. As Figure 3 shown, for a microservice deployment method provided by an embodiment of the present application, where step S20 "Determine the access record and deployment status of the first microservice" may include the following steps S201 to S203, and these steps will be described in detail below.
[0058] S201. Determine the second microservice that calls the first microservice based on the service topology and the call chain.
[0059] In an embodiment of the present application, according to the service topology and the call chain in a business scenario, the second microservice that calls the first microservice can be determined, and this second microservice is the downstream microservice of the first microservice. Refer to Figure 4 , Figure 4 which is an example diagram of a business scenario provided by an embodiment of the present application. As Figure 4 shown, the service topology of this business scenario includes microservice 4, microservice 5, microservice 6, microservice 7, and microservice 8. Assuming that the first microservice includes microservice 7, then according to the call chain of microservice 7, microservice 4 and microservice 5 can be determined as the downstream microservices of microservice 7.
[0060] S202. Listen to the network requests of the second microservice to the first microservice, and generate an access record of the first microservice according to the listening result.
[0061] In an embodiment of the present application, listen to the network requests of the second microservice to the first microservice to generate an access record of the first microservice. For ease of understanding, continue with Figure 4Taking the business scenario shown as an example, microservice 4 and microservice 5, as downstream microservices of microservice 7, can respectively monitor the network requests from microservice 4 to microservice 7 and the network requests from microservice 5 to microservice 7, and generate access records of microservice 4 based on this. The access records of microservice 4 include the access records of microservice 4 to microservice 7 and the access records of microservice 5 to microservice 7. The access records of microservice 4 to microservice 7 specifically include the access targets, access times, access frequencies, etc. of each network request sent by microservice 4 to microservice 5. The access records of microservice 5 to microservice 7 specifically include the access targets, access times, access frequencies, etc. of each network request sent by microservice 5 to microservice 5.
[0062] S203, obtain the return information of the first microservice for the network request, and determine whether the first microservice is reachable based on the return information; wherein, the deployment status when the first microservice is unreachable is undeployed, and the deployment status when the first microservice is reachable is deployed.
[0063] In the embodiments of the present application, the second microservice can be used to obtain the return information of the first microservice for its network request, and thereby determine whether the first microservice is reachable. For example, if the return information is "404 error", then the first microservice is unreachable. If the first microservice is unreachable, the deployment status of the first microservice is undeployed. On the contrary, if the first microservice is reachable, the deployment status of the first microservice is deployed.
[0064] For ease of understanding, continue with Figure 4 Taking the business scenario shown as an example, microservice 4 and microservice 5, as downstream microservices of microservice 7, can respectively monitor the network requests from microservice 4 to microservice 7 and the network requests from microservice 5 to microservice 7. According to the return information of the most recent network request from microservice 7 to microservice 4 or microservice 5, it can be determined whether microservice 7 is reachable. If microservice 7 is unreachable, the deployment status of microservice 7 is undeployed. On the contrary, if microservice 7 is reachable, the deployment status of microservice 7 is deployed.
[0065] S30, if the deployment status is undeployed, calculate the access count of the first microservice based on the access records, and perform resource deployment on the first microservice when the access count is greater than the corresponding count threshold.
[0066] In the embodiments of the present application, if the deployment status of the first microservice is undeployed, the access count of the first microservice can be calculated based on the access records of the first microservice, and then resource deployment can be performed on the first microservice when it exceeds the corresponding count threshold. This can achieve deploying the microservice when the actual network requests reach a certain threshold, thereby saving the resources of the cloud platform.
[0067] For ease of understanding, continue withFigure 4 Taking the business scenario shown as an example, microservice 4 and microservice 5 are downstream microservices of microservice 7. If the deployment status of microservice 7 is undeployed, the access records of microservice 7 can be used to determine the number of accesses of microservice 4 and microservice 5 to microservice 7 within a specified duration (such as 3 minutes). This access number includes the sum of the access times of all network requests sent by microservice 4 and microservice 5 to microservice 7. For example, for microservice 7, the access number within 3 minutes can be set to 5 times. That is, when the access number of microservice 4 and microservice 5 to microservice 7 within 3 minutes exceeds 5 times, resource deployment is performed on microservice 7.
[0068] It should be noted that in practical applications, different access numbers can be set for different microservices, and the embodiments of the present application do not limit this.
[0069] In a possible implementation, resource deployment of the first microservice can be completed through a delivery warehouse. Refer to Figure 5 , Figure 5 which is another part of the flowchart of a microservice deployment method provided by the embodiments of the present application. As shown in Figure 5 , in a microservice deployment method provided by the embodiments of the present application, in step S30, "performing resource deployment on the first microservice" may include the following steps S301 to S302, and these steps will be described in detail below.
[0070] S301, obtaining the delivery information of the first microservice from the delivery warehouse, where the delivery information includes the deployment location and resource information.
[0071] In the embodiments of the present application, the delivery warehouse maintains the delivery information of all passively deployed first microservices, including the deployment location and resource information such as the image ID and instance specification. For this, for the first microservice to be deployed, its corresponding delivery information can be obtained from the delivery warehouse. Refer to Table 2, which is an example of a delivery warehouse provided by the embodiments of the present application. As shown in Table 2, the delivery warehouse includes the numbers, instance specifications, deployment locations, and image IDs of microservice 1, microservice 2, and microservice 3 respectively. Taking microservice 1 as an example, the deployment location of microservice 1 is "Cloud Platform A", the instance specification is "4 cores and 8G", and the image ID is "image-id-0001".
[0072] Table 2
[0073]
[0074] S302, generating a resource instance of the first microservice based on the resource information, and deploying the resource instance according to the deployment location.
[0075] In the embodiments of the present application, for the first microservice to be deployed, after obtaining its delivery information in the delivery warehouse, corresponding resource instances can be generated based on the resource information therein, and the resource instances can be deployed according to the deployment location, thereby completing the deployment and initialization of the first microservice.
[0076] It should be noted that the above resource instances can be cloud instances. Of course, if the business of the first microservice involves more resource types such as load balancing and elastic scaling groups, more types of resource instances can also be generated, and the embodiments of the present application do not limit this. Further, the resource instances of the first microservice are deployed according to the deployment location of the first microservice.
[0077] It should be noted that after the resource deployment of the first microservice is completed, its resource instances have unique resource IDs, which can be used to accurately destroy and recycle the resource instances. The embodiments of the present application can maintain newly created resources through a passive resource list. Refer to Table 3, which is an example of a passive resource list provided by the embodiments of the present application. As shown in Table 3, after the resource deployment of Microservice 1, Microservice 2, and Microservice 3 is completed, the passive resource list includes the respective numbers, deployment locations, and resource IDs of Microservice 1, Microservice 2, and Microservice 3. Taking Microservice 1 as an example, the deployment location of Microservice 1 is "Cloud Platform A" and the resource ID is "instance-id-2032".
[0078] Table 3
[0079]
[0080] In a possible implementation, for the microservice that has completed resource deployment, resources can also be destroyed and recycled when it is not called for a long time, thereby saving cloud platform resources. Refer to Figure 6 , Figure 6 which is another flowchart of a microservice deployment method provided by the embodiments of the present application. As Figure 6 shown, a microservice deployment method provided by the embodiments of the present application further includes the following step S40, which will be described in detail below.
[0081] S40, if the deployment status is deployed, calculate the idle duration of the first microservice according to the access record, and recycle the resources of the first microservice when the idle duration is greater than the corresponding duration threshold.
[0082] In the embodiments of the present application, if the deployment status of the first microservice is deployed, the idle duration of the first microservice can be calculated according to the access record of the first microservice, that is, the duration without receiving network requests (such as 3 minutes). Furthermore, when the idle duration is greater than the corresponding duration threshold, the resources of the first microservice are destroyed and recycled.
[0083] Continuing with Figure 4 the business scenario shown as an example, microservice 4 and microservice 5 are downstream microservices of microservice 7. If the deployment status of microservice 7 is deployed, the access time of the most recent network request sent by microservice 4 or microservice 5 can be determined based on the access records of microservice 7, so as to determine the idle duration of microservice 7. If the idle duration of this microservice 7 is greater than 3 minutes, the resources of microservice 7 will be destroyed and recycled.
[0084] Through the above description, a microservice deployment method provided by an embodiment of the present application can first register non-core low-frequency services but not deploy them in advance, deploy resources when there are actually more requests, and destroy and recycle resources after not receiving requests for a long time, so as to achieve the purpose of saving cloud platform resources.
[0085] The above introduced a microservice deployment method provided by an embodiment of the present application. Next, an apparatus for executing the above microservice deployment method will be introduced.
[0086] See Figure 7 , Figure 7 which is a schematic structural diagram of a microservice deployment apparatus provided by an embodiment of the present application. As Figure 7 shown, a microservice deployment apparatus provided by an embodiment of the present application includes:
[0087] A configuration acquisition module 10, configured to acquire a passive service configuration, where the passive service configuration can indicate a first microservice to be passively deployed;
[0088] A service deployment module 20, configured to determine the access records and deployment status of the first microservice; if the deployment status is not deployed, calculate the access quantity of the first microservice according to the access records, and perform resource deployment on the first microservice when the access quantity is greater than the corresponding quantity threshold.
[0089] In a possible implementation, the configuration acquisition module 10 is specifically configured to:
[0090] Acquire a passive service list; wherein, the first microservice's request entry is recorded in the passive service list.
[0091] In a possible implementation, the service deployment module 20 for determining the access records and deployment status of the first microservice is specifically configured to:
[0092] Determine the second microservice that invokes the first microservice based on the service topology and call chain; monitor the network requests of the second microservice to the first microservice, and generate an access record of the first microservice according to the monitoring result; obtain the return information of the first microservice for the network request, and determine whether the first microservice is reachable according to the return information; wherein, the deployment status when the first microservice is unreachable is undeployed, and the deployment status when the first microservice is reachable is deployed.
[0093] In a possible implementation, the service deployment module 20 for resource deployment of the first microservice is specifically configured to:
[0094] Obtain the delivery information of the first microservice from the delivery warehouse, where the delivery information includes the deployment location and resource information; generate a resource instance of the first microservice based on the resource information, and deploy the resource instance according to the deployment location.
[0095] In a possible implementation, the service deployment module 20 is further configured to:
[0096] If the deployment status is deployed, calculate the idle duration of the first microservice according to the access record, and recycle the resources of the first microservice when the idle duration is greater than the corresponding duration threshold.
[0097] It should be noted that the refined functions of each module in the embodiments of the present application can be referred to the corresponding disclosed parts of the above microservice deployment method embodiments, and will not be elaborated here.
[0098] An electronic device is also provided in the embodiments of the present application. Refer to Figure 8 , Figure 8 which is a schematic structural diagram of an electronic device provided in the embodiments of the present application. The electronic device in the embodiments of the present application may include, but is not limited to, fixed terminals such as mobile phones, laptop computers, PDAs (Personal Digital Assistants), PADs (Tablet Computers), desktop computers, and the like. Figure 8 The electronic device shown is only an example and should not bring any limitation to the functions and usage scope of the embodiments of the present application.
[0099] As Figure 8 shown, the electronic device may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 801, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 802 or the program loaded from the storage device 808 into the random access memory (RAM) 803. When the electronic device is powered on, various programs and data required for the operation of the electronic device are also stored in the RAM 803. The processing device 801, the ROM 802, and the RAM 803 are connected to each other through a bus 804. The input / output (I / O) interface 805 is also connected to the bus 804.
[0100] Typically, the following devices can be connected to the I / O interface 805: input devices 806 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 807 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 808 including, for example, a memory card, a hard disk, etc.; and a communication device 809. The communication device 809 can allow the electronic device to communicate with other devices wirelessly or wiredly to exchange data. Although Figure 8 an electronic device with various devices is shown, it should be understood that it is not required to implement or have all the shown devices. Instead, more or fewer devices can be implemented or had.
[0101] An embodiment of the present application also provides a computer program product including computer-readable instructions, which, when running on an electronic device, enable the electronic device to implement any one of the microservice deployment methods provided by the embodiments of the present application.
[0102] An embodiment of the present application also provides a computer-readable storage medium carrying one or more computer programs, which, when executed by an electronic device, can enable the electronic device to implement any one of the microservice deployment methods provided by the embodiments of the present application.
[0103] In addition, it should be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. In addition, in the drawings of the device embodiments provided in the present application, the connection relationships between the modules indicate that they have communication connections, which can be specifically implemented as one or more communication buses or signal lines.
[0104] Through the description of the above embodiments, those skilled in the art can clearly understand that the present application can be implemented by means of software plus necessary general hardware. Of course, it can also be implemented by dedicated hardware including application-specific integrated circuits, dedicated CPUs, dedicated memories, dedicated components, etc. Generally, functions completed by computer programs can be easily implemented by corresponding hardware, and the specific hardware structures for implementing the same function can also be diverse, such as analog circuits, digital circuits, or dedicated circuits, etc. However, for the present application, software program implementation is a better embodiment in more cases. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium, such as a floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk, or optical disc of a computer, etc., and includes several instructions to enable a computer device (which can be a personal computer, training device, or network device, etc.) to execute the methods described in various embodiments of the present application.
[0105] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product.
[0106] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer can be a general-purpose computer, a dedicated computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website, computer, training device, or data center to another website, computer, training device, or data center in a wired manner (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or a wireless manner (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can store, or a data storage device such as a training device or data center that includes one or more integrated available media. The available medium can be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (SSD)), etc.
Claims
1. A microservice deployment method, characterized in that: The microservice deployment method includes: Obtain a passive service configuration, where the passive service configuration can indicate a passively deployed first microservice; Determine the access record and deployment status of the first microservice; If the deployment state is not deployed, the number of accesses to the first microservice is calculated according to the access record, and when the number of accesses is greater than a corresponding number threshold, resources are deployed for the first microservice.
2. The microservice deployment method according to claim 1, characterized in that: The obtaining of the passive service configuration includes: Obtain a passive service list; wherein the passive service list records the request entry of the first microservice.
3. The microservice deployment method according to claim 1, characterized in that: The determining the access record and deployment status of the first microservice includes: Determine a second microservice that calls the first microservice based on the service topology and the call chain; Monitoring the network request of the second microservice to the first microservice, and generating an access record of the first microservice according to the monitoring result; Obtain return information of the first microservice in response to the network request, and determine whether the first microservice is reachable according to the return information; wherein, when the first microservice is unreachable, the deployment state is undeployed, and when the first microservice is reachable, the deployment state is deployed.
4. The microservice deployment method according to claim 1, characterized in that: The deploying resources for the first microservice includes: Obtaining delivery information of the first microservice from a delivery warehouse, where the delivery information includes deployment location and resource information; Generate a resource instance of the first microservice based on the resource information, and deploy the resource instance according to the deployment location.
5. The microservice deployment method according to claim 1, characterized in that: The microservice deployment method further includes: If the deployment state is deployed, the idle time of the first microservice is calculated according to the access record, and when the idle time is greater than a corresponding time threshold, resources of the first microservice are recycled.
6. A microservice deployment device, characterized in that: The microservice deployment device comprises: A configuration acquisition module, used to acquire a passive service configuration, where the passive service configuration can indicate a passively deployed first microservice; The service deployment module is used to determine the access record and deployment status of the first microservice; if the deployment status is not deployed, the number of accesses to the first microservice is calculated according to the access record, and when the number of accesses is greater than the corresponding number threshold, resources are deployed for the first microservice.
7. The microservice deployment device according to claim 6, characterized in that: The configuration acquisition module is specifically used for: Obtain a passive service list; wherein the passive service list records the request entry of the first microservice.
8. A computer program product, characterized in that The method comprises computer-readable instructions, which, when executed on an electronic device, enable the electronic device to implement the microservice deployment method as claimed in any one of claims 1 to 5.
9. An electronic device, characterized in that: The method comprises at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program so that the electronic device can implement the microservice deployment method as described in any one of claims 1 to 5.
10. A computer storage medium, characterized in that: The storage medium carries one or more computer programs, and when the one or more computer programs are executed by an electronic device, the electronic device can implement the microservice deployment method as described in any one of claims 1 to 5.