A proxy method and device of microservice, electronic equipment and storage medium

By receiving invocation instructions through a microservice proxy platform, determining the registry center of the target service, and storing service information, the problem of registry center isolation in enterprise applications is solved, and cross-registration center service invocation and information synchronization are realized.

CN116192931BActive Publication Date: 2026-06-02BEIJING ADVANCED DIGITAL TECH

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING ADVANCED DIGITAL TECH
Filing Date
2022-11-30
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

During enterprise application updates, the independence of each registry center leads to the isolation of their services, making it impossible for them to discover and invoke each other.

Method used

The microservice proxy platform receives the invocation command, determines the registry center of the target service, obtains and stores the service information, and sends the service information to the service consumer to realize the invocation.

Benefits of technology

This solves the problem of service isolation in the registry center and enables service calls and information synchronization across registry centers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116192931B_ABST
    Figure CN116192931B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a micro-service proxy method and device, electronic equipment and storage medium, and relate to the technical field of service proxy, which comprises the following steps: receiving a calling instruction of a target service sent by a service consumer; determining a first registration center providing the target service; obtaining service information of the target service from the first registration center according to the calling instruction and storing the service information; and sending the service information to the service consumer, so that the service consumer calls the target service through the service information. In the embodiments of the present application, the service information in the first registration center can be managed through a micro-service proxy platform, so as to solve the problem that the services of each first registration center are isolated from each other and cannot discover each other, and the target service information of the service to be called can be stored locally, so as to solve the problem that the services of other first registration centers cannot be called.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of service proxy technology, and in particular to a microservice proxy method, a microservice proxy device, an electronic device, and a storage medium. Background Technology

[0002] As society develops, enterprise applications need continuous updates and improvements to meet their needs. In existing technologies, when initially using an application, an enterprise might use a specific registry center to register services. However, as the enterprise grows, this registry center may become insufficient. Therefore, when updating the application, the enterprise adds another registry center. This results in multiple registries within the application, each independent of the others. Consequently, services in different registries are isolated and unable to discover each other, leading to the problem that microservices connected to one registry center cannot call services from other registries. Summary of the Invention

[0003] In view of the above problems, embodiments of the present invention are proposed to provide a microservice proxy method, a microservice proxy device, an electronic device, and a storage medium that overcome or at least partially solve the above problems.

[0004] To address the aforementioned problems, this invention discloses a microservice proxy method applied to a microservice proxy platform. The method includes:

[0005] Receive the invocation command for the target service sent by the service consumer object;

[0006] Determine the first registry center that provides the target service;

[0007] According to the invocation instruction, obtain and store the service information of the target service from the first registration center;

[0008] The service information is sent to the service consumer object so that the service consumer object can invoke the target service through the service information.

[0009] Optionally, the method further includes:

[0010] Receive registration instructions for the service to be registered from the service provider object;

[0011] Determine the second registry center connected to the microservice proxy platform;

[0012] The registration instruction is sent to the second registration center so that the second registration center can register the service to be registered.

[0013] Optionally, the method further includes:

[0014] Upon receiving the invocation instruction, determine the server running the microservice proxy platform;

[0015] Determine the target server from the servers mentioned above;

[0016] Sending the service information to the service consumer so that the service consumer can invoke the target service through the service information includes:

[0017] The service information is sent from the target server to the service consumer object, so that the service consumer object can invoke the target service on the target server through the service information.

[0018] Optionally, the microservice proxy platform includes a registration interface and a call interface;

[0019] The receiving service provides a registration instruction for the service to be registered, including:

[0020] Receive the registration instruction for the service to be registered sent by the service provider object through the registration interface;

[0021] The receiving service consumer object sends the target service invocation instruction, including:

[0022] Receive the call instruction for the target service sent by the call interface from the service consumer object.

[0023] Optionally, the step of obtaining and storing the service information of the target service from the first registry center according to the invocation instruction includes:

[0024] Determine whether the service information of the target service includes duplicate service information;

[0025] If the service information does not include the duplicate service information, then the service information is stored locally.

[0026] Optionally, the step of obtaining and storing the service information of the target service from the first registry center according to the invocation instruction further includes:

[0027] If the service information includes duplicate service information, then the duplicate service information is deduplicated, and the deduplicated service information is stored.

[0028] Optionally, determining the target server from the servers includes:

[0029] The target server is determined from the servers using a load balancing strategy.

[0030] Accordingly, embodiments of the present invention also disclose a microservice proxy device, applied to a microservice proxy platform, the device comprising:

[0031] The instruction receiving module is used to receive instruction commands for the target service sent by the service consumer object;

[0032] The first registration center determination module is used to determine the first registration center that provides the target service;

[0033] The service information acquisition module is used to acquire and store the service information of the target service from the first registration center according to the invocation instruction.

[0034] The service information sending module is used to send the service information to the service consumer object so that the service consumer object can call the target service through the service information.

[0035] Optionally, the device further includes:

[0036] The registration instruction receiving module is used to receive registration instructions sent by the service provider object for the service to be registered;

[0037] The second registration center determination module is used to determine the second registration center connected to the microservice proxy platform.

[0038] The service registration module is used to send the registration instruction to the second registration center so that the second registration center can register the service to be registered.

[0039] Optionally, the device further includes:

[0040] The server determination module is used to determine the server running the microservice proxy platform after receiving the invocation instruction;

[0041] A target server determination module is used to determine a target server from the servers;

[0042] The service information sending module includes:

[0043] The service information sending submodule is used to send the service information to the service consumer object through the target server, so that the service consumer object can call the target service on the target server through the service information.

[0044] Optionally, the microservice proxy platform includes a registration interface and a call interface;

[0045] The registration instruction receiving module includes:

[0046] The registration instruction receiving submodule is used to receive the registration instruction for the service to be registered sent by the service provider object when calling the registration interface;

[0047] The invocation instruction receiving module includes:

[0048] The instruction receiving submodule is used to receive the instruction to call the target service sent by the service consumer object calling the calling interface.

[0049] Optionally, the service information acquisition module includes:

[0050] The service information judgment submodule is used to determine whether the service information of the target service includes duplicate service information; if the service information does not include the duplicate service information, the service information is stored locally.

[0051] Optionally, the service information acquisition module further includes:

[0052] If the service information includes duplicate service information, then the duplicate service information is deduplicated, and the deduplicated service information is stored.

[0053] Optionally, the target server determination module includes:

[0054] The target server determination submodule is used to determine the target server from the servers through a load balancing strategy.

[0055] Accordingly, this invention discloses an electronic device, including: a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, it implements the various steps of the above-described microservice proxy method embodiment.

[0056] Accordingly, embodiments of the present invention disclose a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the various steps of the above-described microservice proxy method embodiments.

[0057] The embodiments of the present invention include the following advantages: receiving a call instruction for a target service sent by a service consumer; determining a first registry center providing the target service; obtaining and storing service information of the target service from the first registry center according to the call instruction; and sending the service information to the service consumer, so that the service consumer can call the target service through the service information. In these embodiments, a microservice proxy platform can be used to manage the service information in the first registry center, thereby solving the problem of service isolation and inability to discover each other among the various first registry centers. Furthermore, the target service information of the service to be called can be stored locally, thus solving the problem of being unable to call services from other first registry centers. Attached Figure Description

[0058] Figure 1 This is a flowchart illustrating the steps of a microservice proxy method provided in an embodiment of the present invention;

[0059] Figure 2 This is a flowchart of another microservice proxy method provided in an embodiment of the present invention;

[0060] Figure 3 This is a scenario diagram of a microservice proxy method provided in an embodiment of the present invention;

[0061] Figure 4 This is a flowchart of a microservice proxy method provided in an embodiment of the present invention;

[0062] Figure 5 This is a structural block diagram of a microservice proxy device provided in an embodiment of the present invention. Detailed Implementation

[0063] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0064] As a business grows, when the initial registry center of the enterprise application can no longer meet its needs, a new registry center can be added. Similarly, new registry centers can be added during subsequent updates to the enterprise application. In this way, multiple registry centers exist in the enterprise application, but each registry center is independent, resulting in the services of each registry center being isolated from each other and unable to discover each other.

[0065] One of the core concepts of this invention is to propose a microservice proxy method that uses microservice proxy to obtain and store the service information of each registry center locally, so as to solve the problem that the services of each registry center are isolated from each other and cannot discover each other.

[0066] Reference Figure 1The diagram illustrates a flowchart of a microservice proxy method provided by an embodiment of the present invention, which is applied to a microservice proxy platform. The method may specifically include the following steps:

[0067] Step 101: Receive the invocation instruction for the target service sent by the service consumer object.

[0068] Microservices are an architectural pattern that advocates dividing a monolithic application into a set of small services that coordinate and cooperate with each other to provide end-user value. Each service runs in its own independent process, and services communicate with each other using lightweight communication mechanisms (usually HTTP-based RESTful APIs). Each service is built around a specific business function and can be independently deployed to production environments, class-building environments, etc. Furthermore, a unified, centralized service management mechanism should be avoided as much as possible; for a specific service, the appropriate language and tools should be chosen to build it based on the context.

[0069] In enterprise applications, to facilitate the management of the enterprise registry, the registry can be centrally located in middleware. Each service provider and each service consumer has a corresponding registry to connect to. During application usage, a service provider can send its service to the corresponding registry, allowing the registry to register the service. Service consumers can retrieve service information from the registry and invoke the corresponding service based on that information. However, a service provider connected to registry A cannot register its service in registry B, and a service consumer connected to registry A cannot retrieve service information from registry B and invoke the service.

[0070] In this embodiment of the invention, a microservice proxy is provided. The microservice proxy can be embedded in the platform to obtain a microservice proxy platform. When a service consumer object needs to call a target service, the microservice proxy platform can accept the call instruction for the target service sent by the service consumer object.

[0071] Step 102: Determine the first registry center that provides the target service.

[0072] The call request can include the service ID of the target service. When a call request is received from a service consumer object, the second registry center connected to the microservice proxy platform can be determined from the configuration file. Based on the service ID of the target service, the first registry center that can provide the target service can be determined from the connected registry centers.

[0073] Step 103: According to the invocation instruction, obtain the service information of the target service from the first registration center and store it.

[0074] After identifying the primary registry center that can provide the target service, the invocation command can be sent to the corresponding primary registry center in the middleware. The primary registry center can then send the service information corresponding to the service ID in the invocation command to the microservice proxy platform. The microservice proxy platform can obtain the service information corresponding to the invocation command and can also store the service information locally.

[0075] Step 104: Send the service information to the service consumer object so that the service consumer object can invoke the target service through the service information.

[0076] After the microservice proxy platform stores the service information corresponding to the call command locally, it can send the service information to the service consumer object. When the service consumer object receives the service information, it can call the target service according to the service information.

[0077] The system receives a call instruction for the target service from a service consumer; determines a first registry center providing the target service; retrieves and stores the service information of the target service from the first registry center according to the call instruction; and sends the service information to the service consumer so that the service consumer can call the target service through the service information. In this embodiment of the invention, a microservice proxy platform can be used to manage the service information in the first registry center to solve the problem of service isolation and inability to discover each other among the various first registry centers. Furthermore, the target service information of the service to be called can be stored locally to solve the problem of being unable to call services from other first registry centers.

[0078] Reference Figure 2 This diagram illustrates a flowchart of another microservice proxy method provided by an embodiment of the present invention, applied to a microservice proxy platform. The method specifically includes the following steps:

[0079] Step 201: Receive the registration instruction for the service to be registered sent by the service provider object.

[0080] When a service provider needs to register its services in the registry, it can send a registration command for the service to be registered to the microservice proxy platform.

[0081] In this embodiment of the invention, the microservice proxy platform includes a registration interface and a calling interface;

[0082] The receiving service provides a registration instruction for the service to be registered, including:

[0083] Receive the registration instruction for the service to be registered sent by the service provider object through the registration interface.

[0084] The microservice proxy platform can provide northbound and southbound interfaces. The northbound interface can be divided into a registration interface and a call interface. The service provider object can call the registration interface to send the registration instruction for the service to be registered to the microservice proxy platform. The microservice proxy platform can receive the registration instruction for the service to be registered sent by the service provider object through the registration interface.

[0085] Step 202: Determine the second registry center connected to the microservice proxy platform.

[0086] When the microservice proxy platform receives a registration instruction, it can determine the second registry center connected to the microservice proxy platform from the configuration file. The second registry center can include multiple registry centers.

[0087] Step 203: Send the registration instruction to the second registration center so that the second registration center can register the service to be registered.

[0088] After receiving the registration instruction, the microservice proxy platform can determine at least one server that uses the distributed microservice proxy platform, and determine the instance corresponding to each server through at least one server.

[0089] The microservice proxy platform can send registration instructions to a second registry center through the instance corresponding to each server. After receiving the registration instructions, the second registry center can register the service to be registered in multiple registry centers within the second registry center according to the registration instructions. For example, if the microservice proxy platform has 3 servers and 3 registry centers connected to the microservice proxy platform, after receiving the registration instructions, the microservice proxy platform can generate 3 instances based on the 3 servers, and send the registration instructions to the 3 registry centers based on the 3 instances. Each registry center can register the service corresponding to the registration instructions sent by 1 instance once. Therefore, each registry center needs to register the service 3 times, and the 3 registry centers need to register the service 9 times.

[0090] Step 204: Receive the invocation instruction for the target service sent by the service consumer object.

[0091] In this embodiment of the invention, the microservice proxy platform includes a registration interface and a calling interface;

[0092] The receiving service consumer object sends the target service invocation instruction, including:

[0093] Receive the call instruction for the target service sent by the call interface from the service consumer object.

[0094] The microservice proxy platform can provide northbound and southbound interfaces. The northbound interface can be divided into a registration interface and a call interface. Service consumer objects can call the call interface to send the call instruction of the target service to the microservice proxy platform. The microservice proxy platform can receive the call instruction of the target service sent by the service consumer object through the call interface.

[0095] Step 205: Determine the first registry center that provides the target service.

[0096] Step 206: According to the invocation instruction, obtain the service information of the target service from the first registration center and store it.

[0097] In this embodiment of the invention, the method further includes:

[0098] Upon receiving the invocation instruction, determine the server running the microservice proxy platform;

[0099] The target server is determined from the servers mentioned.

[0100] After receiving the invocation instruction, the microservice proxy platform can identify at least one server that uses the distributed microservice proxy platform. Then, a target server is selected from the at least one server using a preset method. The preset method can be random, formula-based, etc., and the specific preset method can be set according to actual conditions; this embodiment of the invention does not impose any limitations on it.

[0101] In this embodiment of the invention, determining the target server from the servers includes:

[0102] The target server is determined from the servers using a load balancing strategy.

[0103] After determining at least one server running the microservice proxy platform, a target server can be selected from at least one server using a load balancing strategy and a preset method. For example, if there are 3 servers, and the first call to the target service uses the first server, then when the target service needs to be called a second time, the target server can be selected from the remaining 2 servers using a preset method.

[0104] In this embodiment of the invention, the step of obtaining and storing the service information of the target service from the first registration center according to the invocation instruction includes:

[0105] Determine whether the service information of the target service includes duplicate service information;

[0106] If the service information does not include the duplicate service information, then the service information is stored locally.

[0107] After receiving the API call, the system can retrieve the service information corresponding to the target service from the first registry center based on the API call. It can also determine whether the service information of the target service includes duplicate service information. If the service information of the target service does not include duplicate service information, the service information can be stored locally.

[0108] In this embodiment of the invention, the step of obtaining and storing the service information of the target service from the first registration center according to the invocation instruction further includes:

[0109] If the service information includes duplicate service information, then the duplicate service information is deduplicated, and the deduplicated service information is stored.

[0110] If the service information of the target service contains duplicate service information, the service information is deduplicated and stored locally. For example, if the service information of the target service contains service information corresponding to 9 target services, the 9 service information is deduplicated and only one service information is left.

[0111] Step 207: Send the service information to the service consumer object so that the service consumer object can invoke the target service through the service information.

[0112] In this embodiment of the invention, sending the service information to the service consumer object so that the service consumer object can invoke the target service through the service information includes:

[0113] The service information is sent from the target server to the service consumer object, so that the service consumer object can invoke the target service on the target server through the service information.

[0114] After identifying the target server, the service information corresponding to the target service can be obtained through the instance generated by the target server. After saving the service information, the service information can be sent to the service consumer object through the target server. When the service consumer object receives the service information, it can call the target service according to the service information.

[0115] The system receives a registration instruction for a service to be registered from a service provider; determines a second registry center connected to the microservice proxy platform; sends the registration instruction to the second registry center to register the service to be registered; receives a call instruction for a target service from a service consumer; determines a first registry center providing the target service; obtains and stores the service information of the target service from the first registry center according to the call instruction; and sends the service information to the service consumer to call the target service through the service information. In this embodiment, the service proxy platform can register the service to be registered to the second registry center, solving the problem of information synchronization issues between registry centers. Furthermore, the microservice proxy platform can manage the service information in the first registry center, solving the problem of service isolation and inability to discover each other in different first registry centers. Additionally, the target service information of the service to be called can be stored locally, solving the problem of being unable to call services from other first registry centers.

[0116] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.

[0117] To enable those skilled in the art to better understand the embodiments of the present invention, an example is provided below to illustrate the embodiments of the present invention: Refer to Figure 3 The diagram illustrates a scenario of a microservice proxy method provided by an embodiment of the present invention.

[0118] Service providers can send registration instructions to the microservice proxy platform by calling the registration interface. After receiving the registration instructions, the microservice proxy platform can send the service to the registration center through distributed application of the microservice proxy platform's servers. The registration center can register the service and send a registration completion message to the microservice proxy platform after the registration is completed.

[0119] Service consumers can send registration instructions to the microservice proxy platform by calling the API. After receiving the instructions, the microservice proxy platform can determine the required server through a preset method and send the instructions to the registry center through the server. The registry center can obtain the corresponding service information based on the instructions and return the service information to the microservice proxy platform. After receiving the service information, the microservice proxy platform can deduplicate the service information and then send the deduplicated service information to the service consumer. The service consumer can then call the service based on the service information.

[0120] To enable those skilled in the art to better understand the embodiments of the present invention, an example is provided below to illustrate the embodiments of the present invention: Refer to Figure 4 The diagram illustrates a process flowchart of a microservice proxy method provided in an embodiment of the present invention.

[0121] First, the system receives the registration instruction for the service to be registered from the registration interface sent by the housing provider object. Then, it determines the distributed application microservice proxy ordinary server. It can determine the second registry center connected to the microservice platform from the configuration file. The server can send the registration instruction to the second registry center, and the second registry center can register the corresponding service in the registry center according to the registration instruction.

[0122] Secondly, it can accept the call instruction of the target service sent by the call interface of the service consumer object, and then determine the ordinary server of the distributed application microservice proxy. According to the preset method, the target server is determined from the server. The second registry center connected to the microservice platform can be determined from the configuration file. Then, according to the call instruction, the first registry center that can provide the target service is determined from the second registry center. According to the call instruction, the service information of the target service is obtained from the first registry center. It is determined whether the service information contains duplicate service information. If the service information contains duplicate service information, the service information is deduplicated and stored locally. If the service information does not contain duplicate service information, the service information can be stored locally. Alternatively, the service information can be sent to the service consumer object through the target server. The service consumer object can call the target service on the target server according to the service information.

[0123] Reference Figure 5 The diagram illustrates a structural block diagram of a microservice proxy device provided by an embodiment of the present invention, which is applied to a microservice proxy platform and may specifically include the following modules:

[0124] The instruction receiving module 301 is used to receive the instruction to call the target service sent by the service consumer object;

[0125] First registration center determination module 302 is used to determine the first registration center that provides the target service;

[0126] The service information acquisition module 303 is used to acquire and store the service information of the target service from the first registration center according to the call instruction.

[0127] The service information sending module 304 is used to send the service information to the service consumer object so that the service consumer object can call the target service through the service information.

[0128] Optionally, the device further includes:

[0129] The registration instruction receiving module is used to receive registration instructions sent by the service provider object for the service to be registered;

[0130] The second registration center determination module is used to determine the second registration center connected to the microservice proxy platform.

[0131] The service registration module is used to send the registration instruction to the second registration center so that the second registration center can register the service to be registered.

[0132] Optionally, the device further includes:

[0133] The server determination module is used to determine the server running the microservice proxy platform after receiving the invocation instruction;

[0134] A target server determination module is used to determine a target server from the servers;

[0135] The service information sending module includes:

[0136] The service information sending submodule is used to send the service information to the service consumer object through the target server, so that the service consumer object can call the target service on the target server through the service information.

[0137] Optionally, the microservice proxy platform includes a registration interface and a call interface;

[0138] The registration instruction receiving module includes:

[0139] The registration instruction receiving submodule is used to receive the registration instruction for the service to be registered sent by the service provider object when calling the registration interface;

[0140] The invocation instruction receiving module includes:

[0141] The instruction receiving submodule is used to receive the instruction to call the target service sent by the service consumer object calling the calling interface.

[0142] Optionally, the service information acquisition module includes:

[0143] The service information judgment submodule is used to determine whether the service information of the target service includes duplicate service information; if the service information does not include the duplicate service information, the service information is stored locally.

[0144] Optionally, the service information acquisition module further includes:

[0145] If the service information includes duplicate service information, then the duplicate service information is deduplicated, and the deduplicated service information is stored.

[0146] Optionally, the target server determination module includes:

[0147] The target server determination submodule is used to determine the target server from the servers through a load balancing strategy.

[0148] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.

[0149] This invention also provides an electronic device, comprising:

[0150] It includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, it implements the various processes of the above-described microservice proxy method embodiments and achieves the same technical effect. To avoid repetition, it will not be described again here.

[0151] This invention also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the various processes of the above-described microservice proxy method embodiments and achieves the same technical effect. To avoid repetition, it will not be described again here.

[0152] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0153] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, apparatus, or computer program products. Therefore, embodiments of the present invention can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of the present invention can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0154] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0155] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0156] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0157] Although preferred embodiments of the present invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present invention.

[0158] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.

[0159] The foregoing has provided a detailed description of a microservice proxy method, a microservice proxy device, an electronic device, and a storage medium provided by the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A proxy method for microservices, characterized in that, Applied to a microservice proxy platform, the method includes: Receive a call instruction for a target service sent by a service consumer object; the call instruction includes the service ID of the target service; Based on the service ID of the target service, a first registration center providing the target service is determined from multiple registration centers connected to the microservice proxy platform; wherein the multiple registration centers are independent of each other and their service information is isolated from each other; According to the invocation instruction, obtain and store the service information of the target service from the first registration center; Send the service information to the service consumer so that the service consumer can invoke the target service through the service information; The step of obtaining and storing the service information of the target service from the first registry center according to the invocation instruction includes: Determine whether the service information of the target service includes duplicate service information; If the service information does not include the duplicate service information, then the service information is stored locally.

2. The method according to claim 1, characterized in that, The method further includes: Receive registration instructions for the service to be registered from the service provider object; Determine the second registry center connected to the microservice proxy platform; The registration instruction is sent to the second registration center so that the second registration center can register the service to be registered.

3. The method according to claim 1, characterized in that, The method further includes: Upon receiving the invocation instruction, determine the server running the microservice proxy platform; Determine the target server from the servers mentioned above; Sending the service information to the service consumer so that the service consumer can invoke the target service through the service information includes: The service information is sent from the target server to the service consumer object, so that the service consumer object can invoke the target service on the target server through the service information.

4. The method according to claim 2, characterized in that, The microservice proxy platform includes a registration interface and a call interface; The receiving service provides a registration instruction for the service to be registered, including: Receive the registration instruction for the service to be registered sent by the service provider object through the registration interface; The receiving service consumer object sends the target service invocation instruction, including: Receive the call instruction for the target service sent by the call interface from the service consumer object.

5. The method according to claim 1, characterized in that, The step of obtaining and storing the service information of the target service from the first registration center according to the invocation instruction further includes: If the service information includes duplicate service information, then the duplicate service information is deduplicated, and the deduplicated service information is stored.

6. The method according to claim 3, characterized in that, The step of determining the target server from the servers includes: The target server is determined from the servers using a load balancing strategy.

7. A microservice proxy device, characterized in that, The device, applied to a microservice proxy platform, includes: The instruction receiving module is used to receive an instruction to invoke a target service sent by a service consumer object; the instruction includes the service ID of the target service. The first registration center determination module is used to determine the first registration center that provides the target service from multiple registration centers connected to the microservice proxy platform based on the service ID of the target service; wherein the multiple registration centers are independent of each other and their service information is isolated from each other; The service information acquisition module is used to acquire and store the service information of the target service from the first registration center according to the invocation instruction. A service information sending module is used to send the service information to the service consumer object, so that the service consumer object can call the target service through the service information; The service information acquisition module includes: The service information judgment submodule is used to determine whether the service information of the target service includes duplicate service information; if the service information does not include the duplicate service information, the service information is stored locally.

8. An electronic device, characterized in that, include: A processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program, when executed by the processor, implements the steps of the proxy method for microservices as described in any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, which, when executed by a processor, implements the steps of the proxy method for microservices as described in any one of claims 1-6.