A method, system, device and medium for building dynamic microservices
By packaging the toolkits required for ERP product deployment into private images, providing unified deployment scripts, dynamically splitting and combining microservices, the complex and inefficient deployment of ERP product in the existing technology is solved, and fast and efficient microservice deployment is achieved.
Patent Information
- Application Number
- CN202210311584.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-28
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2042-03-28
AI Technical Summary
In the prior art, ERP products are deployed in complex, and multiple mirroring scripts are required to be written during each project deployment, resulting in inefficient deployment.
A method for building dynamic microservices is proposed. By packaging the deployment toolkit required for product deployment into private images, a unified deployment script is provided, and the dynamic splitting and combination of microservices is supported, thereby reducing modifications to the underlying image formation mechanism.
It realizes rapid microservice splitting and deployment, improves deployment efficiency, and reduces lengthy scripting work.
Smart Images

Figure CN114675849B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of microservice cluster deployment, and in particular to a method, system, device and medium for dynamically building microservices. Background Art
[0002] The deployment of ERP products is relatively complex. The deployment method in the prior art is to package the product-related design and development compiled files into an image within the company or at the customer's site according to the image packaging method, that is, to package the program files and configuration files into the image at the same time, and then upload them to the public image warehouse or the customer's independent private image warehouse. During on-site deployment, it is necessary to pull independent image files from the public image warehouse or the customer's independent private image warehouse, and pull and start the image on each cluster node in K8S. In the prior art, deployment is carried out by packaging images. When each project is deployed, a set of image formation scripts is required. Packaged images generally require the use of many scripts to create images and other actions, that is, a lot of lengthy documents are required, which is not conducive to improving deployment efficiency. Summary of the invention
[0003] In view of this, the present invention proposes a method, system, device and medium for building dynamic microservices. Among them, the method for building dynamic microservices proposed by the present invention provides a unified private image for storing the deployment scripts required for product deployment, that is, a configuration file toolkit, which does not require a set of image formation scripts to be deployed separately when each project is deployed, and can quickly split microservices without modifying the underlying image formation mechanism.
[0004] Based on the above purpose, one aspect of an embodiment of the present invention provides a method for building dynamic microservices, including the following steps: packaging the deployment toolkit required for product deployment into a private image to provide a unified deployment script for different products; splitting the products to be deployed according to microservice units to obtain a combination of units to be deployed; updating the content of the corresponding deployment unit in the file sharing server according to the content of the products to be deployed; selecting the corresponding unit to be deployed and the server to be deployed in the combination of units to be deployed according to user needs; pulling the content of the deployment unit corresponding to the unit to be deployed in the file sharing server, and deploying it on the server corresponding to the unit to be deployed according to the private image.
[0005] In some embodiments, a method for building dynamic microservices further includes: in response to upgrading the product to be deployed, obtaining the to-be-deployed unit required for upgrading the product to be deployed, modifying the content of the deployment unit corresponding to the required to-be-deployed unit in the file sharing server, and triggering redeployment of the server corresponding to the required to-be-deployed unit.
[0006] In some embodiments, updating the content of the corresponding deployment unit in the file sharing server according to the content of the product to be deployed includes: adding a corresponding service mark in each unit to be deployed of the product to be deployed; identifying the deployment unit corresponding to each unit to be deployed of the product to be deployed in the file sharing server according to the corresponding service mark, so as to realize the content update of the corresponding deployment unit.
[0007] In some embodiments, pulling the content of the deployment unit corresponding to the unit to be deployed in the file sharing server, and deploying it on the server corresponding to the unit to be deployed according to the private image includes: downloading the information of the corresponding deployment unit in the file sharing server according to the unit to be deployed selected by the user; scanning and loading the information of the corresponding deployment unit onto the corresponding server; and deploying it on the corresponding server according to the corresponding deployment toolkit in the private image.
[0008] In some embodiments, selecting corresponding units to be deployed and servers to be deployed from the combination of units to be deployed according to user needs includes: providing a unified service portal for users; identifying an application portal of the microservice according to the microservice selected by the user through the unified service portal; and obtaining the units to be deployed and servers to be deployed corresponding to the microservice according to the application portal.
[0009] In some embodiments, identifying the application entry of the microservice according to the microservice selected by the user through the unified service entry includes: registering with a service registration center according to the microservice selected by the user, and providing the application entry of the microservice to the service registration center.
[0010] In some embodiments, a method for building dynamic microservices further includes: in response to reducing the load-bearing pressure of the corresponding server of the product to be deployed, splitting each unit to be deployed of the product to be deployed through a GUI microservice deployment tool to reduce the granularity of the units to be deployed of the product to be deployed.
[0011] Another aspect of an embodiment of the present invention provides a system for building dynamic microservices, comprising the following modules: a first module, configured to package the deployment toolkit required for product deployment into a private image, so as to provide a unified deployment script for different products; a second module, configured to split the products to be deployed according to microservice units to obtain a combination of units to be deployed; a third module, configured to update the content of the corresponding deployment unit in the file sharing server according to the content of the products to be deployed; a fourth module, configured to select the corresponding unit to be deployed and the server to be deployed in the combination of units to be deployed according to user needs; and a fifth module, configured to pull the content of the deployment unit corresponding to the unit to be deployed in the file sharing server, and deploy it on the server corresponding to the unit to be deployed according to the private image.
[0012] Another aspect of an embodiment of the present invention provides a computer device, comprising at least one processor; and a memory, wherein the memory stores computer instructions executable on the processor, and the instructions implement the steps of any of the above methods when executed by the processor.
[0013] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, which stores a computer program that implements any of the above method steps when executed by a processor.
[0014] The present invention has at least the following beneficial effects: a method, system, device and medium for building dynamic microservices are proposed in the present invention, wherein the method for building dynamic microservices proposed in the present invention processes the splitting of microservices from the product development compilation stage, does not require modification of the underlying image formation mechanism, and realizes rapid microservice splitting. It only requires an interface to select the service content included in the microservice, which is beneficial to improving deployment efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other embodiments can be obtained based on these drawings without paying creative work.
[0016] Figure 1 A schematic diagram of an embodiment of a method for building dynamic microservices provided by the present invention;
[0017] Figure 2 A schematic diagram of an embodiment of a system for building dynamic microservices provided by the present invention;
[0018] Figure 3A schematic diagram of an embodiment of a computer device provided by the present invention;
[0019] Figure 4 A schematic diagram of an embodiment of a computer-readable storage medium provided by the present invention. DETAILED DESCRIPTION
[0020] The following describes embodiments of the present invention. However, it should be understood that the disclosed embodiments are merely examples and other embodiments can take various alternative forms.
[0021] In addition, it should be noted that all expressions using "first" and "second" in the embodiments of the present invention are intended to distinguish two entities with the same name but not the same or non-identical parameters. It can be seen that "first" and "second" are only for the convenience of expression and should not be understood as limitations on the embodiments of the present invention. The subsequent embodiments will not explain this one by one. The terms "include", "comprise" or any other variation thereof are intended to cover non-exclusive inclusions, so that a process, method, article or device that includes a series of elements includes not only those elements, but also elements that are not explicitly listed or inherent to these processes, methods, articles or devices.
[0022] One or more embodiments of the present application will be described below with reference to the accompanying drawings.
[0023] Based on the above objectives, a first aspect of an embodiment of the present invention provides an embodiment of a method for building dynamic microservices. Figure 1 FIG. 1 is a schematic diagram of an embodiment of a method for building a dynamic microservice provided by the present invention. Figure 1 As shown, a method for building a dynamic microservice in an embodiment of the present invention includes the following steps:
[0024] S1. Package the deployment toolkit required for product deployment into a private image to provide a unified deployment script for different products.
[0025] S2. Split the product to be deployed into microservice units to obtain a combination of units to be deployed;
[0026] S3, updating the content of the corresponding deployment unit in the file sharing server according to the content of the product to be deployed;
[0027] S4. Selecting a corresponding unit to be deployed and a server to be deployed from the combination of the units to be deployed according to user needs;
[0028] S5. Pull the content of the deployment unit corresponding to the unit to be deployed in the file sharing server, and deploy it on the server corresponding to the unit to be deployed according to the private image.
[0029] Another embodiment of a method for building dynamic microservices proposed by the present invention is deployed at the customer site based on the K8S microservice deployment environment, and the granularity of the minimized deployment unit is used for processing during product development and compilation. At the same time, the web front end provides services as a whole, and there is no need to split its services.
[0030] Package the deployment toolkit required for deploying the product into a private image, including the JLK, language, and font download toolkits required for the application at runtime. Split the services of the product to be deployed according to the microservice units to obtain a combination of units to be deployed, namely, the procurement microservice unit, the sales microservice unit, and the inventory microservice unit. Use a file sharing server to store the contents of the split units to be deployed, that is, store the combination of units to be deployed, namely, the contents of the procurement microservice unit, the sales microservice unit, and the inventory microservice unit. In actual applications, you can choose to make an http server for storage, configure it with other tools such as nginx, and create three subordinate directories in the http server to store the contents of procurement, sales, and inventory respectively. Create a service in K8S to manage the contents of the procurement microservice unit, the sales microservice unit, and the inventory microservice unit.
[0031] When deploying at the customer site, the packaged backend script is delivered to the customer site as an increment. Each deployment unit has a service unit mark, such as fileserver:gl, fileserver:ar, fileserver.pr, fileserver:tm. When deploying at the customer site, the deployment unit is identified by its service mark, and then the content of the procurement microservice unit, sales microservice unit, and inventory microservice unit is merged with the content of the corresponding units deployed at the customer site, that is, the content of the deployed corresponding units is updated. The updated deployment unit will be packaged and stored as a downloadable tar package in the file sharing server.
[0032] There will be a GUI deployment tool at the front desk of product deployment, which is used to provide users with the selection of microservice deployment units for combination. For example, GL general ledger, AR revenue, AP payable and AA fixed assets can be packaged together and then used as a microservice to provide services. After the GUI deployment tool is selected in the interface, it can be deployed. Users select microservices through a unified service portal, and microservices automatically register with the service registration center and provide their own application portals to the service registration center. The unified service portal identifies the specific application portal of the microservice selected by the user according to the user's choice, and implements routing to a specific server. The server can be a separate Linux machine or a pod inside K8S. When deploying, download the corresponding files in the file sharing server according to the information of the product to be deployed, scan the files and load them into the memory, find the corresponding server, execute the start command in K8S, and execute the task of deploying on the corresponding server.
[0033] When upgrading again, you only need to modify the content of the files in the corresponding directory on the file server, which will trigger the automatic update and corresponding deployment of the microservices, without modifying the content of the private image or repackaging the image.
[0034] When the load-bearing pressure of a single server is too great, the deployment units can be further split on the front-end GUI microservice deployment tool, that is, the deployment units can be further refined to avoid abnormal downtime caused by a server carrying too many requests.
[0035] Based on the above objectives, a second aspect of an embodiment of the present invention proposes a system for dynamically building microservices. Figure 2 FIG. 1 is a schematic diagram of an embodiment of a system for dynamically building microservices provided by the present invention. Figure 2 As shown, it includes the following modules: a first module 011, configured to package the deployment toolkit required for product deployment into a private image, so as to provide a unified deployment script for different products; a second module 012, configured to split the product to be deployed according to the microservice units to obtain a combination of units to be deployed; a third module 013, configured to update the content of the corresponding deployment unit in the file sharing server according to the content of the product to be deployed; a fourth module 014, configured to select the corresponding unit to be deployed and the server to be deployed in the combination of units to be deployed according to user needs; and a fifth module 015, configured to pull the content of the deployment unit corresponding to the unit to be deployed in the file sharing server, and deploy it on the server corresponding to the unit to be deployed according to the private image.
[0036] Based on the above objectives, a third aspect of an embodiment of the present invention provides a computer device, Figure 3 FIG. 2 is a schematic diagram of an embodiment of a computer device provided by the present invention. Figure 3 As shown, an embodiment of a computer device provided by the present invention includes the following modules: at least one processor 021; and a memory 022, wherein the memory 022 stores computer instructions 023 that can be executed on the processor 021, and the computer instructions 023 implement the steps of any of the above methods when executed by the processor 021.
[0037] The present invention also provides a computer-readable storage medium. Figure 4 FIG. 2 is a schematic diagram of an embodiment of a computer-readable storage medium provided by the present invention. Figure 4 As shown, the computer-readable storage medium 031 stores a computer program 032 that performs the above method when executed by a processor.
[0038] Finally, it should be noted that a person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program of the method for setting system parameters can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium of the program can be a disk, an optical disk, a read-only storage memory (ROM) or a random access memory (RAM), etc. The above-mentioned computer program embodiments can achieve the same or similar effects as the corresponding above-mentioned arbitrary method embodiments.
[0039] In addition, the method disclosed in the embodiment of the present invention can also be implemented as a computer program executed by a processor, and the computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the above functions defined in the method disclosed in the embodiment of the present invention are performed.
[0040] In addition, the above method steps and system units may also be implemented using a controller and a computer-readable storage medium for storing a computer program that enables the controller to implement the above steps or unit functions.
[0041] It will also be appreciated by those skilled in the art that various exemplary logic blocks, modules, circuits and algorithm steps described in conjunction with the disclosure herein can be implemented as electronic hardware, computer software or a combination of the two. In order to clearly illustrate this interchangeability of hardware and software, a general description has been given to the functions of various schematic components, blocks, modules, circuits and steps. Whether this function is implemented as software or hardware depends on specific applications and the design constraints imposed on the entire system. Those skilled in the art can implement the function in various ways for each specific application, but this implementation decision should not be interpreted as causing a departure from the disclosed scope of the embodiments of the present invention.
[0042] In one or more exemplary designs, the function can be implemented in hardware, software, firmware or any combination thereof. If implemented in software, the function can be stored on a computer-readable medium or transmitted by a computer-readable medium as one or more instructions or codes. Computer-readable media include computer storage media and communication media, and the communication media include any media that helps to transmit a computer program from one location to another. The storage medium can be any available medium that can be accessed by a general or special computer. As an example and not limiting, the computer-readable medium may include RAM, ROM, EEPROM, CD-ROM or other optical disk storage devices, magnetic disk storage devices or other magnetic storage devices, or any other medium that can be used to carry or store the required program code in the form of an instruction or data structure and can be accessed by a general or special computer or a general or special processor. In addition, any connection can be appropriately referred to as a computer-readable medium. For example, if a coaxial cable, optical fiber cable, twisted pair, digital subscriber line (D0L) or wireless technologies such as infrared, radio and microwaves are used to send software from a website, server or other remote source, the above-mentioned coaxial cable, optical fiber cable, twisted pair, D0L or wireless technologies such as infrared, radio and microwaves are all included in the definition of the medium. As used herein, disk and disc include compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk, Blu-ray disc, wherein disks usually reproduce data magnetically, while optical discs reproduce data optically with lasers. Combinations of the above should also be included within the scope of computer-readable media.
[0043] The above are exemplary embodiments disclosed in the present invention, but it should be noted that various changes and modifications may be made without departing from the scope disclosed in the embodiments of the present invention as defined in the claims. The functions, steps and / or actions of the method claims according to the disclosed embodiments described herein do not need to be performed in any particular order. In addition, although the elements disclosed in the embodiments of the present invention may be described or required in individual form, they may also be understood as multiple unless explicitly limited to the singular.
[0044] It should be understood that, as used herein, the singular forms "a", "an" are intended to include the plural forms as well, unless the context clearly supports an exception. It should also be understood that, as used herein, "and / or" refers to any and all possible combinations including one or more of the associated listed items.
[0045] The serial numbers of the embodiments disclosed in the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0046] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0047] A person skilled in the art should understand that the discussion of any of the above embodiments is only exemplary and is not intended to imply that the scope of the disclosure of the embodiments of the present invention (including the claims) is limited to these examples; under the concept of the embodiments of the present invention, the technical features in the above embodiments or different embodiments can also be combined, and there are many other changes in different aspects of the embodiments of the present invention as above, which are not provided in detail for the sake of simplicity. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present invention should be included in the protection scope of the embodiments of the present invention.
Claims
1. A method for building dynamic microservices, characterized in that: include: Package the deployment toolkits required for product deployment into private images to provide unified deployment scripts for different products; Split the product to be deployed into microservice units to obtain a combination of units to be deployed; Updating the content of the corresponding deployment unit in the file sharing server according to the content of the product to be deployed; Selecting a corresponding unit to be deployed and a server to be deployed from the combination of the units to be deployed according to user needs; Pulling the content of the deployment unit corresponding to the unit to be deployed in the file sharing server, and deploying it on the server corresponding to the unit to be deployed according to the private image; The deployment toolkit required for the product deployment includes: the JLK, language, and font download toolkit required for runtime application; The product to be deployed is split according to the microservice units to obtain a combination of units to be deployed including: Split the services of the product to be deployed into a purchasing microservice unit, a sales microservice unit, and an inventory microservice unit according to the microservice units, obtain a combination of the units to be deployed, and store the contents of the split units to be deployed through a file sharing server; The selecting the corresponding unit to be deployed and the server to be deployed in the combination of the units to be deployed according to the user's needs comprises: providing a unified service portal for the user; identifying the application portal of the microservice according to the microservice selected by the user through the unified service portal; and acquiring the unit to be deployed and the server to be deployed corresponding to the microservice according to the application portal; The identifying the application entry of the microservice according to the microservice selected by the user through the unified service entry includes: registering with a service registration center according to the microservice selected by the user, and providing the application entry of the microservice to the service registration center; In response to upgrading the product to be deployed, obtaining a unit to be deployed required for upgrading the product to be deployed, modifying the content of a deployment unit corresponding to the required unit to be deployed in the file sharing server, and triggering redeployment of a server corresponding to the required unit to be deployed; In response to reducing the load bearing pressure of the server corresponding to the product to be deployed, each unit to be deployed of the product to be deployed is split through a GUI microservice deployment tool to reduce the granularity of the units to be deployed of the product to be deployed.
2. The method for building dynamic microservices according to claim 1, characterized in that: The updating of the content of the corresponding deployment unit in the file sharing server according to the content of the product to be deployed includes: Adding a corresponding service mark in each to-be-deployed unit of the to-be-deployed product; The deployment unit corresponding to each to-be-deployed unit of the to-be-deployed product in the file sharing server is identified according to the corresponding service mark, so as to implement content update of the corresponding deployment unit.
3. The method for building dynamic microservices according to claim 1, characterized in that: Pulling the content of the deployment unit corresponding to the unit to be deployed in the file sharing server, and deploying the content of the deployment unit corresponding to the unit to be deployed according to the private image includes: Downloading the information of the corresponding deployment unit in the file sharing server according to the unit to be deployed selected by the user; Scan and load the information of the corresponding deployment unit onto the corresponding server; Deploy on the corresponding server according to the corresponding deployment toolkit in the private image.
4. A system for building dynamic microservices, characterized in that: include: The first module is configured to package the deployment toolkit required for product deployment into a private image to provide a unified deployment script for different products; The second module is configured to split the product to be deployed according to the microservice units to obtain a combination of units to be deployed; A third module is configured to update the content of the corresponding deployment unit in the file sharing server according to the content of the product to be deployed; A fourth module is configured to select a corresponding unit to be deployed and a server to be deployed from the combination of the units to be deployed according to user needs; as well as A fifth module is configured to pull the content of the deployment unit corresponding to the unit to be deployed in the file sharing server, and deploy it on the server corresponding to the unit to be deployed according to the private image; The deployment toolkit required for the product deployment includes: the JLK, language, and font download toolkit required for runtime application; The second module is used to: split the service of the product to be deployed into a procurement microservice unit, a sales microservice unit and an inventory microservice unit according to the microservice units, obtain a combination of the units to be deployed and store the contents of the split units to be deployed through a file sharing server; The fourth module is used to: provide a unified service portal for users; identify the application portal of the microservice according to the microservice selected by the user through the unified service portal; obtain the to-be-deployed unit and the to-be-deployed server corresponding to the microservice according to the application portal; The identifying the application entry of the microservice according to the microservice selected by the user through the unified service entry includes: registering with a service registration center according to the microservice selected by the user, and providing the application entry of the microservice to the service registration center; And modules for performing the following functions: In response to upgrading the product to be deployed, obtaining a unit to be deployed required for upgrading the product to be deployed, modifying the content of a deployment unit corresponding to the required unit to be deployed in the file sharing server, and triggering redeployment of a server corresponding to the required unit to be deployed; In response to reducing the load bearing pressure of the server corresponding to the product to be deployed, each unit to be deployed of the product to be deployed is split through a GUI microservice deployment tool to reduce the granularity of the units to be deployed of the product to be deployed.
5. A computer device, characterized in that: include: at least one processor; as well as A memory, wherein the memory stores computer instructions executable on the processor, wherein the instructions, when executed by the processor, implement the steps of the method according to any one of claims 1 to 3.
6. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 3 are implemented.
Citation Information
Patent Citations
Automatic testing method and system and computer storage medium
CN109710524A
Multi-place cross-cluster server deployment method and system
CN110572436A