A microservice processing method, deployment method and related device
The service dependence of the microservice package is determined through the interface description file and automatically grouped, which solves the problems of high management costs and error-prone caused by complex dependency chains in the microservice architecture, and realizes efficient microservice development and deployment.
Patent Information
- Application Number
- CN202010316034.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-04-20
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2040-04-20
AI Technical Summary
In the microservice architecture, due to the complex dependency chain between each microservice, the existing technology relies on manual operations to generate planning files, resulting in high management costs and error-prone.
By obtaining the interface description file in the microservice package, the service dependencies of the microservice package, including static dependencies and dynamic dependencies, and grouping the dynamic dependencies microprograms according to the preset grouping policy, thereby automatically determining the deployment order and node.
It reduces manual operations, improves the development efficiency of microservices, reduces development difficulty, and improves deployment accuracy and efficiency.
Smart Images

Figure CN113535254B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a microservice processing method, a deployment method, and related devices. Background Art
[0002] In the microservice architecture, each microservice depends on and calls each other, and its dependency chain is usually complex. Currently, planning files are generated manually, such as manually writing or manually operating on the interface to obtain planning files to complete the deployment of microservices. The planning file includes the deployment order of microservice packages. For example, in the planning file, the deployment order of microservice package A is set to 1, and the deployment order of microservice package B is set to 2, etc.
[0003] It should be noted that when the number of microservices is large, manually managing planning information will bring great management costs and is prone to errors. Summary of the invention
[0004] The embodiments of the present application provide a microservice processing method, a deployment method, and related devices, which are conducive to improving the development efficiency of microservices and reducing the difficulty of microservice development.
[0005] In a first aspect, an embodiment of the present application provides a method for processing a microservice package, comprising: obtaining a microservice package, the microservice package comprising an interface description file; the interface description file comprising: an interface on which the microservice package depends and an interface published by the microservice package; determining a service dependency of the microservice package based on the interface description file, the service dependency being used to describe the microservice package on which the microservice package depends during runtime.
[0006] According to the technical solution provided by the embodiment of the present application, the service dependencies of the microservice package are determined according to the interface description file, which reduces manual operations, is conducive to improving the development efficiency of microservices, and reduces the difficulty of microservice development.
[0007] Based on the first aspect, in some possible implementations of the present application, determining the service dependency of the microservice package according to the interface description file includes: determining a dependency chain according to an interface that the microservice package depends on.
[0008] Based on the first aspect, in some possible implementations of the present application, the service dependency includes: static dependency and dynamic dependency; wherein the static dependency is used to represent the microprogram package that needs to be loaded locally when the microservice package is started; the dynamic dependency is used to represent the microprogram that needs to be accessed through a remote interface when the microservice is started or running.
[0009] Based on the first aspect, in some possible implementations of the present application, the microprograms that need to be accessed through the remote interface are grouped according to a preset grouping strategy.
[0010] In the second aspect, an embodiment of the present application provides a method for deploying a microservice package, including: obtaining a microservice package, the microservice package including an interface description file; the interface description file including: an interface on which the microservice package depends and an interface published by the microservice package; determining the service dependency of the microservice package according to the interface description file, the service dependency being used to describe the microservice package on which the microservice package depends during operation; determining the microservice packages that need to be loaded locally and the microprograms that need to be accessed through a remote interface according to the service dependencies; determining the node on which each of the microprogram groups is deployed; locally loading the microservice packages that need to be loaded locally; and triggering the loading of the corresponding microprogram packages on the nodes corresponding to each of the microprogram groups.
[0011] Based on the second aspect, in some possible implementations of the present application, determining the service dependency of the microservice package according to the interface description file includes: determining a dependency chain according to an interface that the microservice package depends on.
[0012] Based on the second aspect, in some possible implementations of the present application, the service dependency includes: static dependency and dynamic dependency; wherein the static dependency is used to represent the microprogram package that needs to be loaded locally when the microservice package is started; the dynamic dependency is used to represent the microprogram that needs to be accessed through a remote interface when the microservice is started or running.
[0013] Based on the second aspect, in some possible implementations of the present application, after determining the dependency of the microservice package according to the interface description file, the method further includes: grouping the microprogram packages that need to be accessed through the remote interface according to a preset grouping strategy.
[0014] In a third aspect, an embodiment of the present application provides a processing device for a microservice package, comprising: an acquisition unit, used to acquire a microservice package, the microservice package comprising an interface description file; the interface description file comprises: an interface on which the microservice package depends and an interface published by the microservice package; a determination unit, used to determine the service dependency of the microservice package according to the interface description file, the service dependency being used to describe the microservice package on which the microservice package depends during runtime.
[0015] Based on the third aspect, in some possible implementations of the present application, in terms of determining the service dependencies of the microservice package according to the interface description file, the determination unit is specifically used to determine a dependency chain according to the interface on which the microservice package depends; the dependency chain is used to indicate that: when the microservice package is running, the microservice package corresponding to the reverse order of the dependency chain has been loaded.
[0016] Based on the third aspect, in some possible implementations of the present application, the service dependency includes: static dependency and dynamic dependency; wherein the static dependency is used to represent the microprogram package that needs to be loaded locally when the microservice package is started; the dynamic dependency is used to represent the microprogram that needs to be accessed through a remote interface when the microservice is started or running.
[0017] Based on the third aspect, in some possible implementations of the present application, it further includes: a grouping unit, configured to group the microprograms that need to be accessed through the remote interface according to a preset grouping strategy.
[0018] In a fourth aspect, an embodiment of the present application provides a deployment device for a microservice package, comprising: an acquisition unit, used to acquire a microservice package, the microservice package comprising an interface description file; the interface description file comprising: an interface on which the microservice package depends and an interface published by the microservice package; a first determination unit, used to determine the service dependency of the microservice package according to the interface description file, the service dependency being used to describe the microservice package on which the microservice package depends during operation; a second determination unit, used to determine the microservice package that needs to be loaded locally and the microprogram that needs to be accessed through a remote interface according to the service dependency; a third determination unit, used to determine the node on which each of the microprogram groups is deployed; a first processing unit, used to locally load the microservice package that needs to be loaded locally; and a second processing unit, used to trigger loading of the corresponding microprogram package on the node corresponding to each of the microprogram groups.
[0019] Based on the fourth aspect, in some possible implementations of the present application, in determining the service dependency of the microservice package according to the interface description file, the first determination unit is specifically used to determine the dependency chain according to the interface on which the microservice package depends.
[0020] Based on the fourth aspect, in some possible implementations of the present application, the service dependency includes: static dependency and dynamic dependency; wherein the static dependency is used to represent the microprogram package that needs to be loaded locally when the microservice package is started; the dynamic dependency is used to represent the microprogram that needs to be accessed through a remote interface when the microservice is started or running.
[0021] Based on the fourth aspect, some possible implementations of the present application further include: a grouping unit, which is used to group the microprogram that needs to be accessed through the remote interface according to a preset grouping strategy after the first determination unit determines the service dependency of the microservice package.
[0022] In a fifth aspect, an embodiment of the present application provides a computing device, comprising a processor and a memory; the processor is used to execute computer instructions stored in the memory, so that the computing device performs part or all of the steps of any one of the methods of the first aspect or is used to execute part or all of the steps of any one of the methods of the second aspect.
[0023] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores computer instructions, and the computer instructions are used to instruct a computing device to execute part or all of the steps of any one of the methods of the first aspect or to execute part or all of the steps of any one of the methods of the second aspect.
[0024] According to the technical solution provided by the embodiment of the present application, the service dependencies of the microservice package are determined according to the interface description file, which reduces manual operations, is conducive to improving the development efficiency of microservices, and reduces the difficulty of microservice development. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Some drawings related to the embodiments of the present application are described below.
[0026] Figure 1A It is a flowchart of a method for processing a microservice package provided by an embodiment of the present application.
[0027] Figure 1B It is a flowchart of a method for processing a microservice package provided in another embodiment of the present application.
[0028] Figure 2 It is a schematic diagram of an application scenario of an embodiment of the present application.
[0029] Figure 3 It is a flowchart of a microservice package deployment method provided by an embodiment of the present application.
[0030] Figure 4 It is a structural diagram of a microservice package processing device provided by an embodiment of the present application.
[0031] Figure 5 It is a structural diagram of a deployment device for a microservice package provided by an embodiment of the present application. DETAILED DESCRIPTION
[0032] The embodiments of the present application are described below in conjunction with the drawings in the embodiments of the present application.
[0033] With the development of computer application technology, in order to better utilize resources and realize rapid deployment of applications, applications can be split into multiple microservices. Microservices are used to provide external services, and each microservice supports mutual association and access to realize the functional services of the overall application. The technical solution provided in the embodiment of the present application can be used in a distributed system.
[0034] See also Figure 1A , Figure 1A It is a flowchart of a method for processing a microservice package provided in an embodiment of the present application, and the method may include but is not limited to the following steps.
[0035] 101. Obtain a microservice package, where the microservice package includes an interface description file; the interface description file includes: an interface that the microservice package depends on and an interface published by the microservice package.
[0036] A microservice package is usually a compressed file (such as a zip file) that packages an application. The microservice package may include: the application itself, the application installation script, the uninstall and cleanup script, etc. In the embodiment of the present application, the microservice package also includes an interface description file.
[0037] The interface description file contains the application programming interface (API) that the microservice provides to the outside world, as well as the API description information that the microservice needs to access other microservices. Microservice packages are usually uploaded to Figure 2 The management node in .
[0038] Service dependencies include static dependencies and dynamic dependencies. Static dependencies are used to represent microprogram packages that need to be loaded locally when the microservice package is started. Dynamic dependencies are used to represent microprograms that need to be accessed through remote interfaces when the microservice is started or running.
[0039] In some possible implementations, the interface description file includes a representational state transfer (REST) interface that relies on a local API and a remotely accessed resource representation. The local API is an interface required for the service to run, that is, a static interface. The local API is loaded locally and then called, and is a strong dependency, such as the content in static / import / *. The dynamic interface is a REST interface, which can be called only when the remote microservice is started, and is a weak dependency, such as the content in dynamic / import / *. The interface description file also includes the local API and Rest interface published by the microservice, which can be represented in the description file as the contents in dynamic / import / * and dynamic / export / *, respectively.
[0040] In some possible implementations, the static interface format may be as follows, to ensure that the interface can be addressed when assembling the service and to perform strict verification.
[0041] SDK interface: microservice::1ib / a.jar::Class::interface, supports different programming languages
[0042] rtsp interface: microservice::*, example: rtsp::tomcat-1.0.0::*, rtsp can choose whether to use file link mode (default). If the link is not used, a copy of the rtsp package can be copied to the microservice directory.
[0043] The format of the dynamic interface can be as follows. The dynamic interface accesses other services through the remote interface without affecting the integrity of the microservice assembly.
[0044] Microservice package::Interface addressing method::Interface
[0045] REST interface: microservice package::URL::URL
[0046] MQ interface: Microservice package::MQ::Topic
[0047] 102. Determine a service dependency of the microservice package according to the interface description file, where the service dependency is used to describe the microservice package on which the microservice package depends when running.
[0048] In some possible implementations, such as Figure 2 As shown, the microservice package management process running in the management node can parse the information in the microservice package and save the parsed information into the cache.
[0049] For example, the microservice package management process may parse the microservice package obtained by the management node, decompress it, and parse out the interface description file of the microservice package after decompression. In some possible implementations, the interface description file is saved in the cache.
[0050] The microservice deployment process running on the master node can obtain the interface description information of the microservice package from the cache of the management node, calculate the service dependency based on the interface description information, and issue deployment instructions to the microservice proxy. The microservice proxy process can execute the microservice deployment process instructions, obtain the microservice package corresponding to the service dependency from the warehouse, and assemble and pull up the corresponding service.
[0051] According to the technical solution provided by the embodiment of the present application, the service dependencies of the microservice package are determined according to the interface description file, which reduces manual operations, is conducive to improving the development efficiency of microservices, and reduces the difficulty of microservice development.
[0052] like Figure 1B As shown, in some possible implementations, the method for processing a microservice package may further include step 103 of grouping the microprograms that need to be accessed through the remote interface according to a preset grouping strategy.
[0053] Dynamic interface publishing: including performance attributes (message size, number of requests allowed per unit time, throughput = message size multiplied by number of requests per unit time, maximum request delay), maximum message body allowed for requests, and allowed request concurrency (maximum number of requests allowed per unit time).
[0054] Interface affinity types: CPU type (large computing workload), memory type (large memory usage), disk IO (large disk IO), network IO (large network IO). Multiple types can be supported at the same time, connected together using the + sign.
[0055] The microservice package includes: SDK directory and RTSP directory. The SDK directory stores the dependent API packages. The RTSP directory stores the dependent RTSP components. When implemented, the RTSP service directory can be linked to through files. According to the interface description file, the imported items in the cache are searched for the exported items in the cache. When the values of the items are the same, the service package name in the cache item can be obtained to locate the unique microservice package .zip file. This can be done by analogy to find the complete dependency chain, such as: service A→service B→service C→...etc.
[0056] For example, the publishing interface of microservice package A can be expressed as:
[0057] Microservice package A / static / export#Publishing interface of microservice A
[0058] sdk::a.jar::Type::interface
[0059] The dependency interface of microservice package A can be expressed as:
[0060] Microservice package A / static / import#Dependent interface of microservice A,
[0061] sdk::serviceB-version::b.jar::Type::interface#Service A depends on the interface of service B
[0062] The dynamic publishing interface and dynamic dependency interface of microservice package A can be expressed as:
[0063] Service package A / dynamic / export
[0064] Service package A / dynamic / import
[0065] The release and dependent interfaces of microservice package B can be described as follows:
[0066] static / export #B service publishing interface
[0067] sdk::b.jar::Type::interface
[0068] Service package B / static / import
[0069] sdk::serviceC-version::c.jar::Type::interface #B depends on the interface of C
[0070] After receiving the instruction, the service deployment process obtains the dependency information of the service to be deployed from the service package management process, according to the service name:
[0071] Static dependencies:
[0072] Service A -> [Service A, Service B, Service C]
[0073] Service b -> [Service d]
[0074] Service c->[]
[0075] Service B -> [Service A, Service E, Service F]
[0076] Service e->[]
[0077] Service f->[]
[0078] Service C->[]
[0079] Service D->[]
[0080] Dynamic dependency: Service A -> [Service B, Service C, Service D]
[0081] Service B -> [Service C, Service D]
[0082] Service C->[]
[0083] Service D->[]
[0084] The microprograms that need to be accessed through the remote interface are grouped according to a preset grouping strategy. In some possible implementations, the preset grouping strategy may include affinity strategy mutual exclusion principle, etc.
[0085] After the dynamic dependency service calculation is completed, the pre-defined affinity strategy [CPU+Memory+Diskio+Netio] is used according to the service affinity type, such as the principle of mutual exclusion of the same resources: CPU type services are divided into different groups at the same time, and the resources required by the service can be adjusted according to the interface resource baseline calculation service. The accumulated resources do not exceed the upper limit of the node hardware processing capacity. The result of the affinity calculation divides the dynamically dependent services into groups (static dependencies do not need to be grouped). The group name is the name assigned to the microservice proxy node by the service deployment process. After the service is divided into groups, it corresponds to the corresponding microservice proxy.
[0086] Group A->[Service A, Service B, Service C], Group B->[Service D].
[0087] The service deployment process sends the grouped service list to the microservice agents on different nodes. After the microservice agent obtains the information, it downloads and assembles the service according to the static dependency information, such as service A->[service a, service b, service c], microservice b->[service d], service c->[].
[0088] The service packages involved are service A, service a, service b, service c, and service d. First, check whether the service has been deployed in the service running directory. Then, check whether there is an existing service package in the local warehouse temporary directory. If none of them exist, download the service package from the service package management process.
[0089] Unzip the service package to the service running directory according to the reverse order of dependencies, find the file according to the path defined in the interface description file and the rtspSoftLink value, copy or assemble the file link, and execute the initial script in the package to complete the deployment.
[0090] In some possible implementations of the present application, the running directory structure is as follows, and the relationship between services is flat and deployed in reverse order.
[0091] run-folder
[0092] Service A
[0093] |--static
[0094] |--import
[0095] |--service b-rtsp import service b
[0096] Service
[0097] |--static
[0098] |--export
[0099] |--rtsp
[0100] Service
[0101] Service
[0102] After the microservice agent assembles and deploys the service, it determines whether to start the service based on the strong and weak dependencies in the interface description file. If an interface is a strong dependency, the interface must be loaded before the microservice can be started. If an interface is a weak dependency, the microservice can also be started when the interface is missing.
[0103] After the service deployment process monitors the ms-agent service, it sends a service startup instruction to ms-agent based on the previous dynamic service dependency information.
[0104] The technical solution provided in the embodiment of the present application includes an interface description in the microservice package. During deployment, the dependencies of the microservice package can be directly calculated based on the dependencies of the interfaces, thus avoiding the manual definition of the dependency order of services through planning files in the existing technology.
[0105] In some possible implementations, the interface description includes resource requirements of the interface, and the deployment affinity of the microservices (which services are suitable for deployment on the same node) is calculated based on the resource requirements.
[0106] In some possible implementations, the interface description information can define a unified service interaction interface, making it possible to provide a unified development microservice framework, shielding the differences and complexities brought by multiple development languages, integrating and encapsulating compilers and linkers of various current development languages, and completing the creation, compilation, linking, publishing, and deployment of microservices.
[0107] The existence of microservice interface description files facilitates self-checking of completeness based on strong interface type constraints and simplifies the difficulty of microservice development.
[0108] like Figure 3 As shown, in some possible implementations, another embodiment of the present application discloses a technical solution for a method for deploying a microservice package, including the following steps.
[0109] 301. Obtain a microservice package, where the microservice package includes an interface description file; the interface description file includes: an interface that the microservice package depends on and an interface published by the microservice package.
[0110] 302. Determine a service dependency of the microservice package according to the interface description file, where the service dependency is used to describe a microservice package on which the microservice package depends when running.
[0111] 303. Determine, according to the service dependency, the microservice packages that need to be loaded locally and the microprograms that need to be accessed through the remote interface and group them.
[0112] 304. Determine the node where each micro-program group is deployed.
[0113] 305. Load the microservice packages that need to be loaded locally.
[0114] 306. Trigger loading of a corresponding microprogram package on a node corresponding to each microprogram group.
[0115] In some possible implementations, determining the service dependency of the microservice package according to the interface description file includes: determining a dependency chain according to an interface that the microservice package depends on.
[0116] In some possible implementations, the service dependency includes: static dependency and dynamic dependency; wherein the static dependency is used to represent the microprogram package that needs to be loaded locally when the microservice package is started; and the dynamic dependency is used to represent the microprogram that needs to be accessed through a remote interface when the microservice is started or running.
[0117] In some possible implementations, the method further includes: grouping the microprograms that need to be accessed through the remote interface according to a preset grouping strategy.
[0118] like Figure 4 As shown, it is a structural diagram of a processing device 400 for a microservice package disclosed in an embodiment of the present application, including: an acquisition unit 401 and a determination unit 402. Among them, the acquisition unit 401 is used to obtain a microservice package, and the microservice package includes an interface description file; the interface description file includes: an interface on which the microservice package depends and an interface published by the microservice package. The determination unit 402 is used to determine the service dependency of the microservice package according to the interface description file, and the service dependency is used to describe the microservice package on which the microservice package depends during operation. The specific implementation of each module refers to the description in the previous method embodiment, which will not be repeated here.
[0119] In some possible implementations, in terms of determining the service dependency of the microservice package according to the interface description file, the determination unit is specifically used to determine a dependency chain according to the interface on which the microservice package depends; the dependency chain is used to indicate that: when the microservice package is running, the microservice package corresponding to the reverse order of the dependency chain has been loaded.
[0120] In some possible implementations, the static dependency is a microprogram package that needs to be loaded locally; the dynamic dependency is used to represent a microprogram that needs to be accessed through a remote interface when the microservice is started or running.
[0121] In some possible implementations, the microservice package processing device 400 further includes: a grouping unit, configured to group the microprograms that need to be accessed through the remote interface according to a preset grouping strategy.
[0122] like Figure 5 As shown, a deployment device 500 of a microservice package disclosed in an embodiment of the present application includes: an acquisition unit 501, a first determination unit 502, a second determination unit 503, a third determination unit 504, a first processing unit 505 and a second processing unit 506. The acquisition unit 501 is used to acquire a microservice package, and the microservice package includes an interface description file; the interface description file includes: an interface on which the microservice package depends and an interface published by the microservice package. The first determination unit 502 is used to determine the service dependency of the microservice package according to the interface description file, and the service dependency is used to describe the microservice package on which the microservice package depends when it runs. The second determination unit 503 is used to determine the microservice package that needs to be loaded locally and the microprogram that needs to be accessed through the remote interface according to the service dependency. The third determination unit 504 is used to determine the node where each of the microprogram groups is deployed. The first processing unit 505 is used to locally load the microservice package that needs to be loaded locally. The second processing unit 506 is used to trigger the loading of the corresponding microprogram package on the node corresponding to each of the microprogram groups. The specific implementation of each module refers to the description in the previous method embodiment, which will not be repeated here.
[0123] In some possible implementations, in determining the service dependency of the microservice package according to the interface description file, the first determining unit is specifically configured to determine a dependency chain according to an interface on which the microservice package depends.
[0124] In some possible implementations, service dependencies include: static dependencies and dynamic dependencies; wherein the static dependencies are used to represent microprogram packages that need to be loaded locally when the microservice package is started; and the dynamic dependencies are used to represent microprograms that need to be accessed through a remote interface when the microservice is started or running.
[0125] In some possible implementations, the deployment device of the microservice package may further include: a grouping unit, configured to group the microprograms that need to be accessed through the remote interface according to a preset grouping strategy.
[0126] An embodiment of the present application further provides a computing device, which includes a processor and a memory; the processor is used to execute computer instructions stored in the memory, so that the computing device executes the method described in any of the foregoing method embodiments.
[0127] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to instruct a computing device to execute a method described in any of the foregoing method embodiments.
[0128] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that contains one or more available media integration. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., an optical disk), or a semiconductor medium (e.g., a solid-state hard disk), etc. In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0129] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0130] In the several embodiments provided in the present application, it should be understood that the disclosed device can also be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the units is only a logical function division, and there may be other division methods in actual implementation, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the indirect coupling or direct coupling or communication connection between each other shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the device or unit can be electrical or other forms.
[0131] The units described as separate components may or may not be physically separated, and the components shown 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 units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0132] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
Claims
1. A method for processing a microservice package, characterized in that: include: Obtain a microservice package, wherein the microservice package includes an interface description file; The interface description file includes: the interface on which the microservice package depends, the interface published by the microservice package, and the resource requirements of the microservice interface, wherein the resource requirements are used to determine the deployment affinity of the microservice; Determining the service dependency of the microservice package according to the interface description file includes: determining a dependency chain according to the interface on which the microservice package depends; the service dependency is used to describe the microservice package on which the microservice package depends when running; the service dependency includes: static dependency and dynamic dependency; wherein the static dependency is used to represent the microprogram package that needs to be loaded locally when the microservice package is started; the dynamic dependency is used to represent the microprogram that needs to be accessed through a remote interface when the microservice is started or running; The microprograms that need to be accessed through the remote interface are grouped according to a preset grouping strategy, wherein the preset grouping strategy includes grouping the microprograms according to the deployment affinity so that the resource accumulation does not exceed the upper limit of the hardware processing capacity of the microservice proxy node.
2. A method for deploying a microservice package, characterized in that: include: Obtain a microservice package, wherein the microservice package includes an interface description file; The interface description file includes: the interface on which the microservice package depends, the interface published by the microservice package, and the resource requirements of the microservice interface, wherein the resource requirements are used to determine the deployment affinity of the microservice; Determining the service dependency of the microservice package according to the interface description file includes: determining a dependency chain according to the interface on which the microservice package depends; the service dependency is used to describe the microservice package on which the microservice package depends when running, and the service dependency includes: static dependency and dynamic dependency; wherein the static dependency is used to represent the microprogram package that needs to be loaded locally when the microservice package starts; the dynamic dependency is used to represent the microprogram that needs to be accessed through a remote interface when the microservice starts or runs; The microprograms that need to be accessed through the remote interface are grouped according to a preset grouping strategy, wherein the preset grouping strategy includes grouping the microprograms according to the deployment affinity so that the resource accumulation does not exceed the upper limit of the hardware processing capacity of the microservice proxy node; Determine the microservice packages that need to be loaded locally and the microprograms that need to be accessed through the remote interface according to the service dependencies; Determine the node where each of the microprogram groups is deployed; Load the microservice packages that need to be loaded locally locally; Triggering loading of a corresponding microprogram package on a node corresponding to each microprogram group.
3. A microservice packet processing device, characterized in that: include: An acquisition unit, configured to acquire a microservice package, wherein the microservice package includes an interface description file; The interface description file includes: the interface on which the microservice package depends, the interface published by the microservice package, and the resource requirements of the microservice interface, wherein the resource requirements are used to determine the deployment affinity of the microservice; A determination unit, configured to determine the service dependency of the microservice package according to the interface description file, including: determining a dependency chain according to the interface on which the microservice package depends; the service dependency is used to describe the microservice package on which the microservice package depends when running, and the service dependency includes: static dependency and dynamic dependency; wherein the static dependency is used to indicate a microprogram package that needs to be loaded locally when the microservice package starts; and the dynamic dependency is used to indicate a microprogram that needs to be accessed through a remote interface when the microservice starts or runs; A grouping unit is used to group the microprograms that need to be accessed through the remote interface according to a preset grouping strategy, wherein the preset grouping strategy includes grouping the microprograms according to the deployment affinity so that the resource accumulation does not exceed the upper limit of the hardware processing capacity of the microservice proxy node.
4. The device according to claim 3, characterized in that The dependency chain is used to indicate that when the microservice package is run, the microservice package corresponding to the reverse order of the dependency chain has been loaded.
5. A deployment device for a microservice package, characterized in that: include: An acquisition unit, configured to acquire a microservice package, wherein the microservice package includes an interface description file; The interface description file includes: the interface on which the microservice package depends, the interface published by the microservice package, and the resource requirements of the microservice interface, wherein the resource requirements are used to determine the deployment affinity of the microservice; A first determining unit is used to determine the service dependency of the microservice package according to the interface description file, including: determining a dependency chain according to the interface on which the microservice package depends; the service dependency is used to describe the microservice package on which the microservice package depends when running; the service dependency includes: static dependency and dynamic dependency; wherein the static dependency is used to indicate the microprogram package that needs to be loaded locally when the microservice package starts; the dynamic dependency is used to indicate the microprogram that needs to be accessed through a remote interface when the microservice starts or runs; a grouping unit, configured to group the microprograms that need to be accessed through the remote interface according to a preset grouping strategy after the first determining unit determines the service dependency of the microservice package, wherein the preset grouping strategy includes grouping the microprograms according to the deployment affinity so that the resource accumulation does not exceed the upper limit of the hardware processing capacity of the microservice proxy node; A second determining unit is used to determine the microservice package that needs to be loaded locally and the microprogram that needs to be accessed through the remote interface according to the service dependency; A third determining unit is used to determine the node where each of the micro-program groups is deployed; A first processing unit is used to locally load a microservice package that needs to be loaded locally; The second processing unit is used to trigger loading of a corresponding microprogram package on a node corresponding to each microprogram group.
6. A computing device, characterized in that The computing device comprises a processor and a memory; the processor is configured to execute computer instructions stored in the memory, so that the computing device executes the method of claim 1 or 2.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions for instructing a computing device to execute the method of claim 1 or 2.
Citation Information
Patent Citations
Micro kernel pluggable program application system and implementation method thereof
CN102141922A
Mounting method of component packet in distributed cluster and related equipment
CN108347467A
A micro-service packaging deployment method and system
CN109634657A
Service additional dependence management method for large-scale micro-service deployment
CN110908669A