Movatterモバイル変換


[0]ホーム

URL:


CN110808948B - Remote procedure call method, device and system - Google Patents

Remote procedure call method, device and system
Download PDF

Info

Publication number
CN110808948B
CN110808948BCN201910899742.5ACN201910899742ACN110808948BCN 110808948 BCN110808948 BCN 110808948BCN 201910899742 ACN201910899742 ACN 201910899742ACN 110808948 BCN110808948 BCN 110808948B
Authority
CN
China
Prior art keywords
request
calling
invocation
client
call
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
CN201910899742.5A
Other languages
Chinese (zh)
Other versions
CN110808948A (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 Mobile Communications Group Co Ltd
China Mobile Hangzhou Information Technology Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Hangzhou Information Technology 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 Mobile Communications Group Co Ltd, China Mobile Hangzhou Information Technology Co LtdfiledCriticalChina Mobile Communications Group Co Ltd
Priority to CN201910899742.5ApriorityCriticalpatent/CN110808948B/en
Publication of CN110808948ApublicationCriticalpatent/CN110808948A/en
Application grantedgrantedCritical
Publication of CN110808948BpublicationCriticalpatent/CN110808948B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Images

Classifications

Landscapes

Abstract

Translated fromChinese

本发明实施例涉及通信技术领域,公开了一种远程过程调用方法、装置及系统。本发明应用于服务器,方法包括:通过预设的接口统一接收客户端发送的调用请求;根据调用请求将调用请求路由至调用请求对应的目标微服务进程;通过目标微服务进程对调用请求进行处理,得到调用结果,并将调用结果通过预设的接口发送至客户端。调用请求的接收与处理分别对应不同进程,在用于微服务进程在业务变更时,不影响调用请求的接收,也不影响其他微服务进程的正常工作,因此无需中断服务,保障了调用请求的正常答复。

Figure 201910899742

Embodiments of the present invention relate to the technical field of communications, and disclose a remote procedure invocation method, device and system. The present invention is applied to the server, and the method includes: uniformly receiving the calling request sent by the client through a preset interface; routing the calling request to the target microservice process corresponding to the calling request according to the calling request; processing the calling request through the target microservice process , get the call result, and send the call result to the client through the preset interface. The reception and processing of invocation requests correspond to different processes respectively. When the microservice process changes its business, it does not affect the reception of invocation requests, nor does it affect the normal work of other microservice processes. Therefore, there is no need to interrupt the service, which ensures the integrity of the invocation request. Normal reply.

Figure 201910899742

Description

Remote procedure calling method, device and system
Technical Field
The embodiment of the invention relates to the technical field of communication, in particular to a remote procedure calling method, a remote procedure calling device and a remote procedure calling system.
Background
Remote Procedure Calls (RPCs) generally use a client/server mode, meaning that a service is requested from a Remote server using the network. Specifically, the client calling process sends a calling message with process parameters to the service process, and then waits for a response message. At the server, the process remains in a sleep state until the call information arrives. When a calling message arrives, the server side obtains the process parameters, calculates the result, sends the reply message, then waits for the next calling message, and finally, the client side calls the process to receive the reply message, obtains the process result, and then calls execution to continue.
The inventors found that at least the following problems exist in the related art: when a service processed by a service process is changed, the service needs to be interrupted and modified, and the calling information sent by the client cannot be received or responded in the service interruption process.
Disclosure of Invention
The embodiment of the invention aims to provide a remote procedure calling method, a remote procedure calling device and a remote procedure calling system, so that when a service is changed, the service does not need to be interrupted, and the normal operation of the service is ensured.
In order to solve the above technical problem, an embodiment of the present invention provides a remote procedure call method, which is applied to a server, and includes: uniformly receiving a calling request sent by a client through a preset interface; routing the calling request to a target micro-service process corresponding to the calling request according to the calling request; and processing the calling request through the target micro-service process to obtain a calling result, and sending the calling result to the client through a preset interface.
The embodiment of the invention also provides a remote procedure call method, which is applied to the client and comprises the following steps: defining a calling request; wherein, the calling request at least comprises: business data and service names; sending the calling request to a preset interface of the server, so that the server can receive the calling request through the preset interface in a unified manner and process the calling request; and when the server returns the calling result, receiving the calling result.
The embodiment of the invention also provides a remote procedure call device, which comprises: the system comprises a first receiving module, a routing module, a processing module and a first sending module; the first receiving module is used for uniformly receiving a calling request sent by a client through a preset interface; the routing module is used for routing the calling request to a target micro-service process corresponding to the calling request according to the calling request; the processing module is used for processing the calling request through the target micro-service process to obtain a calling result; and the first sending module is used for sending the calling result to the routing module and sending the calling result to the client through a preset interface.
The embodiment of the invention also provides a remote procedure call device, which comprises: the definition module, the second sending module and the second receiving module; the definition module is used for defining a calling request; wherein, the calling request at least comprises: business data and service names; the second sending module is used for sending the calling request to a preset interface of the server so that the server can receive the calling request uniformly through the preset interface and process the calling request; the second receiving module is used for receiving the calling result when the server returns the calling result.
An embodiment of the present invention further provides a server, including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the remote procedure call method.
An embodiment of the present invention further provides a client, including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the remote procedure call method.
The embodiment of the invention also provides a remote procedure call system, which comprises the server and the client.
Compared with the prior art, the interface calling is transparent, the server receives the calling request sent by the client side through the fixed interface in a unified mode, the received calling request is routed to the target micro-service process for processing the calling request, the target micro-service process processes and replies the calling request, the obtained calling result is returned to the client side, and the interface for returning the calling result is the same as the interface for receiving the calling request sent by the client side. By the method, the interface can be definitely called, and the client directly sends the calling request to the fixed calling interface, so that the sending object of the calling request is more definite. On the other hand, the receiving and processing of the call request correspond to different processes respectively, and when the micro service process is used for service change, the receiving of the call request is not influenced, and the normal work of other micro service processes is not influenced, so that the service does not need to be interrupted, and the normal response of the call request is ensured.
In addition, after receiving the call request sent by the client, the method further comprises: judging the type of the session requested by the client according to the calling request; the session type specifically includes: a short connection request type or a long connection request type; and when the service type requested by the client is judged to be the long connection request type, establishing a bidirectional channel with the client. When the types of the sessions called by the calling requests are different, the calling requests are processed in different ways.
In addition, routing the invocation request to a target microservice process corresponding to the invocation request according to the invocation request specifically includes: and determining a target micro-service process corresponding to the calling request according to the service name and calling method name contained in the calling request, and routing the calling request to the determined target micro-service process. And determining a target micro-service process for processing the call request according to the service name and the call method name defined in the call request, and selecting the micro-service process most suitable for processing the call request at present according to the service condition of the micro-service process, so that the call request is processed more efficiently.
In addition, the call request is specifically defined by a ProtoBuf serialization protocol and is transmitted based on an HTTP/2 protocol. The method for calling the request and the return type of the calling result are defined by the ProtoBuf serialization protocol, the speed of the content exchange format is improved, and the programming efficiency is improved. The calling request is transmitted based on the HTTP/2 protocol, and header information of the protocol can be compressed, so that the header information of the protocol is smaller, the consumption of flow is reduced, and safe and stable calling service is provided for the client.
Drawings
One or more embodiments are illustrated by way of example in the accompanying drawings, which correspond to the figures in which like reference numerals refer to similar elements and which are not to scale unless otherwise specified.
FIG. 1 is a flow chart of a remote procedure call method according to a first embodiment of the invention;
FIG. 2 is a flow chart of a remote procedure call method according to a second embodiment of the present invention;
FIG. 3 is a schematic diagram of a remote procedure call device according to a third embodiment of the present invention;
FIG. 4 is a schematic diagram of a remote procedure call device according to a fourth embodiment of the present invention;
fig. 5 is a schematic configuration diagram of a server according to a fifth embodiment of the present invention;
fig. 6 is a schematic structural diagram of a client according to a sixth embodiment of the present invention;
fig. 7 is a schematic structural diagram of a remote procedure call system according to a seventh embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, embodiments of the present invention will be described in detail below with reference to the accompanying drawings. However, it will be appreciated by those of ordinary skill in the art that numerous technical details are set forth in order to provide a better understanding of the present application in various embodiments of the present invention. However, the technical solution claimed in the present application can be implemented without these technical details and various changes and modifications based on the following embodiments.
The following embodiments are divided for convenience of description, and should not constitute any limitation to the specific implementation manner of the present invention, and the embodiments may be mutually incorporated and referred to without contradiction.
The first embodiment of the invention relates to a remote procedure call method, which is applied to a server and comprises the following steps: uniformly receiving a calling request sent by a client through a preset interface; routing the calling request to a target micro-service process corresponding to the calling request according to the calling request; and processing the calling request through the target micro-service process to obtain a calling result, and sending the calling result to the client through a preset interface. And receiving the call request sent by the client through a uniform call interface, and routing the call request to the corresponding micro-service process, so that the sending object of the call request is more definite. The implementation details of the remote procedure call method according to this embodiment are described in detail below, and the following description is only provided for the convenience of understanding, and is not necessary for implementing this embodiment. The specific flow is shown in figure 1.
Step 101, uniformly receiving a call request sent by a client through a preset interface. Specifically, a functional interface of the server is optimized, and a fixed interface is set to uniformly receive a call request of the client. For example, calling requests sent by a first terminal, a second terminal, a third terminal and the like of a client are all received by a preset interface of a server, the server manages the calling requests received by the preset interface, a module capable of managing the calling requests by the server is named as a connector module in practical application, and the calling requests received by the server are all received by the connector module.
And 102, routing the calling request to a target micro-service process corresponding to the calling request according to the calling request. Specifically, the service end receives the call request including the service name, the calling method name, and the session type. The service name is used for determining the micro-service module corresponding to the calling request; the calling method names correspond to the calling interfaces and are used for determining functions which can be realized in the micro-service module; the session type includes a short connection request type and a long connection request type, and is used for distinguishing the session type of the call request.
The following describes a call request of the short connection request type and a call request of the long connection request type.
When the session type of the call request is a short connection request type, the short connection request is a request for list data, a request for attendance rules and the like, the connector module routes the call request to the micro-service module corresponding to the call request according to the service name and the calling method name in the call request, and if more than one micro-service module meeting the calling conditions of the call request, one micro-service module with the lowest utilization rate is selected from the calling conditions meeting the call request to process the call request, so that the call result is obtained more efficiently. And when the micro-service module processes the call request, the micro-service module analyzes the message in the call request, and returns the service data called by the client to the connector module according to the analyzed call request to complete the processing of the call request. When the connector module sends a call request to a target microservice process, if the sending fails due to conditions such as overtime, network disconnection and the like, the call request is added into a queue with failed sending, and the call request is automatically retransmitted by a background, so that the call request is ensured to be replied.
When the session type of the call request is a long connection request type, the long connection request is a request such as login, logout, automatic login and the like, the connector module establishes a bidirectional channel between the server and the client, and transmits the long connection request and a call result aiming at the request through the bidirectional channel. After the bidirectional channel is established, whether the connection of the channel is normal or not needs to be detected, and a heartbeat mechanism can be adopted to detect the connection condition of the channel. In addition, when the call request is transmitted by using the bidirectional channel, the user permission of the call request needs to be judged by using the token, and if the terminal user sending the call request does not have the use permission of the bidirectional channel, the call request is refused to pass through the bidirectional channel. And refreshing the token after the token fails, so that the problem that the token fails to cause interface error report is avoided.
And 103, processing the calling request through the target micro-service process to obtain a calling result.
Andstep 104, sending the calling result to the client through a preset interface. Specifically, after the micro service module obtains the call result, the micro service module may be returned to the connector module, and the connector module sends the call result to the client.
Compared with the prior art, the interface calling is transparent, the server receives the calling request sent by the client side through the fixed interface in a unified mode, the received calling request is routed to the target micro-service process for processing the calling request, the target micro-service process processes and replies the calling request, the obtained calling result is returned to the client side, and the interface for returning the calling result is the same as the interface for receiving the calling request sent by the client side. By the method, the interface can be definitely called, and the client directly sends the calling request to the fixed calling interface, so that the sending object of the calling request is more definite. On the other hand, the receiving and processing of the call request correspond to different processes respectively, and when the micro service process is used for service change, the receiving of the call request is not influenced, and the normal work of other micro service processes is not influenced, so that the service does not need to be interrupted, and the normal response of the call request is ensured.
The second embodiment of the invention relates to a remote procedure call method, which is applied to a client and comprises the following steps: defining a calling request; wherein, the calling request at least comprises: business data and service names; sending the calling request to a preset interface of the server, so that the server can receive the calling request through the preset interface in a unified manner and process the calling request; and when the server returns the calling result, receiving the calling result. The implementation details of the remote procedure call method according to this embodiment are described in detail below, and the following description is only provided for the convenience of understanding, and is not necessary for implementing this embodiment. The specific flow is shown in fig. 2.
Step 201, defining a call request. Specifically, the call request is defined through a ProtoBuf serialization protocol, for example, when the defined session type of the call request is a short connection request type, a service data parameter included in the call request is set to a corresponding ProtoBuf object, and binary data is generated. And setting the service name, the calling method name and the generated binary data in the calling request into a corresponding ProtoBuf request object to realize remote calling, wherein if the request object is set as a connector module of the server, the client sends the calling request to the connector module of the server. When the defined session type of the call request is a long connection request type, defining an identifier for distinguishing the long connection request from the short connection request; in addition, the invocation request may include information of the terminal device, such as an identification number (IMEI) of the mobile device, a type or a version number of the terminal device, and the like, which is used for identifying the authority of the user after the bidirectional channel is established. The performance can be improved to a large extent by utilizing the deserialization and serialization of the ProtoBuf protocol, and both sides of the protocol only need to care about protocol definition and do not need to consider the compatibility problem.
Step 202, sending the call request to a preset interface of the server. Specifically, the call request defined above is transmitted by using a standardized HTTP/2 protocol, and the call request is sent to the connector module of the server. The standardized HTTP/2 protocol has the advantages of the SPDY protocol, and simultaneously, the protocol header information is smaller through an HPACK algorithm specially designed for compressing the header information, so that the time and the data volume for transmitting data are reduced, and the calling efficiency of a client is improved.
Step 203, when the server returns the calling result, the calling result is received. Specifically, when the client receives a call result returned by the server, the client analyzes the data type of the data in the call result, and performs deserialization processing on the service data binary stream in the call result by using the ProtoBuf to obtain call data required by the client, wherein the data required to be called by the client can be a received single chat group chat message in an instant messaging system or a contact message in an enterprise address book system. And completing the remote calling.
In the embodiment, the client defines the call request, and sends the defined call request to the unified call interface of the server, so that the sending object of the call request is clarified. The ProtoBuf protocol is utilized when the call request is defined, the performance of data serialization is improved, when the call request is sent to a preset interface of a server side, transmission is carried out based on the HTTP/2 protocol, header information of transmission data can be compressed, and the header information of the protocol is smaller, so that the time and the data volume of the transmission data are reduced, and the call efficiency of a client side is improved.
The steps of the above methods are divided for clarity, and the implementation may be combined into one step or split some steps, and the steps are divided into multiple steps, so long as the same logical relationship is included, which are all within the protection scope of the present patent; it is within the scope of the patent to add insignificant modifications to the algorithms or processes or to introduce insignificant design changes to the core design without changing the algorithms or processes.
A third embodiment of the present invention relates to a remote procedure call apparatus, as shown in fig. 3, including: afirst receiving module 301, arouting module 302, aprocessing module 303, afirst sending module 304; thefirst receiving module 301 is configured to receive a call request sent by a client through a preset interface in a unified manner; therouting module 302 is configured to route the invocation request to a target microservice process corresponding to the invocation request according to the invocation request; theprocessing module 303 is configured to process the call request through the target micro service process to obtain a call result; thefirst sending module 304 is configured to send the call result to the routing module, and send the call result to the client through a preset interface.
It should be understood that this embodiment is a system example corresponding to the first embodiment, and may be implemented in cooperation with the first embodiment. The related technical details mentioned in the first embodiment are still valid in this embodiment, and are not described herein again in order to reduce repetition. Accordingly, the related-art details mentioned in the present embodiment can also be applied to the first embodiment.
It should be noted that each module referred to in this embodiment is a logical module, and in practical applications, one logical unit may be one physical unit, may be a part of one physical unit, and may be implemented by a combination of multiple physical units. In addition, in order to highlight the innovative part of the present invention, elements that are not so closely related to solving the technical problems proposed by the present invention are not introduced in the present embodiment, but this does not indicate that other elements are not present in the present embodiment.
A fourth embodiment of the present invention relates to a remote procedure call apparatus, as shown in fig. 4, including: a definingmodule 401, asecond sending module 402, asecond receiving module 403; thedefinition module 401 is used for defining a call request; wherein, the calling request at least comprises: business data and service names; thesecond sending module 402 is configured to send the call request to a preset interface of the server, so that the server uniformly receives the call request through the preset interface and processes the call request; thesecond receiving module 403 is configured to receive the call result when the server returns the call result.
Since the second embodiment corresponds to the present embodiment, the present embodiment can be implemented in cooperation with the second embodiment. The related technical details mentioned in the second embodiment are still valid in this embodiment, and the technical effects that can be achieved in the second embodiment can also be achieved in this embodiment, and are not described herein again in order to reduce the repetition. Accordingly, the related-art details mentioned in the present embodiment can also be applied to the second embodiment.
A fifth embodiment of the present invention is directed to a server, as shown in fig. 5, including at least oneprocessor 501; and amemory 502 communicatively coupled to the at least oneprocessor 501; wherein thememory 502 stores instructions executable by the at least oneprocessor 501, the instructions being executable by the at least oneprocessor 501 to enable the at least oneprocessor 501 to perform the remote procedure call method described above.
Thememory 502 and theprocessor 501 are coupled by a bus, which may include any number of interconnected buses and bridges that couple one or more of the various circuits of theprocessor 501 and thememory 502 together. The bus may also connect various other circuits such as peripherals, voltage regulators, power management circuits, and the like, which are well known in the art, and therefore, will not be described any further herein. A bus interface provides an interface between the bus and the transceiver. The transceiver may be one element or a plurality of elements, such as a plurality of receivers and transmitters, providing a means for communicating with various other apparatus over a transmission medium. The data processed by the processor is transmitted over the wireless medium via the antenna, which further receives the data and transmits the data to theprocessor 501.
Theprocessor 501 is responsible for managing the bus and general processing and may also provide various functions including timing, peripheral interfaces, voltage regulation, power management, and other control functions. Andmemory 502 may be used to store data used byprocessor 501 in performing operations.
A sixth embodiment of the present invention relates to a client, as shown in fig. 6, including at least oneprocessor 601; and amemory 602 communicatively coupled to the at least oneprocessor 601; thememory 602 stores instructions executable by the at least oneprocessor 601, and the instructions are executed by the at least oneprocessor 601 to enable the at least oneprocessor 601 to execute the remote procedure call method.
Where thememory 602 and theprocessor 601 are coupled by a bus, the bus may comprise any number of interconnected buses and bridges that couple one or more of the various circuits of theprocessor 601 and thememory 602 together. The bus may also connect various other circuits such as peripherals, voltage regulators, power management circuits, and the like, which are well known in the art, and therefore, will not be described any further herein. A bus interface provides an interface between the bus and the transceiver. The transceiver may be one element or a plurality of elements, such as a plurality of receivers and transmitters, providing a means for communicating with various other apparatus over a transmission medium. The data processed by the processor is transmitted over a wireless medium via an antenna, which further receives the data and transmits the data to theprocessor 601.
Theprocessor 601 is responsible for managing the bus and general processing and may also provide various functions including timing, peripheral interfaces, voltage regulation, power management, and other control functions. Whilememory 602 may be used to store data used byprocessor 601 in performing operations.
A seventh embodiment of the present invention relates to a remote procedure call system, as shown in fig. 7, including the above-mentioned server 72 and the above-mentioned client 71, where the client 71 includes at least one terminal, and the first terminal 711, the second terminal 712, and thethird terminal 713 constitute the client 71 in fig. 7.
An eighth embodiment of the present invention relates to a computer-readable storage medium storing a computer program. The computer program realizes the above-described method embodiments when executed by a processor.
That is, as can be understood by those skilled in the art, all or part of the steps in the method for implementing the embodiments described above may be implemented by a program instructing related hardware, where the program 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 described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It will be understood by those of ordinary skill in the art that the foregoing embodiments are specific examples for carrying out the invention, and that various changes in form and details may be made therein without departing from the spirit and scope of the invention in practice.

Claims (10)

Translated fromChinese
1.一种远程过程调用方法,其特征在于,应用于服务器,所述方法包括:1. a remote procedure call method, is characterized in that, is applied to server, described method comprises:通过预设的接口统一接收客户端发送的调用请求,所述调用请求包括服务名、调用方法名、以及会话类型,其中所述服务名用于确定该调用请求对应的微服务模块,所述调用方法名对应调用接口;所述调用请求在客户端通过ProtoBuf序列化协议进行定义,其中如果调用请求的会话类型是短连接请求类型时,将调用请求中包括的业务数据参数设置到对应的ProtoBuf对象中,生成二进制数据;将所述服务名、调用方法名和生成的二进制数据设置到对应的ProtoBuf请求对象中用于远程调用;如果调用请求的会话类型是长连接请求类型,携带客户端的设备信息,用于在建立双向通道后,对客户端的权限进行识别;The invocation request sent by the client is uniformly received through a preset interface. The invocation request includes the service name, the invocation method name, and the session type, wherein the service name is used to determine the microservice module corresponding to the invocation request. The method name corresponds to the calling interface; the calling request is defined on the client side through the ProtoBuf serialization protocol, and if the session type of the calling request is the short connection request type, the business data parameters included in the calling request are set to the corresponding ProtoBuf object , generate binary data; set the service name, the calling method name and the generated binary data in the corresponding ProtoBuf request object for remote calling; if the session type of the calling request is a long connection request type, carrying the device information of the client, It is used to identify the client's authority after establishing a two-way channel;根据所述调用请求将所述调用请求路由至所述调用请求对应的目标微服务进程;Route the invocation request to the target microservice process corresponding to the invocation request according to the invocation request;通过所述目标微服务进程对所述调用请求进行处理,得到调用结果,并将所述调用结果通过所述预设的接口发送至所述客户端。The invocation request is processed by the target microservice process to obtain an invocation result, and the invocation result is sent to the client through the preset interface.2.根据权利要求1所述的远程过程调用方法,其特征在于,在所述接收客户端发送的调用请求之后,还包括:2. The remote procedure calling method according to claim 1, characterized in that, after receiving the calling request sent by the client, the method further comprises:在判定所述客户端所请求的所述业务类型为长连接请求类型时,与所述客户端建立双向通道。When it is determined that the service type requested by the client is a persistent connection request type, a two-way channel is established with the client.3.根据权利要求1所述的远程过程调用方法,其特征在于,所述根据所述调用请求将所述调用请求路由至所述调用请求对应的目标微服务进程,具体包括:3. The remote procedure invocation method according to claim 1, wherein the routing the invocation request to the target microservice process corresponding to the invocation request according to the invocation request specifically comprises:根据所述调用请求中包含的服务名及调用方法名确定所述调用请求对应的目标微服务进程,并将所述调用请求路由至所述确定的目标微服务进程。The target microservice process corresponding to the invocation request is determined according to the service name and invocation method name contained in the invocation request, and the invocation request is routed to the determined target microservice process.4.一种远程过程调用方法,其特征在于,应用于客户端,所述方法包括:4. A remote procedure calling method, characterized in that, applied to a client, the method comprising:定义调用请求;其中,所述调用请求中至少包括:服务名、调用方法名、以及会话类型,其中所述服务名用于确定该调用请求对应的微服务模块,所述调用方法名对应调用接口;所述调用请求通过ProtoBuf序列化协议进行定义,其中如果调用请求的会话类型是短连接请求类型时,将调用请求中包括的业务数据参数设置到对应的ProtoBuf对象中,生成二进制数据;将所述服务名、调用方法名和生成的二进制数据设置到对应的ProtoBuf请求对象中用于远程调用;如果调用请求的会话类型是长连接请求类型,携带客户端的设备信息,用于在建立双向通道后,对客户端的权限进行识别;Define an invocation request; wherein the invocation request at least includes: service name, invocation method name, and session type, wherein the service name is used to determine the microservice module corresponding to the invocation request, and the invocation method name corresponds to the invocation interface The call request is defined by the ProtoBuf serialization protocol, and if the session type of the call request is a short connection request type, the business data parameter included in the call request is set to the corresponding ProtoBuf object, and binary data is generated; The service name, the calling method name and the generated binary data are set to the corresponding ProtoBuf request object for remote calling; if the session type of the calling request is a long-connection request type, it carries the client's device information, which is used to establish a two-way channel. Identify the permissions of the client;将所述调用请求发送至服务器的预设的接口,以供所述服务器通过预设的接口统一接收所述调用请求,并对所述调用请求进行处理;sending the invocation request to a preset interface of the server, so that the server can uniformly receive the invocation request through the preset interface, and process the invocation request;在服务器返回调用结果时,接收所述调用结果。When the server returns the invocation result, the invocation result is received.5.根据权利要求4所述的远程过程调用方法,其特征在于,所述调用请求基于HTTP/2协议进行传输。5 . The remote procedure calling method according to claim 4 , wherein the calling request is transmitted based on the HTTP/2 protocol. 6 .6.一种远程过程调用装置,其特征在于,包括:第一接收模块,路由模块,处理模块,第一发送模块;6. A remote procedure calling device, comprising: a first receiving module, a routing module, a processing module, and a first sending module;所述第一接收模块用于通过预设的接口统一接收客户端发送的调用请求,所述调用请求包括服务名、调用方法名、以及会话类型,其中所述服务名用于确定该调用请求对应的微服务模块,所述调用方法名对应调用接口;所述调用请求在客户端通过ProtoBuf序列化协议进行定义,其中如果调用请求的会话类型是短连接请求类型时,将调用请求中包括的业务数据参数设置到对应的ProtoBuf对象中,生成二进制数据;将所述服务名、调用方法名和生成的二进制数据设置到对应的ProtoBuf请求对象中用于远程调用;如果调用请求的会话类型是长连接请求类型,携带客户端的设备信息,用于在建立双向通道后,对客户端的权限进行识别;The first receiving module is configured to uniformly receive a call request sent by the client through a preset interface, where the call request includes a service name, a call method name, and a session type, wherein the service name is used to determine the corresponding call request. The microservice module, the calling method name corresponds to the calling interface; the calling request is defined on the client side through the ProtoBuf serialization protocol, and if the session type of the calling request is the short connection request type, the service included in the calling request will be called. The data parameters are set to the corresponding ProtoBuf object to generate binary data; the service name, the calling method name and the generated binary data are set to the corresponding ProtoBuf request object for remote invocation; if the session type of the invocation request is a long connection request Type, which carries the device information of the client, which is used to identify the client's authority after the two-way channel is established;所述路由模块用于根据所述调用请求将所述调用请求路由至所述调用请求对应的目标微服务进程;The routing module is configured to route the invocation request to the target microservice process corresponding to the invocation request according to the invocation request;所述处理模块用于通过所述目标微服务进程对所述调用请求进行处理,得到调用结果;The processing module is configured to process the invocation request through the target microservice process to obtain an invocation result;所述第一发送模块用于将所述调用结果发送至所述路由模块,并通过所述预设的接口发送至所述客户端。The first sending module is configured to send the calling result to the routing module, and send the result to the client through the preset interface.7.一种远程过程调用装置,其特征在于,包括:定义模块,第二发送模块,第二接收模块;7. A remote procedure invocation device, comprising: a definition module, a second sending module, and a second receiving module;所述定义模块用于定义调用请求;其中,所述调用请求中至少包括:服务名、调用方法名、以及会话类型,其中所述服务名用于确定该调用请求对应的微服务模块,所述调用方法名对应调用接口;所述调用请求通过ProtoBuf序列化协议进行定义,其中如果调用请求的会话类型是短连接请求类型时,将调用请求中包括的业务数据参数设置到对应的ProtoBuf对象中,生成二进制数据;将所述服务名、调用方法名和生成的二进制数据设置到对应的ProtoBuf请求对象中用于远程调用;如果调用请求的会话类型是长连接请求类型,携带客户端的设备信息,用于在建立双向通道后,对客户端的权限进行识别;The definition module is used to define a call request; wherein, the call request at least includes: a service name, a call method name, and a session type, wherein the service name is used to determine the microservice module corresponding to the call request, and the The calling method name corresponds to the calling interface; the calling request is defined by the ProtoBuf serialization protocol, and if the session type of the calling request is a short connection request type, the business data parameters included in the calling request are set to the corresponding ProtoBuf object, Generate binary data; set the service name, the calling method name and the generated binary data into the corresponding ProtoBuf request object for remote calling; if the session type of the calling request is a long-connection request type, carry the client's device information for After establishing a two-way channel, identify the client's authority;所述第二发送模块用于将所述调用请求发送至服务器的预设的接口,以供所述服务器通过预设的接口统一接收所述调用请求,并对所述调用请求进行处理;The second sending module is configured to send the invocation request to a preset interface of the server, so that the server can uniformly receive the invocation request through the preset interface, and process the invocation request;所述第二接收模块用于在服务器返回调用结果时,接收所述调用结果。The second receiving module is configured to receive the calling result when the server returns the calling result.8.一种服务器,其特征在于,包括:8. A server, characterized in that, comprising:至少一个处理器;以及,at least one processor; and,与所述至少一个处理器通信连接的存储器;其中,a memory communicatively coupled to the at least one processor; wherein,所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行如权利要求1至3中任一所述的远程过程调用方法。The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform any one of claims 1 to 3 remote procedure call method.9.一种客户端,其特征在于,包括:9. A client, characterized in that, comprising:至少一个处理器;以及,at least one processor; and,与所述至少一个处理器通信连接的存储器;其中,a memory communicatively coupled to the at least one processor; wherein,所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行如权利要求4至5中任一所述的远程过程调用方法。The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the execution of any of claims 4 to 5 remote procedure call method.10.一种远程过程调用系统,其特征在于,包括如权利要求8所述的服务器和如权利要求9所述的客户端。10. A remote procedure calling system, comprising the server according to claim 8 and the client according to claim 9.
CN201910899742.5A2019-09-232019-09-23 Remote procedure call method, device and systemActiveCN110808948B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201910899742.5ACN110808948B (en)2019-09-232019-09-23 Remote procedure call method, device and system

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201910899742.5ACN110808948B (en)2019-09-232019-09-23 Remote procedure call method, device and system

Publications (2)

Publication NumberPublication Date
CN110808948A CN110808948A (en)2020-02-18
CN110808948Btrue CN110808948B (en)2022-03-11

Family

ID=69487807

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201910899742.5AActiveCN110808948B (en)2019-09-232019-09-23 Remote procedure call method, device and system

Country Status (1)

CountryLink
CN (1)CN110808948B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN113709085A (en)*2020-05-222021-11-26成都鼎桥通信技术有限公司Remote procedure call processing method, device and equipment
CN111711620B (en)*2020-06-052022-08-09南京领行科技股份有限公司Method, device, equipment and storage medium for realizing bidirectional communication between applications
CN111818144B (en)*2020-06-302022-12-20中国工商银行股份有限公司Message transmission method, device and system under remote service calling framework
CN112732373A (en)*2021-04-062021-04-30北京轻松筹信息技术有限公司User request processing method and device and electronic equipment
CN113254090B (en)*2021-06-042024-05-28深圳市火乐科技发展有限公司Application management method and device and projection equipment
CN114629945A (en)*2022-03-222022-06-14深圳壹账通智能科技有限公司Micro-service architecture based interface calling method and device and computer equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN106255172A (en)*2016-07-222016-12-21乐视控股(北京)有限公司Communication means based on multipath and device
CN106980545A (en)*2016-01-152017-07-25阿里巴巴集团控股有限公司 Remote calling method and device
CN107948215A (en)*2018-01-172018-04-20广州汇智通信技术有限公司A kind of remote invocation method and device based on UDP communications
CN109560895A (en)*2018-12-272019-04-02北京百佑科技有限公司Data transmission method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US10771564B2 (en)*2017-11-222020-09-08International Business Machines CorporationSharing system managed HTTP client sessions across processes

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN106980545A (en)*2016-01-152017-07-25阿里巴巴集团控股有限公司 Remote calling method and device
CN106255172A (en)*2016-07-222016-12-21乐视控股(北京)有限公司Communication means based on multipath and device
CN107948215A (en)*2018-01-172018-04-20广州汇智通信技术有限公司A kind of remote invocation method and device based on UDP communications
CN109560895A (en)*2018-12-272019-04-02北京百佑科技有限公司Data transmission method and device

Also Published As

Publication numberPublication date
CN110808948A (en)2020-02-18

Similar Documents

PublicationPublication DateTitle
CN110808948B (en) Remote procedure call method, device and system
CN102571756B (en)Multichannel in file system session connects
EP3734913A1 (en)Communication method and communication apparatus
CN113411215B (en)Time-sensitive network centralized user configuration method and system based on OPC UA
CN109672708B (en) Communication method, device and system
CN110995554A (en) Method, device and storage medium for configuring network access of smart home appliances
CN110855792B (en)Message pushing method, device, equipment and medium
WO2018157439A1 (en)Service processing method and device
US20160037429A1 (en)Low cost mesh network capability
CN114338063B (en) Message queue system, business processing method and computer-readable storage medium
CN109857572B (en)Method, device and equipment for realizing remote calling and computer readable storage medium
CN108353263B (en)Method of processing service request in wireless communication system and apparatus therefor
CN112511621B (en)Data transmission method and device, storage medium, and electronic device
CN110912805B (en) Synchronization method, terminal, server and system for message reading status
CN113691520B (en)Method and device for acquiring streaming media information, storage medium and electronic device
CN110572476B (en)Remote control method, device and equipment
CN112491951A (en)Request processing method, server and storage medium in peer-to-peer network
US8145698B1 (en)Self organizing peer-to-peer system, method, and/or apparatus
CN108632355B (en) A home appliance network routing method, control terminal, readable storage medium and device
CN117336346A (en)IPPBX and PMS docking state conversion method, terminal equipment and medium
WO2024027614A1 (en)Communication method and communication device
CN105634931A (en)Messaging service processing method and instant messaging server
CN114189384B (en)Service processing method, device, equipment and storage medium
CN111240867B (en)Information communication system and method
CN115022224B (en) A method, device and equipment for processing session establishment

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp