CN113691635A - Method and device for calling micro service, electronic equipment and readable storage medium - Google Patents

Method and device for calling micro service, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN113691635A
CN113691635A CN202111021304.2A CN202111021304A CN113691635A CN 113691635 A CN113691635 A CN 113691635A CN 202111021304 A CN202111021304 A CN 202111021304A CN 113691635 A CN113691635 A CN 113691635A
Authority
CN
China
Prior art keywords
service
target
micro
calling
microservice
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202111021304.2A
Other languages
Chinese (zh)
Other versions
CN113691635B (en
Inventor
李欢
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhongdian Jinxin Software Co Ltd
Original Assignee
Zhongdian Jinxin Software Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhongdian Jinxin Software Co Ltd filed Critical Zhongdian Jinxin Software Co Ltd
Priority to CN202111021304.2A priority Critical patent/CN113691635B/en
Publication of CN113691635A publication Critical patent/CN113691635A/en
Application granted granted Critical
Publication of CN113691635B publication Critical patent/CN113691635B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/51Discovery or management thereof, e.g. service location protocol [SLP] or web services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4488Object-oriented
    • G06F9/449Object-oriented method invocation or resolution
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)
  • Computer And Data Communications (AREA)

Abstract

The application provides a method, a device, an electronic device and a readable storage medium for calling a micro service, wherein a specific implementation mode of the method comprises the following steps: receiving a calling request for calling a target micro service; the calling request carries target information corresponding to the target micro-service; searching at least one micro service matched with the target information in the constructed service directory; and determining the target microservice from the at least one microservice based on the communication protocol used by the at least one microservice, and completing the calling operation. The method can facilitate the developer to call the required target micro-service from other systems.

Description

Method and device for calling micro service, electronic equipment and readable storage medium
Technical Field
The present application relates to the field of information processing, and in particular, to a method and an apparatus for invoking a microservice, an electronic device, and a readable storage medium.
Background
With the continuous development of informatization construction, the informatization application system architecture gradually changes from a traditional single architecture to a micro-service architecture. The microservice architecture may be embodied as a system that splits a business function into a number of independently deployed microservices, each providing a service function.
For a company, a plurality of systems are deployed simultaneously, and each system provides a plurality of micro services, so the number of the micro services is huge. For developers, only the distribution situation of each micro-service in the system which participates in development is known, and the distribution situation of the micro-services in other systems is difficult to know; for example, when a system developed by a developer lacks the microservice a and the microservice a exists in another system, the developer cannot know the information and can develop the information by himself, so that the operation of calling the microservice in another system cannot be realized conveniently.
Disclosure of Invention
The embodiment of the application aims to provide a method, a device, an electronic device and a readable storage medium for calling a micro service, so as to call a required target micro service from other systems.
In a first aspect, an embodiment of the present application provides a method for invoking a microservice, including: receiving a calling request for calling a target micro service; the calling request carries target information corresponding to the target micro-service; searching at least one micro service matched with the target information in the constructed service directory; and determining the target microservice from the at least one microservice based on the communication protocol used by the at least one microservice, and completing the calling operation. Therefore, developers can call the required target micro-service conveniently without developing the target micro-service by themselves, and development pressure is relieved.
Optionally, the searching for at least one microservice matching the target information includes: when the target information is a service type, searching a target service type matched with the service type, and determining the at least one micro service based on the target service type; and matching the target micro service according to the third identity information when the target information is the third identity information of the target micro service. Two modes capable of being used for determining the target micro-service are provided, in a specific application scene, the target micro-service can be determined according to the information content corresponding to the target information, and multiple calling choices are provided for developers.
Optionally, the determining a target microservice from the at least one microservice based on the communication protocol used by the at least one microservice includes: and when the communication protocols respectively corresponding to the at least one micro service are consistent with the communication protocol of the system requesting to call the target micro service, taking the micro service with the consistent communication protocol as the target micro service. Therefore, the target micro-service capable of being directly called can be determined, and the developer can call the target micro-service to complete the development work of the system.
Optionally, the determining, based on a communication protocol used by the at least one microservice, the target microservice from the at least one microservice and completing a call operation includes: and when the communication protocols respectively corresponding to the at least one micro service do not exist and are consistent with the communication protocol of the system requesting to call the target micro service, selecting the micro service with the latest version from the at least one micro service, converting the communication protocol of the system where the micro service is located into the communication protocol of the system calling the target micro service, and finishing the calling operation. Thus, even if the communication protocol of the target micro-service requested to be called is not consistent with the communication protocol used by the system requesting to call the target micro-service, the target micro-service can be called, and the development work of the system can be completed.
Optionally, the service directory is constructed in advance based on the following steps: respectively acquiring micro-service information of at least one micro-service in each system; the micro service information comprises first identity information of a providing system where the micro service is located, second identity information of a calling system applying for calling the micro service, third identity information corresponding to the micro service and a service type corresponding to the micro service; and establishing an association relation among the first identity information, the second identity information, the third identity information and the service type according to an affiliation relation between the micro service and the providing system and a calling relation between the micro service and the calling system to obtain the service directory. Therefore, no matter the target information is the third identity information or the service type, other information can be searched through the established association relation, and the target micro service is determined.
Optionally, the method for invoking a microservice further includes: when a viewing request for viewing the called condition of the micro service is received, second identity information related to third identity information is searched according to the third identity information corresponding to the micro service to be viewed; determining a calling system applying for calling the checked microservice according to the second identity information; and when the calling system applying for calling the viewed micro-service completes the data interaction operation with the viewed micro-service, determining that the called condition of the viewed micro-service is successful calling. Therefore, developers can conveniently check the calling condition of the micro-service, and can master the calling condition in real time to manage the micro-service.
Optionally, the determining the target microservice and completing a call operation includes: and when receiving the update information of the providing system to the target micro service, updating the target micro service according to the update information, and completing calling operation by using the target micro service after the update operation is completed. Thus, the target micro-service can be updated, and all the target micro-services called by the developers are the latest target micro-services.
In a second aspect, an embodiment of the present application provides an apparatus for invoking a microservice, where the apparatus includes: the receiving module is used for receiving a calling request for calling the target micro service; the calling request carries target information corresponding to the target micro-service; the searching module is used for searching at least one micro service matched with the target information in the constructed service directory; and the calling module is used for determining the target microservice from the at least one microservice based on the communication protocol used by the at least one microservice and finishing calling operation.
In a third aspect, an embodiment of the present application provides an electronic device, including a processor and a memory, where the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the steps in the method as provided in the first aspect are executed.
In a fourth aspect, embodiments of the present application provide a readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, performs the steps in the method as provided in the first aspect.
Additional features and advantages of the present application will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the embodiments of the present application. The objectives and other advantages of the application may be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and that those skilled in the art can also obtain other related drawings based on the drawings without inventive efforts.
FIG. 1 is a flowchart of a method for invoking micro-services according to an embodiment of the present disclosure;
FIG. 2 is a block diagram illustrating an apparatus for invoking microservices according to an embodiment of the present disclosure;
fig. 3 is a schematic structural diagram of an electronic device for executing a method for invoking a microservice according to an embodiment of the present disclosure.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application.
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present application without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only for distinguishing the description, and are not to be construed as indicating or implying relative importance.
It should be noted that, in the present application, embodiments or technical features in the embodiments may be combined without conflict.
In the related art, the problem that micro-services in other systems cannot be conveniently called exists; in order to solve the problem, the application provides a method, a device, an electronic device and a readable storage medium for calling a micro service; further, the method can maintain information such as communication protocols, use requirements, update conditions and the like of a plurality of micro services in the service directory by constructing the service directory in advance, can search relevant information of the target micro service in the constructed service directory when receiving a query request of the target micro service, and can complete calling operation of the target micro service according to needs, thereby solving the technical problem. In practice, the method for invoking the micro service may be applied to a server or a terminal device. Illustratively, the present application specifically describes the method for invoking the microservice by taking the application to the server as an example.
The above solutions in the related art are all the results of practical and careful study of the inventor, and therefore, the discovery process of the above problems and the solutions proposed by the following embodiments of the present invention to the above problems should be the contribution of the inventor to the present invention in the course of the present invention.
Referring to fig. 1, a flowchart of a method for invoking a microservice according to an embodiment of the present application is shown. As shown in fig. 1, the method for invoking a microservice may be applied to a server, and specifically may include the following steps 101 to 103.
Step 101, receiving a calling request for calling a target micro service; the calling request carries target information corresponding to the target micro-service;
in some application scenarios, a user may send a call request through a terminal device corresponding to the user, and a server may receive the call request sent by the terminal device. The call request may include target information corresponding to a target micro service to be called. In these application scenarios, the target information may include information that substantially indicates the identity of the target microservice, such as the domain to which the target microservice belongs, the usage, the identity code, and the like.
Step 102, searching at least one micro service matched with the target information in the constructed service directory;
after receiving the call request, the server may search for the corresponding at least one microservice according to the target information. For example, after receiving target information indicating a purpose of a target microservice, the server may look up all microservices having the purpose in the constructed service directory. For example, when the call request carries target information representing that the purpose is "management", micro-services such as authority management and log management can be found.
Step 103, determining the target microservice from the at least one microservice based on the communication protocol used by the at least one microservice, and completing the calling operation.
In some application scenarios, each microservice may transmit data via its corresponding communication protocol. After the server determines a plurality of micro services matched with the target information, the communication protocol used by each micro service can be further determined.
In these application scenarios, for example, a target communication protocol used by the system requesting invocation of the target microservice may be determined. In this way, the microservices that also used the target communication protocol can be determined. The microservice may then be determined to make the call to the target microservice.
In this embodiment, through the steps 101 to 103, developers can call target micro services required by themselves conveniently without developing themselves, thereby reducing development pressure.
In some optional implementations, the searching for at least one microservice matching the target information in step 102 may include the following sub-steps:
substep 1021, when the target information is a service type, searching a target service type matched with the service type, and determining the at least one micro service based on the target service type;
in some application scenarios, if the target information is detected as a service category, a target service category matching the service category may be searched. For example, if the target information is detected to be a service type capable of realizing logistics operation, a logistics type matched with the target information can be found, and a plurality of micro services belonging to the logistics type, such as code scanning and sending, courier checking and the like, can be determined based on the logistics type. In these application scenarios, for example, one of the plurality of micro services may be selected as a target micro service for invocation according to the selection operation.
And a substep 1022, when the target information is third identity information of the target micro service, matching the target micro service according to the third identity information.
In some application scenarios, if it is detected that the target information is third identity information of the target micro service, the corresponding target micro service may be determined according to the third identity information. The third identity information may include, for example, an identity identification code, an identity number, and other information that can be used to substantially uniquely characterize the identity of the target microservice. For example, when the target information is detected to be the third identity information "01", the corresponding "user management" microservice may be matched according to "01".
The substep 1021 and the substep 1022 respectively provide a manner capable of determining a target microservice, and in a specific application scenario, the target microservice can be determined according to information content corresponding to target information, so that multiple calling options are provided for developers (that is, the developers can make the target information carried by a calling request be service type or third identity information of the target microservice, and can complete calling operation).
In some optional implementations, the determining, in the step 103, the target microservice from the at least one microservice based on the communication protocol used by the at least one microservice includes: and when the communication protocols respectively corresponding to the at least one micro service are consistent with the communication protocol of the system requesting to call the target micro service, taking the micro service with the consistent communication protocol as the target micro service.
After the server side finds the multiple micro services, whether the communication protocols corresponding to the found multiple micro services are consistent with the communication protocol of the system requesting to call the target micro service or not can be judged, and if so, the micro services with the consistent communication protocols can be determined as the target micro service. For example, when the communication protocol of the system requesting to invoke the target microservice is the transmission control protocol (TCP protocol for short), if the microservice a using the TCP protocol exists in the found microservices, the microservice a may be determined as the target microservice. After the target microservice is determined, a call operation may be performed.
Therefore, the target micro-service capable of being directly called can be determined, and the developer can call the target micro-service to complete the development work of the system.
In some application scenarios, if there are multiple micro services with the same communication protocol, all of the multiple micro services may be determined as target micro services. Further, the developer may select one or more of the plurality of microservices for invocation as desired.
In some optional implementations, the determining, based on a communication protocol used by the at least one microservice, the target microservice from the at least one microservice, and completing a call operation includes: and when the communication protocols respectively corresponding to the at least one micro service do not exist and are consistent with the communication protocol of the system requesting to call the target micro service, selecting the micro service with the latest version from the at least one micro service, converting the communication protocol of the system where the micro service is located into the communication protocol of the system calling the target micro service, and finishing the calling operation.
In some application scenarios, after finding a plurality of micro services, if it is detected that the communication protocols used by the micro services are all inconsistent with the communication protocol used by the system requesting to invoke the target micro service, the server may determine the found micro service with the latest version among the micro services as the target micro service, and convert the communication protocol used by the micro service with the latest version into a communication protocol consistent with the communication protocol of the system requesting to invoke the target micro service, so as to implement the invoking operation. In these application scenarios, the technology for converting the communication protocol (e.g., using a protocol converter) is well known to those skilled in the art, and is not described herein.
Thus, even if the communication protocol of the target micro-service requested to be called is not consistent with the communication protocol used by the system requesting to call the target micro-service, the target micro-service can be called, and the development work of the system can be completed.
In some optional implementations, the service directory is constructed in advance based on the following steps:
step 1, respectively acquiring micro-service information of at least one micro-service in each system; the micro service information comprises first identity information of a providing system where the micro service is located, second identity information of a calling system applying for calling the micro service, third identity information corresponding to the micro service and a service type corresponding to the micro service;
the first identity information may include, for example, information such as an identification code, an identity number, and the like, which is substantially used to uniquely characterize the identity of the providing system; the second identity information may include, for example, information such as an identity code, an identity number, and the like, which is substantially used to uniquely characterize the identity of the calling system.
When the service directory is constructed, the first identity information and the second identity information can use the same identification mode, so that the service directory can maintain the identity information uniformly. That is, the corresponding identities may each be characterized by an identity code or an identity number.
In some application scenarios, the service side may pre-construct a service directory. When the server is constructed, the server can acquire information of a plurality of systems. Specifically, for each micro service, micro service information of the micro service may be acquired. In these application scenarios, at least the first identity information of the providing system for developing the micro service, the second identity information of the calling system for applying for calling the micro service, the third identity information corresponding to the micro service, and the service type may be obtained.
And 2, establishing association relations among the first identity information, the second identity information, the third identity information and the service types according to the affiliation relation between the micro service and the providing system and the calling relation between the micro service and the calling system to obtain the service directory.
After acquiring the micro-service information of each micro-service, a service directory can be constructed according to the affiliation between the micro-service and the providing system and the calling relationship between the micro-service and the calling system. Specifically, the first identity information of the providing system, the third identity information corresponding to the micro service and the service type can be stored in an associated manner according to the affiliation; storing the second identity information of the calling system, third identity information corresponding to the micro service and the service type in an associated manner according to the calling relation;
therefore, no matter the target information is the third identity information or the service type, other information can be searched through the established association relation, and the target micro service is determined.
In some optional implementations, the method of invoking a microservice may further include the steps of:
104, when a checking request for checking the called condition of the micro service is received, searching second identity information associated with third identity information according to the third identity information corresponding to the checked micro service;
in some application scenarios, the server may receive a viewing request for requesting to view a condition that the micro service is invoked, and when receiving the viewing request, may determine third identity information of the viewed micro service. Further, according to the determined third identity information, second identity information associated with the third identity information can be determined according to the association relation stored in the service directory.
Step 105, determining a calling system applying for calling the checked microservice according to the second identity information;
after the second identity information is determined, a calling system corresponding to the second identity information can be determined. For example, the second identity information is "02", and it can be determined that the system corresponding to "02" is the a system, and the a system is a calling system that applies for calling the viewed microservice.
And 106, when the calling system applying for calling the viewed micro-service completes the data interaction operation with the viewed micro-service, determining that the called condition of the viewed micro-service is successfully called.
After the calling system is determined, it may be determined whether the calling system completes the data interaction operation with the viewed microservice, and if so, it may be determined that the viewed microservice is successfully called by the calling system. The data interaction operation may include, for example, an operation capable of actually generating interaction data. For example, after system A calls viewed microservice a, if viewed microservice a produces data in cooperation with other microservices in system A, it may be considered that the data interaction operation is completed.
Through the steps 104 to 106, developers can conveniently check the calling condition of the micro-service, so that the developers can master the calling condition in real time to manage the micro-service.
In some optional implementations, the determining of the target microservice in step 103 and completing a call operation include: and when receiving the update information of the providing system to the target micro service, updating the target micro service according to the update information, and completing calling operation by using the target micro service after the update operation is completed.
In some application scenarios, the server may update the target microservice. Specifically, the server may update the target microservice according to the update information when receiving the update information of the providing system to the target microservice. For example, when update information for replacing interface B of the target micro service with interface C transmitted by the provisioning system is received, an update operation for updating current interface B of the target micro service with interface C may be performed.
When the update operation is completed, the updated target microservice may be called to complete the call operation. Thus, the target micro-service can be updated, and all the target micro-services called by the developers are the latest target micro-services.
In other application scenarios, after the calling system completes the calling, the calling system may send feedback information indicating whether the calling is successful to the server, and the server may store the calling condition information of the target microservice according to the feedback information. For example, when receiving the update information sent by the calling system that the target microservice has been put into actual use (e.g., the data interaction operation has been completed), the calling situation information of the target microservice may be updated, so that the developer knows the actual calling situation of the target microservice.
Referring to fig. 2, a block diagram of an apparatus for invoking a micro-service according to an embodiment of the present application is shown, where the apparatus for invoking the micro-service may be a module, a program segment, or code on an electronic device. It should be understood that the apparatus corresponds to the above-mentioned embodiment of the method of fig. 1, and can perform various steps related to the embodiment of the method of fig. 1, and the specific functions of the apparatus can be referred to the description above, and the detailed description is appropriately omitted here to avoid redundancy.
Optionally, the apparatus for invoking a microservice includes a receiving module 201, a searching module 202, and an invoking module 203. The receiving module 201 is configured to receive a call request for calling a target microservice; the calling request carries target information corresponding to the target micro-service; a searching module 202, configured to search at least one microservice matching the target information in the constructed service directory; the invoking module 203 is configured to determine the target microservice from the at least one microservice based on a communication protocol used by the at least one microservice, and complete an invoking operation.
Optionally, the lookup module 202 is further configured to: when the target information is a service type, searching a target service type matched with the service type, and determining the at least one micro service based on the target service type; and matching the target micro service according to the third identity information when the target information is the third identity information of the target micro service.
Optionally, the invoking module 203 is further configured to: and when the communication protocols respectively corresponding to the at least one micro service are consistent with the communication protocol of the system requesting to call the target micro service, taking the micro service with the consistent communication protocol as the target micro service.
Optionally, the invoking module 203 is further configured to: and when the communication protocols respectively corresponding to the at least one micro service do not exist and are consistent with the communication protocol of the system requesting to call the target micro service, selecting the micro service with the latest version from the at least one micro service, converting the communication protocol of the system where the micro service is located into the communication protocol of the system calling the target micro service, and finishing the calling operation.
Optionally, the service directory is constructed in advance based on the following steps: respectively acquiring micro-service information of at least one micro-service in each system; the micro service information comprises first identity information of a providing system where the micro service is located, second identity information of a calling system applying for calling the micro service, third identity information corresponding to the micro service and a service type corresponding to the micro service; and establishing an association relation among the first identity information, the second identity information, the third identity information and the service type according to an affiliation relation between the micro service and the providing system and a calling relation between the micro service and the calling system to obtain the service directory.
Optionally, the apparatus for invoking a microservice further includes a determining module, where the determining module is configured to: when a viewing request for viewing the called condition of the micro service is received, second identity information related to third identity information is searched according to the third identity information corresponding to the micro service to be viewed; determining a calling system applying for calling the checked microservice according to the second identity information; and when the calling system applying for calling the viewed micro-service completes the data interaction operation with the viewed micro-service, determining that the called condition of the viewed micro-service is successful calling.
Optionally, the invoking module 203 is further configured to: and when receiving the update information of the providing system to the target micro service, updating the target micro service according to the update information, and completing calling operation by using the target micro service after the update operation is completed.
It should be noted that, for the convenience and brevity of description, the specific working procedure of the above-described apparatus may refer to the corresponding procedure in the foregoing method embodiment, and the description is not repeated herein.
Referring to fig. 3, fig. 3 is a schematic structural diagram of an electronic device for executing a method for invoking a microservice according to an embodiment of the present disclosure, where the electronic device may include: at least one processor 301, e.g., a CPU, at least one communication interface 302, at least one memory 303, and at least one communication bus 304. Wherein the communication bus 304 is used for realizing direct connection communication of the components. The communication interface 302 of the device in the embodiment of the present application is used for performing signaling or data communication with other node devices. The memory 303 may be a high-speed RAM memory or a non-volatile memory (e.g., at least one disk memory). The memory 303 may optionally be at least one memory device located remotely from the aforementioned processor. The memory 303 stores computer readable instructions, and when the computer readable instructions are executed by the processor 301, the electronic device may execute the method process shown in fig. 1.
It will be appreciated that the configuration shown in fig. 3 is merely illustrative and that the electronic device may include more or fewer components than shown in fig. 3 or may have a different configuration than shown in fig. 3. The components shown in fig. 3 may be implemented in hardware, software, or a combination thereof.
Embodiments of the present application provide a readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the computer program may perform the method processes performed by an electronic device in the method embodiment shown in fig. 1.
The present embodiment discloses a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, enable the computer to perform the method provided by the above-mentioned method embodiments, for example, the method may comprise: receiving a calling request for calling a target micro service; the calling request carries target information corresponding to the target micro-service; searching at least one micro service matched with the target information in the constructed service directory; and determining the target microservice from the at least one microservice based on the communication protocol used by the at least one microservice, and completing the calling operation.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
In addition, units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
Furthermore, the functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
In this document, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions.
The above description is only an example of the present application and is not intended to limit the scope of the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (10)

1. A method of invoking a microservice, the method comprising:
receiving a calling request for calling a target micro service; the calling request carries target information corresponding to the target micro-service;
searching at least one micro service matched with the target information in the constructed service directory;
and determining the target microservice from the at least one microservice based on the communication protocol used by the at least one microservice, and completing the calling operation.
2. The method of claim 1, wherein the searching for at least one microservice matching the target information comprises:
when the target information is a service type, searching a target service type matched with the service type, and determining the at least one micro service based on the target service type;
and matching the target micro service according to the third identity information when the target information is the third identity information of the target micro service.
3. The method of claim 1, wherein the determining the target microservice from the at least one microservice based on the communication protocol used by the at least one microservice comprises:
and when the communication protocols respectively corresponding to the at least one micro service are consistent with the communication protocol of the system requesting to call the target micro service, taking the micro service with the consistent communication protocol as the target micro service.
4. The method of claim 1, wherein the determining the target microservice from the at least one microservice based on the communication protocol used by the at least one microservice and completing the invoking comprises:
and when the communication protocols respectively corresponding to the at least one micro service do not exist and are consistent with the communication protocol of the system requesting to call the target micro service, selecting the micro service with the latest version from the at least one micro service, converting the communication protocol of the system where the micro service is located into the communication protocol of the system calling the target micro service, and finishing the calling operation.
5. The method according to claim 1, characterized in that said service directory is constructed beforehand based on the following steps:
respectively acquiring micro-service information of at least one micro-service in each system; the micro service information comprises first identity information of a providing system where the micro service is located, second identity information of a calling system applying for calling the micro service, third identity information corresponding to the micro service and a service type corresponding to the micro service;
and establishing an association relation among the first identity information, the second identity information, the third identity information and the service type according to an affiliation relation between the micro service and the providing system and a calling relation between the micro service and the calling system to obtain the service directory.
6. The method of claim 5, further comprising:
when a viewing request for viewing the called condition of the micro service is received, second identity information related to third identity information is searched according to the third identity information corresponding to the micro service to be viewed;
determining a calling system applying for calling the checked microservice according to the second identity information;
and when the calling system applying for calling the viewed micro-service completes the data interaction operation with the viewed micro-service, determining that the called condition of the viewed micro-service is successful calling.
7. The method of claim 5, wherein said determining the target microservice and completing the invocation comprises:
and when receiving the update information of the providing system to the target micro service, updating the target micro service according to the update information, and completing calling operation by using the target micro service after the update operation is completed.
8. An apparatus for invoking microservices, the apparatus comprising:
the receiving module is used for receiving a calling request for calling the target micro service; the calling request carries target information corresponding to the target micro-service;
the searching module is used for searching at least one micro service matched with the target information in the constructed service directory;
and the calling module is used for determining the target microservice from the at least one microservice based on the communication protocol used by the at least one microservice and finishing calling operation.
9. An electronic device comprising a processor and a memory, the memory storing computer readable instructions that, when executed by the processor, perform the method of any of claims 1-7.
10. A readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-7.
CN202111021304.2A 2021-09-01 2021-09-01 Method and device for calling microservice, electronic equipment and readable storage medium Active CN113691635B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111021304.2A CN113691635B (en) 2021-09-01 2021-09-01 Method and device for calling microservice, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111021304.2A CN113691635B (en) 2021-09-01 2021-09-01 Method and device for calling microservice, electronic equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN113691635A true CN113691635A (en) 2021-11-23
CN113691635B CN113691635B (en) 2022-08-19

Family

ID=78584791

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111021304.2A Active CN113691635B (en) 2021-09-01 2021-09-01 Method and device for calling microservice, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN113691635B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114942856A (en) * 2022-07-22 2022-08-26 浙江中控技术股份有限公司 Data processing method and device of micro-service system and electronic equipment
CN115086048A (en) * 2022-06-20 2022-09-20 中电金信软件有限公司 Data processing method and device, electronic equipment and readable storage medium
CN115580648A (en) * 2022-09-30 2023-01-06 北京大数据先进技术研究院 Data fusion system design method, system, electronic device and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109246251A (en) * 2018-11-13 2019-01-18 杭州数梦工场科技有限公司 A kind of micro services call method, device, system, equipment and readable storage medium storing program for executing
US20190104184A1 (en) * 2017-09-29 2019-04-04 Siemens Aktiengesellschaft Information processing method, apparatus, and system
CN111767095A (en) * 2020-06-30 2020-10-13 平安国际智慧城市科技股份有限公司 Micro-service generation method and device, terminal equipment and storage medium
CN112214334A (en) * 2020-09-28 2021-01-12 亚信科技(中国)有限公司 Micro-service calling method and device, electronic equipment and computer-readable storage medium
CN112491948A (en) * 2020-10-12 2021-03-12 大家信科有限责任公司 Non-invasive monomer application micro-service method and device and computer equipment
CN112612595A (en) * 2020-12-29 2021-04-06 太平金融科技服务(上海)有限公司 Method and device for establishing micro-service calling relationship, computer equipment and storage medium
CN113301166A (en) * 2021-06-16 2021-08-24 杭州华橙软件技术有限公司 Service calling method and device, storage medium and electronic device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190104184A1 (en) * 2017-09-29 2019-04-04 Siemens Aktiengesellschaft Information processing method, apparatus, and system
CN109246251A (en) * 2018-11-13 2019-01-18 杭州数梦工场科技有限公司 A kind of micro services call method, device, system, equipment and readable storage medium storing program for executing
CN111767095A (en) * 2020-06-30 2020-10-13 平安国际智慧城市科技股份有限公司 Micro-service generation method and device, terminal equipment and storage medium
CN112214334A (en) * 2020-09-28 2021-01-12 亚信科技(中国)有限公司 Micro-service calling method and device, electronic equipment and computer-readable storage medium
CN112491948A (en) * 2020-10-12 2021-03-12 大家信科有限责任公司 Non-invasive monomer application micro-service method and device and computer equipment
CN112612595A (en) * 2020-12-29 2021-04-06 太平金融科技服务(上海)有限公司 Method and device for establishing micro-service calling relationship, computer equipment and storage medium
CN113301166A (en) * 2021-06-16 2021-08-24 杭州华橙软件技术有限公司 Service calling method and device, storage medium and electronic device

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115086048A (en) * 2022-06-20 2022-09-20 中电金信软件有限公司 Data processing method and device, electronic equipment and readable storage medium
CN115086048B (en) * 2022-06-20 2023-12-15 中电金信软件有限公司 Data processing method, device, electronic equipment and readable storage medium
CN114942856A (en) * 2022-07-22 2022-08-26 浙江中控技术股份有限公司 Data processing method and device of micro-service system and electronic equipment
CN115580648A (en) * 2022-09-30 2023-01-06 北京大数据先进技术研究院 Data fusion system design method, system, electronic device and storage medium

Also Published As

Publication number Publication date
CN113691635B (en) 2022-08-19

Similar Documents

Publication Publication Date Title
CN113691635B (en) Method and device for calling microservice, electronic equipment and readable storage medium
CN109558748B (en) Data processing method and device, electronic equipment and storage medium
CN108984388B (en) Method and terminal equipment for generating automatic test case
CN110311983B (en) Service request processing method, device and system, electronic equipment and storage medium
CN110119292B (en) System operation parameter query method, matching method, device and node equipment
CN108846753B (en) Method and apparatus for processing data
CN112422709B (en) Identification management method, terminal equipment, identification analysis secondary node and medium
CN110557433A (en) Resource management method, platform, cloud gateway, system and storage medium
CN113868295A (en) Data query method and device and multi-party security database
CN111858083A (en) Remote service calling method and device, electronic equipment and storage medium
CN117119078A (en) Privacy task scheduling method and device based on Kubernetes cluster interconnection scheduling framework
CN110798358B (en) Distributed service identification method and device, computer readable medium and electronic equipment
CN111327680B (en) Authentication data synchronization method, device, system, computer equipment and storage medium
CN115390939B (en) Service processing method and system
US20210006639A1 (en) Data acquisition method, service provider, service consumer and network functional entity
CN114221971B (en) Data synchronization method, device, server, storage medium and product
CN113434190B (en) Data processing method and device, storage medium and electronic equipment
CN115277707A (en) Service processing method, device, electronic equipment and storage medium
CN114760357A (en) Request processing method and device, computer equipment and storage medium
CN112766486A (en) Searching method of neural network structure, terminal, server and readable storage medium
CN111711639A (en) Terminal, data transmission method, system, and computer-readable storage medium
US7100171B1 (en) System and method for auto-evolvable remote procedure call structures
CN117472617B (en) Message processing method and device, electronic equipment and readable storage medium
CN115604345B (en) Development method of application program and computer readable storage medium
CN117632445B (en) Request processing method and device, task execution method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant