Dynamic micro-service deployment method and device, equipment and storage medium
By using the main container as the gateway and application market in microservice deployment, and dynamically deploying applications according to needs and business relevance, solving the cumbersome and network consumption problems of traditional deployment methods, realizing flexible deployment and traffic management, and improving System scalability and collaboration capabilities.
Patent Information
- Application Number
- CN202411105371.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-13
- Publication Date
- 2024-12-03
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional microservice deployment methods are cumbersome and cannot be flexibly deployed. Network transmission traffic is consumed heavily and cannot be dynamically adjusted according to actual needs.
By deploying the main container as the main control application service and gateway, the applications to be deployed are obtained, and the container deployment method of the application is dynamically determined based on the deployment requirements and business association, a communication gateway is generated, and a flexible combination of applications and communication optimization is realized.
It realizes more convenient application deployment, reduces network transmission consumption, improves the scalability and collaboration capabilities of the system, and adapts to the needs of different application scenarios.
Smart Images

Figure CN119065787A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a dynamic microservice deployment method, apparatus, device and storage medium. Background Art
[0002] With the development of cloud computing and container technology, microservices have become the mainstream method for building complex application systems. When deploying applications, traditional microservices usually divide each application into multiple independent services. Each service has clear responsibilities and communicates between multiple applications through the network. However, the above deployment method has defects. For example, it is very cumbersome to develop multiple services; it cannot be flexibly deployed according to actual needs, multiple applications can only be deployed and divided independently, and the network transmission traffic consumption is large. Summary of the invention
[0003] The embodiments of the present application provide a dynamic microservice deployment method, apparatus, device, and storage medium to solve at least one problem existing in the related art. The technical solution is as follows:
[0004] In a first aspect, an embodiment of the present application provides a method for dynamic microservice deployment, including:
[0005] In response to the deployment instruction, deploy the main container as a master application service and gateway;
[0006] Acquire a first application program and a second application program to be deployed through an application market;
[0007] In response to a deployment requirement, deploying the first application and the second application in at least one secondary container using the primary container;
[0008] In response to the access request, the target application in the secondary container is called through the primary container.
[0009] In one embodiment, in response to the deployment requirement, deploying the first application and the second application in at least one secondary container using the primary container includes:
[0010] When the deployment requirement includes a combined package, deploying the first application and the second application into the same secondary container using the primary container;
[0011] When the deployment requirement does not include a combined package, determining a business relevance between the first application and the second application;
[0012] According to the business association, the first application and the second application are deployed in at least one secondary container using the primary container.
[0013] In one embodiment, deploying the first application and the second application in at least one secondary container by using the primary container according to the business association includes:
[0014] When the business correlation representation is correlated, deploying the first application and the second application into the same secondary container by using the primary container;
[0015] When the business correlation representation does not have any correlation, the first application and the second application are respectively deployed in different secondary containers by using the primary container.
[0016] In one embodiment, the method further comprises:
[0017] When the first application and the second application are respectively deployed in different secondary containers, determining a communication status between the first application and the second application;
[0018] When the communication situation indicates that there is interactive communication, determining the interactive communication frequency between the first application and the second application;
[0019] When the interactive communication frequency is greater than a frequency threshold, the first application and the second application are automatically deployed to the same secondary container.
[0020] In one embodiment, the method further comprises:
[0021] When deploying at least one container for the first application and the second application, generating a first communication gateway and a second communication gateway for the first application and the second application respectively;
[0022] The first communication gateway and the second communication gateway are both connected to the main container serving as a gateway, and the first communication gateway, the second communication gateway and the main container constitute a service grid for communication between the first application and the second application.
[0023] In one embodiment, in response to the access request, calling the target application in the secondary container through the primary container includes:
[0024] When receiving an access request, determining a target application by responding to the access request through the main container as a gateway;
[0025] When the target application is the first application, calling the first application through the main container in the service grid and the first communication gateway;
[0026] When the target application is the second application, the second application is called through the main container and the second communication gateway in the service grid.
[0027] In one embodiment, when receiving the access request, determining the target application by the main container as a gateway responding to the access request includes:
[0028] When receiving an access request sent by the second application, transmitting the access request to the primary container as a gateway through the second communication gateway in the service grid, or, when receiving an access request sent by the first application, transmitting the access request to the primary container as a gateway through the first communication gateway in the service grid;
[0029] The target application is determined by the main container in response to the application name identifier of the application in the application market in the access request.
[0030] In a second aspect, an embodiment of the present application provides a dynamic microservice deployment device, including:
[0031] A first deployment module, configured to deploy a main container as a master application service and a gateway in response to a deployment instruction;
[0032] An acquisition module, used for acquiring the first application program and the second application program to be deployed through the application market;
[0033] A second deployment module, configured to deploy the first application and the second application in at least one secondary container using the deployment master container in response to a deployment requirement;
[0034] The calling module is used to call the target application in the secondary container through the primary container in response to the access request.
[0035] In one embodiment, the second deployment module is further used for:
[0036] When the first application and the second application are respectively deployed in different secondary containers, determining a communication status between the first application and the second application;
[0037] When the communication situation indicates that there is interactive communication, determining the interactive communication frequency between the first application and the second application;
[0038] When the interactive communication frequency is greater than a frequency threshold, the first application and the second application are automatically deployed to the same secondary container.
[0039] In one embodiment, the second deployment module is further used for:
[0040] When deploying at least one container for the first application and the second application, generating a first communication gateway and a second communication gateway for the first application and the second application respectively;
[0041] The first communication gateway and the second communication gateway are both connected to the main container serving as a gateway, and the first communication gateway, the second communication gateway and the main container constitute a service grid for communication between the first application and the second application.
[0042] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor and a memory, wherein the memory stores instructions, and the instructions are loaded and executed by the processor to implement a method in any one of the above-mentioned embodiments.
[0043] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed, the method in any one of the above-mentioned embodiments is implemented.
[0044] The beneficial effects of the above technical solution include at least:
[0045] By responding to the deployment instruction, the main container is deployed as the main control application service and gateway, the first application and the second application to be deployed are obtained through the application market, and in response to the deployment requirements, the first application and the second application are deployed in at least one secondary container using the main container, and in response to the access request, the target application in the secondary container is called through the main container; the main container provides a unified main control application service and gateway entry, which makes deployment more convenient, facilitates traffic distribution and reduces the consumption of calling traffic; at the same time, the first application and the second application can be dynamically deployed based on the actual deployment needs of the user, and the deployment is more flexible.
[0046] The above summary is for illustrative purposes only and is not intended to be limiting in any way. In addition to the illustrative aspects, embodiments and features described above, further aspects, embodiments and features of the present application will be readily apparent by reference to the accompanying drawings and the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In the accompanying drawings, unless otherwise specified, the same reference numerals throughout the multiple drawings represent the same or similar parts or elements. These drawings are not necessarily drawn to scale. It should be understood that these drawings only depict some embodiments disclosed in the present application and should not be regarded as limiting the scope of the present application.
[0048] Figure 1This is a schematic diagram of the steps of a dynamic microservice deployment method according to an embodiment of the present application;
[0049] Figure 2 A schematic diagram of a service grid according to an embodiment of the present application;
[0050] Figure 3 This is a structural block diagram of a dynamic microservice deployment device according to an embodiment of the present application;
[0051] Figure 4 This is a structural block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0052] In the following, only some exemplary embodiments are briefly described. As those skilled in the art will appreciate, the described embodiments may be modified in various ways without departing from the spirit or scope of the present application. Therefore, the drawings and descriptions are considered to be exemplary and non-restrictive in nature.
[0053] In related technologies, with the development of cloud computing and container technology, microservice architecture has become the mainstream method for building complex application systems. The traditional microservice architecture divides the application into multiple independent services, each of which has clear responsibilities and communicates through the network. However, the traditional microservice architecture faces some challenges during deployment and maintenance, such as high network communication overhead and fixed service deployment.
[0054] Reference Figure 1 , a flowchart of a dynamic microservice deployment method according to an embodiment of the present application is shown. The dynamic microservice deployment method may include at least steps S100-S400:
[0055] S100. In response to a deployment instruction, deploy a main container as a master application service and a gateway.
[0056] S200: Acquire a first application program and a second application program to be deployed through an application market.
[0057] S300: In response to a deployment requirement, deploy a first application and a second application in at least one secondary container using a deployment master container.
[0058] S400: In response to the access request, the target application in the secondary container is called through the primary container.
[0059] The technical solution of the embodiment of the present application is to deploy a main container as a master application service and a gateway in response to a deployment instruction, obtain a first application and a second application to be deployed through an application market, and deploy the first application and the second application in at least one secondary container using the main container in response to deployment requirements, and call the target application in the secondary container through the main container in response to an access request; the main container provides a unified master application service and a gateway entry, which makes deployment more convenient and is conducive to traffic distribution and reducing the consumption of calling traffic; at the same time, the first application and the second application can be dynamically deployed based on the actual deployment needs of the user, and the deployment is more flexible.
[0060] In one implementation, the user can perform deployment operations in the server according to their own needs and generate deployment instructions. The server responds to the deployment instructions and deploys the main container (master container) and one or more secondary containers; wherein the main container serves as the master application service and gateway, providing the application market function and the ability of a unified gateway entrance, and the master application service is stateless, and the same container can be added at any time to cope with traffic changes. The same type of container can be accessed randomly or polling, and is not limited by the state of the container itself. For example, the master container can deploy multiple identical containers to achieve respective load balancing.
[0061] In one implementation, when an application needs to be deployed, the application to be deployed can be uploaded to an application market, and the application to be deployed can be obtained through the application market. In the embodiment of the present application, the application to be deployed includes a first application and a second application. In other embodiments, the number of applications is not specifically limited.
[0062] In one implementation, step S300 includes steps S310-S330:
[0063] S310: When the deployment requirement includes a combined package, the first application and the second application are deployed into the same secondary container using the primary container.
[0064] In the embodiment of the present application, the application market can select different application combinations to automatically start the container and use the main container to deploy the application. Therefore, the user can freely choose the combination deployment according to the deployment requirements, or the application developer can specify the deployment requirements of the combination package when developing the application and deploy the application according to the corresponding deployment requirements.
[0065] Optionally, when the deployment requirements include a combination package, for example, the first application A and the second application B are a combination package specified by a developer, the first application A and the second application B are deployed to the same secondary container by using the main container through the application market. Among them, the developer can develop different combination packages as deployment requirements based on actual business scenarios, carry out different targeted deployments, adapt to different business scenarios, and have strong scalability; at the same time, as a combination of applications for a combination package, through having associated functions, data interaction is required, and the first application A and the second application B are deployed to the same secondary container, which is conducive to reducing network transmission consumption. For example, a first application A for a duty service is developed, and the first application A needs to frequently obtain user information from the second application B of the user information service. Then, the first application A and the second application B can be installed in the same secondary container to reduce network communication, because the network communication in the same secondary container does not need to be forwarded by the host machine, so it is better than setting the first application A and the second application B in different secondary containers, which can reduce latency. In addition, due to container orchestration systems such as k8s, different containers are often assigned to different servers. At this time, if the two applications are located in different secondary containers, the consumption of network transmission is further increased.
[0066] S320: When the deployment requirement does not include a combined package, determine the business relevance between the first application and the second application.
[0067] Optionally, when the deployment requirements do not include a combination package, that is, the developer has not specified a combination package, the business relevance between the first application and the second application can be analyzed and determined. For example, in the above-mentioned example of the on-duty service, there is a business relevance between the first application and the second application. If the first application and the second application do not need to obtain each other's data, that is, there is no possibility of interaction, then there is no business relevance.
[0068] S330: Deploy the first application and the second application to at least one secondary container using the primary container according to business relevance.
[0069] Optionally, steps S3301-S3302 are included:
[0070] S3301: When the business correlation representation is correlated, deploy the first application and the second application into the same secondary container using the primary container.
[0071] Optionally, when the business relevance representation is associated, that is, there is data interaction between the first application and the second application, in order to improve interaction efficiency and reduce network transmission consumption, the first application and the second application are deployed to the same secondary container through the application market using the main container.
[0072] S3302: When the business correlation representation does not have any correlation, the first application and the second application are respectively deployed in different secondary containers using the primary container.
[0073] Optionally, when the business correlation representation does not have any correlation, there is no need to deploy them in the same secondary container. In this case, the first application and the second application are deployed in different secondary containers respectively through the application market and the main container.
[0074] In one implementation, the method of the embodiment of the present application may further include S11-S13:
[0075] S11. When the first application and the second application are respectively deployed in different secondary containers, determine the communication status between the first application and the second application.
[0076] Optionally, when the first application and the second application are respectively deployed in different sub-containers, the application market or server engineer can determine the communication status of the first application and the second application every preset time to determine whether there is interactive communication between the first application and the second application.
[0077] S12: When the communication situation indicates that there is interactive communication, determine the interactive communication frequency between the first application and the second application.
[0078] Optionally, when the communication situation indicates the presence of interactive communication, the frequency of interactive communication between the first application and the second application is statistically determined.
[0079] S13: When the interactive communication frequency is greater than the frequency threshold, the first application and the second application are automatically deployed to the same secondary container.
[0080] Optionally, the frequency threshold is set based on actual conditions. When the interactive communication frequency is greater than the frequency threshold, the application market acquires the server and uses the main container to automatically deploy the first application and the second application to the same secondary container.
[0081] In one implementation, if there is interactive communication, the first application and the second application may be directly and automatically deployed to the same secondary container.
[0082] In one implementation, the method of the embodiment of the present application may further include S21:
[0083] S21. When deploying the first application and the second application in at least one container, generate a first communication gateway and a second communication gateway for the first application and the second application respectively.
[0084] Optionally, when deploying at least one sub-container for the first application and the second application, the server generates a communication gateway for each application, for example, generates a first communication gateway and a second communication gateway for the first application and the second application respectively, and the first communication gateway and the second communication gateway are both connected to the main container as a gateway, and the first communication gateway, the second communication gateway and the main container constitute a service grid for the first application to communicate with the second application. It should be noted that when the third application is deployed again, the third communication gateway will continue to be generated, and it will also be connected to the main container as a gateway; each application communicates through the service grid using protocols such as TCP or UDP to ensure that applications provided by different developers can work together. The service grid is like Figure 2 As shown. Each application 21 has a corresponding communication gateway 22, and the communication between each application 21 is realized through its communication gateway 22. Through the service grid, as an application sending a message, it does not need to know how the communication process works. It only needs to hand over the information to the communication gateway and tell the address of the application that needs to communicate, such as the name of the other party's application and the service that needs to be requested. The communication gateway will pass the information to the destination, that is, the application that needs to communicate.
[0085] In one implementation, step S400 includes steps S410-S430:
[0086] S410: When an access request is received, the main container as a gateway responds to the access request and determines a target application.
[0087] Specifically, when the application market or server receives an access request, the main container as a gateway receives all external traffic such as access requests. For example, when an access request sent by a second application is received, the access request is transmitted to the main container as a gateway through the second communication gateway in the service grid, and the main container responds to the application name identifier of the application in the application market in the access request to determine the target application.
[0088] It should be noted that the access request carries the application name identifier (app name), so the sender (user) does not need to care about the other party's native k8s service name, microservice or IP. He only needs to know the unique application name identifier of the application in the application market. For example, there is a first application A named user. If the user wants to access a service service1 in user, he can initiate an access request carrying the name of the first application A in the second application B, and call user.service1 to obtain the service. At this time, the determined target application is the first application A.
[0089] Similarly, when an access request sent by a first application is received, the access request is transmitted to the main container serving as a gateway through the first communication gateway in the service grid, and then the main container responds to the application name identifier of the application in the application market in the access request to determine the target application, which will not be repeated here.
[0090] S420: When the target application is a first application, the first application is called through a main container in the service grid and a first communication gateway.
[0091] Optionally, when the target application is the first application, a request is sent to the first communication gateway through the main container in the service grid, and the first communication gateway transmits the request to the first application, thereby calling the first application.
[0092] S430: When the target application is a second application, the second application is called through the main container in the service grid and the second communication gateway.
[0093] Similarly, when the target application is a second application, a request is sent to the second communication gateway through the main container in the service grid, and the second communication gateway transmits the request to the second application, thereby calling the second application.
[0094] By using the method of the embodiment of the present application, at least the following effects can be achieved:
[0095] 1) Reduce network transmission consumption by combining and deploying frequently communicating applications into the same container;
[0096] 2) Provide a method for dynamically combining and deploying applications to meet the needs of different application scenarios. The deployment of containers and applications can be adjusted according to actual needs, and the deployment is flexible;
[0097] 3) Allow different developers to provide different applications and communicate through a unified service grid, which is conducive to the collaboration of different developers and enhances the scalability and collaboration capabilities of the system;
[0098] 4) Providing a unified gateway entry and traffic distribution function through a master application service is conducive to traffic management and simplifies system management and maintenance; in addition, the master application service is stateless and containers can be added at any time to ensure high availability and scalability of the system.
[0099] Reference Figure 3 , shows a structural block diagram of a dynamic microservice deployment device according to an embodiment of the present application, and the device may include:
[0100] A first deployment module, configured to deploy a main container as a master application service and a gateway in response to a deployment instruction;
[0101] An acquisition module, used for acquiring the first application program and the second application program to be deployed through the application market;
[0102] A second deployment module, configured to deploy the first application and the second application in at least one secondary container by using the deployment main container in response to a deployment requirement;
[0103] The calling module is used to call the target application in the secondary container through the primary container in response to the access request.
[0104] In one embodiment, the second deployment module is further used to:
[0105] When the first application and the second application are respectively deployed in different secondary containers, determining a communication status between the first application and the second application;
[0106] When the communication situation indicates that there is interactive communication, determining the interactive communication frequency between the first application and the second application;
[0107] When the interactive communication frequency is greater than a frequency threshold, the first application and the second application are automatically deployed to the same secondary container.
[0108] In one embodiment, the second deployment module is further used to:
[0109] When deploying the first application and the second application in at least one container, generating a first communication gateway and a second communication gateway for the first application and the second application respectively;
[0110] The first communication gateway and the second communication gateway are both connected to a main container as a gateway, and the first communication gateway, the second communication gateway and the main container constitute a service grid for the first application to communicate with the second application.
[0111] The functions of each module in each device in the embodiments of the present application can be found in the corresponding description in the above method, and will not be repeated here.
[0112] Reference Figure 4 , shows a structural block diagram of an electronic device according to an embodiment of the present application, the electronic device includes: a memory 310 and a processor 320, the memory 310 stores instructions that can be run on the processor 320, and the processor 320 loads and executes the instructions to implement the dynamic microservice deployment method in the above embodiment. The number of the memory 310 and the processor 320 can be one or more.
[0113] In one embodiment, the electronic device also includes a communication interface 330 for communicating with external devices and performing data exchange transmission. If the memory 310, the processor 320 and the communication interface 330 are implemented independently, the memory 310, the processor 320 and the communication interface 330 can be interconnected through a bus and complete mutual communication. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0114] Optionally, in a specific implementation, if the memory 310, the processor 320 and the communication interface 330 are integrated on a chip, the memory 310, the processor 320 and the communication interface 330 can communicate with each other through an internal interface.
[0115] An embodiment of the present application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the dynamic microservice deployment method provided in the above embodiment.
[0116] An embodiment of the present application also provides a chip, which includes a processor for calling and executing instructions stored in the memory from the memory, so that a communication device equipped with the chip executes the method provided by the embodiment of the present application.
[0117] An embodiment of the present application also provides a chip, including: an input interface, an output interface, a processor and a memory, wherein the input interface, the output interface, the processor and the memory are connected via an internal connection path, and the processor is used to execute the code in the memory. When the code is executed, the processor is used to execute the method provided in the embodiment of the application.
[0118] It should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. It is worth noting that the processor may be a processor supporting the advanced RISC machines (ARM) architecture.
[0119] Further, optionally, the above-mentioned memory may include a read-only memory and a random access memory, and may also include a non-volatile random access memory. The memory may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may include a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may include a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available. For example, static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM) and direct rambus RAM (DR RAM).
[0120] 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. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. 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.
[0121] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example" or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. Moreover, the described specific features, structures, materials or characteristics may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine different embodiments or examples described in this specification and the features of different embodiments or examples, unless they are contradictory.
[0122] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0123] Any process or method description in the flow chart or otherwise described herein can be understood to represent a module, fragment or portion of a code including one or more executable instructions for implementing the steps of a specific logical function or process. And the scope of the preferred embodiment of the present application includes other implementations, in which the functions may not be performed in the order shown or discussed, including in a substantially simultaneous manner or in a reverse order according to the functions involved.
[0124] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, which can be embodied in any computer-readable medium for use by an instruction execution system, apparatus or device (such as a computer-based system, a system including a processor or other system that can fetch instructions from an instruction execution system, apparatus or device and execute instructions), or used in combination with these instruction execution systems, apparatuses or devices.
[0125] It should be understood that the various parts of the present application can be implemented with hardware, software, firmware or a combination thereof. In the above embodiments, multiple steps or methods can be implemented with software or firmware stored in a memory and executed by a suitable instruction execution system. All or part of the steps of the above embodiment method can be completed by instructing the relevant hardware through a program, which can be stored in a computer-readable storage medium, and when the program is executed, it includes one of the steps of the method embodiment or a combination thereof.
[0126] In addition, each functional unit in each embodiment of the present application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into one module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of a software functional module. If the above-mentioned integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. The storage medium can be a read-only memory, a disk or an optical disk, etc.
[0127] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A dynamic microservice deployment method, characterized in that: include: In response to the deployment instruction, deploy the main container as a master application service and gateway; Acquire the first application program and the second application program to be deployed through the application market; In response to a deployment requirement, deploying the first application and the second application in at least one secondary container using the primary container; In response to the access request, the target application in the secondary container is called through the primary container.
2. The dynamic microservice deployment method according to claim 1, characterized in that: In response to the deployment requirement, deploying the first application and the second application in at least one secondary container using the primary container includes: When the deployment requirement includes a combined package, deploying the first application and the second application into the same secondary container using the primary container; When the deployment requirement does not include a combined package, determining a business relevance between the first application and the second application; According to the business association, the first application and the second application are deployed in at least one secondary container using the primary container.
3. The dynamic microservice deployment method according to claim 2 is characterized in that: The deploying the first application and the second application in at least one secondary container by using the primary container according to the business association includes: When the business correlation representation is correlated, deploying the first application and the second application into the same secondary container using the primary container; When the business correlation representation does not have any correlation, the first application and the second application are respectively deployed in different secondary containers by using the primary container.
4. The dynamic microservice deployment method according to any one of claims 1 to 3, characterized in that: The method further comprises: When the first application and the second application are respectively deployed in different secondary containers, determining a communication status between the first application and the second application; When the communication situation indicates that there is interactive communication, determining the interactive communication frequency between the first application and the second application; When the interactive communication frequency is greater than a frequency threshold, the first application and the second application are automatically deployed to the same secondary container.
5. The dynamic microservice deployment method according to any one of claims 1 to 3, characterized in that: The method further comprises: When deploying at least one container for the first application and the second application, generating a first communication gateway and a second communication gateway for the first application and the second application respectively; The first communication gateway and the second communication gateway are both connected to the main container serving as a gateway, and the first communication gateway, the second communication gateway and the main container constitute a service grid for communication between the first application and the second application.
6. The dynamic microservice deployment method according to claim 5, characterized in that: In response to the access request, calling the target application in the secondary container through the primary container includes: When receiving an access request, determining a target application by responding to the access request through the main container as a gateway; When the target application is the first application, calling the first application through the main container in the service grid and the first communication gateway; When the target application is the second application, the second application is called through the main container and the second communication gateway in the service grid.
7. The dynamic microservice deployment method according to claim 6, characterized in that: When receiving the access request, determining the target application by the main container as a gateway responding to the access request includes: When receiving an access request sent by the second application, transmitting the access request to the primary container as a gateway through the second communication gateway in the service grid, or, when receiving an access request sent by the first application, transmitting the access request to the primary container as a gateway through the first communication gateway in the service grid; The target application is determined by the main container in response to the application name identifier of the application in the application market in the access request.
8. A dynamic microservice deployment device, characterized in that: include: A first deployment module, configured to deploy a main container as a master application service and a gateway in response to a deployment instruction; An acquisition module, used for acquiring the first application program and the second application program to be deployed through the application market; A second deployment module, configured to deploy the first application and the second application in at least one secondary container using the deployment master container in response to a deployment requirement; The calling module is used to call the target application in the secondary container through the primary container in response to the access request.
9. An electronic device, characterized in that: include: A processor and a memory, wherein the memory stores instructions, and the instructions are loaded and executed by the processor to implement the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Cloud computing-oriented interactive perception containerized micro-service resource scheduling method
CN112783649A
Container cluster deployment method and device and computer equipment
CN114217956A
AI algorithm and micro-service scheduling method and device based on cloud native technology
CN115454629A
