Micro-service architecture generation method and device, electronic equipment and storage medium

By selecting microservice architecture components with high activity and high iteration efficiency, a microservice architecture that meets the needs of small and medium-sized enterprises is generated, solving the problem of low component activity and improving the business experience of enterprises.

CN115357221BActive Publication Date: 2026-05-01SAMOYED DIGITAL TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SAMOYED DIGITAL TECH CO LTD
Filing Date
2022-07-11
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

The components in the existing microservice architecture are not very active and cannot meet the rapid iteration needs of small and medium-sized enterprises.

Method used

By identifying the application scenarios of the business users, target microservice architecture components with high activity, high iteration efficiency, and high usage frequency are selected from the pre-set microservice architecture component library. The basic code is obtained and compiled to integrate a microservice architecture that meets the business requirements.

Benefits of technology

It improves the activity and iteration efficiency of microservice architecture, meets the business needs of small and medium-sized enterprises, and enhances the user experience for business users.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115357221B_ABST
    Figure CN115357221B_ABST
Patent Text Reader

Abstract

Embodiments of the present application relate to a micro-service architecture generation method and device, electronic equipment and storage medium, the method comprising: determining an application scenario of a business party for a micro-service architecture; finding a target micro-service architecture component matching the application scenario from a preset micro-service architecture component library; obtaining a basic code corresponding to the micro-service architecture and compiling the basic code to integrate the target micro-service architecture component to obtain a micro-service architecture. Thus, the application scenario determined by the business party for the micro-service architecture can be realized to automatically obtain the matching target micro-service architecture component, and then generate the matching micro-service architecture, thereby improving the experience of the business party.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of microservice technology, and in particular to a method, apparatus, electronic device and storage medium for generating a microservice architecture. Background Technology

[0002] Microservices architecture is an architectural pattern that advocates dividing a single application into a set of small services that coordinate and cooperate with each other to provide end-user value. Currently, microservices architecture faces higher requirements: it must not only meet the core business needs but also be easy for developers to quickly learn and use, and most importantly, it must meet system stability requirements to ensure long-term, problem-free operation.

[0003] However, existing technologies often suffer from low component activity in some microservice architectures, making them unsuitable for rapid iteration. Therefore, there is an urgent need for a microservice architecture that meets the business needs of small and medium-sized enterprises. Summary of the Invention

[0004] In view of this, in order to solve the technical problem in the prior art that the low activity of some microservice architecture components makes it impossible to meet the needs of rapid iteration, the present invention provides a method, apparatus, electronic device and storage medium for generating microservice architecture.

[0005] In a first aspect, embodiments of the present invention provide a method for generating a microservice architecture, the method comprising:

[0006] Determine the application scenarios of the microservice architecture for the business stakeholders;

[0007] From the preset microservice architecture component library, find the target microservice architecture component that matches the application scenario;

[0008] Obtain the basic code corresponding to the microservice architecture, and compile the basic code to integrate the target microservice architecture components to obtain the microservice architecture.

[0009] In one possible implementation, before searching for a target microservice architecture component matching the application scenario from a preset microservice architecture component library, the method further includes:

[0010] Determine whether the application scenario meets the preset conditions, the preset conditions include: the query access volume index of the application scenario is greater than or equal to the preset index threshold, and / or the application scenario is used externally by the business party;

[0011] If the application scenario meets the preset conditions, then the step of searching for a target microservice architecture component that matches the application scenario from the preset microservice architecture component library is executed.

[0012] In one possible implementation, the step of searching for a target microservice architecture component that matches the application scenario from a preset microservice architecture component library includes:

[0013] Remove microservice architecture components from the pre-defined microservice architecture component library that have an activity level below the activity level threshold and / or an iteration efficiency below the efficiency threshold and / or a usage count below the usage count threshold.

[0014] From the remaining microservice architecture components in the preset microservice architecture component library, find the target microservice architecture component that matches the application scenario.

[0015] In one possible implementation, the application scenario includes: query access volume metrics or query rate per second metrics;

[0016] The step of searching for a target microservice architecture component that matches the application scenario from the remaining microservice architecture components in the preset microservice architecture component library includes:

[0017] Compare the query access volume metric with a first preset threshold;

[0018] If the query access volume indicator is greater than or equal to the first preset threshold, search for the first message queue component that matches the query access volume indicator from the remaining microservice architecture components in the preset microservice architecture component library; determine the first message queue component as the target microservice architecture component;

[0019] or,

[0020] The query rate per second metric is compared with a second preset threshold.

[0021] If the query rate per second is greater than or equal to the second preset threshold, a second message queue component matching the query rate per second is searched from the remaining microservice architecture components in the preset microservice architecture component library; the second message queue component is determined as the target microservice architecture component.

[0022] In one possible implementation, the method further includes:

[0023] If the query access volume index is less than the first preset threshold, then the first number of container nodes in the microservice architecture is determined based on the query access volume index.

[0024] Compare the number of the first container nodes with a preset first threshold number;

[0025] If the number of the first container nodes is greater than or equal to the first threshold, then the gateway component is searched from the remaining microservice architecture components in the preset microservice architecture component library.

[0026] or,

[0027] If the query rate per second is less than the second preset threshold, then the second number of container nodes in the microservice architecture is determined based on the query rate per second.

[0028] The number of the second container nodes is compared with a preset second threshold number;

[0029] If the number of the second container nodes is greater than or equal to the second threshold number, then the gateway component is searched from the remaining microservice architecture components in the preset microservice architecture component library.

[0030] In one possible implementation, the application scenario includes: data volume information; the step of searching for a target microservice architecture component matching the application scenario from the remaining microservice architecture components in a preset microservice architecture component library includes:

[0031] Search for the database component from the remaining microservice architecture components in the preset microservice architecture component library;

[0032] Determine the number of database components that match the data volume information;

[0033] The database components whose number is determined are the target microservice architecture components.

[0034] In one possible implementation, the application scenario includes: usage scenarios, monitoring requirements, and scheduled service requirements; the step of searching for a target microservice architecture component matching the application scenario from the remaining microservice architecture components in a preset microservice architecture component library includes:

[0035] Determine whether the use case is for external use by the business party;

[0036] If the use case is determined to be for external use by the business party, a check component matching the external use by the business party is found from the remaining microservice architecture components in the preset microservice architecture component library.

[0037] Determine whether the monitoring requirement is necessary;

[0038] If the monitoring requirement is determined to be necessary, a monitoring component matching the monitoring requirement is found from the remaining microservice architecture components.

[0039] Determine whether the scheduled service request is required;

[0040] If the scheduled service requirement is determined to be necessary, a monitoring component matching the scheduled service requirement is searched from the remaining microservice architecture components.

[0041] The inspection component, the monitoring component, and the timed service component are identified as target microservice architecture components.

[0042] Secondly, embodiments of the present invention provide a microservice architecture generation apparatus, the apparatus comprising:

[0043] The scenario determination module is used to determine the application scenarios of the business for the microservice architecture;

[0044] The component search module is used to search for target microservice architecture components that match the application scenario from a preset microservice architecture component library.

[0045] The code acquisition module is used to acquire the basic code corresponding to the microservice architecture and compile the basic code to integrate the target microservice architecture components to obtain the microservice architecture.

[0046] In one possible implementation, the device further includes:

[0047] The scenario judgment module is used to determine whether the application scenario meets preset conditions before searching for a target microservice architecture component that matches the application scenario from the preset microservice architecture component library. The preset conditions include: the query access volume index of the application scenario is greater than or equal to a preset index threshold, and / or the application scenario is used externally by the business party.

[0048] The step execution module is used to execute the step of searching for a target microservice architecture component that matches the application scenario from a preset microservice architecture component library if the application scenario meets the preset conditions.

[0049] In one possible implementation, the component lookup module includes:

[0050] The component removal unit is used to remove microservice architecture components from the preset microservice architecture component library that have an activity level lower than the activity level threshold and / or an iteration efficiency lower than the efficiency threshold and / or a usage count lower than the usage count threshold.

[0051] The component lookup unit is used to search for a target microservice architecture component that matches the application scenario from the remaining microservice architecture components in the preset microservice architecture component library.

[0052] In one possible implementation, the application scenario includes: query access volume metrics or query rate per second metrics;

[0053] The component lookup unit is specifically used for:

[0054] Compare the query access volume metric with a first preset threshold;

[0055] If the query access volume indicator is greater than or equal to the first preset threshold, search for the first message queue component that matches the query access volume indicator from the remaining microservice architecture components in the preset microservice architecture component library; determine the first message queue component as the target microservice architecture component;

[0056] or,

[0057] The query rate per second metric is compared with a second preset threshold.

[0058] If the query rate per second is greater than or equal to the second preset threshold, a second message queue component matching the query rate per second is searched from the remaining microservice architecture components in the preset microservice architecture component library; the second message queue component is determined as the target microservice architecture component.

[0059] In one possible implementation, the device further includes:

[0060] The first determining module is used to determine the first number of container nodes in the microservice architecture based on the query access volume index if the query access volume index is less than the first preset threshold.

[0061] The first comparison module is used to compare the number of the first container nodes with a preset first number threshold.

[0062] The first search module is used to search for the gateway component from the remaining microservice architecture components in the preset microservice architecture component library if the number of the first container nodes is greater than or equal to the first number threshold.

[0063] or,

[0064] The second determining module is used to determine the second number of container nodes in the microservice architecture based on the query rate per second indicator if the query rate per second indicator is less than the second preset threshold.

[0065] The second comparison module is used to compare the number of the second container nodes with a preset second threshold number.

[0066] The second search module is used to search for the gateway component from the remaining microservice architecture components in the preset microservice architecture component library if the number of the second container nodes is greater than or equal to the second threshold number.

[0067] In one possible implementation, the application scenario includes: data volume information; the component lookup unit is specifically used for:

[0068] Search for the database component from the remaining microservice architecture components in the preset microservice architecture component library;

[0069] Determine the number of database components that match the data volume information;

[0070] The database components whose number is determined are the target microservice architecture components.

[0071] In one possible implementation, the application scenarios include: usage scenarios, monitoring requirements, and scheduled service requirements; the component lookup unit is specifically used for:

[0072] Determine whether the use case is for external use by the business party;

[0073] If the use case is determined to be for external use by the business party, a check component matching the external use by the business party is found from the remaining microservice architecture components in the preset microservice architecture component library.

[0074] Determine whether the monitoring requirement is necessary;

[0075] If the monitoring requirement is determined to be necessary, a monitoring component matching the monitoring requirement is found from the remaining microservice architecture components.

[0076] Determine whether the scheduled service request is required;

[0077] If the scheduled service requirement is determined to be necessary, a monitoring component matching the scheduled service requirement is searched from the remaining microservice architecture components.

[0078] The inspection component, the monitoring component, and the timed service component are identified as target microservice architecture components.

[0079] Thirdly, embodiments of the present invention provide an electronic device, including: a processor and a memory, wherein the processor is configured to execute a microservice architecture generation program stored in the memory to implement the microservice architecture generation method described in any one of the first aspects.

[0080] Fourthly, embodiments of the present invention provide a storage medium storing one or more programs, which can be executed by one or more processors to implement the microservice architecture generation method described in the first aspect.

[0081] The technical solution provided by this invention determines the application scenario of a microservice architecture for a business user, searches for target microservice architecture components matching the application scenario from a pre-set microservice architecture component library, obtains the corresponding basic code for the microservice architecture, compiles the basic code, and integrates the target microservice architecture components to obtain the microservice architecture. Therefore, based on the application scenario determined by the business user for the microservice architecture, it can automatically obtain matching target microservice architecture components, thereby generating a microservice architecture that meets business needs and improving the user experience. Attached Figure Description

[0082] Figure 1 A flowchart illustrating an embodiment of a method for generating a microservice architecture provided by an embodiment of the present invention;

[0083] Figure 2 A flowchart illustrating an embodiment of a microservice architecture component integration method provided by this invention;

[0084] Figure 3 A flowchart illustrating an embodiment of another method for generating a microservice architecture provided by an embodiment of the present invention;

[0085] Figure 4 A schematic diagram of a microservice architecture provided in an embodiment of the present invention;

[0086] Figure 5 A block diagram illustrating an embodiment of a microservice architecture generation device provided in this invention;

[0087] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0088] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0089] The method for generating a microservice architecture provided by the present invention will be further explained below with reference to the accompanying drawings and specific embodiments. These embodiments do not constitute a limitation on the embodiments of the present invention.

[0090] See Figure 1 This is a flowchart illustrating an embodiment of a method for generating a microservice architecture according to an embodiment of the present invention. Figure 1 As shown, the process may include the following steps:

[0091] Step 101: Determine the application scenarios of the microservice architecture for the business side.

[0092] The aforementioned business party refers to the party that needs or is served by the microservice architecture. It can be a small or medium-sized enterprise or an individual, and this embodiment of the invention does not impose any restrictions on it.

[0093] The above application scenarios refer to the business requirements input or selected by the business party for the microservice architecture, which may include, but are not limited to: query access volume metrics, query rate per second metrics, data volume information, usage scenarios, service requirements, and scheduled service requirements.

[0094] In one embodiment, the above application scenario could be a requirement text input by the business party, enabling the server to determine and generate microservice architecture components based on that requirement text. For example, it could be used externally by the business party with a query volume of 100 QPS (Queries per second).

[0095] Optionally, business users can input their requirements for the microservice architecture through a pre-defined text input visual interface, thus defining the application scenario. For example, suppose a user inputs the following requirements through the text input visual interface: "For internal use by the business, with a daily query volume of approximately 200 QPS, evenly distributed, with no monitoring or tracing requirements." Based on the above description, the user's application scenario for the microservice architecture can be determined as the input requirements text.

[0096] In another embodiment, the above application scenario can also be a requirement option. For example, the use case is for external use by the business party, where the daily query volume is less than or equal to 1 and greater than or equal to 100 QPS, etc.

[0097] Optionally, business users can select specific requirements for the microservice architecture through a pre-defined requirements visualization interface, thus defining the requirements as an application scenario. For example, suppose the requirements options output by the pre-defined requirements visualization interface are as shown in Table 1 below:

[0098] Table 1

[0099] Query rate per second metric Greater than 0 and less than 100 Greater than or equal to 100 Data volume information Greater than 0 and less than 1000 Greater than or equal to 1000 Use cases For internal use by the business unit External use by business parties Monitoring needs need unnecessary Scheduled service requirements need unnecessary

[0100] Table 1, output by the business side through the requirement options visualization interface, shows that the selected requirement options for the microservice architecture are: queries per second (CPS) greater than or equal to 100, data volume greater than or equal to 1000, use case for external business use, monitoring requirement (required), and scheduled service requirement (required). Therefore, based on the above description, it can be determined that the business side's application scenario for the microservice architecture is the selected requirement options.

[0101] It should be noted that the above is only one example of determining the application scenario of the business party for the microservice architecture. In actual applications, application scenarios can also be determined by other means, such as voice input, external upload, etc. This embodiment of the invention does not limit this.

[0102] By using the above processing method, the application scenarios of the business for the microservice architecture can be determined. In this way, the server can filter out the target microservice architecture components that match the determined application scenarios.

[0103] Step 102: Find the target microservice architecture component that matches the application scenario from the preset microservice architecture component library.

[0104] The aforementioned microservice architecture component library includes at least one microservice architecture component, which is used to generate a microservice architecture that matches the application scenario of the business party for the microservice architecture.

[0105] In one embodiment, to address the issue of low activity levels in microservice architecture components, which fail to meet the requirements of rapid iteration and business needs, a microservice architecture component library can be selected based on its high activity level and / or high iteration efficiency and / or high usage frequency. From this library, a target microservice architecture matching the aforementioned application scenario can be obtained. In this way, a target microservice architecture component that meets the business needs of the client can be obtained.

[0106] For example, suppose the preset microservice architecture component library includes monitoring components with the following usage counts: Prometheus + Grafana + Alerting (20 usages); Zabbix (15 usages); and Open-Falcon (5 usages). Assume the business requires monitoring in its microservice architecture application scenario. Then, according to the above description, the target microservice architecture components matching the application scenario from the preset microservice architecture component library are: Prometheus + Grafana + Alerting, Zabbix, and Open-Falcon. Therefore, the monitoring component Prometheus + Grafana + Alerting is determined to be the target microservice architecture component.

[0107] This approach automatically filters out target microservice architecture components that match the application scenario, eliminating the need for the business to select them themselves, thus improving efficiency and meeting business needs.

[0108] Step 103: Obtain the basic code corresponding to the microservice architecture and compile the basic code to integrate the target microservice architecture components to obtain the microservice architecture.

[0109] The aforementioned basic code is the development code used to generate the microservice architecture.

[0110] In one embodiment, see Figure 2 This is a flowchart illustrating an embodiment of a microservice architecture component integration method provided by the present invention. Figure 2 The illustrated embodiment process enables the automatic compilation of the basic code of the microservice architecture, and then integrates the target microservice architecture components to obtain the microservice architecture.

[0111] Specifically, when the system detects that a business user has triggered a code submission visualization, the basic code corresponding to the microservice architecture is submitted to a pre-defined code repository. The system then triggers the verification component of the pre-defined code compilation platform to verify the basic code. The verification results can be manually reviewed. If the verification passes, the basic code and the code in the aforementioned code repository are merged, and the merged code is then uploaded to the code repository branch. If the verification fails, the operation ends.

[0112] Furthermore, when the PaaS (Platform-as-a-Service) platform detects changes in the code repository, it pulls the merged code from the aforementioned code repository branch and verifies the merged code. The verification results can be manually reviewed. If the verification passes, the merged code is automatically compiled to integrate the target microservice architecture components, resulting in the microservice architecture; if the verification fails, the operation ends.

[0113] The code repository mentioned above can be a Git (distributed version control system) remote repository. Correspondingly, the code repository branch mentioned above is a remote branch (i.e., a branch in a remote repository), which can be GitLab or GitHub. This embodiment of the invention does not limit this.

[0114] The aforementioned code compilation platform is used to compile the foundational code of the microservice architecture to integrate the target microservice architecture components, resulting in the microservice architecture. This platform could be Jenkins. Jenkins is an open-source software project, a continuous integration tool developed in Java, used to monitor repetitive tasks and aiming to provide an open and easy-to-use software platform for continuous integration of software projects. Correspondingly, the verification components of the code compilation platform could be KW, Coverity, and security / compliance components, which respectively perform code style checks, code unit test rate checks, and code security checks on the foundational code corresponding to the microservice architecture. KW, short for Klocwork, is developed by Klocwork Corporation based on its patented analysis engine and comprehensively applies several of the most advanced static analysis technologies in recent years, enabling code style verification. Coverity is a static code analysis tool that can verify code unit test rate.

[0115] In addition, image components (such as Docker image components) can be triggered to package and deploy the merged code, thus saving a copy of the merged code. Simultaneously, a Java Archive (JAR) package is built from the merged code and uploaded to a pre-defined storage medium (such as a Nexus server) to save the merged code's JAR file and prevent loss.

[0116] Nexus, mentioned above, is a powerful Maven repository manager, also known as a Maven private repository. It greatly simplifies the maintenance of internal repositories and access to external repositories, and allows deployment of artifacts to internal Maven projects when they are unavailable from any external remote repository.

[0117] This approach enables the automatic compilation of the basic code for a microservice architecture, allowing for the integration of target microservice components to achieve a microservice architecture that meets the business needs of the business stakeholders and improves their experience.

[0118] This concludes the process. Figure 1 The process described is as follows.

[0119] pass Figure 1As shown in the process, in the technical solution of this invention, by determining the application scenario of the microservice architecture for the business user, the target microservice architecture component matching the application scenario is searched from a preset microservice architecture component library. Then, the basic code corresponding to the microservice architecture is obtained and compiled to integrate the target microservice architecture component to obtain the microservice architecture. Therefore, based on the application scenario determined by the business user for the microservice architecture, the matching target microservice architecture component can be automatically obtained, thereby generating a microservice architecture that meets business needs and improving the user experience.

[0120] See Figure 3 This is a flowchart illustrating an embodiment of a method for generating a microservice architecture provided by this invention. Figure 3 The process shown above Figure 1 Based on the illustrated process, a detailed description is as follows: Figure 3 As shown, the process may include the following steps:

[0121] Step 301: Determine the application scenarios of the business party for the microservice architecture.

[0122] For a detailed description of step 301, please refer to [link / reference]. Figure 1 The relevant description of step 101 will not be repeated here.

[0123] Step 302: Determine whether the application scenario meets the preset conditions. The preset conditions include: the query access volume index of the application scenario is greater than or equal to the preset index threshold, and / or the application scenario is used externally by the business party. If the conditions are met, proceed to step 303.

[0124] Step 303: Remove microservice architecture components from the preset microservice architecture component library that have an activity level lower than the activity level threshold and / or an iteration efficiency lower than the efficiency threshold and / or a usage count lower than the usage count threshold.

[0125] Step 304: From the remaining microservice architecture components in the preset microservice architecture component library, find the target microservice architecture component that matches the application scenario.

[0126] Steps 302 to 304 are described uniformly below:

[0127] From the above Figure 1 As can be seen from the description of step 101, the above application scenarios include, but are not limited to: query access volume metrics or query rate per second metrics, data volume information, usage scenarios, service requirements, and scheduled service requirements.

[0128] In one embodiment, since some small and medium-sized enterprises have low query volume metrics and their usage scenarios are for internal business use, they can choose not to use a microservice architecture and implement it only through a monolithic architecture. Therefore, in this embodiment of the invention, before searching for target microservice architecture components that match the application scenario, it can be determined whether the user's application scenario for the microservice architecture meets preset conditions, that is, the query volume metric is greater than or equal to a preset metric threshold (e.g., 600), and / or the usage scenario is for external business use. If it is determined that the application scenario meets the above preset conditions, then the subsequent operation, i.e., step 303, can be executed; if it is determined that the application scenario does not meet the preset conditions, then the operation can be terminated. In this way, unnecessary generation of microservice architecture can be avoided, reducing overhead.

[0129] In one embodiment, by Figure 1 As described in step 102, the microservice architecture component library contains components with low activity levels and / or that do not meet the requirements for rapid iteration, thus failing to meet the business needs of the client. Therefore, in this embodiment of the invention, microservice architecture components with activity levels below an activity threshold (e.g., 60), iteration efficiency below an efficiency threshold (e.g., 5), and / or usage count below a usage count threshold (e.g., 20) are removed from the preset microservice architecture component library. Then, target microservice architecture components matching the application scenario are searched from the remaining microservice architecture components in the library. This ensures that the remaining microservice architecture components in the library have high activity levels and / or high iteration efficiency, and / or high usage counts, thus meeting the business needs of the client.

[0130] For example, suppose the activity threshold is 60, the efficiency threshold is 5, and the usage threshold is 20. Further suppose the preset microservice architecture component library includes a first microservice architecture component, a second microservice architecture component, a third microservice architecture component, a fourth microservice architecture component, and a fifth microservice architecture component, and all five microservice architecture components are monitoring components. The activity, iteration efficiency, and usage frequency of these five microservice architecture components are shown in Table 2 below:

[0131] Table 2

[0132] microservice architecture components Activity Iteration efficiency Number of times used First microservice architecture component 10 2 5 Second microservice architecture component 20 3 10 Third microservice architecture components 30 4 24 Fourth microservice architecture component 60 3 25 Fifth microservice architecture component 80 7 30

[0133] As shown in Table 2 above, the microservice architecture components whose activity levels are below the activity threshold are: the first microservice architecture component, the second microservice architecture component, and the third microservice architecture component; the microservice architecture components whose iteration efficiency is below the efficiency threshold are: the first microservice architecture component, the second microservice architecture component, and the fourth microservice architecture component; and the microservice architecture components whose usage frequency is below the frequency threshold are: the first microservice architecture component and the second microservice architecture component. Therefore, according to the above description, from the preset microservice architecture component library, after removing the microservice architecture components whose activity levels, iteration efficiency, and usage frequency are below the activity threshold, the remaining microservice architecture component is: the fifth microservice architecture component. From the remaining microservice architecture components in the preset microservice architecture component library, a target microservice architecture component matching the application scenario is searched.

[0134] Let's assume that from the preset microservice architecture component library, microservice architecture components with activity levels below the activity threshold are removed, leaving the fourth and fifth microservice architecture components. From the fourth and fifth microservice architecture components, we search for target microservice architecture components that match the application scenario.

[0135] Let's assume that from the preset microservice architecture component library, microservice architecture components whose iteration efficiency is lower than the efficiency threshold are removed. The remaining microservice architecture components are: the third microservice architecture component and the fifth microservice architecture component. From the third microservice architecture component and the fifth microservice architecture component, the target microservice architecture component that matches the application scenario is searched.

[0136] Let's assume that from the preset microservice architecture component library, microservice architecture components that have been used less than a certain number of times are removed. The remaining microservice architecture components are: the third microservice architecture component, the fourth microservice architecture component, and the fifth microservice architecture component. From the third microservice architecture component, the fourth microservice architecture component, and the fifth microservice architecture component, we search for the target microservice architecture component that matches the application scenario.

[0137] In one embodiment, the above-mentioned application scenario includes query access volume metrics. The specific implementation of searching for a target microservice architecture component that matches the application scenario from the remaining microservice architecture components in the preset microservice architecture component library may include: comparing the query access volume metrics with a first preset threshold; if the query access volume metrics are greater than or equal to the first preset threshold, searching for a first message queue component that matches the query access volume metrics from the remaining microservice architecture components in the preset microservice architecture component library; and determining the first message queue component as the target microservice architecture component.

[0138] If the query traffic metric is less than a first preset threshold, the first number of container nodes in the microservice architecture is determined based on the query traffic metric. This first number of container nodes is then compared with a preset first threshold (e.g., 3). If the first number of container nodes is greater than or equal to the first threshold, a gateway component is searched from the remaining microservice architecture components in the preset microservice architecture component library. This allows for load balancing through the gateway component. If the first number of container nodes is less than the first threshold, searching for the gateway component is unnecessary.

[0139] The aforementioned query access volume metric refers to the query access volume within a preset time period (e.g., daily). The first message queue component can be a RocketMQ component or a Redis (Remote Dictionary Server) component; this embodiment of the invention does not impose any limitations on this. RocketMQ is a pure Java, distributed, queue-based open-source message middleware that supports transactional messages, sequential messages, batch messages, timed messages, message backtracking, etc.

[0140] For example, suppose the first preset threshold is 600, and suppose the business's query volume metric for the microservice architecture is 1000. Then, as described above, the query volume metric is compared with the first preset threshold. If the query volume metric is greater than the first preset threshold, the remaining microservice architecture components in the preset microservice architecture component library are searched for, and the first message queue component that matches the query volume metric is identified as the Redis component. The Redis component is then determined as the target microservice architecture component.

[0141] Let's assume the first threshold is 3, and the business's query volume metric for the microservice architecture is 500. Following the above description, comparing the query volume metric with the first preset threshold, if the query volume metric is less than the first preset threshold, then the first container node in the microservice architecture is determined to be 3. Comparing the first container node number with the preset first threshold, if the first container node number equals the first threshold, then the gateway component is searched from the remaining microservice architecture components in the preset microservice architecture component library.

[0142] In one embodiment, the above-mentioned application scenario includes a query rate per second (MRS) metric. The specific implementation of finding a target microservice architecture component that matches the application scenario from the remaining microservice architecture components in the preset microservice architecture component library may include: comparing the MRS metric with a second preset threshold; if the MRS metric is greater than or equal to the second preset threshold, finding a second message queue component that matches the MRS metric from the remaining microservice architecture components in the preset microservice architecture component library; and determining the second message queue component as the target microservice architecture component.

[0143] If the query rate per second is less than the second preset threshold, then the number of second container nodes in the microservice architecture is determined based on the query rate per second. The number of second container nodes is compared with the preset second threshold. If the number of second container nodes is greater than or equal to the second threshold, then a gateway component is searched from the remaining microservice architecture components in the preset microservice architecture component library to perform load balancing. If the number of first container nodes is less than the first threshold, then it is not necessary to search for a gateway component.

[0144] For example, suppose the second preset threshold is 100, and the business's query-per-second (RPS) metric for the microservice architecture is 300. Then, as described above, the RPS metric is compared to the second preset threshold. If the RPS metric is greater than the second preset threshold, the remaining microservice architecture components in the preset microservice architecture component library are searched for, and the second message queue component matching the RPS metric is identified as the Redis component. The Redis component is then determined as the target microservice architecture component.

[0145] Let's assume the first threshold is 3, and the business's query volume metric for the microservice architecture is 50. Then, as described above, the query rate per second is compared to the second preset threshold. If the query rate per second is less than the second preset threshold, the second number of container nodes in the microservice architecture is determined to be 4. The second number of container nodes is then compared to the second preset threshold. If the second number of container nodes is greater than the second preset threshold, the gateway component is searched from the remaining microservice architecture components in the preset microservice architecture component library.

[0146] In one embodiment, the above-mentioned application scenario includes data volume information. The specific implementation of finding the target microservice architecture component that matches the application scenario from the remaining microservice architecture components in the preset microservice architecture component library may include: finding a database component from the remaining microservice architecture components in the preset microservice architecture component library; determining the number of database components that match the data volume information; and determining the database component with the number of database components as the target microservice architecture component.

[0147] The aforementioned data volume information represents the size of the data. It can be other data volume information, and correspondingly, the number of database components is determined based on this data volume information. The aforementioned database components store user data; they can be a MySQL database or other databases, and this embodiment of the invention does not impose any limitations on this.

[0148] When the number of database components exceeds the preset threshold, a master-slave architecture can be configured for the database, that is, master node database components and slave node database components can be set.

[0149] For example, assuming the data volume is 500, then, according to the above description, from the remaining microservice architecture components in the preset microservice architecture component library, the database component is searched to be a MySQL database component; the number of database components matching the data volume is determined to be 2, thus identifying 2 MySQL database components as the target microservice architecture components. One master node database component and one slave node database component can be configured.

[0150] Assuming the data volume is 1000, then, according to the above description, from the remaining microservice architecture components in the preset microservice architecture component library, the database component is searched to be a MySQL database component; the number of database components matching the data volume information is determined to be 4, thus identifying 4 MySQL database components as the target microservice architecture components. Two master node database components and two slave node database components can be configured.

[0151] In addition, the aforementioned data volume information can also be log data volume information. In practice, because some small and medium-sized enterprises have relatively low log data volumes, their business needs can be met by a single server, and a logging system is not required. Therefore, this data volume information is used to determine whether a logging system is needed.

[0152] In one embodiment, the aforementioned application scenario includes a usage scenario, monitoring requirements, and scheduled service requirements. The specific implementation of searching for a target microservice architecture component matching the application scenario from the remaining microservice architecture components in a preset microservice architecture component library may include: determining whether the usage scenario is for external use by the business entity; if the usage scenario is determined to be for external use by the business entity, searching for a check component matching the external use by the business entity from the remaining microservice architecture components in the preset microservice architecture component library; determining whether the monitoring requirement is required; if the monitoring requirement is determined to be required, searching for a monitoring component matching the monitoring requirement from the remaining microservice architecture components; determining whether the scheduled service requirement is required; if the scheduled service requirement is determined to be required, searching for a monitoring component matching the scheduled service requirement from the remaining microservice architecture components; and determining the check component, monitoring component, and scheduled service component as the target microservice architecture components.

[0153] The aforementioned detection components may include, but are not limited to: KW component, Coverity component. The aforementioned monitoring components may include, but are not limited to: Prometheus component, Grafana component. Prometheus is an open-source system monitoring and alerting framework, and Grafana is an open-source program for visualizing large-scale measurement data, providing a powerful and elegant way to create, share, and browse data. The aforementioned scheduled service components may include, but are not limited to: XXL-Job component. XXL-Job is a distributed task scheduling platform whose core design goals are rapid development, ease of learning, lightweight design, and easy extensibility.

[0154] The above use cases include both internal and external business applications. In practice, the query volume metrics for internal and external business applications differ. When the use case is for external business applications, the query volume metrics may be greater than or equal to a preset threshold, and there are high requirements for code quality, monitoring needs, scheduled service requirements, and even cascading monitoring needs. Conversely, when the use case is for internal business applications, the query volume metrics may be less than the threshold, evenly distributed, and there are no monitoring, scheduled service, or cascading monitoring needs. To determine whether a use case is for external business applications, a matching inspection component can be found from the remaining microservice architecture components in the preset microservice architecture component library.

[0155] For example, suppose the business uses the microservice architecture for external purposes and requires monitoring and scheduled services. Then, from the remaining microservice architecture components in the pre-defined microservice architecture component library, we can find inspection components that match the business's external needs; monitoring components that match the monitoring requirements; and monitoring components that match the scheduled service requirements. This allows us to identify the inspection, monitoring, and scheduled service components as the target microservice architecture components.

[0156] Furthermore, the aforementioned application scenarios can also include distributed tracing requirements. This involves searching for a matching distributed tracing component, such as Skywalking, from the remaining microservice architecture components in a pre-defined microservice architecture component library. Skywalking is an application performance monitoring tool for distributed systems, designed specifically for microservices, cloud-native architectures, and container-based (Docker, Kubernetes, Mesos) architectures. It is an excellent APM (Application Performance Management) tool, encompassing distributed tracing, performance metric analysis, and service dependency analysis.

[0157] It should be noted that the above are just a few examples of application scenarios for microservice architecture by business parties. In actual applications, the above application scenarios also include other business requirements, such as logging systems, remote service calls, service registration and discovery, and configuration information. This embodiment of the invention does not limit these.

[0158] In this embodiment of the invention, the ELK logging system can be selected based on log data volume information; the Feign component in Spring Cloud can be selected based on remote service calls; the Nacos component can be selected based on service registration, discovery, and configuration information; and the Hystrix or Sentinel component can be selected based on circuit breaker and rate limiting functionality. This embodiment of the invention does not impose any restrictions on these aspects. For the specific generated microservice architecture, please refer to [link / reference]. Figure 4 This is a schematic diagram of a microservice architecture provided in an embodiment of the present invention.

[0159] The aforementioned ELK is a combination of three open-source software components: Elasticsearch (a search server based on Lucene), Logstash (an open-source data collection engine with real-time pipeline capabilities), and Kibana (an open-source analytics and visualization platform designed to work in conjunction with Elasticsearch). It is a complete enterprise-level solution for log collection, analysis, and visualization developed by Elastic.

[0160] The Spring Cloud framework described above is an ordered collection of frameworks. The Feign component within the Spring Cloud ecosystem is primarily responsible for remote method invocation. Nacos, mentioned above, is an open-source dynamic service discovery, configuration, and service management component from Alibaba. Hystrix, the component mentioned above, is a circuit breaker component built into Spring Cloud and is also an open-source fault tolerance framework from Netflix, a powerful tool against cascading failures, featuring service degradation, circuit breaking, dependency isolation, and monitoring (Hystrix Dashboard). Sentinel, mentioned above, is an open-source traffic defense component for distributed systems from Alibaba. Sentinel uses traffic as its entry point, protecting service stability from multiple dimensions, including traffic control, circuit breaking and degradation, and system load protection.

[0161] Step 305: Obtain the basic code corresponding to the microservice architecture and compile the basic code to integrate the target microservice architecture components to obtain the microservice architecture.

[0162] For a detailed description of step 305, please refer to [link / reference]. Figure 1 The relevant description of step 103 will not be repeated here.

[0163] This concludes the process. Figure 3 The process described is as follows.

[0164] In the technical solution of this invention, by determining the application scenario of the business party for the microservice architecture, it is judged whether the application scenario meets preset conditions. These preset conditions include: the query access volume index of the application scenario is greater than or equal to a preset index threshold, and / or the application scenario is used externally by the business party. If satisfied, microservice architecture components whose activity level is lower than the activity level threshold and / or whose iteration efficiency is lower than the efficiency threshold and / or whose usage frequency is lower than the frequency threshold are removed from a preset microservice architecture component library. From the remaining microservice architecture components in the preset microservice architecture component library, a target microservice architecture component matching the application scenario is searched, and the corresponding basic code of the microservice architecture is obtained and compiled to integrate the target microservice architecture component to obtain the microservice architecture. Therefore, by judging the application scenario, business parties that need the microservice architecture can be further screened, reducing overhead. Furthermore, microservice architecture components with activity levels below an activity threshold and / or iteration efficiency below an efficiency threshold and / or usage frequency below a usage frequency threshold are removed from a pre-defined microservice architecture component library. This ensures that the selected target microservice architecture components that match the application scenario have high activity levels, / or high iteration efficiency, and / or high usage frequency, thus meeting business requirements. It can automatically select matching target microservice architecture components based on the business's application scenario, thereby generating a microservice architecture that meets business needs and improving the user experience.

[0165] Corresponding to the aforementioned embodiments of the microservice architecture generation method, the present invention also provides an embodiment block diagram of the apparatus.

[0166] See Figure 5 This is a block diagram illustrating an embodiment of a microservice architecture generation device provided by an embodiment of the present invention. Figure 5 As shown, the device includes:

[0167] The scenario determination module 501 is used to determine the application scenarios of the business for the microservice architecture.

[0168] The component lookup module 502 is used to look up target microservice architecture components that match the application scenario from a preset microservice architecture component library.

[0169] The code acquisition module 503 is used to acquire the basic code corresponding to the microservice architecture and compile the basic code to integrate the target microservice architecture components to obtain the microservice architecture.

[0170] In one possible implementation, the device further includes (not shown in the figures):

[0171] The scenario judgment module is used to determine whether the application scenario meets preset conditions before searching for a target microservice architecture component that matches the application scenario from the preset microservice architecture component library. The preset conditions include: the query access volume index of the application scenario is greater than or equal to a preset index threshold, and / or the application scenario is used externally by the business party.

[0172] The step execution module is used to execute the step of searching for a target microservice architecture component that matches the application scenario from a preset microservice architecture component library if the application scenario meets the preset conditions.

[0173] In one possible implementation, the component lookup module 502 includes (not shown in the figure):

[0174] The component removal unit is used to remove microservice architecture components from the preset microservice architecture component library that have an activity level lower than the activity level threshold and / or an iteration efficiency lower than the efficiency threshold and / or a usage count lower than the usage count threshold.

[0175] The component lookup unit is used to search for a target microservice architecture component that matches the application scenario from the remaining microservice architecture components in the preset microservice architecture component library.

[0176] In one possible implementation, the application scenario includes: query access volume metrics or query rate per second metrics;

[0177] The component lookup unit is specifically used for:

[0178] Compare the query access volume metric with a first preset threshold;

[0179] If the query access volume indicator is greater than or equal to the first preset threshold, search for the first message queue component that matches the query access volume indicator from the remaining microservice architecture components in the preset microservice architecture component library; determine the first message queue component as the target microservice architecture component;

[0180] or,

[0181] The query rate per second metric is compared with a second preset threshold.

[0182] If the query rate per second is greater than or equal to the second preset threshold, a second message queue component matching the query rate per second is searched from the remaining microservice architecture components in the preset microservice architecture component library; the second message queue component is determined as the target microservice architecture component.

[0183] In one possible implementation, the device further includes (not shown in the figures):

[0184] The first determining module is used to determine the first number of container nodes in the microservice architecture based on the query access volume index if the query access volume index is less than the first preset threshold.

[0185] The first comparison module is used to compare the number of the first container nodes with a preset first number threshold.

[0186] The first search module is used to search for the gateway component from the remaining microservice architecture components in the preset microservice architecture component library if the number of the first container nodes is greater than or equal to the first number threshold.

[0187] or,

[0188] The second determining module is used to determine the second number of container nodes in the microservice architecture based on the query rate per second indicator if the query rate per second indicator is less than the second preset threshold.

[0189] The second comparison module is used to compare the number of the second container nodes with a preset second threshold number.

[0190] The second search module is used to search for the gateway component from the remaining microservice architecture components in the preset microservice architecture component library if the number of the second container nodes is greater than or equal to the second threshold number.

[0191] In one possible implementation, the application scenario includes: data volume information; the component lookup unit is specifically used for:

[0192] Search for the database component from the remaining microservice architecture components in the preset microservice architecture component library;

[0193] Determine the number of database components that match the data volume information;

[0194] The database components whose number is determined are the target microservice architecture components.

[0195] In one possible implementation, the application scenarios include: usage scenarios, monitoring requirements, and scheduled service requirements; the component lookup unit is specifically used for:

[0196] Determine whether the use case is for external use by the business party;

[0197] If the use case is determined to be for external use by the business party, a check component matching the external use by the business party is found from the remaining microservice architecture components in the preset microservice architecture component library.

[0198] Determine whether the monitoring requirement is necessary;

[0199] If the monitoring requirement is determined to be necessary, a monitoring component matching the monitoring requirement is found from the remaining microservice architecture components.

[0200] Determine whether the scheduled service request is required;

[0201] If the scheduled service requirement is determined to be necessary, a monitoring component matching the scheduled service requirement is searched from the remaining microservice architecture components.

[0202] The inspection component, the monitoring component, and the timed service component are identified as target microservice architecture components.

[0203] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Figure 6 The illustrated electronic device 600 includes at least one processor 601, a memory 602, at least one network interface 604, and a user interface 603. The various components in the electronic device 600 are coupled together via a bus system 605. It is understood that the bus system 605 is used to implement communication between these components. In addition to a data bus, the bus system 605 also includes a power bus, a control bus, and a status signal bus. However, for clarity, in… Figure 6 The general designated all buses as Bus System 605.

[0204] The user interface 603 may include a display, keyboard or clicking device (e.g., mouse, trackball), touchpad or touch screen.

[0205] It is understood that the memory 602 in this embodiment of the invention can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchlink DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The memory 602 described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0206] In some implementations, memory 602 stores elements, executable units or data structures, or subsets thereof, or extended sets thereof: operating system 6021 and application program 6022.

[0207] The operating system 6021 includes various system programs, such as the framework layer, core library layer, and driver layer, used to implement various basic business functions and handle hardware-based tasks. The application program 6022 includes various applications, such as a media player and a browser, used to implement various application functions. The program implementing the method of this embodiment can be included in the application program 6022.

[0208] In this embodiment of the invention, by calling the program or instructions stored in memory 602, specifically the program or instructions stored in application program 6022, processor 601 executes the method steps provided in each method embodiment, including, for example:

[0209] Determine the application scenarios of the microservice architecture for the business stakeholders;

[0210] From the preset microservice architecture component library, find the target microservice architecture component that matches the application scenario;

[0211] Obtain the basic code corresponding to the microservice architecture, and compile the basic code to integrate the target microservice architecture components to obtain the microservice architecture.

[0212] The methods disclosed in the above embodiments of the present invention can be applied to processor 601, or implemented by processor 601. Processor 601 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit of the hardware in processor 601 or by instructions in the form of software. The processor 601 may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present invention. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of the present invention can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software units in the decoding processor. The software units may be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory 602. Processor 601 reads the information in memory 602 and, in conjunction with its hardware, completes the steps of the above method.

[0213] It is understood that the embodiments described herein can be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described herein, or combinations thereof.

[0214] For software implementation, the techniques described herein can be implemented by units that perform the functions described herein. The software code can be stored in memory and executed by a processor. The memory can be implemented in the processor or external to the processor.

[0215] The electronic device provided in this embodiment may be as follows: Figure 6 The electronic device shown can perform the following: Figure 1 and Figure 3 All steps of the method for generating a microservice architecture, thereby achieving Figure 1 and Figure 3 For details on the technical effects of the method for generating microservice architectures, please refer to [link / reference needed]. Figure 1 and Figure 3 The relevant descriptions are presented concisely and will not be elaborated upon here.

[0216] This invention also provides a storage medium (computer-readable storage medium). This storage medium stores one or more programs. The storage medium may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as read-only memory, flash memory, hard disk, or solid-state drive; the memory may also include combinations of the above types of memory.

[0217] When one or more programs in the storage medium can be executed by one or more processors, the above-described method for generating a microservice architecture that is executed on the electronic device side can be implemented.

[0218] The processor is used to execute a microservice architecture generation program stored in memory to implement the following steps of a microservice architecture generation method executed on the electronic device side:

[0219] Determine the application scenarios of the microservice architecture for the business stakeholders;

[0220] From the preset microservice architecture component library, find the target microservice architecture component that matches the application scenario;

[0221] Obtain the basic code corresponding to the microservice architecture, and compile the basic code to integrate the target microservice architecture components to obtain the microservice architecture.

[0222] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0223] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented in hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0224] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for generating a microservice architecture, characterized in that, The method includes: Determine the application scenarios of the microservice architecture for the business stakeholders; From the preset microservice architecture component library, find the target microservice architecture component that matches the application scenario; Obtain the basic code corresponding to the microservice architecture, and compile the basic code to integrate the target microservice architecture components to obtain the microservice architecture; The step of searching for a target microservice architecture component that matches the application scenario from a preset microservice architecture component library includes: Remove microservice architecture components from the pre-defined microservice architecture component library that have an activity level below the activity level threshold and / or an iteration efficiency below the efficiency threshold and / or a usage count below the usage count threshold. From the remaining microservice architecture components in the preset microservice architecture component library, find the target microservice architecture component that matches the application scenario; The application scenarios include: query access volume metrics or query rate per second metrics; The step of searching for a target microservice architecture component that matches the application scenario from the remaining microservice architecture components in the preset microservice architecture component library includes: Compare the query access volume metric with a first preset threshold; If the query access volume indicator is greater than or equal to the first preset threshold, search for the first message queue component that matches the query access volume indicator from the remaining microservice architecture components in the preset microservice architecture component library; determine the first message queue component as the target microservice architecture component; or, The query rate per second metric is compared with a second preset threshold. If the query rate per second is greater than or equal to the second preset threshold, a second message queue component matching the query rate per second is searched from the remaining microservice architecture components in the preset microservice architecture component library; the second message queue component is determined as the target microservice architecture component.

2. The method according to claim 1, characterized in that, Before searching for a target microservice architecture component matching the application scenario from a preset microservice architecture component library, the method further includes: Determine whether the application scenario meets the preset conditions, the preset conditions include: the query access volume index of the application scenario is greater than or equal to the preset index threshold, and / or the application scenario is used externally by the business party; If the application scenario meets the preset conditions, then the step of searching for a target microservice architecture component that matches the application scenario from the preset microservice architecture component library is executed.

3. The method according to claim 1, characterized in that, The method further includes: If the query access volume index is less than the first preset threshold, then the first number of container nodes in the microservice architecture is determined based on the query access volume index. Compare the number of the first container nodes with a preset first threshold number; If the number of the first container nodes is greater than or equal to the first threshold, then the gateway component is searched from the remaining microservice architecture components in the preset microservice architecture component library. or, If the query rate per second is less than the second preset threshold, then the second number of container nodes in the microservice architecture is determined based on the query rate per second. The number of the second container nodes is compared with a preset second threshold number; If the number of the second container nodes is greater than or equal to the second threshold number, then the gateway component is searched from the remaining microservice architecture components in the preset microservice architecture component library.

4. The method according to claim 1, characterized in that, The application scenario includes: data volume information; the step of searching for a target microservice architecture component that matches the application scenario from the remaining microservice architecture components in the preset microservice architecture component library includes: Search for the database component from the remaining microservice architecture components in the preset microservice architecture component library; Determine the number of database components that match the data volume information; The database components whose number is determined are the target microservice architecture components.

5. The method according to claim 1, characterized in that, The application scenarios include: usage scenarios, monitoring requirements, and scheduled service requirements; the step of searching for a target microservice architecture component that matches the application scenario from the remaining microservice architecture components in the preset microservice architecture component library includes: Determine whether the use case is for external use by the business party; If the use case is determined to be for external use by the business party, a check component matching the external use by the business party is found from the remaining microservice architecture components in the preset microservice architecture component library. Determine whether the monitoring requirement is necessary; If the monitoring requirement is determined to be necessary, a monitoring component matching the monitoring requirement is found from the remaining microservice architecture components. Determine whether the scheduled service request is required; If the scheduled service requirement is determined to be necessary, a monitoring component matching the scheduled service requirement is searched from the remaining microservice architecture components. The inspection component, the monitoring component, and the scheduled service component are identified as components of the target microservice architecture.

6. A microservice architecture generation apparatus, characterized in that, The device includes: The scenario determination module is used to determine the application scenarios of the business for the microservice architecture; The component search module is used to search for target microservice architecture components that match the application scenario from a preset microservice architecture component library. The code acquisition module is used to acquire the basic code corresponding to the microservice architecture and compile the basic code to integrate the target microservice architecture components to obtain the microservice architecture. The step of searching for a target microservice architecture component that matches the application scenario from a preset microservice architecture component library includes: Remove microservice architecture components from the pre-defined microservice architecture component library that have an activity level below the activity level threshold and / or an iteration efficiency below the efficiency threshold and / or a usage count below the usage count threshold. From the remaining microservice architecture components in the preset microservice architecture component library, find the target microservice architecture component that matches the application scenario; The application scenarios include: query access volume metrics or query rate per second metrics; The step of searching for a target microservice architecture component that matches the application scenario from the remaining microservice architecture components in the preset microservice architecture component library includes: Compare the query access volume metric with a first preset threshold; If the query access volume indicator is greater than or equal to the first preset threshold, search for the first message queue component that matches the query access volume indicator from the remaining microservice architecture components in the preset microservice architecture component library; determine the first message queue component as the target microservice architecture component; or, The query rate per second metric is compared with a second preset threshold. If the query rate per second is greater than or equal to the second preset threshold, a second message queue component matching the query rate per second is searched from the remaining microservice architecture components in the preset microservice architecture component library; the second message queue component is determined as the target microservice architecture component.

7. An electronic device, characterized in that, include: A processor and a memory, the processor being configured to execute a microservice architecture generation program stored in the memory to implement the microservice architecture generation method according to any one of claims 1 to 5.

8. A storage medium, characterized in that, The storage medium stores one or more programs, which can be executed by one or more processors to implement the microservice architecture generation method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Construction method and system for unified regulation and management system of substation data assets

    CN113888139A

  • Service log processing method and system based on lightweight architecture, storage medium and terminal

    CN114595363A