A service deployment method and device, electronic device and storage medium
By generating a dependency map, the poor universality problem during service deployment under the cloud-native technology architecture is solved, the dependency processing is simplified, the deployment efficiency is improved, and it is suitable for development environments of multiple programming languages.
Patent Information
- Application Number
- CN202110843525.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-07-26
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2041-07-26
AI Technical Summary
The cloud-native technology architecture has poor universality in the dual-mode application mode, especially when deploying services, it is necessary to first sort out complex dependencies, resulting in cumbersome and inefficient deployment.
By extracting the service development components and service dependency configuration files in the application center, forming a service dependency component collection and service dependency collection, generating a dependency map, and deploying target application services based on the dependency map, avoiding the need to sort out the dependency relationships first when deploying dual-mode applications The steps to improve deployment efficiency and versatility.
It realizes the universality of service deployment under the cloud-native technology architecture, simplifies dependency processing, improves deployment efficiency, and is suitable for development environments of multiple programming languages.
Smart Images

Figure CN113504972B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer software technology, and in particular to a service deployment method and device, electronic equipment and storage medium. Background Art
[0002] As cloud-native technologies represented by Docker and CNCF Kubernetes container orchestration platforms continue to mature and be widely used, more and more enterprise application technology architectures are beginning to transform into cloud-native technology architectures, which in essence are application container-related technology systems.
[0003] The application forms of common cloud-native technology architectures are constantly changing and evolving, both in development and operation states. As enterprise application development architecture evolves towards microservice architecture and cloud-native architecture, the delivery form of business applications has evolved from a centralized deployment of a single technology stack to a distributed heterogeneous environment with multiple languages and multiple services. As business applications are split into many fine-grained services, the internal structure and dependencies of the application become more complex.
[0004] The shortcomings or deficiencies of the application forms of the above-mentioned common cloud-native technology architecture include the problem of poor universality in the dual-mode application mode. Summary of the invention
[0005] In view of the problems existing in the prior art, embodiments of the present invention provide a service deployment method and device, an electronic device and a storage medium.
[0006] The present invention provides a service deployment method, comprising:
[0007] Deploy an application set, extract service development components and service dependency configuration files in the application set, and extract dependent development components and dependent service information of the service dependency configuration files;
[0008] Forming a service dependency component set based on the service development component and the dependency development component, and forming a service dependency set based on the dependency service information;
[0009] Generate a dependency graph based on the service dependency component set and the service dependency set;
[0010] Based on the dependency graph, the target application service is deployed.
[0011] According to a service deployment method provided by the present invention, the method further includes:
[0012] Determining whether the application set includes the service dependency configuration file;
[0013] If the application set includes the service dependency configuration file, continue to extract the service dependency configuration file in the application set;
[0014] If the application set does not include the service dependency configuration file, the step of extracting the service dependency configuration file from the application set is terminated.
[0015] According to a service deployment method provided by the present invention, forming a service dependency component set based on the service development component and the dependency development component includes:
[0016] Processing the service development component and the dependent development component to form a development component set;
[0017] A development component mapping library is created, and based on the development component mapping library, the development component set is converted into the service dependency component set.
[0018] According to a service deployment method provided by the present invention, generating a dependency graph based on the service dependency component set and the service dependency set includes:
[0019] Determine whether any service in the service dependency component set contains multiple version information of the target component;
[0020] If any service in the service dependency component set contains multiple version information of a target component, determine the target component and its corresponding target version information to form a target component set, and aggregate the target component set and the service dependency set to generate a service dependency cluster;
[0021] If no service in the service dependency component set contains multiple version information of the target component, aggregating the service dependency component set and the service dependency set to generate a service dependency cluster;
[0022] The dependency graph is generated based on the service dependency clustering.
[0023] According to a service deployment method provided by the present invention, the generation of the dependency graph based on the service dependency clustering includes:
[0024] Based on the service dependency clustering, determining the dependency relationships of the service dependencies in the application set, and identifying dependency conflicts and dependency deployment order of the service dependencies;
[0025] The dependency graph is generated based on the dependency relationship, the dependency conflict and the dependency deployment order.
[0026] The present invention also provides a service deployment device, comprising:
[0027] A deployment module, used to deploy an application set, extract service development components and service dependency configuration files in the application set, and extract dependent development components and dependent service information of the service dependency configuration files;
[0028] A basic module, used to form a service dependency component set based on the service development component and the dependency development component, and to form a service dependency set based on the dependency service information;
[0029] A generation module, used to generate a dependency graph based on the service dependency component set and the service dependency set;
[0030] The target module is used to deploy the target application service based on the dependency graph.
[0031] According to a service deployment device provided by the present invention, the device also includes:
[0032] A judgment module, used to judge whether the application set contains the service dependency configuration file;
[0033] an extraction module, configured to continue to extract the service dependency configuration file in the application set if the application set includes the service dependency configuration file;
[0034] The execution module is used to terminate the extraction of the service dependency configuration file in the application set if the application set does not contain the service dependency configuration file.
[0035] According to a service deployment device provided by the present invention, the basic module includes:
[0036] A processing submodule, used for processing the service development component and the dependent development component to form a development component set;
[0037] The conversion submodule is used to create a development component mapping library, and based on the development component mapping library, convert the development component set into the service dependency component set.
[0038] According to a service deployment device provided by the present invention, the generation module includes:
[0039] A judgment submodule, used to judge whether any service in the service dependency component set contains multiple version information of the target component;
[0040] A determination submodule is used to determine the target component and its corresponding target version information if any service in the service dependency component set contains multiple version information of the target component, form a target component set, and aggregate the target component set and the service dependency set to generate a service dependency cluster;
[0041] An aggregation submodule, used for aggregating the service dependency component set and the service dependency set to generate a service dependency cluster if there is no multiple version information of a target component included in any service in the service dependency component set;
[0042] A generation submodule is used to generate the dependency graph based on the service dependency clustering.
[0043] According to a service deployment device provided by the present invention, the generating submodule is specifically used for:
[0044] Based on the service dependency clustering, determining the dependency relationships of the service dependencies in the application set, and identifying dependency conflicts and dependency deployment order of the service dependencies;
[0045] The dependency graph is generated based on the dependency relationship, the dependency conflict and the dependency deployment order.
[0046] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of any of the above-mentioned service deployment methods are implemented.
[0047] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the service deployment methods described above are implemented.
[0048] The present invention provides a service deployment method and device, electronic device and storage medium. By deploying an application set, the service development components and service dependency configuration files in the application set are extracted, and the dependency development components and dependency service information in the service dependency configuration files are extracted; a service dependency component set is formed based on the service development components and the dependency development components, and a service dependency set is formed based on the dependency service information; a dependency graph is generated based on the service dependency component set and the service dependency set; and a target application service is deployed based on the dependency graph. The service deployment method and device provided by the present invention deploy the target application service based on the generated dependency graph, thereby avoiding the need to sort out the dependency relationship first and then deploy the service when performing service deployment of dual-mode applications, thereby improving its versatility. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0050] Figure 1 It is a flow chart of a service deployment method provided by an embodiment of the present invention;
[0051] Figure 2 It is an example diagram of forming a service dependency component set and a service dependency set in the service deployment method provided in an embodiment of the present invention;
[0052] Figure 3 It is a schematic diagram of a process of forming a service dependency component set in a service deployment method provided in an embodiment of the present invention;
[0053] Figure 4 It is an example diagram of forming a service dependency component set in the service deployment method provided in an embodiment of the present invention;
[0054] Figure 5 It is a schematic diagram of a process of generating a dependency graph based on a service dependency component set and a service dependency set in a service deployment method provided by an embodiment of the present invention;
[0055] Figure 6 This is an example diagram of generating a service dependency cluster in the service deployment method provided in an embodiment of the present invention;
[0056] Figure 7 It is a schematic diagram of a process of generating a dependency graph based on service dependency clustering in a service deployment method provided by an embodiment of the present invention;
[0057] Figure 8 is an example diagram of a dependency graph generated in the service deployment method provided in an embodiment of the present invention;
[0058] Fig. 9 It is a detailed flow chart of the service deployment method provided by an embodiment of the present invention;
[0059] Fig.10 It is a structural diagram of a service deployment device provided by an embodiment of the present invention;
[0060] Fig.11 It is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0061] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are 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.
[0062] The accompanying drawings are for illustration only and are not drawn strictly to scale. As used herein, the term "preferably" and similar terms are used to indicate approximations, not degrees, and are intended to illustrate the inherent deviations in measured or calculated values that will be recognized by a person of ordinary skill in the art. It should be noted that in this specification, the expressions "first", "second", "third", etc. are only used to distinguish one feature from another, and do not represent any limitation on the features, especially not any order of precedence.
[0063] It should also be understood that expressions such as "include", "comprising", "including" and / or "comprising" are open rather than closed expressions in this specification, which indicate the presence of the stated features, elements and / or components, but do not exclude the presence of one or more other features, elements, components and / or their combinations. In addition, when describing the embodiments of the present application, "may" is used to mean "one or more embodiments of the present application". And, the term "exemplary" is intended to refer to an example or illustration.
[0064] Unless otherwise specified, all words (including engineering terms and scientific and technological terms) used in this article have the same meaning as those commonly understood by ordinary technicians in the field to which this application belongs. It should also be understood that, unless clearly stated in this application, words defined in common dictionaries should be interpreted as having the same meaning as their meaning in the context of the relevant technology, and should not be interpreted in an idealized or overly formal sense.
[0065] In order to solve the problems existing in the prior art, embodiments of the present invention provide a service deployment method and device, an electronic device and a storage medium.
[0066] First, the terms involved in one or more embodiments of the present invention are explained.
[0067] An application set, also known as an application program set, is a group of applications that are closely related in functionality.
[0068] Application services refer to contractual services that provide application deployment, provisioning, management, and application rental access in centrally managed organizations.
[0069] Figure 1 FIG. 1 is a flow chart of a service deployment method according to an embodiment of the present invention. Figure 1 As shown, the method includes:
[0070] Step 101 , deploying an application set, extracting service development components and service dependency configuration files in the application set, and extracting dependent development components and dependent service information of the service dependency configuration files.
[0071] Specifically, in step 101, deploying an application set refers to deploying a set of application programs that are closely related in function.
[0072] Correspondingly, the service development component refers to the service SDK (Software Development Kit). The service dependency configuration file refers to the relevant configuration files that are obtained through independent research and development and configured in the application set to serve each dependency.
[0073] Furthermore, the dependent development component refers to the dependent SDK (Software Development Kit). The dependent service information refers to the detailed information of the service that supports the existence of each dependency.
[0074] Step 102: forming a service dependency component set based on the service development component and the dependency development component, and forming a service dependency set based on the dependency service information.
[0075] The service dependency component set refers to the set of service components in the service that supports the continuation of each dependency. The service dependency set refers to the set of service information that supports the continuation of each dependency obtained through independent research and development.
[0076] Specifically, forming a service dependency component set based on a service development component and a dependency development component means first combining a service SDK and a dependent SDK, and then forming a service dependency component set based on the combined service SDK and dependent SDK.
[0077] Forming a service dependency set based on dependent service information means storing detailed information of services supporting the continuation of each dependency in a specific set, and then, the set is the service dependency set.
[0078] Step 103: Generate a dependency graph based on the service dependency component set and the service dependency set.
[0079] Specifically, the dependency graph in step 103 refers to a directed multigraph with labels that represents the dependency relationships in the program.
[0080] The dependency graph includes dependency relationships, dependency conflicts, and dependency deployment order.
[0081] Correspondingly, dependency is also called "logical relationship", which means that the change of one activity will affect the other activity. Dependency conflict refers to the conflicting behavior caused by the change of two activities affecting a specific activity. Dependency deployment order refers to the order in which the change of any activity affects the relationship of another activity among some activities.
[0082] Step 104: deploy the target application service based on the dependency graph.
[0083] In summary, it should be noted that, based on the above embodiments, after the application set is deployed, the service dependency configuration files in the application set will be cyclically extracted until there are no service dependency configuration files in the application set.
[0084] Correspondingly, the service deployment method further includes:
[0085] Step S1, determining whether the application set contains a service dependency configuration file.
[0086] Step S2: If the application set includes a service dependency configuration file, continue to extract the service dependency configuration file in the application set.
[0087] Step S3: if the application set does not contain the service dependency configuration file, the process of extracting the service dependency configuration file in the application set ends.
[0088] Based on the above embodiments, in summary, the service deployment method provided by the embodiments of the present invention deploys the target application service based on the generated dependency graph, thereby avoiding the need to sort out the dependencies first and then deploy the services when deploying services for dual-mode applications. At the same time, it reduces the complexity of the dependencies and improves its versatility.
[0089] Preferably, the service dependency component set and the service dependency set formed in the service deployment method described in the above embodiment can be explained in conjunction with specific examples.
[0090] Based on the above embodiments, Figure 2 It is an example diagram of forming a service dependency component set and a service dependency set in a service deployment method provided according to an embodiment of the present invention. Figure 2 An application set 201 , an intermediate component set 202 , and a service dependency set 203 are shown.
[0091] For example, the application set 201 is deployed, and SDKs (software development kits) and dependency.json files (service dependency configuration files) of all services in the application set 201 are extracted until there is no dependency.json file in the application set 201, and the extraction of the dependency.json file in the application set 201 is terminated.
[0092] At the same time, the dependent SDK (software development kit) and dependent service information in the dependency.json file are extracted cyclically.
[0093] Further, the SDKs of all services are combined to form an intermediate component set 202, and based on the intermediate component set 202, a service dependency component set is formed.
[0094] The dependent service information is stored in a specific set, and the set is the service dependency set 203 .
[0095] Based on the above embodiments, Figure 3 FIG. 1 is a flow chart of forming a service dependency component set in a service deployment method provided according to an embodiment of the present invention. Figure 3 As shown, a set of service dependency components is formed, including:
[0096] Step 301, process service development components and dependent development components to form a development component set.
[0097] Specifically, step 301 means first combining the service development component and the dependent development component, and then storing them in a specific set, and then the set is the development component set.
[0098] Step 302: Create a development component mapping library, and based on the development component mapping library, convert the development component set into a service dependency component set.
[0099] Specifically, in step 302, creating a development component mapping library refers to creating a component mapping set that divides development components into coordinates and version numbers and corresponds usable components to their version numbers.
[0100] For example, if a service uses the mysql-connector-java-8.0.20 component, its coordinates correspond to mysql-connector-java, and its version number corresponds to 8.0.20. In addition, if mysql-connector-java-8.0.* uses the mysql component, and in addition to the 8.0 version, its 5.6 and 5.7 versions may also be used, then a corresponding data is created, see:
[0101] mysql-connector-java#8.0.*:{mysql:[5.6,5.7,8.0]}
[0102] Furthermore, a development component mapping library is formed by combining multiple pieces of data similar to the above data.
[0103] Preferably, the service dependency component set formed in the service deployment method described in the above embodiment can be explained in conjunction with a specific example.
[0104] Based on the above embodiments, Figure 4 It is an example diagram of forming a service dependency component set in a service deployment method provided according to an embodiment of the present invention. Figure 4 A development component set 401, a development component mapping library 402, and a service dependency component set 403 are shown.
[0105] Exemplarily, if service development components and dependent development components are processed to form development component set 401 , and the created development component mapping library is development component mapping library 402 ; then the corresponding development component set 401 will be converted into service dependent component set 403 by development component mapping library 402 .
[0106] Based on the above embodiments, in summary, the service deployment method provided by the present invention reduces the complexity of dependency relationships by forming a service dependency component set.
[0107] Based on the above embodiments, Figure 5 FIG. 1 is a flow chart of generating a dependency graph based on a service dependency component set and a service dependency set in a service deployment method provided according to an embodiment of the present invention. Figure 5 As shown, a dependency graph is generated based on the service dependency component set and the service dependency set, including:
[0108] Step 501, determine whether any service in the service dependency component set contains multiple version information of the target component; if so, execute step 502, if not, execute step 503.
[0109] Exemplarily, step 501 means that if a service in the service dependency component set includes the target component mysql, it is determined whether the service in the service dependency component set includes multiple version information of the mysql component.
[0110] Step 502: If any service in the service dependency component set contains multiple versions of target components, determine the target component and its corresponding target version information to form a target component set, and aggregate the target component set and the service dependency set to generate a service dependency cluster.
[0111] Specifically, aggregating the target component set and the service dependency set refers to aggregating all individuals in the target component set and the service dependency set together.
[0112] Correspondingly, service dependency clustering refers to the analysis process of dividing the set of abstract objects in the service dependency into multiple classes consisting of similar objects.
[0113] Exemplarily, if it is determined that any service in the service dependency component set contains multiple version information of a target component mysql, such as 1.2, 3.4, 4.4, 5.6, 5.7, 7.1, 8.0, 9.2, 9.3, 9.5 and 9.9, and the available mysql-connector-java component and its corresponding available version information such as 5.6, 5.7 and 8.0 are listed; then the 8.0 version corresponding to the mysql-connector-java component is used as a recommended version for selection and determination, and finally the target component is determined to be mysql-connector-java, and its corresponding target version information is version 8.0. Repeating the aforementioned steps of determining the target component and its corresponding target version information, multiple target components and target version information corresponding to the multiple target components can be obtained. A target component set is formed by multiple target components and their corresponding target version information. Aggregate the target component set and the service dependency set to generate a service dependency cluster.
[0114] Step 503: If there is no service in the service dependency component set that contains multiple versions of the target component, aggregate the service dependency component set and the service dependency set to generate a service dependency cluster.
[0115] Specifically, aggregating the service dependency component set and the service dependency set refers to aggregating all individuals in the service dependency component set and the service dependency set together.
[0116] Correspondingly, service dependency clustering refers to the analysis process of dividing the set of abstract objects in the service dependency into multiple classes consisting of similar objects.
[0117] Step 504: Generate a dependency graph based on service dependency clustering.
[0118] Preferably, the generation of service dependency clusters in the service deployment method described in the above embodiment can be described in conjunction with specific examples.
[0119] Based on the above embodiments, Figure 6 This is an example diagram of generating service dependency clusters in a service deployment method provided according to an embodiment of the present invention. Figure 6 A service dependency component set 601 , a service dependency set 602 , and a service dependency relationship cluster 603 are shown.
[0120] Exemplarily, it is determined whether any service in the service dependency component set 601 contains multiple version information of the target component.
[0121] If any service in the service dependency component set 601 contains multiple version information of a target component, the target component and its corresponding target version information are determined to form a target component set, and the target component set and the service dependency set 602 are aggregated to generate a service dependency cluster 603.
[0122] If there is no service in the service dependency component set 601 that contains multiple versions of the target component, the service dependency component set 601 and the service dependency set 602 are aggregated to generate a service dependency cluster 603 .
[0123] Based on the above embodiments, in summary, the service deployment method provided by the present invention generates a service dependency cluster, thereby avoiding the need to sort out the dependencies first when deploying services.
[0124] Based on the above embodiments, Figure 7 FIG. 1 is a flow chart of generating a dependency graph based on service dependency clustering in a service deployment method provided according to an embodiment of the present invention. Figure 7 As shown in the figure, a dependency graph is generated based on service dependency clustering, including:
[0125] Step 701 : Determine the dependency relationships of service dependencies in the application set based on service dependency clustering, and identify dependency conflicts and dependency deployment order of the service dependencies.
[0126] Specifically, in step 701, service dependency clustering refers to an analysis process of dividing a set of abstract objects in a service dependency into multiple classes consisting of similar objects. Service dependency refers to the dependency relationship between services.
[0127] Step 702: Generate a dependency graph based on dependency relationships, dependency conflicts, and dependency deployment order.
[0128] Preferably, the dependency graph generated in the service deployment method described in the above embodiment can be explained in conjunction with a specific example.
[0129] Based on the above embodiments, Figure 8 FIG. 1 is an example diagram of a dependency graph generated in a service deployment method provided according to an embodiment of the present invention. Figure 8 As shown, it is a dependency graph generated based on service dependency clustering.
[0130] Specifically, the applications in the dependency graph include: Service D_2.1.1(2), Service F_1.2.1(3), Service A_1.1.3(4), Service C_3.6.2(5), Service B_4.2.1(6), Service G_1.6.2(7), and Service E_1.5.3(8).
[0131] The service dependency profiles in the dependency graph include: auth_1.6.2(1), Service D_2.1.5(2), and Service F_1.2.3(3).
[0132] The components in the dependency graph include: kafka_2.3.1(1), redis_3.2(1), MongoDB_3.4(1), elasticsearch_7.12.0(1), and mysql_8.0(1).
[0133] Correspondingly, the relationship between each application in the dependency graph and the service dependency configuration file and component is:
[0134] Service D_2.1.1(2) depends on auth_1.6.2(1) and conflicts with Service D_2.1.5(2);
[0135] Service F_1.2.1(3) conflicts with Service F_1.2.3(3);
[0136] Service A_1.1.3(4) depends on kafka_2.3.1(1), mysql_8.0(1), Service D_2.1.1(2), and Service F_1.2.1(3);
[0137] Service C_3.6.2(5) depends on MongoDB_3.4(1);
[0138] Service B_4.2.1(6) depends on elasticsearch_7.12.0(1), mysql_8.0(1), Service D_2.1.5(2), and Service C_3.6.2(5);
[0139] Service E_1.5.3(8) depends on Service C_3.6.2(5), Service G_1.6.2(7), redis_3.2(1), and Service F_1.2.3(3).
[0140] Based on the above embodiments, in summary, the service deployment method provided by the present invention generates a dependency graph based on service dependency clustering, which can be applied to development environments of multiple programming languages.
[0141] Based on the above embodiments, Fig. 9 FIG. 1 is a detailed flow chart of a service deployment method provided according to an embodiment of the present invention. Fig. 9 As shown, the method includes:
[0142] Step 901, deploying an application set, extracting service development components and service dependency configuration files in the application set.
[0143] Step 902: extract the dependent development components and dependent service information of the service dependency configuration file.
[0144] Step 903, determine whether the application set contains a service dependency configuration file; if so, execute step 904, if not, execute step 905.
[0145] Step 904, continue to extract the service dependency configuration files in the application set.
[0146] Step 905, ending the execution of extracting the service dependency configuration files in the application set.
[0147] Step 906: Process the service development components and dependent development components to form a development component set.
[0148] Step 907: forming a service dependency set based on the dependent service information.
[0149] Step 908: Create a development component mapping library, and based on the development component mapping library, convert the development component set into a service dependency component set.
[0150] Step 909 , determine whether any service in the service dependency component set contains multiple version information of the target component; if so, execute step 910 , if not, execute step 911 .
[0151] Step 910, determine the target component and its corresponding target version information, form a target component set, and aggregate the target component set and the service dependency set to generate a service dependency cluster.
[0152] Step 911: Aggregate the service dependency component set and the service dependency set to generate a service dependency cluster.
[0153] Step 912: Determine the dependency relationships of the service dependencies in the application set based on the service clustering, and identify the dependency conflicts and dependency deployment order of the service dependencies.
[0154] Step 913, generating a dependency graph based on dependency relationships, dependency conflicts, and dependency deployment order.
[0155] Step 914: deploy the target application service based on the dependency graph.
[0156] Based on the above embodiments, in summary, the service deployment method provided by the embodiments of the present invention deploys the target application service based on the generated dependency graph, thereby avoiding the need to sort out the dependencies first and then deploy the services when deploying services for dual-mode applications. At the same time, it reduces the complexity of the dependencies, and further, it can be applied to the development environments of multiple programming languages, thereby improving its versatility.
[0157] Based on the above embodiments, Fig.10 FIG. 1 is a schematic diagram of the structure of a service deployment device provided according to an embodiment of the present invention. Fig.10 As shown, the service deployment device includes: a deployment module 1010, a basic module 1020, a generation module 1030 and a target module 1040.
[0158] The deployment module 1010 is used to deploy the application set, extract the service development components and service dependency configuration files in the application set, and extract the dependent development components and dependent service information of the service dependency configuration files.
[0159] The basic module 1020 is used to form a service dependency component set based on the service development component and the dependency development component, and to form a service dependency set based on the dependency service information.
[0160] The basic module 1020 includes: a processing submodule and a conversion submodule.
[0161] The processing submodule is used to process service development components and dependent development components to form a development component set.
[0162] The conversion submodule is used to create a development component mapping library, and based on the development component mapping library, convert the development component set into a service dependency component set.
[0163] A generating module 1030, configured to generate a dependency graph based on a service dependency component set and a service dependency set;
[0164] The generation module 1030 includes: a judgment submodule, a determination submodule, an aggregation submodule and a generation submodule.
[0165] The judgment submodule is used to judge whether any service in the service dependency component set contains multiple version information of the target component.
[0166] The determination submodule is used to determine the target component and its corresponding target version information if any service in the service dependency component set contains multiple version information of the target component, form a target component set, and aggregate the target component set and the service dependency set to generate a service dependency cluster.
[0167] The aggregation submodule is used to aggregate the service dependency component set and the service dependency set to generate a service dependency cluster if no service in the service dependency component set contains multiple version information of the target component.
[0168] The generation submodule is used to generate a dependency graph based on service dependency clustering.
[0169] Furthermore, a submodule is generated, which is specifically used to: determine the dependency relationships of service dependencies in the application set based on service dependency clustering, and identify dependency conflicts and dependency deployment order of service dependencies; generate a dependency graph based on dependency relationships, dependency conflicts and dependency deployment order.
[0170] The target module 1040 is used to deploy the target application service based on the dependency graph.
[0171] It should be noted that the service deployment device also includes: a judgment module, an extraction module and an execution module.
[0172] The judgment module is used to judge whether the application set contains the service dependency configuration file.
[0173] The extraction module is used to continue to extract the service dependency configuration file in the application set if the application set contains the service dependency configuration file.
[0174] The execution module is used to terminate the execution of extracting the service dependency configuration file in the application set if the application set does not contain the service dependency configuration file.
[0175] Based on the above embodiments, in summary, the service deployment device provided by the embodiments of the present invention deploys the target application service based on the generated dependency graph, thereby avoiding the need to sort out the dependencies and then deploy the services when deploying services for dual-mode applications. At the same time, it reduces the complexity of the dependencies and improves its versatility.
[0176] Fig.11 FIG. 1 is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present invention. Fig.11As shown, the electronic device may include: a processor 1110, a communication interface 1120, a memory 1130 and a communication bus 1140, wherein the processor 1110, the communication interface 1120 and the memory 1130 communicate with each other through the communication bus 1140. The processor 1110 may call the logic instructions in the memory 1130 to execute the service deployment method, which includes: deploying an application set, extracting the service development components and service dependency configuration files in the application set, and extracting the dependent development components and dependent service information of the service dependency configuration files; forming a service dependency component set based on the service development components and the dependent development components, and forming a service dependency set based on the dependent service information; generating a dependency graph based on the service dependency component set and the service dependency set; and deploying the target application service based on the dependency graph.
[0177] In addition, the logic instructions in the above-mentioned memory 1130 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0178] On the other hand, the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the service deployment method provided by the above-mentioned methods, and the method includes: deploying an application set, extracting service development components and service dependency configuration files in the application set, and extracting dependent development components and dependent service information of the service dependency configuration files; forming a service dependency component set based on the service development components and the dependent development components, and forming a service dependency set based on the dependent service information; generating a dependency graph based on the service dependency component set and the service dependency set; and deploying the target application service based on the dependency graph.
[0179] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the service deployment method provided by the above-mentioned methods, the method comprising: deploying an application set, extracting service development components and service dependency configuration files in the application set, and extracting dependent development components and dependent service information of the service dependency configuration files; forming a service dependency component set based on the service development components and the dependent development components, and forming a service dependency set based on the dependent service information; generating a dependency graph based on the service dependency component set and the service dependency set; and deploying the target application service based on the dependency graph.
[0180] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0181] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0182] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A service deployment method, characterized in that: include: Deploy an application set, extract service development components from the application set, cyclically extract service dependency configuration files from the application set until there are no service dependency configuration files in the application set, and extract dependent development components and dependent service information of the service dependency configuration files; The service dependency configuration file refers to the configuration files related to services and dependencies obtained through independent research and development and configured in the application set; Forming a service dependency component set based on the service development component and the dependency development component, and forming a service dependency set based on the dependency service information; Generate a dependency graph based on the service dependency component set and the service dependency set; The dependency graph includes dependency relationships, dependency conflicts, and dependency deployment order; Deploy target application services based on the dependency graph; The forming of a service dependency component set based on the service development component and the dependency development component includes: Processing the service development component and the dependent development component to form a development component set; A development component mapping library is created, and based on the development component mapping library, the development component set is converted into the service dependency component set; the creation of the development component mapping library refers to creating a component mapping set that divides the development components into coordinates and version numbers and corresponds the available components to their version numbers.
2. The service deployment method according to claim 1, characterized in that: The method further comprises: Determining whether the application set includes the service dependency configuration file; If the application set includes the service dependency configuration file, continue to extract the service dependency configuration file in the application set; If the application set does not include the service dependency configuration file, the step of extracting the service dependency configuration file from the application set is terminated.
3. The service deployment method according to claim 1, characterized in that: The generating a dependency graph based on the service dependency component set and the service dependency set includes: Determine whether any service in the service dependency component set contains multiple version information of the target component; If any service in the service dependency component set contains multiple version information of a target component, determine the target component and its corresponding target version information to form a target component set, and aggregate the target component set and the service dependency set to generate a service dependency cluster; If no service in the service dependency component set contains multiple version information of the target component, aggregating the service dependency component set and the service dependency set to generate a service dependency cluster; The dependency graph is generated based on the service dependency clustering.
4. The service deployment method according to claim 3, characterized in that: The generating the dependency graph based on the service dependency clustering includes: Based on the service dependency clustering, determining the dependency relationships of the service dependencies in the application set, and identifying dependency conflicts and dependency deployment order of the service dependencies; The dependency graph is generated based on the dependency relationship, the dependency conflict and the dependency deployment order.
5. A service deployment device, characterized in that: include: A deployment module is used to deploy an application set, extract service development components from the application set, cyclically extract service dependency configuration files from the application set until there are no service dependency configuration files in the application set, and extract dependency development components and dependency service information of the service dependency configuration files; the service dependency configuration files refer to configuration files related to services and dependencies obtained through independent research and development and configured in the application set; A basic module, used to form a service dependency component set based on the service development component and the dependency development component, and to form a service dependency set based on the dependency service information; A generation module, used to generate a dependency graph based on the service dependency component set and the service dependency set; The dependency graph includes dependency relationships, dependency conflicts, and dependency deployment order; A target module, used to deploy a target application service based on the dependency graph; The basic module includes: A processing submodule, used for processing the service development component and the dependent development component to form a development component set; The conversion submodule is used to create a development component mapping library, and based on the development component mapping library, convert the development component set into the service dependency component set. The creation of the development component mapping library refers to creating a component mapping set that divides the development components into coordinates and version numbers and corresponds the usable components to their version numbers.
6. The service deployment device according to claim 5, characterized in that: The device also includes: A judgment module, used to judge whether the application set contains the service dependency configuration file; an extraction module, configured to continue to extract the service dependency configuration file in the application set if the application set includes the service dependency configuration file; The execution module is used to terminate the extraction of the service dependency configuration file in the application set if the application set does not contain the service dependency configuration file.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the service deployment method according to any one of claims 1 to 4 are implemented.
8. A non-transitory computer-readable storage medium, wherein a computer program is stored in the storage medium, characterized in that: When the computer program is executed by a processor, the steps of the service deployment method according to any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Deployment constraint automatic detection method for Web application
CN101957794A
Deployment method and apparatus of applications and services
CN105704188A
Microservice application arrangement and deployment method and device and computer terminal
CN108762769A
Service deployment method and device and electronic equipment
CN111596927A
Typed dependency graphs
US8624898B1