Microservice unified construction method, environment generation method and related equipment

By splitting and unified building of microservice configurations, the problems of high construction and maintenance costs and difficult environment generation and switching in the existing technology are solved, rapid construction and efficient environment generation are achieved, and operation and maintenance costs and error rates are reduced.

CN114968225BActive Publication Date: 2025-03-25CHINA LIFE INSURANCE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210334253.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-30
Publication Date
2025-03-25
Estimated Expiration
2042-03-30

AI Technical Summary

Technical Problem

The existing microservices are costly to build and maintain, and it is difficult to generate and switch environments, especially in a large number of microservices and diversified environment scenarios.

Method used

A unified microservice construction method is proposed. By splitting the configurations of different microservices, forming fixed configurations and general configurations, storing the key values ​​of the general configurations as construction templates, and pulling the corresponding configurations according to the target microservice type and environment type to form a complete supporting configuration to achieve the rapid construction of the target microservices.

Benefits of technology

It reduces the modification cost of a large number of microservices, improves the efficiency of environment generation, simplifies the environment switching and continuous integration process, and reduces the error rate and operation and maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114968225B_ABST
    Figure CN114968225B_ABST
Patent Text Reader

Abstract

The present application provides a unified microservice construction method, an environment generation method and related equipment, the construction method includes: splitting various configurations of different microservices to form fixed configurations and general configurations; storing the key value of the general configuration as a construction template, and independently storing the value corresponding to the key value according to different environment types; obtaining the target microservice type and the target environment type, pulling the corresponding fixed configuration according to the target microservice type, pulling the corresponding value according to the target environment type, filling the value into the construction template and merging it with the fixed configuration to form a complete supporting configuration; completing the target microservice construction according to the supporting configuration. The unified microservice construction method, environment generation method and related equipment provided by the present application reduce the modification cost of a large number of microservices, have a low error rate, improve the efficiency of environment generation, and facilitate environment switching and continuous integration.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of microservice technology, and in particular to a microservice unified construction method, an environment generation method, and related equipment. Background Art

[0002] Microservices are a loosely coupled distributed architecture framework. With the rapid development of business, microservices are being split into smaller and smaller parts, with an increasing number of microservices and more complex topological relationships between services. At the same time, in order to meet the needs of various business scenarios, the types of environments generated by microservices are also becoming more diverse. How to build microservices and quickly generate environments at the lowest possible cost is a common concern and a problem that all major companies are concerned about. The existing microservice construction and maintenance costs are high, and the corresponding environment generation and switching are difficult. Summary of the invention

[0003] In view of this, the purpose of this application is to propose a microservice unified construction method, an environment generation method and related equipment to solve the above-mentioned technical problems.

[0004] In a first aspect of the present application, a method for uniformly constructing microservices is provided, comprising:

[0005] Various configurations of different microservices are split into fixed configurations and common configurations; the key value of the common configuration is stored as a construction template, and the value corresponding to the key value is stored separately according to different environment types; the target microservice type and the target environment type are obtained, and the corresponding fixed configuration is pulled according to the target microservice type, and the corresponding value is pulled according to the target environment type, and the value is filled into the construction template and merged with the fixed configuration to form a complete supporting configuration; the target microservice is built according to the supporting configuration.

[0006] Furthermore, completing the target microservice construction according to the supporting configuration includes: compiling, generating an image, uploading the image to a warehouse, and pulling up a container process in sequence according to the supporting configuration to build the target microservice.

[0007] Further, completing the target microservice construction according to the supporting configuration includes: feeding back the result of the target microservice construction to the service page.

[0008] Furthermore, the key value of the general configuration is stored as a construction template, and the value corresponding to the key value is stored independently according to different environment types, and then includes: setting a bottom-line configuration.

[0009] Furthermore, the setting of the fallback configuration includes: setting a default environment type or configuring a default value.

[0010] Further, completing the target microservice construction according to the supporting configuration then includes: in response to a failure in the construction of the target microservice, executing the backup configuration for reconstruction.

[0011] The second aspect of the present application provides an environment generation method, including: according to the target environment type and the selected different target microservice types, respectively executing the microservice unified construction method as described in the first aspect to construct multiple target microservices, and the multiple target microservices together form a target environment.

[0012] According to a third aspect of the present application, a unified microservice construction device is provided, comprising: a splitting module, configured to split various configurations of different microservices into fixed configurations and common configurations; a modeling module, configured to store the key value of the common configuration as a construction template, and to independently store the value corresponding to the key value according to different environment types; a configuration module, configured to obtain a target microservice type and a target environment type, pull the corresponding fixed configuration according to the target microservice type, pull the corresponding value according to the target environment type, fill the value into the construction template one by one and merge it with the fixed configuration to form a complete supporting configuration; and a construction module, configured to complete the construction of the target microservice according to the supporting configuration.

[0013] In a fourth aspect of the present application, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the microservice unified construction method as described in the first aspect above when executing the computer program.

[0014] In a fifth aspect of the present application, a non-transitory computer-readable storage medium is provided, wherein the non-transitory computer-readable storage medium stores computer instructions, wherein the computer instructions are used to enable the computer to execute the unified microservice construction method described in the first aspect above.

[0015] As can be seen from the above, the present application provides a unified construction method for microservices, an environment generation method and related equipment, which splits various configurations of different microservices into fixed configurations and common configurations. The common configuration is a variable configuration that is common to different microservices, so that a unified construction logic for different microservices is formed. After a large number of microservices are subsequently constructed, only the unified construction logic needs to be modified, which avoids repeated operations, reduces the error rate, and has low maintenance costs; the key value of the common configuration is stored as a construction template, and the value value corresponding to the key value is stored separately according to different environment types, so that corresponding common configurations can be formed for different target environments in the future, which facilitates the rapid construction and switching of the environment; the corresponding fixed configuration is pulled according to the target microservice type, and the corresponding value value is pulled according to the target environment type, and the value value is filled into the construction template and merged with the fixed configuration to form a complete supporting configuration, and the target microservice is quickly constructed according to the supporting configuration, which improves the efficiency of environment generation, removes manual operations, and provides the possibility for continuous integration. The unified construction method, environment generation method and related equipment of microservices reduce the modification cost of a large number of microservices, have a low error rate, improve the efficiency of environment generation, and facilitate environment switching and continuous integration. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions in the present application or related technologies, the drawings required for use in the embodiments or related technical descriptions are briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0017] Figure 1 A schematic diagram of a process of a unified microservice construction method according to an embodiment of the present application;

[0018] Figure 2 A schematic diagram of the principle of an environment generation method according to an embodiment of the present application;

[0019] Figure 3 A schematic diagram of the structure of a microservice unified construction device according to an embodiment of the present application;

[0020] Figure 4 A schematic diagram of the structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0021] In order to make the objectives, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.

[0022] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present application should be understood by people with ordinary skills in the field to which the present application belongs. The "first", "second" and similar words used in the embodiments of the present application do not represent any order, quantity or importance, but are only used to distinguish different components. "Including" or "comprising" and similar words mean that the elements or objects appearing in front of the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect.

[0023] Microservices are loosely coupled distributed architecture frameworks. The benefit of using microservices is that the development team can quickly build new components of the application to meet changing business needs. With the rapid development of the business, microservices are split into smaller and smaller parts, the number of microservices is increasing, and the topological relationship between services is becoming more and more complex. At the same time, in order to meet the needs of various business scenarios, the types of environments generated by microservices are gradually diversified. How to build microservices at the lowest possible cost and quickly generate a stable environment according to user needs is a common problem that all major companies are concerned about and pay close attention to.

[0024] For example, in the insurance industry, microservices include user center login, registration, password retrieval, etc. The required environments include development environment, test environment, joint debugging environment or integrated verification environment, etc. The microservice configurations in different environments are different. The existing technology generally maintains independent build scripts and configurations for each microservice. Each build needs to modify different configuration contents according to the build requirements, and then complete the construction of each microservice and the generation of the environment in a targeted manner.

[0025] Now, due to the increasingly refined decomposition of microservices, a single environment may usually face hundreds of microservices. The build scripts and configurations are hashed and managed, which is very complex. Once the configuration file needs to be upgraded, hundreds of microservices need to be modified one by one, which results in a huge amount of repetitive work and high modification costs. In addition, a large number of microservices are usually maintained by different personnel, and each developer has his or her own development habits and personalized coding methods. Therefore, each time a modification is made, due to the large number of modified microservices, it is very easy to make mistakes or introduce some personalized modifications, resulting in increased subsequent maintenance costs.

[0026] In addition, since each microservice requires a lot of adjustments, the generation efficiency of the entire environment is very low. When multiple people collaborate, developer A modifies the configuration of the microservices one by one to construct development environment a. At this time, if tester B wants to build a test environment b, he needs to wait for developer A's environment to be built. Otherwise, tester B's configuration changes will overwrite the content modified by developer A, making it difficult to switch environments. If the configuration is modified by pulling a new branch, the maintenance cost and modification and merging cost of subsequent branches will increase accordingly. Moreover, each change requires manual modification of a large number of configurations according to needs, making it difficult to directly perform continuous integration. Continuous integration is a software development practice in which each integration is verified through automated builds to detect integration errors as early as possible.

[0027] In the process of implementing this application, it was found that since there are generally some common variable configurations in the configuration, upgrades or adjustments may be frequently faced during the entire R&D life cycle. It is possible to consider splitting the configurations of different microservices to abstract the common configurations so that different microservices can be built uniformly for easy maintenance. In addition, the environment construction template can be abstracted so that the corresponding microservices can be built according to the specified environment to facilitate environment switching.

[0028] Below, through specific embodiments and combined Figure 1-4 To describe the technical solution of this application in detail.

[0029] Some embodiments of the present application provide a method for uniformly constructing microservices, such as Figure 1 As shown, the following steps are included:

[0030] S101. Split various configurations of different microservices into fixed configurations and common configurations.

[0031] The configuration is stored in the configuration center, and the various configurations of different microservices are split into fixed configurations and common configurations. Fixed configurations are configurations that do not need to be changed when microservices are modified or upgraded. Common configurations are variable configurations that are common to different microservices. This forms a unified build logic for different microservices. Different microservices can be built according to fixed configurations and common configurations, avoiding differences in coding habits among different personnel and reducing the error rate. If a large number of microservices need to be modified or upgraded after they have been built, you only need to modify the unified build logic. There is no need to modify the microservices one by one, avoiding repeated operations and greatly reducing maintenance costs.

[0032] S102: The key value of the general configuration is stored as a construction template, and the value corresponding to the key value is independently stored according to different environment types.

[0033] The Java backend can read the key and value of the common configuration. Key-value is a way to add a custom string. You can get the value through the key. There are multiple key values. The Maven dependency management tool is used to store the key value of the common configuration as a build template, and the value corresponding to each key value is stored separately according to different environment types, so that corresponding common configurations can be formed for different target environments in the future, which facilitates the rapid construction and switching of the environment.

[0034] S103: Obtain the target microservice type and the target environment type, pull the corresponding fixed configuration according to the target microservice type, pull the corresponding value according to the target environment type, fill the value into the construction template and merge it with the fixed configuration to form a complete supporting configuration.

[0035] The target microservice type may be, for example, the login, registration or password retrieval service of the user center, and the target environment type may be, for example, the development environment, test environment, joint debugging environment or integrated verification environment, without specific limitation. According to the target microservice type, the fixed configuration of the corresponding microservice is pulled, and then the corresponding value is pulled according to the target environment type, and the value corresponding to each key value is filled into the build template one by one to form a general configuration of the target microservice under the target environment, and the general configuration is re-merged with the fixed configuration to form a complete supporting configuration. The supporting configuration is the supporting configuration of the target microservice of the specified target environment. Different microservices can form corresponding supporting configurations according to the specified target environment type, which facilitates the rapid generation of the environment, and there is no need to modify different microservices one by one for environment switching operations. Only the target environment type needs to be changed, which eliminates manual operations and provides the possibility for continuous integration.

[0036] S104. Complete the target microservice construction according to the supporting configuration.

[0037] Docker technology is used to quickly build target microservices according to supporting configurations, which improves environment generation efficiency and reduces operation and maintenance costs.

[0038] This unified microservice construction method reduces the modification cost of a large number of microservices, has a low error rate, improves the environment generation efficiency, and facilitates environment switching and continuous integration. Since the construction logic of a large number of microservice hashes is abstracted into a unified construction logic, the cost of continuous integration is greatly reduced; the unified construction logic avoids the personalized behavior of users, and at the same time, since a large number of modification operations are reduced, the probability of errors is greatly reduced; when deploying the entire environment, users no longer need to make a large number of adjustments, they only need to select the corresponding target environment, and they can quickly complete the deployment, meeting the needs of rapid construction and convenient switching of various environments.

[0039] In some embodiments, step S104 includes: compiling, generating an image, uploading the image to a warehouse, and pulling up a container process in sequence according to the supporting configuration to build the target microservice.

[0040] In some embodiments, the microservice unified construction method further includes:

[0041] S105: Feedback the target microservice construction result to the service page.

[0042] This step makes it easy for users to view the results and perform subsequent work. The results of building the target microservice can also be sent to users in the form of emails.

[0043] In some embodiments, the microservice unified construction method includes the following steps:

[0044] S201. Split various configurations of different microservices into fixed configurations and common configurations.

[0045] S202: The key value of the general configuration is stored as a construction template, and the value corresponding to the key value is independently stored according to different environment types.

[0046] S203. Set a fallback configuration.

[0047] S204: Obtain the target microservice type and the target environment type, pull the corresponding fixed configuration according to the target microservice type, pull the corresponding value according to the target environment type, fill the value values ​​into the construction template one by one, and merge them with the fixed configuration to form a complete supporting configuration.

[0048] S205. Complete the target microservice construction according to the supporting configuration.

[0049] S206: In response to the target microservice construction failure, execute the fallback configuration to rebuild.

[0050] The purpose of setting a fallback configuration is to take into account various abnormal situations that may occur during the microservice construction process. The fallback configuration includes, for example, setting a default environment type or configuring a default value, etc., which is not specifically limited. In this way, when the target microservice construction fails, for example, the user does not select the target environment type or the value is not configured, resulting in a construction failure, the fallback configuration can be executed to rebuild it and reduce the failure rate.

[0051] In some embodiments, abstract general capabilities can also be analyzed in combination with common user needs, such as the ability to quickly generate different types of environments, incremental deployment capabilities, and the ability to quickly replace configurations, so as to determine the operation options ultimately provided to the user. The operation options may include, for example, the target environment type, target microservice type, microservice branch, etc., without specific limitations. Users select the microservice to be built based on the operation options to improve the user service experience.

[0052] It should be noted that the above describes some embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the above embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0053] In some embodiments of the present application, a method for generating an environment is provided, such as Figure 2 As shown, according to the target environment type and the selected different target microservice types, the corresponding microservice unified construction method in any of the foregoing embodiments is respectively executed to construct multiple target microservices, and the multiple target microservices together form the target environment.

[0054] When users deploy the entire environment, they do not need to manually modify various configurations. They only need to select the target environment type and target microservice type to be built, and then they can quickly build n microservices 23, quickly complete the generation of the environment, and facilitate environment switching, with low operation and maintenance costs.

[0055] like Figure 2 As shown, the maintenance of various configurations is carried out in the configuration center 21. Of course, it can also be directly stored through file storage, various configuration system storage, or other storage media, which can achieve the same effect or achieve the same purpose. The service source code 232 in the figure is the source code, and the supporting configuration corresponds to the regular build 221 in the unified build script 22. The bottom-up configuration 231 corresponds to the bottom-up build 222 in the unified build script 22. This solution maintains the configuration and can also maintain the build script, which will not be elaborated here.

[0056] It should be noted that the above describes some embodiments of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the above embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0057] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present application also provides another microservice unified construction device, referring to Figure 3 ,include:

[0058] A splitting module 31 is configured to split various configurations of different microservices into fixed configurations and common configurations;

[0059] A modeling module 32 is configured to store the key value of the general configuration as a building template, and to store the value corresponding to the key value independently according to different environment types;

[0060] The configuration module 33 is configured to obtain the target microservice type and the target environment type, pull the corresponding fixed configuration according to the target microservice type, pull the corresponding value according to the target environment type, fill the value into the construction template and merge it with the fixed configuration to form a complete supporting configuration;

[0061] The construction module 34 is configured to complete the target microservice construction according to the supporting configuration.

[0062] For the convenience of description, the above device is described in terms of functions divided into various modules. Of course, when implementing the present application, the functions of each module can be implemented in the same or multiple software and / or hardware.

[0063] The device of the above embodiment is used to implement the corresponding microservice unified construction method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.

[0064] Based on the same inventive concept, corresponding to any of the above-mentioned embodiments and methods, the present application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the unified microservice construction method described in any of the above-mentioned embodiments is implemented.

[0065] Figure 4A more specific schematic diagram of the hardware structure of an electronic device provided in this embodiment is shown, and the device may include: a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040 and a bus 1050. It is characterized in that the processor 1010, the memory 1020, the input / output interface 1030 and the communication interface 1040 realize communication connection with each other inside the device through the bus 1050.

[0066] The processor 1010 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.

[0067] The memory 1020 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 may store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 1020 and are called and executed by the processor 1010.

[0068] The input / output interface 1030 is used to connect the input / output module to realize information input and output. The input / output module can be configured as a component in the device (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. It is characterized in that the input device can include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device can include a display, a speaker, a vibrator, an indicator light, etc.

[0069] The communication interface 1040 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).

[0070] The bus 1050 includes a path that transmits information between the various components of the device (eg, the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040).

[0071] It should be noted that, although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040 and the bus 1050, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiments of the present specification, and does not necessarily include all the components shown in the figure.

[0072] The electronic device of the above embodiment is used to implement the corresponding microservice unified construction method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiment, which will not be repeated here.

[0073] Based on the same inventive concept, corresponding to any of the above-mentioned embodiment methods, the present application also provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the unified microservice construction method described in any of the above embodiments.

[0074] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.

[0075] The computer instructions stored in the storage medium of the above embodiment are used to enable the computer to execute the microservice unified construction method described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.

[0076] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the present application (including the claims) is limited to these examples. In line with the concept of the present application, the technical features in the above embodiments or different embodiments may be combined, the steps may be implemented in any order, and there are many other variations of the different aspects of the embodiments of the present application as described above, which are not provided in detail for the sake of simplicity.

[0077] In addition, to simplify the description and discussion, and in order not to make the embodiments of the present application difficult to understand, the device can be shown in the form of a block diagram, so as to avoid making the embodiments of the present application difficult to understand, and this also takes into account the following fact, that is, the details of the implementation method of these block diagram devices are highly dependent on the platform to be implemented in the embodiments of the present application (that is, these details should be fully within the scope of understanding of those skilled in the art). In the case of elaborating specific details to describe the exemplary embodiments of the present application, it is obvious to those skilled in the art that the embodiments of the present application can be implemented without these specific details or when these specific details are changed. Therefore, these descriptions should be considered to be illustrative rather than restrictive.

[0078] Although the present application has been described in conjunction with specific embodiments thereof, many alternatives, modifications and variations of these embodiments will be apparent to those skilled in the art in light of the foregoing description.

[0079] The embodiments of the present application are intended to cover all such substitutions, modifications and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present application should be included in the scope of protection of the present application.

Claims

1. A method for uniformly building microservices, characterized in that: include: The various configurations of different microservices are split into fixed configurations and common configurations, wherein the fixed configuration is the configuration that does not need to be changed when the microservice is modified or upgraded, and the common configuration is the variable configuration that is common to different microservices; The key value of the general configuration is stored as a construction template, and the value corresponding to the key value is stored separately according to different environment types; the bottom-line configuration is set, including: setting a default environment type or configuring a default value; Obtain the target microservice type and the target environment type, pull the corresponding fixed configuration according to the target microservice type, pull the corresponding value according to the target environment type, fill the value values ​​into the construction template one by one and merge them with the fixed configuration to form a complete supporting configuration; The target microservice is built according to the supporting configuration, including: compiling, generating an image, uploading the image to a warehouse, and pulling up a container in sequence according to the supporting configuration to build the target microservice; in response to a failure in building the target microservice, executing the backup configuration to rebuild; and feeding back the result of building the target microservice to the service page.

2. A method for generating an environment, characterized in that: include: According to the target environment type and the selected different target microservice types, the microservice unified construction method as claimed in claim 1 is executed respectively to construct multiple target microservices, and the multiple target microservices together form a target environment.

3. A microservice unified construction device, characterized in that: include: A splitting module is configured to split various configurations of different microservices into fixed configurations and common configurations, wherein the fixed configuration is a configuration that does not need to be changed when the microservice is modified or upgraded, and the common configuration is a variable configuration that is common to different microservices; The modeling module is configured to store the key value of the general configuration as a building template, and store the value corresponding to the key value independently according to different environment types; set the bottom-line configuration, including: setting a default environment type or configuring a default value; A configuration module is configured to obtain a target microservice type and a target environment type, pull the corresponding fixed configuration according to the target microservice type, pull the corresponding value according to the target environment type, fill the value values ​​into the construction template one by one and merge them with the fixed configuration to form a complete supporting configuration; The construction module is configured to complete the construction of the target microservice according to the supporting configuration, including: compiling, generating images, uploading the images to the warehouse and pulling up the container process in sequence according to the supporting configuration to build the target microservice; in response to the failure of the target microservice to build, executing the backup configuration for reconstruction; and feeding back the result of the target microservice construction to the service page.

4. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the microservice unified construction method according to claim 1 is implemented.

5. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to enable the computer to execute the microservice unified construction method as claimed in claim 1.

Citation Information

Patent Citations

  • Micro-service management method and device

    CN111857653A

  • System and method for managing enterprise application configuration

    US7499933B1