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

Micro-service calling method and device Download PDF

Info

Publication number
CN111176761B
CN111176761B CN201911341055.8A CN201911341055A CN111176761B CN 111176761 B CN111176761 B CN 111176761B CN 201911341055 A CN201911341055 A CN 201911341055A CN 111176761 B CN111176761 B CN 111176761B
Authority
CN
China
Prior art keywords
service
call
application
calling
micro
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.)
Active
Application number
CN201911341055.8A
Other languages
Chinese (zh)
Other versions
CN111176761A (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

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, which relate to the field of computer software and are used for calling a certain service of an application program in an application server according to a calling entry 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 call entry for indicating one of a plurality of services provided by an application program invoked by the client; the application server runs the target service called by the first call portal 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 response data. The invention is used for calling the micro-service.

Description

Micro-service calling method and device
Technical Field
The present invention relates to the field of computer software, and in particular, to a method and apparatus for calling a micro service.
Background
The single application is an application program which packages all functions into one independent unit, and when the application program is small in size and involves fewer functions, program development can be performed according to a single application architecture, so that development efficiency is effectively improved, and deployment and operation are convenient. With the expansion of the service scale, the expansibility and the persistent delivery capability of the application program realized by the single application architecture are poor, failure of any module in the application program may cause the breakdown of the whole software system, and overload of any module may affect the stability of the whole application program. In addition, for some smaller volume monomer applications, as the volume of traffic data increases, the monomer application may not meet the processing requirements for increasing the volume of data.
Micro-services are small services made up of a single application, different micro-services can interact through an application program interface (application programming interface, API), and different micro-services work in different processes, avoiding the above-mentioned problems. Currently, when converting a single application into a micro service, a developer needs to perform a large amount of development work according to the program code 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 entry and providing micro-service for a client.
In order to achieve the above purpose, the embodiment of the present invention adopts the following technical scheme:
in a first aspect, a micro service invocation method is provided, including: the application server receives a data request from a client; the data request comprises a first call entry for indicating one of a plurality of services provided by an application program invoked by the client; the application server runs the target service called by the first call portal 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 response data.
In a second aspect, there is provided a micro service invocation apparatus, comprising: a receiving module for receiving a data request from a client; the data request comprises a first call entry for indicating one of a plurality of services provided by an application program invoked 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 response data.
In a third aspect, there is provided a micro service invocation apparatus, comprising: memory, processor, bus and 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 apparatus is running, the processor executes computer-executable instructions stored in the memory to cause the micro service invocation apparatus to perform the micro service invocation method as provided in the first aspect.
In a fourth aspect, there is provided a computer-readable storage medium comprising: computer-executable instructions that, when run on a computer, cause the computer to perform the micro-service invocation method as provided in the first aspect.
The embodiment of the invention provides a micro-service calling method and a micro-service calling device, wherein the method comprises the following steps: the application server receives a data request from a client; the data request comprises a first call entry for indicating one of a plurality of services provided by an application program invoked by the client; the application server runs the target service called by the first call portal 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 response data. According to the micro-service calling method provided by the embodiment of the invention, the corresponding target service in the application program in the application server is called through the first calling entry in the data request, different services are provided according to different calling application programs of the first calling entry, namely, the process of providing micro-service for the client through configuring different calling entries is realized, and the micro-service is convenient to realize. Compared with the prior art, the micro-service implementation mode provided by the embodiment of the invention is relatively simple, development work is only needed 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 invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of a single application architecture 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 flowchart illustrating a method for invoking micro services according to an embodiment of the present invention;
fig. 4 is a schematic flow chart of a client remote call service according to an embodiment of the present invention;
FIG. 5 is a second flowchart of a micro service invocation method according to an embodiment of the present invention;
FIG. 6 is a flowchart of an application server responding to a client data request according to an embodiment of the present invention;
FIG. 7 is a flowchart of an application server deployment application provided in an embodiment of the present invention;
fig. 8 is a schematic structural diagram of a micro service calling device according to an embodiment of the present invention;
fig. 9 is a schematic diagram II of a micro service calling device according to an embodiment of the present invention;
fig. 10 is a schematic diagram of a micro service call device according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
It should be noted that, in the embodiments of the present invention, words such as "exemplary" or "such as" are used to mean serving as an example, instance, or illustration. Any embodiment or design described herein as "exemplary" or "e.g." in an embodiment should not be taken as preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "such as" is intended to present related concepts in a concrete fashion.
It should be noted that, in the embodiment of the present invention, "english: of", "corresponding" and "corresponding" may sometimes be used in combination, and it should be noted that the meaning to be expressed is consistent when the distinction is not emphasized.
In order to clearly describe the technical solution of the embodiments of the present invention, in the embodiments of the present invention, the terms "first", "second", etc. are used to distinguish the same item or similar items having substantially the same function and effect, and those skilled in the art will understand that the terms "first", "second", etc. are not limited in number and execution order.
A monolithic application is an application that packages all functions in a single unit, with all functional modules in a single process. Micro services are developed as a set of small services to develop a separate application system, where each service runs as a separate process.
Referring to fig. 1, an embodiment of the present invention provides a schematic architecture of a single application, including a user interface and multiple functions, where the user interface is an overall design of man-machine interaction, operation logic and interface aesthetics for the single application; the functions of the single application can be realized by a plurality of included functional modules, such as a module 1 realizes a function 1, a module 2 realizes a function 2, and a module N realizes a function N; the individual functional modules of the individual applications are data-supported via a common database.
Referring to fig. 2, an embodiment of the present invention further provides a schematic architecture of the micro service. Unlike the monolithic application architecture, each service in the micro-service architecture is data-supported by a separate database, for example, the service provided by the micro-service 1 is data-supported by the database 1, the service provided by the micro-service 2 is data-supported by the database 2, and the service provided by the micro-service N is data-supported by the database N. Different micro-services can communicate through an API, and the API between the micro-services is designed based on the architecture style of the representational state transfer (representational state transfer, REST), namely the REST API in FIG. 2.
Because all functions of the single application are realized by one database, 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 realized on the basis of the original micro service. Therefore, the current large-scale application project construction generally uses a micro-service architecture construction to improve the service quality and reduce the operation and maintenance cost. However, for the developed single application, the micro service for converting the single application needs to perform a great deal of development work according to the codes of the single application, and the operation is complex and easy to make mistakes.
In combination with the monolithic 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 invocation method, which is shown in fig. 3, and includes:
101. the application server receives a data request from a client.
Wherein the data request includes a first call portal for indicating one of a plurality of services provided by the application invoked by the client.
Specifically, in the embodiment of the present application, the application server may receive the data request sent by the client and may be implemented by using a remote procedure call (remote procedure call, RPC), and referring to fig. 4, a procedure for remotely calling an application service in the application server for the client is shown. 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 the data request also comprises request parameters; the serialization is to perform serialization processing on the data request of the client, so that the client is convenient to realize when transmitting to the application server through the network service, and the network service is convenient to identify the transmission data. Correspondingly, the process of receiving the data request by the application service comprises deserialization and service call, wherein the deserialization is used for carrying out reverse operation on the data request serialized by the client to obtain the request parameter of the client and a first call entry; the service call is used for calling the service provided by the application server locally according to the first call entry. The first call portal 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 class application, the service provided by the application may include user information, commodity purchase information, commodity inventory information, commodity recommendation information, and the like, and the first call portal may be used to instruct to call a certain 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 the code of the data request into a byte sequence, and the anti-serialization refers to a process of recovering the byte sequence into the code of the data request, where the byte sequence is convenient for network transmission, and the serialization and anti-serialization processing of the data request can be implemented by protocols. The application program in the application server can be a single application, and the micro-service calling method provided by the embodiment of the application is based on the service of the single application, and is used for calling different services in the single application to realize the micro-service function by defining a plurality of calling portals for the single application. The data request sent by the client to the application server also includes an internet protocol (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, where 192.168.0.0 represents the IP address of the application server, 80 represents the application server transmitting data through 80 ports.
The data request sent by the client can be implemented in a GET mode or a POST mode of a hypertext transfer protocol (hypertext transport protocol, HTTP), wherein the GET mode is used for requesting to acquire data of the application server, and the POST mode is used for requesting the application server to create corresponding data.
102. And the application server runs the target service called by the first call entry to obtain response data.
The target service is a call service corresponding to the first call entry.
Optionally, referring to fig. 5, step 102 specifically includes:
1021. a second call portal is determined among the call portals of the application configuration.
Wherein the second call portal is the same as the service called by the first call portal.
Specifically, when the application server deploys the application program, at least one call portal is configured for the application program, and each call portal can call a service in the application program. After receiving the data request, the application server analyzes the data request to obtain a first call portal and request parameters, and queries a call portal which is the same as the first call portal in the call portals configured by the application program, namely, determines a second call portal in the call portals, and the service called by the second call portal is the service called by the client request.
For example, if the application program in the application server is a mathematical computing application, the computing functions include addition, subtraction, multiplication, division, and the like. When the application server deploys the application program, a plurality of call entries are configured, and the call entries can respectively call any operation service in the algorithms such as addition operation, subtraction operation or multiplication operation. When the client side 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 the same call portal as the first call portal in the call portals, i.e. determines the call portal that calls the addition operation in the call portals.
It should be noted that, after the application server completes the deployment of the application program, the client and the application server both generate a service registry, where the service registry includes a corresponding relationship between the service and the call portal, where the service registry of the client is the same as the service registry of the application server, and the client can determine the call portal for calling the service through the service registry.
1022. And running the service called by the second call entry to obtain response data.
Specifically, the data request further includes a request parameter, where the request parameter may be input to each service in the application program, and different services have different inputs.
For example, if the first call entry is used to call an add operation, the request parameters are 2 and 3, and after the application server determines the second call entry, the add operation corresponding to the second call entry is called. The addition operation service operates, and response data obtained according to the request parameters is 5.
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 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, where 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, where the response status code may be included in the HTTP packet, and if the response status code is 200OK, it indicates that the data request processing is successful; a response status code 404, indicating that the service has been deleted; those skilled in the art may set the application program according to a common response status code, which is not described herein.
Optionally, referring to fig. 7, before step 101, the method further includes:
201. at least one call portal is configured for an application in an application server.
The application program is used for providing a plurality of services for the client, and the call portal is used for calling one service of the application program.
Specifically, the application program can be a single application, and the application server can realize the call of the client to the micro-service by configuring a call portal for the single application.
For example, if the application is a shopping application, the services provided by the application may include user information, merchandise purchase information, merchandise inventory information, merchandise recommendation information, and the like, and the application server may call the portal according to the service configuration to call different services. Such as a first call portal may be used to invoke a user information service, a second call portal may be used to invoke a merchandise information service, a third call portal may be used to invoke merchandise purchase information, and so on. The application server can configure the call entry for the application program through the RPC, and the specific implementation process can be as follows:
Application1{
rpc method1(InputType1)
returns(OutputType1);
}。
application1 may represent a micro service name, where the micro service is called a service named method1 by RPC, inputType1 represents an input parameter type, and OutputType1 represents an output parameter type.
The application service configures the call portal and simultaneously configures the input parameter type and the output parameter type of the call portal, for example:
message InputType1{
repeated double length=1;
};
message OutputType1{
repeated int64 value=1;
}。
202. the application server configures dependencies for at least one service that invokes the portal call.
Where the environment required to run the service that invokes the portal call is relied upon.
Specifically, the running of an application requires the support of components that the running of the application requires to rely on, such as databases required by the individual services in the application, the computer programming software python, and the Protocol Buffers for the serialization and deserialization tools. Of course, because the dependencies of different service needs may be different, different dependencies need to be configured for different services when the dependencies are configured.
By way of example, the process of configuring dependencies for a service may be implemented by defining metadata files for an application, such as:
among these, the dependencies of service operations include python and protobuf, which can be installed automatically by an installation tool pip when an application server installs an application.
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 an application program in the application server, and providing services for the client through a call entry of the application program.
Specifically, the application program run by the application server is actually a call to a single application service, and the process of implementing the micro service through the single application includes: and configuring a call inlet for the single application, and configuring a route for the single application according to the configured call inlet.
Further, configuring the call portal for the monolithic application may be implemented by defining a metadata file including the call portal code and the input parameter type and output parameter type codes of the call portal as exemplified in step 201. The application server loads the metadata file when running the application program, and is also configured with a route for routing the data request sent by the client to the corresponding service.
The application server may configure routing for the application through a uniform resource locator (uniform resource locator, URL), such as: http:// content/Application1, where content represents a storage directory of an Application program, application1 represents a method name of a micro-service called, where Application1 may be used to call Application1 services in the above-described RPC implementation.
It should be noted that, the steps 201 and 202 may be implemented by configuring the interface definition file and the metadata file for the single application. The metadata file may be as examples described above, including dependencies of the service run and the dependency installation method; the interface definition file includes the call entry described above, and the types of input parameters and output parameters. When the application is configured to provide micro services according to the monomer application, the host address and port number of the providing service are also configured as described above for 192.168.0.0:80, the application program provides service through the application server with the IP address of 192.168.0.0, and the port number for providing the service is 80. Of course, the application program is configured with a plurality of processes according to the number of services provided, each service operating in a separate process.
Steps 201-203 are methods for providing micro services according to a single application code implementation, after metadata files and interface definition files are generated and parameters of host addresses, port numbers and processes are configured for single applications are completed, contents such as the metadata files, the interface definition files, the host addresses, the port numbers and the single application codes can be packaged to generate a dock mirror image, application programs modified by the single applications are deployed in an application server through container operation of the dock mirror image, after service application program deployment is completed for a client through different call portals, the client can transmit corresponding data requests to corresponding application servers through IP addresses and ports of the application servers, and the IP addresses and the ports can be implemented through sockets. The application server processes the data request, and the application server processes and deploys the data request according to the metadata file, the interface definition file and the single application code. After the application server completes the application deployment of steps 201-203, the processing of the data request in steps 101-103 may be implemented.
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 call entry for indicating one of a plurality of services provided by an application program invoked by the client; the application server runs the target service called by the first call portal 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 response data. According to the micro-service calling method provided by the embodiment of the invention, the corresponding target service in the application program in the application server is called through the first calling entry in the data request, different services are provided according to different calling application programs of the first calling entry, namely, the process of providing micro-service for the client through configuring different calling entries is realized, and the micro-service is convenient to realize. Compared with the prior art, the micro-service implementation mode provided by the embodiment of the invention is relatively simple, development work is only needed 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 apparatus 30, including:
a receiving module 301, configured to receive a data request from a client; the data request includes a first call portal for indicating one of a plurality of services provided by an application invoked by the client.
A calling module 302, configured to operate the target service called by the first call entry received by the receiving module 301, to obtain response data; the target service is a call service corresponding to the first call entry.
A sending module 303, configured to return the response request obtained by the calling module 302 to the client; the response request includes response data.
Optionally, referring to 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 portal for an application program in an application server; the application program is used for providing a plurality of services for the client, and the call portal is used for calling one service of the application program.
Optionally, the calling module 302 is specifically configured to: determining a second call entry in the call entries of the application configuration; the second call portal is the same as the service called by the first call portal; and running the service called by the second call entry to obtain response data.
Optionally, the configuration module 304 is further configured to configure dependencies for at least one service invoked by the invocation portal; depending on the environment required to run the service that invokes 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 call entry for indicating one of a plurality of services provided by an application program invoked 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 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 entry in the data request, and different services are provided according to different calling application programs of the first calling entry, namely, the process of providing micro-service for the client through configuring different calling entries is realized, and the micro-service is convenient to realize. Compared with the prior art, the micro-service implementation mode provided by the embodiment of the invention is relatively simple, development work is only needed 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, another micro service call device is provided according to an embodiment of the present invention, which includes a memory 41, a processor 42, a bus 43, and a communication interface 44; the memory 41 is used for storing computer-executable instructions, and the processor 42 is connected with the memory 41 through the bus 43; when the micro service invocation apparatus is running, the processor 42 executes the computer-executable instructions stored in the memory 41 to cause the micro service invocation apparatus to execute the micro service invocation method as provided by the above-described embodiment.
In a particular implementation, as one embodiment, the processor 42 (42-1 and 42-2) may include one or more CPUs, such as CPU0 and CPU1 shown in FIG. 10. And as one example, the micro service invocation means may comprise a plurality of processors 42, such as processor 42-1 and processor 42-2 shown in fig. 10. Each of these processors 42 may be a single-core processor (single-CPU) or a multi-core processor (multi-CPU). The processor 42 herein may refer to one or more devices, circuits, and/or processing cores for processing 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 (random access memory, RAM) or other type of dynamic storage device that can store information and instructions, or an electrically erasable programmable read-only memory (electrically erasable programmable read-only memory, EEPROM), a compact disc read-only memory (compact disc read-only memory) 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 stand alone and be coupled to the processor 42 via a bus 43. Memory 41 may also be integrated with processor 42.
In a specific implementation, the memory 41 is used for storing data in the application and computer-executable instructions corresponding to executing a software program of the application. The processor 42 may call various functions of the device by running or executing a software program stored in the memory 41 and calling data stored in the memory 41.
The communication interface 44 uses any transceiver-like device for communicating with other devices or communication networks, such as a control system, a radio access network (radio access network, RAN), a wireless local area network (wireless local area networks, WLAN), etc. The communication interface 44 may include a receiving unit to implement a receiving function and a transmitting unit to implement a transmitting function.
The bus 43 may be an industry standard architecture (industry standard architecture, ISA) bus, an external device interconnect (peripheral component interconnect, PCI) bus, or an extended industry standard architecture (extended industry standard architecture, EISA) bus, among others. The bus 43 may be classified into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in fig. 10, but not only one bus or one type of bus.
The embodiment of the invention also provides a computer readable storage medium, which comprises computer execution instructions, when the computer execution instructions run on a computer, the computer is caused to execute the micro-service calling method provided by the embodiment.
The embodiment of the invention also provides a computer program which can be directly loaded into a 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 a computer.
Those skilled in the art will appreciate that in one or more of the examples described above, the functions described in the present invention may be implemented in hardware, software, firmware, or any combination thereof. When implemented in software, these 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.
From the foregoing description of the embodiments, it will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of functional modules is illustrated, and in practical application, the above-described functional allocation may be implemented by different functional modules according to needs, i.e. the internal structure of the apparatus is divided into different functional modules to implement all or part of the functions described above.
In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described embodiments of the apparatus are merely illustrative, and the division of modules or units, for example, is merely a logical function division, and other manners of division are possible when actually implemented. For example, multiple units or components may be combined or may be integrated into another device, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form. The units described as separate parts may or may not be physically separate, and the parts shown as units may be one physical unit or a plurality of physical units, may be located in one place, or may be distributed in a plurality of different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units. The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a readable storage medium. Based on such understanding, the technical solution of the embodiments of the present application may be essentially or a part contributing to the prior art or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, including several instructions for causing a device (may be a single-chip microcomputer, a chip or the like) or a processor (processor) to perform all or part of the steps of the method described in the embodiments of the present invention. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk, etc.
The foregoing is merely illustrative of the present invention, and the present invention is not limited thereto, and any changes or substitutions easily contemplated by those skilled in the art within the scope of the present invention should be included in the present invention. Therefore, the protection scope of the invention is subject to the protection scope of the claims.

Claims (6)

1. A micro service invocation method, comprising:
after metadata files and interface definition files are generated and parameters of host addresses, port numbers and processes are configured for single application are completed, contents such as the metadata files, the interface definition files, the host addresses, the port numbers and single application codes are packed to generate a dock mirror image, and the dock mirror image is used for deploying application programs modified by single application through containers in an application server;
configuring at least one call entry for an application program in the application server, wherein the application server configures a dependency for a service called by the at least one call entry, the dependency being an environment required when a service called by the call entry is operated, and the application program in the application server is operated to provide a service for a client through the call entry of the application program;
the application server receives a data request from a client; the data request comprises a first call entry, wherein the first call entry is used for calling one of a plurality of services provided by an application program called by the client;
the application server runs the target service called by the first call entry 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 micro service invocation method of claim 1, wherein the application server running the target service invoked by the first invocation portal, obtaining response data comprises:
determining a second call portal in the call portals configured by the application program; the second call entry is the same as the service called by the first call entry;
and running the service called by the second call entry to obtain the response data.
3. A micro service invocation apparatus, comprising:
the configuration module is used for packaging the contents of the metadata file, the interface definition file, the host address, the port number, the single application code and the like to generate a dock mirror image after generating the metadata file and the interface definition file and completing the configuration of the parameters of the host address, the port number and the process for the single application, and operating the dock mirror image in an application server through a container to deploy the application program modified by the single application; configuring at least one call entry for an application program in the application server, wherein the application server configures a dependency for a service called by the at least one call entry, the dependency being an environment required when a service called by the call entry is operated, and the application program in the application server is operated to provide a service for a client through the call entry of the application program;
a receiving module for receiving a data request from a client; the data request comprises a first call entry, wherein the first call entry is used for indicating one of a plurality of services provided by an 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.
4. The micro service invocation apparatus of claim 3, wherein the invocation module is specifically configured to:
determining a second call portal in the call portals configured by the application program; the second call entry is the same as the service called by the first call entry;
and running the service called by the second call entry to obtain the response data.
5. 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; when the micro service invocation apparatus is running, the processor executes the computer-executable instructions stored in the memory to cause the micro service invocation apparatus to perform the micro service invocation method as claimed in claim 1 or 2.
6. A computer-readable storage medium comprising computer-executable instructions that, when run on a computer, cause the computer to perform the micro service invocation method of claim 1 or 2.
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 CN111176761A (en) 2020-05-19
CN111176761B true 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)

Families Citing this family (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
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
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
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
CN115242894B (en) * 2022-06-08 2023-11-17 三一智矿科技有限公司 Data processing method, device, storage medium and computer equipment

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108664343A (en) * 2018-05-09 2018-10-16 顺丰科技有限公司 A kind of stateful call method and device of micro services

Family Cites Families (9)

* 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
CN108206852B (en) * 2016-12-20 2020-12-22 华为技术有限公司 Session-based service instance management method and device under micro-service framework
WO2019143412A1 (en) * 2018-01-19 2019-07-25 Umajin Inc. Configurable server kit
CN109995713B (en) * 2017-12-30 2020-11-27 华为技术有限公司 Service processing method in micro-service framework and related equipment
CN108279926B (en) * 2018-01-10 2021-06-08 浙江网新恒天软件有限公司 Method for micro-service of single application
CN108667925B (en) * 2018-05-04 2020-10-16 北京天元创新科技有限公司 Method and system for seamless access of WEB application to distributed system
CN109818980A (en) * 2019-03-21 2019-05-28 中国铁塔股份有限公司 A kind of communication means and device
CN110058864B (en) * 2019-04-18 2023-08-22 成都四方伟业软件股份有限公司 Micro-service deployment method and device
CN110430173A (en) * 2019-07-19 2019-11-08 河南工程学院 A kind of cloud platform based on Vue+SpringCloud

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108664343A (en) * 2018-05-09 2018-10-16 顺丰科技有限公司 A kind of stateful call method and device of micro services

Also Published As

Publication number Publication date
CN111176761A (en) 2020-05-19

Similar Documents

Publication Publication Date Title
CN111176761B (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
US6393497B1 (en) Downloadable smart proxies for performing processing associated with a remote procedure call in a distributed system
US8701129B2 (en) Web API server program, web API publication method
WO2014169619A1 (en) Systems and methods for installing applications
US20210389976A1 (en) Techniques to facilitate a migration process to cloud storage
US8495664B2 (en) System, method and program product for invoking a remote method
US20130332605A1 (en) Advertising and facilitating management access to added capabilities of intelligent devices in a system
CN112787999A (en) Cross-chain calling method, device, system and computer readable storage medium
CN116303309A (en) File mounting method and device and electronic equipment
CN115562887A (en) Inter-core data communication method, system, device and medium based on data package
CN109343970B (en) Application program-based operation method and device, electronic equipment and computer medium
US7266622B2 (en) Method, computer program product, and system for automatic application buffering
WO2001035242A1 (en) Highly distributed computer server architecture and operating system
EP1057272A2 (en) Apparatus and method for dynamically verifying information in a distributed system
CN116860236A (en) Component sharing method, system, client and electronic device
CN116700745A (en) Application deployment method and device based on container cloud platform, electronic equipment and medium
WO2021233103A1 (en) Method and apparatus of cross-ipc access
WO1999044123A1 (en) Downloadable smart proxies for performing processing associated with a remote procedure call in a distributed system
US6745250B1 (en) Finding named EJB homes via life cycle support
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
US11650860B2 (en) Managing services across containers
CN113656110B (en) Page loading method and device for front-end updating free cache

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