A Component Cloud Call Method and System Based on a Microservices Architecture
Through the cloud-based component call method based on the microservice architecture, the middle platform sends requests to multiple clouds, and the cloud searches and adapts components, solving the problem of high operation and maintenance costs of component cloud deployment, realizing flexible deployment and reducing operation and maintenance costs.
Patent Information
- Application Number
- CN202210276558.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-21
- Publication Date
- 2025-07-04
- Estimated Expiration
- 2042-03-21
AI Technical Summary
In the prior art, the operation and maintenance cost of component cloud deployment is high and it relies on cloud service providers, resulting in the problem of repeated component deployment.
The cloud-based component call method based on the microservice architecture is adopted. After receiving the service request, the middle platform sends component call requests to each cloud. The cloud searches for the target component locally and performs the running environment adaptation and compilation through the environment compiler. The platform calls the target component to complete the target service.
It realizes flexible deployment of components in multiple clouds, reduces operation and maintenance costs, and avoids dependence on a certain cloud service provider, improving the flexibility and adaptability of middle-end construction.
Smart Images

Figure CN114661493B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of cloud services, and particularly to a method and system for component cloud call based on a microservices architecture. Background Art
[0002] For digital transformation and cloudification, it is necessary to deploy business components and service components of the middle platform / system in the cloud. Especially for platforms and systems built based on the microservices architecture, there are many service components involved. In the prior art, when deploying components in the cloud, a middle platform is directly deployed on a single cloud, that is, all service components included in a middle platform are deployed on a single cloud. This leads to dependence on cloud service providers. At the same time, if different service components are deployed on different clouds, the same components need to be deployed repeatedly, resulting in high operation and maintenance costs.
[0003] Therefore, the prior art still needs to be improved and enhanced. Summary of the Invention
[0004] In view of the above-mentioned defects of the prior art, the present invention provides a method and system for component cloud call based on a microservices architecture, aiming to solve the problem of high operation and maintenance costs in component cloud deployment in the prior art.
[0005] To solve the above technical problems, the technical solutions adopted by the present invention are as follows:
[0006] In a first aspect of the present invention, there is provided a method for component cloud call based on a microservices architecture, the method comprising:
[0007] The middle platform receives a service request and sends a component call request to each cloud according to the service request;
[0008] The cloud receives the component call request and searches for a target component locally in the cloud according to the component call request;
[0009] The platform calls the target component to complete the target service.
[0010] For the method for component cloud call based on a microservices architecture, wherein the middle platform sends a component call request to each cloud according to the service request, comprising:
[0011] The middle platform determines the target component configuration requirements according to the target service corresponding to the service request;
[0012] The middle platform sends a component call request to each cloud according to the target component configuration requirements.
[0013] For the method for component cloud call based on a microservices architecture, wherein the middle platform sends a component call request to each cloud according to the target component configuration requirements, comprising:
[0014] The middleware determines the target cloud address corresponding to the target component configuration requirement according to the pre-compiled call index of the call-end component;
[0015] The middleware sends the component call request to the cloud corresponding to the target cloud address according to the target cloud address.
[0016] The method for cloud calling of components based on a microservices architecture, wherein the cloud locates the target component locally in the cloud according to the component call request, includes:
[0017] The cloud determines the storage address of the target component according to the component call request and the pre-established mapping relationship between the component and the storage address.
[0018] The method for cloud calling of components based on a microservices architecture, wherein the target component is stored in a component library, and the component library includes at least one component of at least one category, and the at least one component is obtained by disassembling at least one service corresponding to the middleware into components.
[0019] The method for cloud calling of components based on a microservices architecture, wherein the platform calls the target component to complete the target service, includes:
[0020] The cloud obtains the operating environments of the cloud and the middleware;
[0021] When the operating environment of the cloud is consistent with the operating environment of the middleware, the platform directly calls the target component to run to complete the target service.
[0022] The method for cloud calling of components based on a microservices architecture, wherein the platform calls the target component to complete the target service, includes:
[0023] The cloud obtains the operating environments of the cloud and the middleware;
[0024] When the operating environment of the cloud is inconsistent with the operating environment of the middleware, the cloud performs runtime environment adaptation compilation on the target component through an environment compiler;
[0025] The platform calls the compiled target component to run to complete the target service.
[0026] The method for cloud calling of components based on a microservices architecture, wherein the cloud performs runtime environment adaptation compilation on the target component through an environment compiler, includes:
[0027] The cloud allocates a compilation cache in the cache space;
[0028] The cloud performs runtime environment adaptation compilation on the target component through the environment compiler, and stores the compiled target component in the environment compilation cache.
[0029] The method for cloud calling of components based on a microservice architecture, wherein the platform calls the compiled target component to run to complete the target service, including:
[0030] The platform calls the compiled target component through the environment compilation cache to run to complete the target service.
[0031] In a second aspect of the present invention, there is provided a system for cloud calling of components based on a microservice architecture, including: the system includes a middle platform and at least one cloud;
[0032] The middle platform is used to receive a service request and send a component call request to each cloud according to the service request;
[0033] The cloud is used to receive the component call request and find the target component locally in the cloud according to the component call request;
[0034] The middle platform is further used to call the target component to complete the target service.
[0035] Compared with the prior art, the present invention provides a method and system for cloud calling of components based on a microservice architecture. In the method for cloud calling of components based on a microservice architecture, after the middle platform receives a service request, it sends a component call request to each cloud. After the cloud receives the component call request, it finds the target component locally. Then the platform calls the target component found by the cloud. In this way, the components of all services supported by the middle platform do not need to be all deployed on one cloud, but can be respectively deployed on different clouds, without relying on a certain cloud service provider, and when the components of all services are deployed on multiple clouds, it is also possible to achieve non-redundant deployment of the components on each cloud, reducing the operation and maintenance cost. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 It is a flowchart of an embodiment of the method for cloud calling of components based on a microservice architecture provided by the present invention;
[0037] Figure 2 It is a schematic diagram of an application scenario of the method for cloud calling of components based on a microservice architecture provided by the present invention;
[0038] Figure 3 It is a schematic diagram of the process of component deployment and calling in an embodiment of the method for cloud calling of components based on a microservice architecture provided by the present invention;
[0039] Figure 4Logic block diagram when the cloud and the middle platform running environments are consistent in the embodiment of the component cloud call method based on the microservice architecture provided by the present invention;
[0040] Figure 5 Logic block diagram when the cloud and the middle platform running environments are inconsistent in the embodiment of the component cloud call method based on the microservice architecture provided by the present invention;
[0041] Figure 6 Component call scenario flowchart when a single service has multiple components and the running environments are consistent in the embodiment of the component cloud call method based on the microservice architecture provided by the present invention;
[0042] Figure 7 Component call scenario flowchart when a single service has multiple components and the running environments are inconsistent in the embodiment of the component cloud call method based on the microservice architecture provided by the present invention;
[0043] Figure 8 Component call scenario flowchart when multiple services have multiple components and the running environments are consistent in the embodiment of the component cloud call method based on the microservice architecture provided by the present invention;
[0044] Figure 9 Component call scenario flowchart when multiple services have multiple components and the running environments are consistent in the embodiment of the component cloud call method based on the microservice architecture provided by the present invention;
[0045] Figure 10 Structural schematic diagram of the embodiment of the component cloud call system based on the microservice architecture provided by the present invention;
[0046] Figure 11 Specific structural schematic diagram of the cloud and the middle platform in the embodiment of the component cloud call system based on the microservice architecture provided by the present invention. Detailed implementation manners
[0047] To make the objectives, technical solutions and effects of the present invention clearer and more definite, the following further describes the present invention in detail with reference to the accompanying drawings and by way of examples. It should be understood that the specific examples described herein are only used to explain the present invention, and are not used to limit the present invention.
[0048] Embodiment 1
[0049] As Figure 1 shown, in an embodiment of the component cloud call method based on the microservice architecture, the method includes the steps of:
[0050] S100. The middle platform receives a service request, and sends a component call request to each cloud according to the service request;
[0051] S200. The cloud receives the component call request and looks up the target component locally in the cloud according to the component call request.
[0052] As Figure 2 shown, in the method for cloud calling of components based on the microservice architecture provided in this embodiment, the middle platform can be a business middle platform providing multiple services or an application middle platform with only a single application. Specifically, the middle platform is an electronic device, which can be a mobile device, a local device or a server. The middle platform can support multiple services. When a certain service needs to be executed, the service requester (the terminal executing the service, which can be the electronic device of the middle platform itself or another electronic device) sends the service request. The middle platform receives the service request and sends the component call request to each cloud according to the service request. A component set is set on the cloud. After receiving the component call request, the cloud looks up the target component corresponding to the component call request in the local component set.
[0053] Specifically, the middle platform sending the component call request to each cloud according to the service request includes:
[0054] The middle platform determines the target component configuration requirement according to the target service corresponding to the service request;
[0055] The middle platform sends the component call request to each cloud according to the target component configuration requirement.
[0056] The service request is used to obtain the service components of the target service for operation to complete the target service. After receiving the service request, the middle platform determines the target service corresponding to the service request, and then determines the target component configuration requirement according to the target service. Specifically, the target component configuration requirement includes the service components required by the target service.
[0057] In a possible implementation manner, the middle platform can broadcast the target component configuration requirement to each cloud, but this will cause a relatively large amount of communication, especially in the case where a relatively large number of clouds are set. In this embodiment, a call - end component call index is set in the middle platform. The call - end component index includes the cloud address information where the components required by each service are located, so that the target component configuration requirement can be sent only to the cloud storing the components corresponding to the target component configuration requirement.
[0058] The middle platform sending the component call request to each cloud according to the target component configuration requirement includes:
[0059] The middle platform determines the target cloud address corresponding to the target component configuration requirement according to the pre - compiled call - end component call index;
[0060] The middle platform sends the component call request to the cloud corresponding to the target cloud address according to the target cloud address.
[0061] As Figure 3 shown, when developing the middle platform, first sort out the components required by each service to form a component call requirement list, and configure the component call order according to the business or application process of the service, and write the component call index of the calling end component. The component call index of the calling end component stores the cloud address information and execution order information of the components required by the service. When the middle platform receives the target component configuration requirement, it determines which cloud each service component in the target component configuration requirement is stored in according to the component call index of the calling end component, that is, determines the target cloud address corresponding to the target component configuration requirement. Furthermore, the middle platform sends the component call request to the corresponding cloud according to the target cloud address.
[0062] In this embodiment, as Figure 3 shown, each service supported by the middle platform is pre-split into components, and then different components are deployed on each cloud, and a mapping relationship between the service components on each cloud and the storage address is established in advance, so that after the cloud receives the component call request, it can determine the local storage address of the target component corresponding to the component call request according to the mapping relationship, that is, the cloud searches for the target component locally in the cloud according to the component call request, including:
[0063] The cloud determines the storage address of the target component according to the component call request and the pre-established mapping relationship between the component and the storage address.
[0064] A component library is set in each cloud, and the components stored on the cloud are stored in the component library. The components can be classified and stored in the component library according to categories, that is, the component library includes at least one component of at least one category, and the at least one component is obtained by disassembling the components of the at least one service corresponding to the normal distribution. Specifically, as Figure 3As shown, component decomposition is performed based on the services supported by the middle platform, and then the cloud where different components are stored is determined. For each component stored on the cloud, classification and combination are performed according to component characteristics to form a component set. The component library is included in the component set. According to the component list in the component set and the address (including IP address and physical address) where each component is located, the mapping relationship is established to obtain the component index on each cloud. The component set and component index corresponding to each cloud are encapsulated into a "component cloud deployment device", and then the component cloud deployment device is deployed to the corresponding cloud. In this way, after each cloud receives the component call request, the storage address of the target component stored locally can be obtained through the component set in the component cloud deployment device.
[0065] Please refer to again Figure 1 , the component cloud call method based on the microservice architecture provided in this embodiment further includes the step:
[0066] S300. The platform calls the target component to complete the target service.
[0067] The platform needs to call the target component to run, obtain the running result of the target component and return it to the service, and sequentially obtain the running results of the respective target components corresponding to the target service according to the component running order of the target service, and finally complete the target service.
[0068] For different cloud service providers, the corresponding cloud development tools and development environments may be different, that is, the operating environments of each cloud may be different, and the development tools and development environments of the middle platform may also be different for different clouds. And the components stored in each cloud are based on the operating environment of the cloud, so that each component can run locally for detection, and it is also convenient to directly update and upgrade the components on the cloud during later maintenance.
[0069] Through the method provided in this embodiment, component cloud deployment is not limited by the operating environment and cloud service providers; after the components are on the cloud, they can be called by services and applications without limitation; component reuse means that the cloud deployment of part of the middle platform can be more lightweight; component reuse can improve the flexibility of middle platform construction and is more suitable for agile development projects; through the device of this patent, the operation and maintenance cost of components will also be relatively reduced.
[0070] In order to achieve compatibility of the operating environments of different clouds, in this embodiment, when the platform calls the target component, different processing is required for the two cases where the operating environments of the cloud and the middle platform are the same or different.
[0071] Specifically, the platform calls the target component to complete the target service, including:
[0072] The cloud obtains the operating environments of the cloud and the middleware platform.
[0073] When the operating environments of the cloud and the middleware platform are consistent, the platform directly invokes the target component to run to complete the target service.
[0074] When the operating environments of the cloud and the middleware platform are inconsistent, the cloud performs runtime environment adaptation compilation on the target component through an environment compiler.
[0075] The platform invokes the compiled target component to run to complete the target service.
[0076] As Figure 4 shown, the component cloud deployment device further includes an environment compiler. After the cloud locates the target component, it sends the target component to the environment compiler. The environment compiler identifies whether the operating environments of the cloud and the middleware platform are consistent. Specifically, the operating environment includes the virtual machine version, virtual machine program, etc. If they are consistent, the middleware platform can directly invoke the target component to run, that is, the cloud sends the target component to the middleware platform, and the middleware platform returns the operation result to the service requester after running.
[0077] As Figure 5 shown, if the operating environments of the cloud and the middleware platform are inconsistent, then the cloud first performs environment adaptation compilation on the target component. Specifically, after sending the target component to the environment compiler, the environment compiler performs adaptation compilation on the target component according to the operating environments of the cloud and the middleware platform, so that the compiled target component can run on the middleware platform.
[0078] The cloud performs runtime environment adaptation compilation on the target component through an environment compiler, including:
[0079] The cloud allocates a compilation cache in the cache space.
[0080] The cloud performs runtime environment adaptation compilation on the target component through the environment compiler, and stores the compiled target component in the environment compilation cache.
[0081] Specifically, the component set in the component cloud deployment device allocates the environment compilation cache in the cache space of the cloud. The environment compiler stores the compiled target component in the environment compilation cache. The middleware platform invokes the compiled component to run through the environment compilation cache. That is, the cloud sends the compiled target component stored in the environment compilation cache to the middleware platform.
[0082] In a possible implementation, after the cloud invokes the compiled target component stored in the environment compilation cache, the cloud can retain a copy of the compiled target component in the environment compilation cache. Each time the middleware updates the running environment version, it can send a notification to the cloud. After receiving the notification, the cloud clears the environment compilation cache. For a component call request sent by the middleware that is inconsistent with the running environment of the cloud, after receiving the component call request, the cloud queries whether the corresponding component already exists in the environment compilation cache. If it exists, the cloud can directly send the corresponding component in the environment compilation cache to the middleware. Each time a component in the environment compilation cache is invoked, the cloud increments by one the call count corresponding to the invoked component in the environment compilation cache. If it does not exist, component adaptation compilation is performed. The cloud can clean the components in the environment compilation cache at every preset time interval, and the cleaning is not affected by the action of emptying the environment compilation cache upon receiving the notification. Each time of cleaning, the cloud determines the call counts of the components currently stored in the environment compilation cache, and deletes the components whose call counts are lower than the average of the call counts of all the components in the environment compilation cache.
[0083] In this embodiment, when the middleware needs to process multiple services, multiple threads can be created, and the component call requests corresponding to each service are respectively sent to the cloud. The multiple services do not affect or interfere with each other during the call process.
[0084] The following is an illustrative example in combination with four specific application scenarios:
[0085] As Figure 6 shown, a single application with the same running environment outputs corresponding application capabilities by invoking components within different component sets;
[0086] Step 1: When middleware A executes service A, service A sends a request to the "invocation-side component index" according to the required components;
[0087] Step 2: The invocation-side component index performs address resolution based on the address information and sends an invocation request to the cloud service component set;
[0088] Step 3: Component set A receives the invocation request, invokes component A1, and simultaneously starts the environment compiler; component set B receives the invocation request and invokes component B2;
[0089] Step 4: The environment compiler of component set A identifies that the server environment where component set A is located and the server environment where middleware A is located are consistent; the environment compiler of component set B identifies that the server environment where component set B is located and the server environment where middleware A is located are consistent;
[0090] Step Five: Service A in Middle Platform A directly executes the operations of Component A1 and Component B2.
[0091] As Figure 7 shown, a single application in different operating environments outputs corresponding application capabilities by calling components within different component sets.
[0092] Step One: When Middle Platform A executes Service A, Service A sends a request to the "Caller Component Index" according to the required components.
[0093] Step Two: The Caller Component Index performs address resolution to the cloud service component set based on the address information and sends a call request.
[0094] Step Three: Component Set A receives the call request, calls Component A1, and simultaneously starts the environment compiler; Component Set B receives the call request, calls Component B2, and simultaneously starts the environment compiler.
[0095] Step Four: The environment compiler of Component Set A identifies that the server environment where Component Set A is located is inconsistent with the server environment where Middle Platform A is located, and starts the component compilation program; the environment compiler of Component Set B identifies that the server environment where Component Set B is located is inconsistent with the server environment where Middle Platform A is located, and starts the component compilation program.
[0096] Step Five: Component Set A allocates an environment compilation cache in the server cache space; Component Set B allocates an environment compilation cache in the server cache space.
[0097] Step Six: The environment compiler performs environment adaptation compilation on the components according to the environment where the middle platform is located, and stores the compiled components in the environment compilation cache.
[0098] Step Seven: The middle platform calls the compiled components through the environment compilation cache for operation.
[0099] As Figure 8 shown, multiple applications in the same operating environment simultaneously call components within different component sets and multiple services need to call the same component in a certain component set, and output corresponding application capabilities.
[0100] Step One: When Middle Platform A executes Service A and Service B, Service A sends a request to the "Caller Component Index" according to the required components; Service B synchronously sends a request to the "Caller Component Index" according to the required components; the call requests of Service A and Service B are independent of each other and do not interfere with each other.
[0101] Step Two: The Caller Component Index performs address resolution to the cloud service component set based on the address information and sends a call request.
[0102] Step 3: Component set A receives the call request, calls components A1 and A2, and starts the environment compiler; component set B receives the call request and calls component B2;
[0103] Step 4: The environment compiler of component set A recognizes that the server environment where component set A is located is consistent with the server environment where middle station A is located; the environment compiler of component set B recognizes that the server environment where component set B is located is consistent with the server environment where middle station A is located;
[0104] Step 5: Service A directly calls components A1 and B2 to run; service B directly calls components A2 and B2 to run; the calls of services A and B to components are relatively independent and do not interfere with each other.
[0105] like Figure 9 As shown, multiple applications in different operating environments simultaneously call components in different component sets, and multiple services need to call the same component in a component set to output corresponding application capabilities;
[0106] Step 1: When the middle station A executes service A and service B, service A initiates a request to the "calling end component index" according to the required components; service B simultaneously initiates a request to the "calling end component index" according to the required components; the call requests of service A and service B are independent of each other and do not interfere with each other;
[0107] Step 2: The calling end component index addresses the cloud service component set according to the address information and sends a call request;
[0108] Step 3: Component set A receives the call request, calls components A1 and A2, and starts the environment compiler; component set B receives the call request and calls component B2;
[0109] Step 4: The environment compiler of component set A recognizes that the server environment where component set A is located is inconsistent with the server environment where middle station A is located, and starts the component compiler; the environment compiler of component set B recognizes that the server environment where component set B is located is inconsistent with the server environment where middle station A is located, and starts the component compiler;
[0110] Step 5: Component set A allocates environment compilation cache in the server cache space; component set B allocates environment compilation cache in the server cache space;
[0111] Step 6: The environment compiler compiles the components according to the environment where the middle station is located, and stores the compiled components in the environment compilation cache;
[0112] Step 7: The middleware calls the compiled components to run through the environment compilation cache; Service A calls the compiled component A1-1 and the compiled component B2-1; Service B calls the compiled component A2-1 and the compiled component B2-2; The calls are relatively independent and do not interfere with each other.
[0113] In summary, this embodiment provides a method for cloud calling components based on a microservices architecture. After receiving a service request, the middleware sends a component call request to each cloud. After receiving the component call request, the cloud searches for the target component locally, and then the platform calls the target component found by the cloud. In this way, the components of all services supported by the middleware do not need to be all deployed on one cloud, but can be respectively deployed on different clouds, without relying on a certain cloud service provider, and when the components of all services are deployed on multiple clouds, it is also possible to ensure that the components on each cloud are not repeatedly deployed, reducing the operation and maintenance costs.
[0114] It should be understood that although the steps in the flowcharts given in the accompanying drawings of the present invention are shown in sequence according to the arrows, these steps do not necessarily have to be executed in the order indicated by the arrows. Unless otherwise clearly stated in this article, there is no strict order limit for the execution of these steps, and these steps can be executed in other orders. Moreover, at least some of the steps in the flowchart may include multiple sub-steps or multiple stages. These sub-steps or stages do not necessarily have to be executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages does not necessarily have to be sequential, but can be executed alternately or alternately with at least a part of other steps or sub-steps or stages of other steps.
[0115] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, storage, database, or other medium used in the embodiments provided by the present invention can include non-volatile and / or volatile memories. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or an external cache. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0116] Embodiment 2
[0117] Based on the above embodiments, the present invention also correspondingly provides a component cloud call system based on a microservices architecture, as Figure 10 shown. The system includes a middle platform and at least one cloud;
[0118] The middle platform is used to receive service requests and send component call requests to each cloud according to the service requests;
[0119] The cloud is used to receive the component call requests and find target components locally in the cloud according to the component call requests;
[0120] The middle platform is also used to call the target components to complete the target services.
[0121] In a possible implementation manner, as Figure 11 the lower half of, the middle platform includes 6 parts: a network adapter, a processing unit, an I / O interface, a display unit, and a middle platform storage unit;
[0122] 1) The network adapter is a network hardware device for the middle platform / system to connect to the Internet; it is connected to the cloud server where the component is located through the Internet with the cloud network adapter;
[0123] 2) The processing unit refers to the processing unit of the device where the middle platform / system is located;
[0124] 3) The I / O interface is the hardware interface required when the middle platform / system needs to connect external devices such as monitors, keyboards, and mice during use;
[0125] 4) The display unit is the device that presents the results when the middle platform / system is applied, and can be a monitor or an intelligent terminal;
[0126] 5) External devices are the hardware devices that need to input and output information during the use of the middle platform / system, such as keyboards and mice;
[0127] 6) The storage unit of the middle platform / system includes the operating system, programs stored by services / applications, running memory, cache, etc.
[0128] Such as Figure 11 In the upper part of [], the cloud includes three parts: a processing unit, a network adapter, and the storage space of the cloud service virtual machine;
[0129] 1) The processing unit refers to the computing unit of the cloud server (i.e., the CPU);
[0130] 2) The network adapter refers to the network hardware device that connects the cloud server to the Internet;
[0131] 3) The storage space of the cloud service virtual machine is the physical location where the component cloud deployment device in the method embodiment is stored, which includes the storage and application of the virtual machine operating system, environment compiler, component index, and component library.
[0132] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for cloud calling of components based on a microservices architecture, characterized in that, The method includes: The middleware receives a service request and sends a component call request to each cloud based on the service request; The cloud receives the component call request and locates a target component locally in the cloud according to the component call request; The middleware invokes the target component to complete the target service; Among them, the middleware sending a component call request to each cloud according to the service request includes: The middleware determines the target component configuration requirements according to the target service corresponding to the service request; The middleware determines the target cloud address corresponding to the target component configuration requirements according to a pre-compiled call-side component call index; the call-side component call index stores the cloud address information and execution order information of the components required by the service; The middleware sends the component call request to the cloud corresponding to the target cloud address according to the target cloud address; The middleware invoking the target component to complete the target service includes: The cloud obtains the operating environments of the cloud and the middleware; When the operating environment of the cloud is inconsistent with the operating environment of the middleware, the cloud performs runtime environment adaptation compilation on the target component through an environment compiler; The middleware invokes the compiled target component to run to complete the target service.
2. The component cloud call method based on the microservice architecture according to claim 1, wherein The cloud locating the target component locally in the cloud according to the component call request includes: The cloud determines the storage address of the target component according to the component call request and a pre-established mapping relationship between the component and the storage address.
3. The method for cloud calling components based on a microservices architecture according to claim 2, wherein The target component is stored in a component library, and the component library includes at least one component of at least one category, and the at least one component is obtained by disassembling the components corresponding to at least one service of the middleware.
4. The component cloud call method based on the microservice architecture according to claim 1, characterized in that The middleware invoking the target component to complete the target service includes: The cloud obtains the operating environments of the cloud and the middleware; When the operating environment of the cloud is consistent with the operating environment of the middleware, the middleware directly invokes the target component to run to complete the target service.
5. The component cloud call method based on the microservice architecture according to claim 1, characterized in that The cloud performing runtime environment adaptation compilation on the target component through an environment compiler includes: The cloud allocates an environment compilation cache in the cache space; The cloud performs runtime environment adaptation compilation on the target component through the environment compiler and stores the compiled target component in the environment compilation cache.
6. The component cloud call method based on the microservice architecture according to claim 5, characterized in that, The middleware invoking the compiled target component to run to complete the target service includes: The middleware invokes the compiled target component to run through the environment compilation cache to complete the target service.
7. A component cloud call system based on a microservices architecture, characterized in that, The system includes a middleware and at least one cloud; The middleware is used to receive a service request and send a component call request to each cloud according to the service request; The cloud is used to receive the component call request and locate a target component locally in the cloud according to the component call request; The middleware is also used to invoke the target component to complete the target service; Among them, the middle platform is specifically used for: determining the target component configuration requirements according to the target service corresponding to the service request; determining the target cloud address corresponding to the target component configuration requirements according to the pre-compiled call-end component call index; the call-end component call index stores the cloud address information and execution order information of the components required by the service; sending the component call request to the cloud corresponding to the target cloud address according to the target cloud address; The cloud obtains the operating environments of the cloud and the middle platform; when the operating environment of the cloud is inconsistent with that of the middle platform, the cloud performs operating environment adaptation compilation on the target component through an environment compiler; the middle platform calls the compiled target component to run to complete the target service.
Citation Information
Patent Citations
Application development system, operation method, equipment and storage medium
CN111831269A
Request processing method and device, electronic equipment and storage medium
CN113810472A