A microservice development method and device

By retrieving the tag information of cloud components and its mapping relationship with the microservice basic framework, it automatically filters and generates dependency information, solving the problem of manually querying the cloud environment and components in microservice development and improving development efficiency.

CN112506487BActive Publication Date: 2025-01-21STATE GRID INFORMATION & TELECOMM GRP CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011487625.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-16
Publication Date
2025-01-21
Estimated Expiration
2040-12-16

AI Technical Summary

Technical Problem

During the microservice development process, users need to manually query the cloud environment and related components supported by the microservice basic framework, resulting in inefficient development.

Method used

By retrieving the tag information of cloud components and their mapping relationship with the microservice basic framework, supported cloud components are automatically filtered out, the dependency information required for cloud migration is generated, and directly added to the microservice engineering structure.

Benefits of technology

There is no need for users to manually query the cloud environment and components, which significantly reduces the workload and improves the efficiency of microservice development.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112506487B_ABST
    Figure CN112506487B_ABST
Patent Text Reader

Abstract

The present invention discloses a microservice development method, including: when developing microservices, calling the tag information of cloud components and the mapping relationship between cloud components and microservice basic frameworks, after determining the microservice basic framework used for microservice development, the tag information of cloud components with mapping relationships with the microservice basic framework can be screened out, then the target cloud component can be directly selected from the tag information of the cloud components with mapping relationships with the microservice basic framework, and then the content information of the target cloud component is called through the tag information of the selected target cloud component, and the first dependency information required for clouding is generated according to the content information of the target cloud component. Thus, when performing the cloud operation of microservices, users no longer need to manually query the cloud environment and each basic component supported by the microservice basic framework, which reduces the workload and greatly improves the development efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of software development, and in particular to a microservice development method and device. Background Art

[0002] With the in-depth development of cloud computing and cloud service technologies, "cloud-based applications" has become an important measure for enterprises to transform digitally. Cloud-based applications of microservice architecture can effectively reduce the complexity of microservice governance and operation and maintenance, and the demand for cloud-based microservices is becoming more and more urgent. In order to meet the demand for cloud-based applications, microservices need to select a suitable cloud platform based on their own needs before development.

[0003] In order to realize the need of cloud computing during the development of microservices, it is necessary to select suitable cloud environment components and other related components. However, there are many cloud environment components on the market. When developing microservices, users need to select supported cloud environments and related components. In addition, when developing microservices, microservice development needs to adopt the microservice basic framework. Different microservice basic frameworks or different versions of microservice basic frameworks support different cloud environments. This requires users to query the supported cloud environments before developing microservices, which greatly affects development efficiency. Summary of the invention

[0004] In view of this, an embodiment of the present invention discloses a microservice development method, so that when developing microservices, users no longer need to query the cloud environment supported by the microservice basic framework and the relationship between various components, thereby improving development efficiency.

[0005] An embodiment of the present invention discloses a microservice development method, which is applied to a client and includes:

[0006] In response to the microservice parent project creation instruction, retrieve the tag information of the cloud-based component and the mapping relationship between the cloud-based component and the microservice basic framework; the cloud-based component includes the cloud environment component and basic component required for the microservice to be cloud-based;

[0007] Determine the microservice basic framework used to create microservices, and filter out the tag information of cloud components that have a mapping relationship with the microservice basic framework;

[0008] Receive tag information of a target cloud component; the tag information of the target cloud component is selected from tag information of cloud components having a mapping relationship with the microservice basic framework;

[0009] Retrieving content information of the target cloud-based component related to the tag information of the target cloud-based component, and generating first dependency information required for cloud-based migration according to the content information of the target cloud-based component;

[0010] A microservice engineering structure is created, and the first dependency information is added to the microservice engineering structure.

[0011] Optionally, the retrieving content information of the target cloud component related to the tag information of the target cloud component includes:

[0012] Retrieve the content information of all pre-stored cloud components;

[0013] The content information of the target cloud-online component related to the tag information of the target cloud-online component is obtained from the content information of all cloud-online components.

[0014] Optionally, also include:

[0015] In response to a microservice sub-project creation instruction, receiving identification information of a parent project corresponding to the sub-project;

[0016] According to the identification information of the parent project, a dependency relationship between the parent project and the sub-project is established, so that the sub-project can use the dependency files required for the parent project to be put on the cloud;

[0017] Create the engineering structure of the microservice subproject.

[0018] Optionally, also include:

[0019] Receive label information of basic components in cloud components;

[0020] Acquire content information of the basic component according to tag information of the basic component in the cloud-based component;

[0021] Generate second dependency information according to the content information of the basic component;

[0022] The second dependency information is added to the project file of the sub-project.

[0023] Optionally, also include:

[0024] In response to an instruction to switch the cloud environment, obtain tag information of the cloud component to be switched;

[0025] Acquire content information of the cloud-based component related to the tag information of the cloud-based component;

[0026] Generate a second dependency file required for cloud migration based on the content information of the cloud migration component to be switched;

[0027] The second dependency file replaces the first dependency information in the microservice engineering structure.

[0028] The embodiment of the present invention further discloses a microservice development device, which is applied to a client and includes:

[0029] A first retrieval unit is used to retrieve the tag information of the cloud-based component and the mapping relationship between the cloud-based component and the microservice basic framework in response to the microservice parent project creation instruction; the cloud-based component includes the cloud environment component and the basic component required for the microservice to be cloud-based;

[0030] A screening unit, used to determine a microservice basic framework for creating microservices, and screen out tag information of cloud components that have a mapping relationship with the microservice basic framework;

[0031] A first receiving unit is used to receive tag information of a target cloud component; the tag information of the target cloud component is selected from tag information of cloud components having a mapping relationship with the microservice basic framework;

[0032] A second retrieving unit is used to retrieve content information of a target cloud-based component related to the tag information of the target cloud-based component, and generate first dependency information required for cloud-based migration according to the content information of the target cloud-based component;

[0033] The first creation unit is used to create a microservice engineering structure and add the first dependency information to the microservice engineering structure.

[0034] Optionally, the second calling unit includes:

[0035] A first retrieving subunit, used to retrieve the content information of all pre-stored cloud components;

[0036] The first acquisition subunit is used to acquire the content information of the target cloud component related to the tag information of the target cloud component from the content information of all cloud components.

[0037] Optionally, also include:

[0038] A second receiving unit, configured to receive identification information of a parent project corresponding to the microservice sub-project in response to a microservice sub-project creation instruction;

[0039] A dependency relationship establishing unit, comprising establishing a dependency relationship between the parent project and the sub-project according to the identification information of the parent project, so that the sub-project can use the dependency files required for the parent project to be put on the cloud;

[0040] The second creation unit is used to create the engineering structure of the microservice sub-project.

[0041] Optionally, also include:

[0042] A third receiving unit is used to receive label information of the basic components in the cloud-based components;

[0043] A second acquisition subunit is used to acquire content information of the basic component according to tag information of the basic component in the cloud-based component;

[0044] A first generating unit, configured to generate second dependency information according to content information of the basic component;

[0045] The first adding unit is used to add the second dependency information to the project file of the sub-project.

[0046] Optionally, also include:

[0047] A third acquisition unit is used to obtain label information of the cloud component to be switched in response to the instruction to switch the cloud environment;

[0048] A fourth acquisition unit, used to acquire content information of the cloud-based component related to the tag information of the cloud-based component;

[0049] A second generating unit, configured to generate a second dependent file required for cloud migration according to the content information of the cloud migration component to be switched;

[0050] The second adding unit is used to replace the first dependency information in the microservice engineering structure with the second dependency file.

[0051] The embodiment of the present invention also discloses a microservice development system, including:

[0052] Client, server and cloud component libraries;

[0053] The client is used to execute the method described in claims 1-5;

[0054] The server is used to provide an interface for the client to enable the client to retrieve the tag information of the cloud component and the mapping relationship between the cloud component and the microservice basic framework, as well as the content information of the cloud component;

[0055] The cloud component library pre-stores pre-stored tag information of cloud components and a mapping relationship between the cloud components and the microservice basic framework.

[0056] This embodiment discloses a microservice development method, including: when developing microservices, calling up the tag information of cloud components and the mapping relationship between cloud components and microservice basic framework, so that after determining the microservice basic framework used for microservice development, the tag information of cloud components that have a mapping relationship with the microservice basic framework can be screened out, and then the target cloud component can be directly selected from the tag information of the cloud components that have a mapping relationship with the microservice basic framework, and then the content information of the target cloud component is called up through the tag information of the selected target cloud component, and the first dependency information required for clouding is generated according to the content information of the target cloud component. Therefore, when performing the cloud operation of microservices, users no longer need to manually query the cloud environment and each basic component supported by the microservice basic framework, which reduces the workload and greatly improves the development efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0058] Figure 1 A schematic diagram of a process of a microservice development method provided by an embodiment of the present invention is shown;

[0059] Figure 2 Another schematic diagram of a process of a microservice development method provided by an embodiment of the present invention is shown;

[0060] Figure 3 Another schematic diagram of a process of a microservice development method provided by an embodiment of the present invention is shown;

[0061] Figure 4 Another schematic diagram of a process of developing a microservice provided by an embodiment of the present invention is shown;

[0062] Figure 5 Another schematic diagram of a process of a microservice development method provided by an embodiment of the present invention is shown;

[0063] Figure 6 A schematic diagram of the structure of a microservice development device provided by an embodiment of the present invention is shown;

[0064] Figure 7 The embodiment of the present invention also discloses a structural schematic diagram of a microservice development system. DETAILED DESCRIPTION

[0065] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0066] refer to Figure 1 , shows a schematic flow chart of a microservice development method provided by an embodiment of the present invention. In this embodiment, the method is applied to a terminal, and the method includes:

[0067] S101: In response to a microservice parent project creation instruction, retrieve tag information of cloud-based components and a mapping relationship between cloud-based components and a microservice basic framework; the cloud-based components include cloud environment components and basic components required for microservice cloud-based components;

[0068] In this embodiment, the tag information of the cloud component is information used to describe and characterize the cloud component, and the tag information is used to be displayed on the terminal. The tag information includes: name, identification, description and other information, which are used to be displayed on the client for the user to select.

[0069] In addition, the mapping relationship between the cloud-based components and the microservice basic framework is the relationship between the microservice basic framework and the cloud-based components that support the microservice basic framework. It can be understood that when you know which microservice basic framework to use for microservice development, you can filter out the cloud-based components that support the microservice basic framework through the mapping relationship between the cloud-based components and the microservice basic framework.

[0070] In this embodiment, the cloud components include cloud environment components and basic components, wherein the basic components include: industry components and general components.

[0071] S102: Determine a microservice basic framework for creating microservices, and filter out tag information of cloud components that have a mapping relationship with the microservice basic framework;

[0072] What you need to know is that there are many microservice infrastructure frameworks on the market, and a microservice infrastructure framework also includes many different versions.

[0073] In this embodiment, the microservice basic framework referred to in S102 may be any microservice basic framework, or a certain version of any microservice basic framework.

[0074] For example, refer to Figure 2 , users can select any version of Spring Boot Version, for example, select Spring Boot Version 2.1.3.

[0075] Preferably, in order to improve the stability of microservices' dependence on the cloud environment, microservice basic frameworks supported by the cloud environment are pre-screened so that the microservice basic framework selected by the user supports the cloud environment and can run stably.

[0076] S103: receiving tag information of a target cloud component; the tag information of the target cloud component is selected from tag information of cloud components having a mapping relationship with the microservice basic framework;

[0077] In this embodiment, when the user selects the microservice basic framework for creating microservices on the client, based on the mapping relationship between the cloud components and the microservice basic framework, the tag information of the cloud components that have a mapping relationship with the microservice basic framework can be automatically screened out, and the screened out tag information is the tag information of the cloud components that support the microservice basic framework. In this way, the user does not need to query which cloud environment components and basic components support the microservice basic framework, which greatly reduces the workload.

[0078] In addition, the label information of the cloud components that support the microservice basic framework can be displayed on the terminal, so that the user can filter the label information of the cloud components displayed on the terminal according to the needs.

[0079] S104: Retrieving content information of the target cloud-based component related to the tag information of the target cloud-based component, and generating first dependency information required for cloud-based migration according to the content information of the target cloud-based component;

[0080] In this embodiment, the content information of the target cloud component can be understood as the relevant information used to generate the dependent files, for example, including: the name, coordinates and component description of the component.

[0081] The method for creating a microservice in this embodiment is executed on the client. In order to further reduce the interaction between the client and other terminals, the content information of all cloud components can be retrieved in advance. In this way, after the cloud component selected by the user is determined, the relevant information of the component can be directly retrieved from the client.

[0082] In addition, the relevant information of the cloud components is stored in the cloud component library. The client needs to interact with the cloud component library through the network. If the content information of the cloud components is retrieved from the cloud component library in advance, the content information of the cloud components can be quickly obtained even in poor network conditions.

[0083] In particular, when creating other sub-projects related to the parent project, there is no need to interact with other devices. The content information of the cloud components stored in the terminal can be directly used, which improves the efficiency of creating microservice sub-projects.

[0084] Therefore, in the above case, S104 includes:

[0085] Retrieve the content information of all pre-stored cloud components;

[0086] The content information of the target cloud-online component related to the tag information of the target cloud-online component is obtained from the content information of all cloud-online components.

[0087] In addition, after obtaining the tag information of the cloud-based component, the content information of the cloud-based component related to the tag information of the cloud-based component can also be retrieved from the cloud component library.

[0088] S105: Generate a microservice engineering structure, and add the first dependency information to a dependency file of the microservice engineering structure.

[0089] In this embodiment, the microservice engineering structure includes all files supporting the microservice application, such as source code information for operating the microservice software and dependency files of the microservice.

[0090] In this embodiment, in order to enable the microservice to meet the cloud migration requirements, the generated first dependency information on which the cloud migration depends is added to the dependency file of the microservice engineering structure.

[0091] Among them, the dependency file of the project structure contains all components that support the operation of the microservice project, and the first dependency information contains all components required for cloud migration.

[0092] In this embodiment, when developing microservices, the tag information of cloud components and the mapping relationship between cloud components and microservice basic framework are retrieved. After determining the microservice basic framework used for microservice development, the tag information of cloud components that have a mapping relationship with the microservice basic framework can be screened out. Then, the target cloud component can be directly selected from the tag information of the cloud components that have a mapping relationship with the microservice basic framework, and the content information of the target cloud component can be retrieved through the tag information of the selected target cloud component, and the first dependency information required for cloud migration is generated according to the content information of the target cloud component. Therefore, when performing microservice cloud migration operations, users no longer need to manually query the cloud environment and various basic components supported by the microservice basic framework, which reduces the workload and greatly improves the development efficiency.

[0093] refer to Figure 3 , shows another flow chart of a microservice development method provided by an embodiment of the present invention. In this embodiment, the method includes:

[0094] S301: In response to a microservice sub-project creation instruction, receiving identification information of a parent project corresponding to the sub-project;

[0095] In this embodiment, the identification information of the parent project may be any information used to characterize the parent project, for example, the name of the parent project.

[0096] When creating a sub-project, the user may enter identification information of the parent project corresponding to the sub-project.

[0097] S302: Establishing a dependency relationship between the parent project and the subproject according to the identification information of the parent project, so that the subproject can use the dependency files required for the parent project to be put on the cloud;

[0098] In this embodiment, there are multiple methods for establishing the dependency relationship between the parent project and the sub-project, which are not limited in this embodiment. For example, the dependency management tool Maven can be used to implement the dependency between the parent project and the sub-project.

[0099] In this embodiment, a dependency relationship between a subproject and a parent project is established so that the subproject can call the dependency files required for the parent project to go to the cloud.

[0100] Among them, the dependency files include cloud environment components, basic components and other components required for the project operation.

[0101] S303: Create the engineering structure of the microservice sub-project.

[0102] In this embodiment, the microservice engineering structure includes all files supporting the microservice application, such as source code information and dependent files for operating the microservice software.

[0103] In this embodiment, when creating a sub-project of a microservice, you only need to establish the dependency relationship between the microservice parent project and the project, and the sub-project can use the dependency files required by the parent project to go to the cloud, thereby realizing the sub-project's cloud needs. In this way, the sub-project does not need to select cloud environment components separately to realize the cloud needs, which simplifies the process of sub-project cloud migration and improves the efficiency of microservice creation.

[0104] refer to Figure 4 , shows another flow chart of a microservice development method provided by an embodiment of the present invention. In this embodiment, the method includes:

[0105] S401: In response to a microservice sub-project creation instruction, receiving identification information of a parent project corresponding to the sub-project;

[0106] S402: establishing a dependency relationship between the parent project and the sub-project according to the identification information of the parent project, so that the sub-project can use the dependency files required for the parent project to be uploaded to the cloud;

[0107] S403: Receive label information of basic components in the cloud-based components;

[0108] In this embodiment, in the process of creating a sub-project, the cloud environment of the sub-project only needs to depend on the parent project. That is to say, when creating a sub-project, there is no need to select an environment-free component, but other basic components may still be required. Then, if the user has a demand for the basic component, the required component can be selected and the dependency can be generated.

[0109] In this embodiment, the tag information of the basic component can be understood as relevant information used to characterize the basic component. The tag information may include: name, identification, description and other information, which are used to be displayed on the client and provided for selection by the user.

[0110] S404: Acquire content information of the basic component according to the tag information of the basic component;

[0111] The content information of the basic component can be understood as the relevant information used to generate the dependent files, including, for example: the name, coordinates and component description of the basic component.

[0112] The acquisition of content information of basic components may include the following two implementations:

[0113] Implementation method 1: retrieve content information corresponding to tag information of basic components from cloud component library through the server;

[0114] Implementation method 2: obtaining the content information of the basic component from the content information of the cloud component pre-stored on the client.

[0115] S405: Generate second dependency information according to the content information of the basic component;

[0116] S406: Create a project file of the sub-project, and add the second dependency information to the dependency file of the project structure of the sub-project.

[0117] In this embodiment, when creating a sub-project of a microservice, you only need to establish the dependency relationship between the parent project and the project of the microservice, and the sub-project can use the dependency files required by the parent project to go to the cloud, thereby realizing the cloud requirements of the sub-project. In this way, the sub-project can realize the cloud requirements without having to select cloud environment components separately, simplifying the process of sub-project clouding and improving the efficiency of microservice creation. In addition, other basic components can be added according to needs when creating a sub-project, which provides convenience for microservice development.

[0118] After completing the cloud migration needs of microservices, users may want to use other cloud environments to support the cloud migration needs of microservices. In the existing technology, if the cloud environment is switched, a large amount of information needs to be modified, which is a lot of work. Especially in the case of parent projects and sub-projects, both the parent project and the sub-project need to be modified, which is a huge workload.

[0119] To solve the above problems, refer to Figure 5 , shows another flow chart of a microservice development method provided by an embodiment of the present invention. In this embodiment, the method includes:

[0120] S501: In response to an instruction to switch the cloud environment, obtain label information of the cloud component to be switched;

[0121] In this embodiment, when a user needs to change the cloud environment for a microservice that has generated cloud dependencies, the user can reselect the tag information of the cloud component.

[0122] When receiving the instruction to switch the cloud environment, the client obtains the tag information of the cloud component selected by the user, and the cloud component includes the cloud environment component that the user wants to switch.

[0123] S502: Acquire content information of the cloud component related to the tag information of the cloud component to be switched;

[0124] In this embodiment, the acquisition of the content information of the cloud component can include the following two implementation methods:

[0125] Method 1: retrieve the content information of the cloud component from the cloud component library based on the tag information of the cloud component;

[0126] Method 2: Acquire, from the content information of the cloud-based component pre-stored on the client, the content information of the cloud-based component related to the tag information of the cloud-based component.

[0127] S503: Generate third dependency information required for cloud migration based on the content information of the cloud migration component to be switched;

[0128] S504: Replace the first dependency information in the engineering structure of the microservice parent project with the third dependency information.

[0129] In this embodiment, when the microservice needs to switch the cloud environment, after the new dependency information required for cloud migration is generated, the new dependency information for cloud migration replaces the original dependency information required for cloud migration in the engineering structure of the microservice parent project, thereby realizing the switching of the microservice cloud environment. In addition, when the parent project contains sub-projects, since there is a dependency relationship between the parent project and the sub-project, after the parent project switches the cloud environment, the sub-project can directly call the dependency file of the parent project, thereby realizing the switching of the sub-environment's cloud environment.

[0130] In this embodiment, the cloud-based component is reselected according to user needs, and the third dependency information required for cloud-based is generated based on the reselected cloud-based component, and the third dependency information replaces the first dependency information in the engineering structure of the microservice parent project. In this way, when developing microservices, the purpose of automatically switching the cloud environment of the developed microservice is achieved, and the process of cloud environment switching is simplified, thereby improving the efficiency of cloud environment switching.

[0131] refer to Figure 6 , shows a schematic diagram of the structure of a microservice development device provided by an embodiment of the present invention, the device is applied to a client, and the device includes:

[0132] The first retrieval unit 601 is used to retrieve the tag information of the cloud-based component and the mapping relationship between the cloud-based component and the microservice basic framework in response to the microservice parent project creation instruction; the cloud-based component includes the cloud environment component and the basic component required for the microservice to be cloud-based;

[0133] A screening unit 602 is used to determine a microservice basic framework for creating a microservice, and screen out tag information of cloud components that have a mapping relationship with the microservice basic framework;

[0134] The first receiving unit 603 is used to receive tag information of a target cloud component; the tag information of the target cloud component is selected from tag information of cloud components having a mapping relationship with the microservice basic framework;

[0135] The second retrieving unit 604 is used to retrieve the content information of the target cloud component related to the tag information of the target cloud component, and generate the first dependency information required for cloud migration according to the content information of the target cloud component;

[0136] The first creation unit 605 is used to create a microservice engineering structure and add the first dependency information to a dependency file of the microservice engineering structure.

[0137] Optionally, the second calling unit includes:

[0138] A first retrieving subunit, used to retrieve the content information of all pre-stored cloud components;

[0139] The first acquisition subunit is used to acquire the content information of the target cloud component related to the tag information of the target cloud component from the content information of all cloud components.

[0140] Optionally, also include:

[0141] A second receiving unit, configured to receive identification information of a parent project corresponding to the microservice sub-project in response to a microservice sub-project creation instruction;

[0142] A dependency relationship establishing unit, comprising establishing a dependency relationship between the parent project and the sub-project according to the identification information of the parent project, so that the sub-project can use the dependency files required for the parent project to be put on the cloud;

[0143] The second creation unit is used to create the engineering structure of the microservice sub-project.

[0144] Optionally, also include:

[0145] A third receiving unit is used to receive label information of the basic components in the cloud-based components;

[0146] A second acquisition subunit is used to acquire content information of the basic component according to tag information of the basic component in the cloud-based component;

[0147] A first generating unit, configured to generate second dependency information according to content information of the basic component;

[0148] The first adding unit is used to add the second dependency information to a dependency file of the engineering structure of the sub-project.

[0149] Optionally, also include:

[0150] A third acquisition unit is used to obtain label information of the cloud component to be switched in response to the instruction to switch the cloud environment;

[0151] A fourth acquisition unit, used to acquire content information of the cloud-based component related to the tag information of the cloud-based component;

[0152] A second generating unit is used to generate third dependency information required for cloud migration based on the content information of the cloud migration component to be switched;

[0153] The second adding unit is used to replace the first dependency information in the microservice engineering structure with the third dependency information.

[0154] Through the device of this embodiment, when developing microservices, the tag information of the cloud-based components and the mapping relationship between the cloud-based components and the microservice basic framework are retrieved. After determining the microservice basic framework used for microservice development, the tag information of the cloud-based components that have a mapping relationship with the microservice basic framework can be screened out. Then, the target cloud-based component can be directly selected from the tag information of the cloud-based components that have a mapping relationship with the microservice basic framework, and the content information of the target cloud-based component can be retrieved through the tag information of the selected target cloud-based component, and the first dependency information required for cloud-based operation is generated according to the content information of the target cloud-based component. Therefore, when performing cloud-based operations on microservices, users no longer need to manually query the cloud environment and various basic components supported by the microservice basic framework, which reduces the workload and greatly improves the development efficiency.

[0155] refer to Figure 7 , showing a schematic diagram of the structure of a microservice development system disclosed in an embodiment of the present invention. In this embodiment, the system includes:

[0156] Client 701, server 702 and cloud component library 703;

[0157] The client is used to execute the microservice development method described above, specifically including:

[0158] In response to the microservice parent project creation instruction, retrieve the tag information of the cloud-based component and the mapping relationship between the cloud-based component and the microservice basic framework; the cloud-based component includes the cloud environment component and basic component required for the microservice to be cloud-based;

[0159] Determine the microservice basic framework used to create microservices, and filter out the tag information of cloud components that have a mapping relationship with the microservice basic framework;

[0160] Receive tag information of a target cloud component; the tag information of the target cloud component is selected from tag information of cloud components having a mapping relationship with the microservice basic framework;

[0161] Retrieving content information of the target cloud-based component related to the tag information of the target cloud-based component, and generating first dependency information required for cloud-based migration according to the content information of the target cloud-based component;

[0162] A microservice engineering structure is created, and the first dependency information is added to a dependency file of the microservice engineering structure.

[0163] Optionally, the retrieving content information of the target cloud component related to the tag information of the target cloud component includes:

[0164] Retrieve the content information of all pre-stored cloud components;

[0165] The content information of the target cloud-online component related to the tag information of the target cloud-online component is obtained from the content information of all cloud-online components.

[0166] Optionally, also include:

[0167] In response to a microservice sub-project creation instruction, receiving identification information of a parent project corresponding to the sub-project;

[0168] According to the identification information of the parent project, a dependency relationship between the parent project and the sub-project is established, so that the sub-project can use the dependency files required for the parent project to be put on the cloud;

[0169] Create the engineering structure of the microservice subproject.

[0170] Optionally, also include:

[0171] Receive label information of basic components in cloud components;

[0172] Acquire content information of the basic component according to tag information of the basic component in the cloud-based component;

[0173] Generate second dependency information according to the content information of the basic component;

[0174] The second dependency information is added to a dependency file of the project structure of the sub-project.

[0175] Optionally, also include:

[0176] In response to an instruction to switch the cloud environment, obtain tag information of the cloud component to be switched;

[0177] Acquire content information of the cloud-based component related to the tag information of the cloud-based component;

[0178] Generate third dependency information required for cloud migration through the content information of the cloud migration component to be switched;

[0179] The first dependency information in the microservice engineering structure is replaced by the third dependency information.

[0180] The server is used to provide an interface for the client to enable the client to retrieve the tag information of the cloud component and the mapping relationship between the cloud component and the microservice basic framework, as well as the content information of the cloud component;

[0181] The cloud component library pre-stores pre-stored tag information of cloud components and a mapping relationship between the cloud components and the microservice basic framework.

[0182] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0183] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A microservice development method, characterized in that: The method is applied to a client, and the method comprises: In response to the microservice parent project creation instruction, retrieve the tag information of the cloud-based component and the mapping relationship between the cloud-based component and the microservice basic framework; the cloud-based component includes the cloud environment component and basic component required for the microservice to be cloud-based; In response to a user's selection operation of a microservice basic framework, determining a microservice basic framework for creating a microservice, and filtering out tag information of cloud components that have a mapping relationship with the microservice basic framework; In response to a user's selection operation for tag information of a cloud component having a mapping relationship with the microservice basic framework, tag information of a target cloud component is received; the tag information of the target cloud component is selected from the tag information of the cloud component having a mapping relationship with the microservice basic framework; Retrieving content information of the target cloud-based component related to the tag information of the target cloud-based component, and generating first dependency information required for cloud-based migration according to the content information of the target cloud-based component; A microservice engineering structure is created, and the first dependency information is added to a dependency file of the microservice engineering structure.

2. The method according to claim 1 is characterized in that The step of retrieving content information of the target cloud component related to the tag information of the target cloud component includes: Retrieve the content information of all pre-stored cloud components; The content information of the target cloud-online component related to the tag information of the target cloud-online component is obtained from the content information of all cloud-online components.

3. The method according to claim 1, characterized in that Also includes: In response to a microservice sub-project creation instruction, receiving identification information of a parent project corresponding to the sub-project; According to the identification information of the parent project, a dependency relationship between the parent project and the sub-project is established, so that the sub-project can use the dependency files required for the parent project to be put on the cloud; Create the engineering structure of the microservice subproject.

4. The method according to claim 3, characterized in that Also includes: Receive label information of basic components in cloud components; Acquire content information of the basic component according to tag information of the basic component in the cloud-based component; Generate second dependency information according to the content information of the basic component; The second dependency information is added to the dependency file of the project structure of the sub-project.

5. The method according to claim 1, characterized in that Also includes: In response to an instruction to switch the cloud environment, obtain tag information of the cloud component to be switched; Obtaining content information of the cloud component related to the tag information of the cloud component to be switched; Generate third dependency information required for cloud migration through the content information of the cloud migration component to be switched; The first dependency information in the microservice engineering structure is replaced by the third dependency information.

6. A microservice development device, characterized in that: The device is applied to a client, and comprises: A first retrieval unit is used to retrieve the tag information of the cloud-based component and the mapping relationship between the cloud-based component and the microservice basic framework in response to the microservice parent project creation instruction; the cloud-based component includes the cloud environment component and the basic component required for the microservice to be cloud-based; A screening unit, configured to determine the microservice basic framework used to create the microservice in response to a user's selection operation on the microservice basic framework, and screen out tag information of cloud components that have a mapping relationship with the microservice basic framework; A first receiving unit is configured to receive tag information of a target cloud component in response to a user's selection operation of tag information of a cloud component having a mapping relationship with the microservice basic framework; the tag information of the target cloud component is selected from the tag information of the cloud component having a mapping relationship with the microservice basic framework; A second retrieving unit is used to retrieve content information of a target cloud-based component related to the tag information of the target cloud-based component, and generate first dependency information required for cloud-based migration according to the content information of the target cloud-based component; The first creation unit is used to create a microservice engineering structure and add the first dependency information to a dependency file of the microservice engineering structure.

7. The device according to claim 6, characterized in that The second calling unit includes: A first retrieving subunit, used to retrieve the content information of all pre-stored cloud components; The first acquisition subunit is used to acquire the content information of the target cloud component related to the tag information of the target cloud component from the content information of all cloud components.

8. The device according to claim 6, characterized in that Also includes: A second receiving unit, configured to receive identification information of a parent project corresponding to the microservice sub-project in response to a microservice sub-project creation instruction; A dependency relationship establishing unit, comprising establishing a dependency relationship between the parent project and the sub-project according to the identification information of the parent project, so that the sub-project can use the dependency files required for the parent project to be put on the cloud; The second creation unit is used to create the engineering structure of the microservice sub-project.

9. The device according to claim 8, characterized in that Also includes: A third receiving unit is used to receive label information of the basic components in the cloud-based components; A second acquisition subunit is used to acquire content information of the basic component according to tag information of the basic component in the cloud-based component; A first generating unit, configured to generate second dependency information according to content information of the basic component; The first adding unit is used to add the second dependency information to a dependency file of the engineering structure of the sub-project.

10. The device according to claim 6, characterized in that Also includes: A third acquisition unit is used to obtain label information of the cloud component to be switched in response to the instruction to switch the cloud environment; A fourth acquisition unit, used to acquire content information of the cloud-based component related to the tag information of the cloud-based component; A second generating unit is used to generate third dependency information required for cloud migration based on the content information of the cloud migration component to be switched; The second adding unit is used to replace the first dependency information in the microservice engineering structure with the third dependency information.

11. A microservice development system, characterized in that: include: Client, server and cloud component libraries; The client is used to execute the method described in any one of claims 1 to 5; The server is used to provide an interface for the client to enable the client to retrieve the tag information of the cloud component and the mapping relationship between the cloud component and the microservice basic framework, as well as the content information of the cloud component; The cloud component library pre-stores pre-stored tag information of cloud components and a mapping relationship between the cloud components and the microservice basic framework.

Citation Information

Patent Citations

  • Webpage-based mixed reality development system and webpage-based mixed reality production method

    CN110442817A

  • Development framework generation method and related device

    CN110727416A