CN111176761A - Micro-service calling method and device - Google Patents

Micro-service calling method and device Download PDF

Info

Publication number
CN111176761A
CN111176761A CN201911341055.8A CN201911341055A CN111176761A CN 111176761 A CN111176761 A CN 111176761A CN 201911341055 A CN201911341055 A CN 201911341055A CN 111176761 A CN111176761 A CN 111176761A
Authority
CN
China
Prior art keywords
calling
service
client
micro
application
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
CN201911341055.8A
Other languages
Chinese (zh)
Other versions
CN111176761B (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.)
China United Network Communications Group Co Ltd
Original Assignee
China United Network Communications Group 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 China United Network Communications Group Co Ltd filed Critical China United Network Communications Group Co Ltd
Priority to CN201911341055.8A priority Critical patent/CN111176761B/en
Publication of CN111176761A publication Critical patent/CN111176761A/en
Application granted granted Critical
Publication of CN111176761B publication Critical patent/CN111176761B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/4482Procedural
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The embodiment of the invention provides a micro-service calling method and a micro-service calling device, relates to the field of computer software, and is used for calling a certain service of an application program in an application server according to a calling entrance so as to provide micro-service for a client. The method comprises the following steps: the application server receives a data request from a client; the data request comprises a first calling inlet, and the first calling inlet is used for indicating one service in a plurality of services provided by the application program called by the client; the application server runs the target service called by the first calling entrance to obtain response data; the target service is a calling service corresponding to the first calling inlet; the application server returns a response request to the client; the response request includes response data. The invention is used for calling the micro-service.

Description

Micro-service calling method and device
Technical Field
The invention relates to the field of computer software, in particular to a micro-service calling method and device.
Background
The single application is an application program which packs all functions in an independent unit, and when the size of the application program is small and related functions are few, the program development can be carried out according to the single application architecture, so that the development efficiency is effectively improved, and the deployment, the operation and the maintenance are convenient. As the business scale increases, the expandability and the sustainable delivery capability of the application implemented by the single application architecture deteriorate, the failure of any module in the application may cause the crash of the whole software system, and the overload of any module may affect the stability of the whole application. In addition, for some single applications with smaller volume, the single application may not meet the processing requirement for increasing data volume as the traffic data volume increases.
The micro-service is a small service formed by a single application program, different micro-services can interact through Application Programming Interfaces (APIs), and different micro-services work in different processes, thereby avoiding the problems. At present, when a single application is converted into a micro-service, developers need to carry out a large amount of development work according to program codes of the single application, and the workload is huge.
Disclosure of Invention
The embodiment of the invention provides a micro-service calling method and a micro-service calling device, which are used for calling a certain service of an application program in an application server according to a calling entrance and providing micro-services for a client.
In order to achieve the above purpose, the embodiment of the invention adopts the following technical scheme:
in a first aspect, a method for invoking a micro-service is provided, including: the application server receives a data request from a client; the data request comprises a first calling inlet, and the first calling inlet is used for indicating one service in a plurality of services provided by the application program called by the client; the application server runs the target service called by the first calling entrance to obtain response data; the target service is a calling service corresponding to the first calling inlet; the application server returns a response request to the client; the response request includes response data.
In a second aspect, a micro-service invocation apparatus is provided, which includes: a receiving module for receiving a data request from a client; the data request comprises a first calling inlet, and the first calling inlet is used for indicating one service in a plurality of services provided by the application program called by the client; the calling module is used for running the target service called by the first calling inlet received by the receiving module and acquiring response data; the target service is a calling service corresponding to the first calling inlet; the sending module is used for returning the response request obtained by the calling module to the client; the response request includes response data.
In a third aspect, an apparatus for invoking a micro-service is provided, including: a memory, a processor, a bus, and a communication interface; the memory is used for storing computer execution instructions, and the processor is connected with the memory through a bus; when the micro-service invocation device is running, the processor executes computer execution instructions stored by the memory to cause the micro-service invocation device to perform the micro-service invocation method as provided by the first aspect.
In a fourth aspect, a computer-readable storage medium is provided, comprising: the computer executes instructions that, when executed on a computer, cause the computer to perform the microservice invocation method as provided by the first aspect.
The embodiment of the invention provides a method and a device for calling micro-services, wherein the method comprises the following steps: the application server receives a data request from a client; the data request comprises a first calling inlet, and the first calling inlet is used for indicating one service in a plurality of services provided by the application program called by the client; the application server runs the target service called by the first calling entrance to obtain response data; the target service is a calling service corresponding to the first calling inlet; the application server returns a response request to the client; the response request includes response data. The micro-service calling method provided by the embodiment of the invention calls the corresponding target service in the application program in the application server through the first calling entrance in the data request, realizes that different services are provided according to different client requests according to different services of the application program called by the first calling entrance, namely realizes the process of providing micro-service for the client through configuring different calling entrances, and is convenient for realizing the micro-service. Compared with the prior art, the micro-service implementation method provided by the embodiment of the invention is relatively simple, only development work is needed to be carried out on the basis of the existing single application, the workload of micro-service development is reduced, and coding errors caused by huge workload can be avoided.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic diagram of a single application according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a micro service architecture according to an embodiment of the present invention;
fig. 3 is a first flowchart illustrating a method for invoking a micro service according to an embodiment of the present invention;
fig. 4 is a schematic flowchart of a remote client invocation service according to an embodiment of the present invention;
fig. 5 is a second flowchart illustrating a method for invoking a micro service according to an embodiment of the present invention;
fig. 6 is a schematic flowchart of an application server responding to a client data request according to an embodiment of the present invention;
fig. 7 is a schematic flowchart of an application deployment process performed by an application server according to an embodiment of the present invention;
fig. 8 is a first schematic structural diagram of a microservice calling apparatus according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of a microservice calling apparatus according to an embodiment of the present invention;
fig. 10 is a schematic structural diagram of a microservice calling apparatus according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that, in the embodiments of the present invention, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "e.g.," an embodiment of the present invention is not necessarily to be construed as preferred or advantageous over other embodiments or designs. Rather, use of the word "exemplary" or "such as" is intended to present concepts related in a concrete fashion.
It should be noted that, in the embodiments of the present invention, "of", "corresponding" and "corresponding" may be sometimes used in combination, and it should be noted that, when the difference is not emphasized, the intended meaning is consistent.
For the convenience of clearly describing the technical solutions of the embodiments of the present invention, in the embodiments of the present invention, the words "first", "second", and the like are used for distinguishing the same items or similar items with basically the same functions and actions, and those skilled in the art can understand that the words "first", "second", and the like are not limited in number or execution order.
A monolithic application is an application that packages all functions in a single unit, with all functional modules in a single process. Microservices are developed as a stand-alone application system in the form of a set of small services, each of which runs as a separate process.
Referring to fig. 1, an embodiment of the present invention provides an architecture diagram of a monolithic application, including a user interface and multiple functions, where the user interface is an integral design of human-computer interaction, operation logic, and interface beauty for the monolithic application; the function of the single application can be realized by a plurality of functional modules, for example, the module 1 realizes the function 1, the module 2 realizes the function 2, and the module N realizes the function N; the individual functional modules of the individual applications are data-supported by a common database.
Referring to fig. 2, an embodiment of the present invention further provides a structural diagram of a microservice. Unlike the single application architecture, each service in the micro service architecture is supported by a separate database, for example, the service provided by micro service 1 is supported by the database 1, the service provided by micro service 2 is supported by the database 2, and the service provided by micro service N is supported by the database N. Different microservices can communicate with each other through an API, and the API between microservices is designed based on the architectural style of presentation state transfer (REST), i.e., the REST API in fig. 2.
All functions of the single application are realized by one database, so that the service expansion capability of the single application is poor, and the micro-service uses different databases, so that the maintenance and expansion of the single micro-service are convenient on the basis of the original micro-service. Therefore, the construction of large-scale application projects at present generally uses a micro-service architecture to improve the quality of service and reduce the operation and maintenance cost. However, for the developed single application, the micro-service converted from the single application also needs to perform a large amount of development work according to the code of the single application, and the operation is complex and is prone to errors.
With reference to the single application architecture shown in fig. 1 and the micro service architecture shown in fig. 2, an embodiment of the present invention provides a micro service invoking method, which, as shown in fig. 3, includes:
101. the application server receives a data request from a client.
The data request comprises a first calling inlet, and the first calling inlet is used for indicating one service in a plurality of services provided by the application program called by the client.
Specifically, in the embodiment of the present application, the receiving, by the application server, the data request sent by the client may be implemented by Remote Procedure Call (RPC), which refers to a process shown in fig. 4 for remotely calling the application service in the application server for the client. The process of sending the data request to the application server by the client can comprise calling service and serialization, wherein the calling service is realized by writing a first calling entry in the data request, and meanwhile, the data request also comprises request parameters; the serialization refers to the serialization processing of the data request of the client, so that the client can conveniently realize the transmission to the application server through the network service, and the identification of the network service to the transmission data is convenient. Correspondingly, the process of receiving the data request by the application service comprises deserialization and service calling, wherein the deserialization is used for carrying out reverse operation on the serialized data request of the client to obtain a request parameter of the client and a first calling inlet; the service call is used for calling the service locally provided by the application server according to the first call entrance. The first call entry is only used to call a certain service in the application server, and the client stub and the server stub can be used for serialization and deserialization of data.
For example, if the application server includes a shopping application, the service provided by the application may include user information, commodity purchasing information, commodity inventory information, commodity recommendation information, and the like, and the first invocation entry may be used to instruct to invoke some service of the user information, the commodity information, or other services. And if the first calling entrance is used for calling the commodity information service, the application server operates the commodity information service according to the first calling entrance in the data request after receiving the data request, and the commodity information service responds to the data request.
It should be noted that the serialization refers to a process of converting a code of a data request into a byte sequence, the deserialization refers to a process of recovering the byte sequence into a code of the data request, the byte sequence is convenient for network transmission, and the serialization and deserialization of the data request can be realized by Protocol Buffers. The application program in the application server may be a monolithic application, and different from a monolithic application architecture, the method for calling the micro-service provided by the embodiment of the present application is based on a service of the monolithic application, and defines a plurality of call entries for the monolithic application, and the call entries are respectively used for calling different services in the monolithic application to implement a micro-service function. The data request sent by the client to the application server further includes an Internet Protocol (IP) address of the application server and a service port of the application program, and the data request is transmitted through a socket, for example, 192.168.0.0: 80, wherein 192.168.0.0 represents the IP address of the application server, and 80 represents the application server transmitting data through the 80 port.
The data request sent by the client may be implemented in a GET mode or a POST mode of a hypertext transfer protocol (HTTP), where the GET mode is used to request to obtain data of the application server, and the POST mode is used to request the application server to create corresponding data.
102. And the application server operates the target service called by the first calling entrance to obtain response data.
And the target service is the calling service corresponding to the first calling entry.
Optionally, referring to fig. 5, step 102 specifically includes:
1021. a second call entry is determined among the call entries configured by the application.
And the second call entry calls the same service as the first call entry.
Specifically, when the application program is deployed, the application server configures at least one call entry for the application program, and each call entry can call one service in the application program. After receiving the data request, the application server analyzes the data request to obtain a first call entry and a request parameter, and queries a call entry which is the same as the first call entry in the call entries configured by the application program, namely, determines a second call entry in the call entries, wherein the service called by the second call entry is the service called by the client request.
Illustratively, if the application program in the application server is a mathematical computation application, the computation functions of adding, subtracting, multiplying, dividing and the like are included. When the application program is deployed by the application server, a plurality of call entries are configured, and the call entries can respectively call any one operation service of algorithms such as addition operation, subtraction operation or multiplication operation. When the client calls the addition operation, a first call entry is defined in the data request, and the first call entry is used for calling the addition operation. The application server receives the data request, and determines a call entry which is the same as the first call entry in the call entries, namely determines a call entry for calling addition operation in the call entries.
It should be noted that, after the application server completes the deployment of the application program, both the client and the application server generate a service registry, the service registry includes a corresponding relationship between the service and the call entry, the service registry of the client is the same as the service registry of the application server, and the client can determine the call entry for calling the service through the service registry.
1022. And running the service called by the second calling entrance to obtain response data.
Specifically, the data request further includes a request parameter, where the request parameter may be an input of each service in the application program, and different services have different inputs.
Illustratively, if the first call entry is used for calling addition operation, and the request parameters are 2 and 3, the application server calls the addition operation corresponding to the second call entry after determining the second call entry. The add service operates to obtain response data of 5 based on the request parameters.
103. The application server returns a response request to the client.
Wherein the response request includes response data.
Specifically, referring to fig. 6, after obtaining the response data, the application server performs serialization processing on the response data to obtain a response request, and returns the response request to the client, and the client performs deserialization processing on the serialized response request to obtain the response data.
It should be noted that the response request returned by the application server further includes a response status code, and the response status code may be included in the HTTP message, for example, the response status code is 200OK, which indicates that the data request is successfully processed; the response status code is 404, indicating that the service has been deleted; those skilled in the art can perform setting when deploying the application program according to the commonly used response status code, which is not described herein again.
Optionally, as shown in fig. 7, before step 101, the method further includes:
201. at least one call entry is configured for an application in the application server.
The application program is used for providing a plurality of services for the client, and the calling inlet is used for calling one service of the application program.
Specifically, the application program may be a monolithic application, and the application server may configure a call entry for the monolithic application to implement the call of the client to the microservice.
For example, if the application is a shopping application, the service provided by the application may include user information, commodity purchasing information, commodity inventory information, commodity recommendation information, and the like, and the application server may configure a call portal according to the services to call different services. For example, a first call entry may be used to call a user information service, a second call entry may be used to call a goods information service, a third call entry may be used to call goods shopping information, and so on. The application server may configure a call entry for the application program by using RPC, and the specific implementation process may be as follows:
Application1{
rpc method1(InputType1)
returns(OutputType1);
}。
among them, the Application1 may represent a micro-service name, the micro-service calls a service with a method name of method1 through RPC, the InputType1 represents an input parameter type, and the OutputType1 represents an output parameter type.
The application service configures an input parameter type and an output parameter type of a call entry while configuring the call entry, such as:
message InputType1{
repeated double length=1;
};
message OutputType1{
repeated int64 value=1;
}。
202. the application server configures dependencies for at least one service invoking the portal call.
Where the context required for running the service called for the call entry is relied upon.
Specifically, the running of the application needs support of some components, that is, the running of the application needs support depending on, such as a database required by each service in the application, computer programming software python, and Protocol Buffers for serialization and deserialization tools. Of course, because the dependencies required by different services may be different, different dependencies need to be configured for different services when configuring the dependencies.
Illustratively, configuring the dependency process for the service may be accomplished by defining a metadata file for the application, such as:
Figure BDA0002332272720000081
the dependence of service operation includes python and protobuf, and the dependence can be automatically installed through an installation tool pip when the application server installs the application program.
Optionally, the metadata file may further define an entry method for exposing the service to the outside and an input parameter type and an output parameter type of the entry method, such as:
"methodName1":{
"outputType":"OutType1",
"inputType":"InpuType1"
}。
203. and running the application program in the application server, and providing service for the client through the call entrance of the application program.
Specifically, the application program run by the application server is actually a call to the single application service, and the process of implementing the micro-service through the single application includes: and configuring a calling entrance for the single application, and configuring a route for the single application according to the configured calling entrance.
Further, configuring the call entry for the monolithic application may be implemented by defining a metadata file, which includes the call entry code illustrated in step 201 and the input parameter type and output parameter type codes of the call entry. And the application server loads the metadata file when running the application program, and is also provided with a route for routing the data request sent by the client to the corresponding service.
The application server may configure the route for the application program through a Uniform Resource Locator (URL), such as: http:// content/Application1, where content denotes the storage directory of the Application and Application1 denotes the method name of the invoked microservice, where Application1 may be used to invoke the Application1 service in the RPC implementation described above.
It should be noted that the above steps 201 and 202 can be implemented by configuring the interface definition file and the metadata file for the monolithic application. The metadata file may be, as in the examples above, including dependencies of service operations and dependent installation methods; the interface definition file includes the call entry described above and the types of input parameters and output parameters. When an application is configured to provide micro-services according to a monolithic application, the application is also configured with the host address and port number to provide the services, such as 192.168.0.0: 80, the application program provides service through an application server with the IP address of 192.168.0.0, and the port number of the service is 80. Of course, the application is configured with a plurality of processes according to the number of services provided, and each service operates in an independent process.
Steps 201-203 are methods for providing micro services according to a monolithic application code, after generating a metadata file, an interface definition file, and completing configuring parameters of a host address, a port number and a process for monolithic application, the metadata file, the interface definition file, the host address, the port number, the monolithic application code and the like can be packaged to generate a docker mirror image, the docker mirror image is operated by a container in an application server to deploy an application program modified by the monolithic application, and after the service application program deployment is completed for a client through different call entries, the client can transmit a corresponding data request to a corresponding application server through an IP address and a port of the application server, where the IP address and the port can be realized through a socket. The processing of the data request by the application server depends on the processing and deployment of the application server according to the metadata file, the interface definition file and the single application code, and different metadata files, interface definition files and single application codes can enable the application server to realize different data request processing flows. After the application server completes the deployment of the application program in steps 201 to 203, the processing of the data request in steps 101 to 103 can be realized.
The embodiment of the invention provides a micro-service calling method, which comprises the following steps: the application server receives a data request from a client; the data request comprises a first calling inlet, and the first calling inlet is used for indicating one service in a plurality of services provided by the application program called by the client; the application server runs the target service called by the first calling entrance to obtain response data; the target service is a calling service corresponding to the first calling inlet; the application server returns a response request to the client; the response request includes response data. The micro-service calling method provided by the embodiment of the invention calls the corresponding target service in the application program in the application server through the first calling entrance in the data request, realizes that different services are provided according to different client requests according to different services of the application program called by the first calling entrance, namely realizes the process of providing micro-service for the client through configuring different calling entrances, and is convenient for realizing the micro-service. Compared with the prior art, the micro-service implementation method provided by the embodiment of the invention is relatively simple, only development work is needed to be carried out on the basis of the existing single application, the workload of micro-service development is reduced, and coding errors caused by huge workload can be avoided.
Referring to fig. 8, an embodiment of the present invention further provides a micro-service invocation device 30, including:
a receiving module 301, configured to receive a data request from a client; the data request comprises a first calling entry, and the first calling entry is used for indicating one service in a plurality of services provided by the application program called by the client.
A calling module 302, configured to run a target service called by the first calling entry received by the receiving module 301, and obtain response data; the target service is a calling service corresponding to the first calling entry.
A sending module 303, configured to return the response request obtained by the invoking module 302 to the client; the response request includes response data.
Optionally, as shown in fig. 9, the micro-service invocation apparatus 30 further includes a configuration module 304.
A configuration module 304, configured to configure at least one call entry for an application program in the application server; the application program is used for providing a plurality of services for the client, and the calling inlet is used for calling one service of the application program.
Optionally, the invoking module 302 is specifically configured to: determining a second call entry in the call entries configured by the application program; the second calling entrance is the same as the service called by the first calling entrance; and running the service called by the second calling entrance to obtain response data.
Optionally, the configuration module 304 is further configured to configure a dependency for the service invoked by the at least one call entry; depending on the context required for running the service that calls the portal call.
The embodiment of the invention provides a micro-service calling device, which comprises: a receiving module for receiving a data request from a client; the data request comprises a first calling inlet, and the first calling inlet is used for indicating one service in a plurality of services provided by the application program called by the client; the calling module is used for running the target service called by the first calling inlet received by the receiving module and acquiring response data; the target service is a calling service corresponding to the first calling inlet; the sending module is used for returning the response request obtained by the calling module to the client; the response request includes response data. The micro-service calling device provided by the embodiment of the invention calls the corresponding target service in the application program in the application server through the first calling entrance in the data request, realizes that different services are provided according to different client requests according to different services of the application program called by the first calling entrance, namely realizes the process of providing micro-service for the client through configuring different calling entrances, and is convenient to realize the micro-service. Compared with the prior art, the micro-service implementation method provided by the embodiment of the invention is relatively simple, only development work is needed to be carried out on the basis of the existing single application, the workload of micro-service development is reduced, and coding errors caused by huge workload can be avoided.
Referring to fig. 10, an embodiment of the present invention further provides another microservice calling apparatus, including a memory 41, a processor 42, a bus 43, and a communication interface 44; the memory 41 is used for storing computer execution instructions, and the processor 42 is connected with the memory 41 through a bus 43; when the micro-service invocation device is running, the processor 42 executes computer-executable instructions stored by the memory 41 to cause the micro-service invocation device to perform the micro-service invocation methods provided by the embodiments described above.
In particular implementations, processor 42(42-1 and 42-2) may include one or more CPUs, such as CPU0 and CPU1 shown in FIG. 10, for example, as one embodiment. And as an example, the micro service invocation device may include multiple processors 42, such as processor 42-1 and processor 42-2 shown in fig. 10. Each of the processors 42 may be a single-Core Processor (CPU) or a multi-Core Processor (CPU). Processor 42 may refer herein to one or more devices, circuits, and/or processing cores that process data (e.g., computer program instructions).
The memory 41 may be, but is not limited to, a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a Random Access Memory (RAM) or other type of dynamic storage device that can store information and instructions, an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compact disc, laser disc, optical disc, digital versatile disc, blu-ray disc, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer. The memory 41 may be self-contained and coupled to the processor 42 via a bus 43. The memory 41 may also be integrated with the processor 42.
In a specific implementation, the memory 41 is used for storing data in the present application and computer-executable instructions corresponding to software programs for executing the present application. The micro-service may invoke various functions of the device by running or executing software programs stored in memory 41, as well as invoking data stored in memory 41.
The communication interface 44 is any device, such as a transceiver, for communicating with other devices or communication networks, such as a control system, a Radio Access Network (RAN), a Wireless Local Area Network (WLAN), and the like. The communication interface 44 may include a receiving unit implementing a receiving function and a transmitting unit implementing a transmitting function.
The bus 43 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (EISA) bus, or the like. The bus 43 may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 10, but this is not intended to represent only one bus or type of bus.
An embodiment of the present invention further provides a computer-readable storage medium, where the computer-readable storage medium includes computer-executable instructions, and when the computer-executable instructions are executed on a computer, the computer is enabled to execute the micro-service invocation method provided in the foregoing embodiment.
The embodiment of the invention also provides a computer program, which can be directly loaded into the memory and contains software codes, and the computer program can realize the micro-service calling method provided by the embodiment after being loaded and executed by the computer.
Those skilled in the art will recognize that, in one or more of the examples described above, the functions described in this invention may be implemented in hardware, software, firmware, or any combination thereof. When implemented in software, the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. A storage media may be any available media that can be accessed by a general purpose or special purpose computer.
Through the above description of the embodiments, it is clear to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device may be divided into different functional modules to complete all or part of the above described functions.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules or units is only one logical function division, and there may be other division ways in actual implementation. For example, various elements or components may be combined or may be integrated into another device, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form. Units described as separate parts may or may not be physically separate, and parts displayed as units may be one physical unit or a plurality of physical units, may be located in one place, or may be distributed to a plurality of different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit. The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a readable storage medium. Based on such understanding, the technical solutions of the embodiments of the present application may be essentially or partially contributed to by the prior art, or all or part of the technical solutions may be embodied in the form of a software product, where the software product is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, or the like) or a processor (processor) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a U disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.
The above description is only for the specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. A method for invoking a micro-service, comprising:
the application server receives a data request from a client; the data request comprises a first call inlet, and the first call inlet is used for calling one of a plurality of services provided by the application program called by the client;
the application server operates the target service called by the first calling entrance to obtain response data; the target service is a calling service corresponding to the first calling entry;
the application server returns a response request to the client; the response request includes the response data.
2. The method of claim 1, wherein before the application server receives the data request from the client, the method further comprises:
configuring at least one call entry for the application program in the application server; the application program is used for providing a plurality of services for a client, and the calling inlet is used for calling one service of the application program.
3. The micro-service invocation method according to claim 2, wherein said application server runs the target service invoked by said first invocation entry, and obtaining response data comprises:
determining a second call entry in the call entries of the application configuration; the second calling inlet and the first calling inlet call the same service;
and running the service called by the second calling entrance to obtain the response data.
4. The method of claim 2, wherein after configuring at least one call entry for the application program in the application server, the method further comprises:
the application server configures dependence for the service called by the at least one calling entry; the dependency is the environment required when running the service called by the call entry.
5. A microservice invocation device, comprising:
a receiving module for receiving a data request from a client; the data request comprises a first calling inlet, and the first calling inlet is used for indicating one service in a plurality of services provided by the application program called by the client;
the calling module is used for operating the target service called by the first calling inlet received by the receiving module to obtain response data; the target service is a calling service corresponding to the first calling entry;
the sending module is used for returning the response request obtained by the calling module to the client; the response request includes the response data.
6. The micro-service invocation device according to claim 5, further comprising:
the configuration module is used for configuring at least one calling inlet for the application program in the application server; the application program is used for providing a plurality of services for a client, and the calling inlet is used for calling one service of the application program.
7. The micro-service invocation device according to claim 6, wherein said invocation module is specifically configured to:
determining a second call entry in the call entries of the application configuration; the second calling inlet and the first calling inlet call the same service;
and running the service called by the second calling entrance to obtain the response data.
8. The micro-service invocation device according to claim 6, wherein said configuration module is further configured to configure dependencies for the services invoked by said at least one invocation entry; the dependency is the environment required when running the service called by the call entry.
9. The micro-service calling device is characterized by comprising a memory, a processor, a bus and a communication interface; the memory is used for storing computer execution instructions, and the processor is connected with the memory through the bus; the processor executes the computer-executable instructions stored by the memory to cause the microservice calling device to perform the microservice calling method of any of claims 1-4 when the microservice calling device is running.
10. A computer-readable storage medium comprising computer-executable instructions that, when executed on a computer, cause the computer to perform the microservice invocation method of any of claims 1-4.
CN201911341055.8A 2019-12-23 2019-12-23 Micro-service calling method and device Active CN111176761B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911341055.8A CN111176761B (en) 2019-12-23 2019-12-23 Micro-service calling method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911341055.8A CN111176761B (en) 2019-12-23 2019-12-23 Micro-service calling method and device

Publications (2)

Publication Number Publication Date
CN111176761A true CN111176761A (en) 2020-05-19
CN111176761B CN111176761B (en) 2023-07-18

Family

ID=70650328

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911341055.8A Active CN111176761B (en) 2019-12-23 2019-12-23 Micro-service calling method and device

Country Status (1)

Country Link
CN (1) CN111176761B (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112463211A (en) * 2020-07-28 2021-03-09 上海汇招信息技术有限公司 System architecture transformation method compatible with multiple development architectures and system architecture
CN112506679A (en) * 2020-12-17 2021-03-16 中国联合网络通信集团有限公司 RPC service calling method and equipment
CN112631804A (en) * 2020-12-25 2021-04-09 杭州涂鸦信息技术有限公司 Service call request processing method based on isolation environment and computer equipment
CN112860450A (en) * 2020-12-04 2021-05-28 武汉悦学帮网络技术有限公司 Request processing method and device
CN113268229A (en) * 2021-06-08 2021-08-17 中国联合网络通信集团有限公司 Code generation method and code generation device
CN113779467A (en) * 2021-01-05 2021-12-10 北京沃东天骏信息技术有限公司 Method and device for visualizing functional component management
CN114416224A (en) * 2022-03-25 2022-04-29 共道网络科技有限公司 Method and device for calling micro service under multi-micro service environment
CN115242894A (en) * 2022-06-08 2022-10-25 三一智矿科技有限公司 Data processing method, data processing device, storage medium and computer equipment
WO2023044929A1 (en) * 2021-09-27 2023-03-30 西门子股份公司 Method and system for providing service associated with information system

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105391683A (en) * 2015-09-30 2016-03-09 小米科技有限责任公司 Remote method invocation method, device and system
CN108206852A (en) * 2016-12-20 2018-06-26 杭州华为数字技术有限公司 A kind of dialogue-based Service Instance management method and equipment under micro services frame
CN108279926A (en) * 2018-01-10 2018-07-13 浙江网新恒天软件有限公司 A kind of method of monomer applications micro services
CN108664343A (en) * 2018-05-09 2018-10-16 顺丰科技有限公司 A kind of stateful call method and device of micro services
CN108667925A (en) * 2018-05-04 2018-10-16 北京天元创新科技有限公司 A kind of method and system of WEB application seamless access distributed system
CN109818980A (en) * 2019-03-21 2019-05-28 中国铁塔股份有限公司 A kind of communication means and device
CN109995713A (en) * 2017-12-30 2019-07-09 华为技术有限公司 Service processing method and relevant device in a kind of micro services frame
WO2019143412A1 (en) * 2018-01-19 2019-07-25 Umajin Inc. Configurable server kit
CN110058864A (en) * 2019-04-18 2019-07-26 成都四方伟业软件股份有限公司 The dispositions method and device of micro services
CN110430173A (en) * 2019-07-19 2019-11-08 河南工程学院 A kind of cloud platform based on Vue+SpringCloud

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105391683A (en) * 2015-09-30 2016-03-09 小米科技有限责任公司 Remote method invocation method, device and system
CN108206852A (en) * 2016-12-20 2018-06-26 杭州华为数字技术有限公司 A kind of dialogue-based Service Instance management method and equipment under micro services frame
CN109995713A (en) * 2017-12-30 2019-07-09 华为技术有限公司 Service processing method and relevant device in a kind of micro services frame
CN108279926A (en) * 2018-01-10 2018-07-13 浙江网新恒天软件有限公司 A kind of method of monomer applications micro services
WO2019143412A1 (en) * 2018-01-19 2019-07-25 Umajin Inc. Configurable server kit
CN108667925A (en) * 2018-05-04 2018-10-16 北京天元创新科技有限公司 A kind of method and system of WEB application seamless access distributed system
CN108664343A (en) * 2018-05-09 2018-10-16 顺丰科技有限公司 A kind of stateful call method and device of micro services
CN109818980A (en) * 2019-03-21 2019-05-28 中国铁塔股份有限公司 A kind of communication means and device
CN110058864A (en) * 2019-04-18 2019-07-26 成都四方伟业软件股份有限公司 The dispositions method and device of micro services
CN110430173A (en) * 2019-07-19 2019-11-08 河南工程学院 A kind of cloud platform based on Vue+SpringCloud

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
ANTONIO MESSINA等: "A Simplified Database Pattern for the Microservice Architecture", 《DBKDA 2016, THE EIGHTH INTERNATIONAL CONFERENCE ON ADVANCES IN DATABASES, KNOWLEDGE, AND DATA APPLICATIONS》, pages 35 - 40 *
LIUBAO68: "单体应用微服务改造实践", 《HTTPS://ZHUANLAN.ZHIHU.COM/P/58257749》, pages 1 - 6 *
PROFLIER: "如何将单体应用改造为微服务", 《HTTPS://BLOG.CSDN.NET/U014693253/ARTICLE/DETAILS/86621224》, pages 1 - 4 *
耿超: "面向Web AR的微服务化可定制业务***的设计与实现", 《中国优秀硕士学位论文全文数据库 信息科技辑》, pages 138 - 1242 *

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112463211A (en) * 2020-07-28 2021-03-09 上海汇招信息技术有限公司 System architecture transformation method compatible with multiple development architectures and system architecture
CN112860450A (en) * 2020-12-04 2021-05-28 武汉悦学帮网络技术有限公司 Request processing method and device
CN112860450B (en) * 2020-12-04 2024-04-19 武汉悦学帮网络技术有限公司 Request processing method and device
CN112506679A (en) * 2020-12-17 2021-03-16 中国联合网络通信集团有限公司 RPC service calling method and equipment
CN112631804A (en) * 2020-12-25 2021-04-09 杭州涂鸦信息技术有限公司 Service call request processing method based on isolation environment and computer equipment
CN112631804B (en) * 2020-12-25 2024-05-24 杭州涂鸦信息技术有限公司 Service call request processing method based on isolation environment and computer equipment
CN113779467A (en) * 2021-01-05 2021-12-10 北京沃东天骏信息技术有限公司 Method and device for visualizing functional component management
CN113268229A (en) * 2021-06-08 2021-08-17 中国联合网络通信集团有限公司 Code generation method and code generation device
CN113268229B (en) * 2021-06-08 2023-06-27 中国联合网络通信集团有限公司 Code generation method and code generation device
WO2023044929A1 (en) * 2021-09-27 2023-03-30 西门子股份公司 Method and system for providing service associated with information system
CN114416224B (en) * 2022-03-25 2022-07-12 共道网络科技有限公司 Method and device for calling micro service under multi-micro service environment
CN114416224A (en) * 2022-03-25 2022-04-29 共道网络科技有限公司 Method and device for calling micro service under multi-micro service environment
CN115242894A (en) * 2022-06-08 2022-10-25 三一智矿科技有限公司 Data processing method, data processing device, storage medium and computer equipment
CN115242894B (en) * 2022-06-08 2023-11-17 三一智矿科技有限公司 Data processing method, device, storage medium and computer equipment

Also Published As

Publication number Publication date
CN111176761B (en) 2023-07-18

Similar Documents

Publication Publication Date Title
CN111176761A (en) Micro-service calling method and device
US11159411B2 (en) Distributed testing service
CN108667925B (en) Method and system for seamless access of WEB application to distributed system
US20210263714A1 (en) System and method for autowiring of a microservice architecture
US11816492B2 (en) Third party integration of plugins and widgets
CN107872437B (en) Method, device and server for service request
CN112115190A (en) Method, device and system for converting interface message
US8701129B2 (en) Web API server program, web API publication method
WO2016058488A1 (en) Method and device for providing sdk files
CN111193803A (en) Spring group-based micro-service construction method and spring group micro-service framework
US8886703B2 (en) Advertising and facilitating management access to added capabilities of intelligent devices in a system
JP7181992B2 (en) Client application for running web applications
CN112787999A (en) Cross-chain calling method, device, system and computer readable storage medium
CN109343970B (en) Application program-based operation method and device, electronic equipment and computer medium
US11700241B2 (en) Isolated data processing modules
Indrasiri et al. Introduction to WSO2 ESB
CN113010561A (en) Data acquisition method and device based on super account book and computer system
CN114675982A (en) General method and system for acquiring data of service integration system
CN110764769A (en) Method and device for processing user request
US10402454B1 (en) Obtaining platform-specific information in a firmware execution environment
KR102637168B1 (en) Appartus for providing application services, method thereof, and computationally-implementable storage medium storing a program for providing application services
KR102659150B1 (en) Appartus for providing application services, method thereof, and computationally-implementable storage medium for storing a program for providing application services
KR102659154B1 (en) Appartus for providing application services, method thereof, and computationally-implementable storage medium for storing a program for providing application services
KR102663418B1 (en) Appartus for providing application services, method thereof, and computationally-implementable storage medium for storing a program for providing application services
CN114666418B (en) Service system connection method, device and storage medium

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