RPC-based parameter transmission method and apparatus, system, and storage medium
By using WebSocket connections and a publish-subscribe approach in RPC transmission, the problems of RPC transmission latency and packet loss are solved, enabling efficient parameter transmission and real-time monitoring of controlled devices, thus improving the user experience.
Patent Information
- Application Number
- PCT/CN2023/115906
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-08-30
- Publication Date
- 2025-03-06
AI Technical Summary
Existing RPC parameter transmission methods suffer from latency and packet loss issues in communication between the client and server, leading to degraded transmission performance and impacting user experience.
Parameters are transmitted using a WebSocket connection, and relevant information about the controlled device, including status information and the results of control commands, is obtained from the server through a publish-subscribe approach.
The WebSocket connection enables efficient and reliable parameter transmission, reduces latency and packet loss, improves transmission performance, and allows for real-time monitoring of the controlled device's status.
Smart Images

Figure CN2023115906_06032025_PF_FP_ABST
Abstract
Description
A method, device, system and storage medium based on RPC transmission parameters Technical Field
[0001] The present application relates to the technical field of computer network communications, and in particular to a method, device, system and storage medium for transmitting parameters based on remote procedure call (RPC). Background Art
[0002] RPC, or remote procedure call, is a method used in distributed computer networks to transfer parameters from one server application to another server application over a computer network. Specifically, the RPC process works as follows: Server A and Server B deploy an application on Server A. If that application wants to call a method or function in another application on Server B, the method or function is called in Server A's application over the computer network between Servers A and B. Here, the method or function refers to the parameters obtained by encapsulating the computer language code that implements a specific function in the application.
[0003] Typically, RPC is implemented using object-oriented programming in computer languages such as Golang, Python, or PHP to construct an RPC framework. The RPC framework includes a client and a server. The client is deployed on the device that calls the parameters, while the server is deployed on the device receiving the parameters. When an application requires parameters from the server, the client establishes communication with the server, initiates a call request to the server, and receives the requested parameters. The server receives the client's call request, extracts the parameters from the local application, and sends them to the client. One of the steps in implementing RPC is how to transmit parameters between the client and server. Currently, mainstream computer network communication protocols such as the Transmission Control Protocol (TCP) or the Hypertext Transfer Protocol (HTTP) are used to transmit parameters. However, because these protocols were not designed for RPC communication requirements, they are not highly adaptable and can cause packet loss or delays when transmitting parameters between the client and server, reducing parameter transmission performance and the user experience.
[0004] Summary of the Invention
[0005] In view of this, the embodiments of the present application provide, on one hand, a method based on RPC transmission parameters, which can improve the performance of the RPC transmission parameters. On the other hand, the embodiments of the present application provide, on the other hand, a device, system, and storage medium based on RPC transmission parameters, which can improve the performance of the RPC transmission parameters.
[0006] In one embodiment of the present application, a method for transmitting parameters based on RPC is provided, including:
[0007] The server receives the websocket connection request from the client and establishes a websocket connection with the client;
[0008] The server receives a call request sent by the client through the websocket connection, where the call request is used to call parameters required by an application of the client;
[0009] The server sends the acquired parameters of the call request to the client through the websocket connection.
[0010] In the above embodiment, the server receiving the call request sent by the client through the websocket connection includes:
[0011] The call request is binary serialized and sent through the websocket connection;
[0012] After receiving the request, the server performs binary deserialization on the binary serialized request;
[0013] The server sends the acquired parameters of the call request to the client through the websocket connection, including:
[0014] The server performs binary serialization processing on the acquired parameters and sends the obtained parameters through the websocket connection, so that after receiving the parameters, the client performs binary deserialization processing on the acquired parameters that have been binary serialized to obtain the acquired parameters.
[0015] In the above embodiment, the parameters to be called by the call request obtained by the server include:
[0016] The server obtains a method or function from the local application, and uses the method or function as a parameter to be called in the call request.
[0017] In the above embodiment, the method further includes:
[0018] The server adopts a subscription publishing method to push relevant information of at least one controlled device under monitoring to a client that subscribes to the relevant information through the websocket connection.
[0019] In the above embodiment, the server adopts a subscription publishing method to push the relevant information of at least one monitored controlled device to the client subscribing to the relevant information through the websocket connection, including:
[0020] The server receives a subscription request sent by the client through the websocket connection, where the subscription request is used to subscribe to relevant information of at least one controlled device monitored by the server, where the relevant information of the controlled device includes: status information of the controlled device or result information of the controlled device executing a control command;
[0021] The server establishes a second subscription application locally, and the second subscription application is bound to the first subscription application established by the client;
[0022] When the subscribed related information of the controlled device is acquired by the second subscription application of the server, the server pushes the subscribed related information of the controlled device to the first subscription application of the client through the second subscription application.
[0023] In the above embodiment, the subscribed related information of the controlled device is acquired by the second subscription application of the server, including:
[0024] The server interacts with the controlled device in a polling access manner or a timed access manner, so that the subscribed related information of the controlled device is acquired by the second subscription application.
[0025] In another embodiment of the present application, a device based on RPC transmission parameters is provided, comprising: a transmission unit and a request processing unit, wherein:
[0026] The transmission unit is configured to receive a websocket connection request from a client and establish a websocket connection with the client;
[0027] The request processing unit is used to receive a call request sent by the client through the websocket connection, where the call request is used to call the parameters required by an application of the client; obtain the parameters to be called by the call request, and send the obtained parameters to the client through the websocket connection.
[0028] In another embodiment of the present application, a system based on RPC transmission parameters is provided, comprising: at least one client and a server, wherein:
[0029] The client is configured to send a websocket connection request to the server; send a call request to the server via the websocket connection, wherein the call request is used to call parameters required by an application of the client; and receive parameters to be called by the call request;
[0030] The server is configured to receive a websocket connection request from the client, establish a websocket connection with the client, receive the call request, obtain parameters to be called by the call request, and send them to the client via the websocket connection.
[0031] In another embodiment of the present application, an electronic device is provided, including:
[0032] processor;
[0033] A memory stores a program, wherein the program is configured to implement any of the above-mentioned methods based on RPC transmission parameters when executed by the processor.
[0034] In another embodiment of the present application, a computer program product is provided, including a computer program or instructions, which, when executed by a processor, implements any of the above-mentioned methods based on RPC transmission parameters.
[0035] In another embodiment of the present application, a non-transitory computer-readable storage medium is provided, wherein the non-transitory computer-readable storage medium stores instructions, wherein when the instructions are executed by a processor, the processor executes any one of the above-mentioned methods based on RPC transmission parameters.
[0036] In an embodiment of the present application, when the server provides parameters called by an application of the client, a websocket connection is established between the server and the client, and the parameters are transmitted to the application of the client through the websocket connection. Furthermore, the client also subscribes to the relevant information of at least one controlled device monitored by the service from the server through a publish / subscribe (pub / sub) method based on the established websocket connection, so that the client can monitor the controlled device through the server. Since websocket is a full-duplex communication protocol on TCP, it allows the server to actively push parameters or information to the client, and when the two are connected using websocket, only one handshake between the two is required to create a persistent connection, thereby avoiding delays or packet loss in parameters transmitted based on the websocket connection and improving the performance of transmitting parameters or information. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The preferred embodiments of the present application will be described in detail below with reference to the accompanying drawings, so that those skilled in the art can better understand the above and other features and advantages of the present application. In the accompanying drawings:
[0038] FIG1 is a schematic diagram of an RPC framework for implementing RPC according to an embodiment of the present application;
[0039] FIG2 is a flow chart of a method for transmitting parameters based on RPC provided in an embodiment of the present application;
[0040] FIG3 is a flow chart of a client subscribing to relevant information of at least one controlled device monitored by a server through a subscription and publishing method according to an embodiment of the present application;
[0041] FIG4 is a schematic diagram of a device structure based on RPC transmission parameters provided in an embodiment of the present application;
[0042] FIG5 is a schematic diagram of a system structure based on RPC transmission parameters provided in an embodiment of the present application.
[0043] The accompanying drawings are numerals as follows: DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solutions and advantages of this application clearer, the following embodiments are given to further illustrate this application in detail.
[0045] Currently, there are two main RPC frameworks that can implement RPC. One is the zerorpc framework, in which the server transmits the parameters of the client application call to the client based on TCP. The client uses a request-response method to implement the client application's required parameters from the server. Therefore, it is necessary to pre-set the environment for running zerorpc on both the server and the client to implement RPC. The other is the jsonrpc framework, in which the server transmits the parameters of the client application call to the server based on TCP. Both the client and the server use json settings and can run in a javascript computer language environment pre-set on the client and server. The jsonrpc framework does not support the pub / sub method on the server side. The server cannot monitor background services or obtain relevant information about background services in real time, such as status information or the results of executing control commands. It cannot transmit the relevant information of background services to the client as parameters required by the client application. As a result, the types of parameters transmitted to the client application are reduced, reducing the efficiency of the client's monitoring of the server's background services.
[0046] In addition, some RPC frameworks can also enable the server to transmit the parameters of the client's application call to the client based on HTTP when implementing RPC.
[0047] It can be seen from the above scheme that no matter which RPC framework is used to implement RPC, when the client application calls the required parameters from the server through the computer network, it is usually through TCP or HTTP, which is subject to the performance limitations of the communication protocol such as TCP or HTTP it adopts, causing delays or packet loss in the parameter transmission, resulting in a decrease in the transmission performance of the parameters, affecting the effect of the remote call, and reducing the user experience.
[0048] A server that implements RPC not only includes local applications, but also provides at least one background service that can be deployed to the controlled device to receive relevant information about the controlled device, such as status information or the results of executing control commands. Currently, how the server that implements RPC provides the client with relevant information about the controlled device it monitors, while ensuring the accuracy and timeliness of the information, is also an urgent problem to be solved. Furthermore, in the process of implementing RPC, when the server provides the client with parameters for the client's application call, it currently only provides the method or function of a certain function in the local application, and does not include relevant information about the controlled device. However, when the client application is executed, it also needs relevant information about the controlled device, but there is currently no channel to obtain it.
[0049] To address the aforementioned issues, in an embodiment of the present application, when a server provides parameters to be called by an application on a client, a WebSocket connection is established between the server and the client, and the parameters are transmitted to the client application via the WebSocket connection. Furthermore, based on the established WebSocket connection, the client subscribes to information related to at least one controlled device monitored by the server from the server via a pub / sub method, enabling the client to monitor the controlled device through the server.
[0050] In an embodiment of the present application, since websocket is a full-duplex communication protocol on TCP, it allows the server to actively push parameters or information to the client, and when the two are connected using websocket, only one handshake between the two is required to create a persistent connection, thereby avoiding delays or packet loss in parameters transmitted based on the websocket connection and improving the performance of transmitting parameters or information.
[0051] FIG1 is a schematic diagram of an RPC framework for implementing RPC according to an embodiment of the present application, including a client 10 and a server 20. In the message layer 11 of the client 10, a call request is set to call the parameters required for an application of the client 10. The call request is compiled into a format adapted for websocket transmission, such as by binary serialization, and is transmitted to the websocket-based transport layer 22 of the server 20 via the websocket-based transport layer 12 of the client 10. In the message layer 21 of the server 20, the call request is decompiled into a format adapted for websocket transmission, such as by binary deserialization, to obtain the call request. In the message layer 21 of the server 20, the parameters required by an application of the client 10 are obtained and compiled into a format suitable for websocket transmission, for example, by using binary serialization processing, and then transmitted to the websocket-based transport layer 12 of the client 10 through the websocket-based transport layer 22 of the server 20. The message layer 11 of the client 10 decompiles the received parameters required by an application of the client into a format suitable for websocket transmission to obtain the parameters required by an application of the client.
[0052] FIG2 is a flow chart of a method for transmitting parameters based on RPC provided in an embodiment of the present application, wherein the specific steps include:
[0053] Step 201: The server receives a websocket connection request from the client.
[0054] Step 202: The server establishes a websocket connection with the client.
[0055] Step 202: The server receives a call request sent by the client through the websocket connection, where the call request is used to call parameters required by an application of the client;
[0056] Step 203: The server obtains the parameters to be called by the call request;
[0057] Step 204: The server sends the acquired parameters to the client through the websocket connection.
[0058] In this way, the method described in FIG. 1 is used to implement the parameters required for the client to call any application of the client from the server.
[0059] In an embodiment of the present application, the implementation of RPC includes a client and a server, wherein the client, which can also be called the user end, is a program that provides local applications to customers and can be hosted on user devices such as computers, mobile terminals or tablets; the server is a program running on a remote computer, which is responsible for processing and responding to call requests from the client.
[0060] In an embodiment of the present application, the server receiving the call request sent by the client through the websocket connection includes:
[0061] The call request is binary serialized and sent via a websocket connection;
[0062] After receiving the binary serialization request, the server performs binary deserialization on the call request.
[0063] Here, when implementing RPC, the call request transmitted between the client and the server adopts binary serialization and deserialization, and the websocket connection also supports the transmission of binary code, so the binary serialization method is adopted when transmitting the call request. After receiving it, the server executes the binary deserialization method to obtain the call request.
[0064] Accordingly, in the embodiment of the present application, the server sending the acquired parameters to the client through the websocket connection includes:
[0065] The server performs binary serialization processing on the acquired parameters and sends them through a websocket connection, so that after receiving the parameters, the client performs binary deserialization processing on the acquired parameters that have been binary serialized to obtain the acquired parameters for execution in the client application.
[0066] In an embodiment of the present application, the server obtains the parameters to be called by the call request including:
[0067] The server obtains a method or function from the local application, and uses the method or function as a parameter to be called in the call request.
[0068] In this case, it indicates that the parameter to be called by the call request is a method or function of the local application of the server that implements a certain function, and the method or function is directly searched and passed to the client.
[0069] In an embodiment of the present application, the method further includes:
[0070] The server adopts a subscription publishing method to push relevant information of at least one controlled device under monitoring to a client that subscribes to the relevant information through the websocket connection.
[0071] Specifically, the server adopts a subscription publishing method to push the relevant information of at least one monitored controlled device to the client that subscribes to the relevant information through the websocket connection, including:
[0072] The server receives a subscription request sent by the client through the websocket connection, where the subscription request is used to subscribe to relevant information of at least one controlled device monitored by the server, where the relevant information of the controlled device includes: status information of the controlled device or result information of the controlled device executing a control command;
[0073] The server establishes a second subscription application locally, and the second subscription application is bound to the first subscription application established by the client;
[0074] When the subscribed related information of the controlled device is acquired by the second subscription application of the server, the server pushes the subscribed related information of the controlled device to the first subscription application of the client through the second subscription application.
[0075] Here, the subscribed related information of the controlled device being acquired by the second subscription application of the server includes:
[0076] The server interacts with the controlled device in a polling access manner or a timed access manner, so that the subscribed related information of the controlled device is acquired by the second subscription application.
[0077] When a client interacts with a server using a PRC approach, it not only requires a method or function in the server's local application that implements a certain function for the client's application to use during execution, but also needs to monitor at least one of the server's backend services and obtain relevant information about the backend service from the server for use by the client's application during execution. Therefore, the client uses a subscription-based publishing approach to obtain relevant information about the at least one backend service it monitors from the server. Here, a backend service is an application running on the server that exchanges data with the server's frontend via network communication. It is responsible for handling backend data processing and business logic processing unrelated to client interaction. In a specific implementation, at least one backend service of the server can be deployed to the controlled devices monitored by the server. These controlled devices can be industrial robots or industrial programmable logic controllers (PLCs). The server interacts with these controlled devices using a polling or timing approach to obtain information about the controlled devices' runtime status or the results of the controlled devices' execution of control commands. The server then pushes the obtained relevant information about the controlled devices to the client using a subscription-based publishing approach based on a WebSocket connection.
[0078] In this embodiment of the present application, the server implementing the RRC not only needs to transmit the method or function implementing a certain function in the local application to the client, but also needs to obtain relevant information about the controlled device in real time and push it to the client via a WebSocket connection. The client subscribes to the relevant information of at least one controlled device monitored by the server through a subscription-publishing method, thereby obtaining relevant information about the controlled device in real time, such as status information or the results of executing control commands.
[0079] FIG3 is a flowchart of a client subscribing to relevant information of at least one controlled device monitored by a server through a subscription-publishing method according to an embodiment of the present application. The specific steps include:
[0080] Step 301: Establish a websocket connection between the server and the client;
[0081] Step 302: The server receives a subscription request sent by the client, where the subscription request is used to subscribe to relevant information of at least one controlled device monitored by the server;
[0082] Step 303: The client establishes a first subscription application locally based on the sent subscription request;
[0083] Step 304: The server establishes the second application locally based on the subscription request, and binds the second subscription application to the first subscription application established by the client.
[0084] Step 305: When the subscribed related information of the controlled device is acquired by the second subscription application of the server, the server pushes the subscribed related information of the controlled device to the first subscription application of the client through the second subscription application.
[0085] In the above method, the first subscription application in the client is bound to the second subscription application of the server, and is implemented by using an instance context method. The instance context method indicates that the service instance of the client is bound to the service agent of the server. Through the context instances established respectively in the two, the context instance of the server pushes the relevant information of the controlled device to the context instance corresponding to the client.
[0086] In the above process, the relevant information of the controlled device includes:
[0087] Status information of the controlled device or result information of executing the control command.
[0088] In the above process, the subscribed related information of the controlled device is acquired by the second subscription application of the server, including:
[0089] The server interacts with the controlled device in a polling access manner or a timed access manner, so that the subscribed related information of the controlled device is acquired by the second subscription application.
[0090] In the above process, the communication between the server and at least one controlled device monitored by the server can be implemented using various communication protocols, which are not limited here.
[0091] FIG4 is a schematic diagram of a device structure based on RPC transmission parameters provided by an embodiment of the present application. The device is a server, including: a transmission unit 40 and a request processing unit 41, wherein:
[0092] The transmission unit 40 is configured to receive a websocket connection request from a client and establish a websocket connection with the client;
[0093] The request processing unit 41 is used to receive a call request sent by the client through the websocket connection, where the call request is used to call the parameters required by an application of the client; obtain the parameters to be called by the call request, and send the obtained parameters to the client through the websocket connection.
[0094] In the device, the request processing unit 41 is also used to adopt a binary sequence deserialization method to receive the call request sent by the client through the websocket connection; and is also used to adopt a binary sequence deserialization method to send the obtained parameters to the client through the websocket connection.
[0095] In the device, the request processing unit 41 is further configured to obtain the parameters to be called by the call request, including:
[0096] A method or function is obtained from the local application, and the method or function is used as a parameter to be called in the call request.
[0097] In the device, the request processing unit 41 is further configured to adopt a subscription-publishing method to push relevant information of at least one monitored controlled device to a client that subscribes to the relevant information through the websocket connection.
[0098] Here, the relevant information of the monitored controlled device includes but is not limited to status information of the controlled device or result information of the controlled device executing the control command.
[0099] FIG5 is a schematic diagram of a system structure based on RPC transmission parameters provided by an embodiment of the present application, including: at least one client 10 and a server 20, wherein:
[0100] The client 10 is configured to send a websocket connection request to the server 20; send a call request to the server 20 via the websocket connection, wherein the call request is used to call parameters required by an application of the client 10; and receive parameters to be called by the call request;
[0101] The server 20 is configured to receive a websocket connection request from the client 10 and establish a websocket connection with the client 10; receive the call request; obtain parameters to be called by the call request, and send them to the client 10 via the websocket connection.
[0102] In the above system, the server 20 is further configured to receive the call request sent by the client 10 through the websocket connection by adopting a binary sequence deserialization method.
[0103] In the above system, the server 20 is further configured to use a binary sequence deserialization method to send the acquired parameters to the client 10 through the websocket connection.
[0104] In the above system, at least one controlled device 30 is further included, which is used to send relevant information of the controlled device 30 to the server 20 under the monitoring of the server 20;
[0105] The server 20 is further configured to adopt a subscription-publishing method to push the relevant information of the monitored controlled device to the client 10 that subscribes to the relevant information through the websocket connection.
[0106] In the above system, the server 20 is further configured to obtain the parameters to be called by the call request, including:
[0107] A method or function is obtained from the local application, and the method or function is used as a parameter to be called in the call request.
[0108] Here, the information related to the monitored controlled device includes but is not limited to the status information of the controlled device or the result information of the controlled device executing the control command. The monitored controlled device includes but is not limited to industrial equipment such as industrial robots or PLCs.
[0109] In another embodiment of the invention, an electronic device is provided, comprising: a processor; and a memory storing a program, wherein the program is configured to implement the aforementioned method for transmitting parameters based on RPC when executed by the processor. The electronic device specifically comprises a processor configured to execute the steps of the aforementioned method for transmitting parameters based on RPC. The electronic device provided in the aforementioned embodiment also includes a non-transitory computer-readable storage medium storing a computer program, which, when executed by the processor, executes the steps of the aforementioned method for transmitting parameters based on RPC.
[0110] Specifically, the non-transitory computer-readable storage medium can be a general storage medium, such as a mobile disk, a hard disk, FLASH, a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), or a portable compact disk read-only memory (CD-ROM), etc. When the computer program on the non-transitory computer-readable storage medium is executed by the processor, it can trigger the processor to execute the various steps of the above-mentioned method based on RPC transmission parameters.
[0111] In practical applications, the non-transitory computer-readable storage medium may be included in the device / apparatus / system described in the above embodiments, or may exist independently and not be incorporated into the device / apparatus / system. The computer-readable storage medium carries one or more programs, which, when executed, can perform the steps of the above-described method for transmitting parameters based on RPC.
[0112] In another embodiment of the present application, a non-transitory computer-readable storage medium is provided, wherein the non-transitory computer-readable storage medium stores instructions, which, when executed by a processor, cause the processor to execute a method based on RPC transmission parameters in the aforementioned embodiment.
[0113] Yet another embodiment of the present application provides a computer program product, including a computer program or instructions, which implements the various steps of the above-mentioned method of transmitting parameters based on RPC when executed by a processor.
[0114] The flowcharts and block diagrams in the accompanying drawings of the present application show the possible implementation architecture, functions and operations of the systems, methods and computer program products according to the various embodiments disclosed in the present application. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the above-mentioned module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in the order of the standards in different figures. For example, the boxes represented by two connections can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of the boxes in the block diagram or flowchart, can be implemented by a dedicated hardware-based system that performs the specified function or operation, or can be implemented by a combination of dedicated hardware and computer instructions.
[0115] Those skilled in the art will appreciate that the features described in the various embodiments and / or claims disclosed in this application may be combined and / or coupled in various ways, even if such combinations and / or couplings are not explicitly disclosed in this application. In particular, without departing from the spirit and teachings of this application, the features described in the various embodiments and / or claims of this application may be combined and / or coupled in various ways, and all such combinations and / or couplings fall within the scope disclosed in this application.
[0116] Specific embodiments are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core ideas of the present application and is not intended to limit the present application. For those skilled in the art, changes can be made in the specific implementation methods and application scope based on the ideas, spirit and principles of the present application. Any modifications, equivalent replacements, improvements, etc. made by them should be included in the scope of protection of this application.
[0117] Nouns and pronouns referring to persons in this patent application are not limited to a specific gender.
Claims
1. A method for transmitting parameters based on RPC, characterized in that: include: The server receives the websocket connection request from the client and establishes a websocket connection with the client; The server receives a call request sent by the client through the websocket connection, wherein the call request is used to call parameters required by an application of the client; The server sends the acquired parameters to be called by the calling request to the client through the websocket connection.
2. The method according to claim 1, characterized in that The server receiving the call request sent by the client through the websocket connection includes: The call request is sent through the websocket connection after being processed by binary serialization; After receiving the request, the server performs binary deserialization on the binary serialized request; The server sends the acquired parameters of the call request to the client through the websocket connection, including: The server performs binary serialization processing on the acquired parameters and sends the parameters through the websocket connection, so that after receiving the parameters, the client performs binary deserialization processing on the acquired parameters that have been processed by binary serialization to obtain the acquired parameters.
3. The method according to claim 1, characterized in that The parameters to be called by the call request obtained by the server include: The server obtains a method or function from the local application, and uses the method or function as a parameter to be called by the call request.
4. The method according to claim 1, characterized in that The method further comprises: The server adopts a subscription publishing method to push the relevant information of at least one monitored controlled device to the client that subscribes to the relevant information through the websocket connection.
5. The method according to claim 4, characterized in that The server adopts a subscription publishing method to push the relevant information of at least one monitored controlled device to the client subscribing to the relevant information through the websocket connection, including: The server receives a subscription request sent by the client through the websocket connection, wherein the subscription request is used to subscribe to relevant information of at least one controlled device monitored by the server, and the relevant information of the controlled device includes: status information of the controlled device or result information of the controlled device executing a control command; The server locally establishes a second subscription application, and the second subscription application is bound to the first subscription application established by the client; When the subscribed related information of the controlled device is acquired by the second subscription application of the server, the server pushes the subscribed related information of the controlled device to the first subscription application of the client through the second subscription application.
6. The method according to claim 5, characterized in that The subscribed related information of the controlled device is acquired by the second subscription application of the server, including: The server interacts with the controlled device in a polling access manner or a timed access manner, so that the subscribed relevant information of the controlled device is acquired by the second subscription application.
7. A device based on RPC transmission parameters, characterized in that: include: A transmission unit (40) and a request processing unit (41), wherein: The transmission unit (40) is used to receive a websocket connection request from a client and establish a websocket connection with the client; The request processing unit (41) is used to receive a call request sent by the client through the websocket connection, wherein the call request is used to call parameters required by an application of the client; Obtain parameters to be called by the call request, and send the obtained parameters to the client through the websocket connection.
8. A system based on RPC transmission parameters, characterized in that: include: At least one client (10) and a server (20), wherein: The client (10) is used to send a websocket connection request to the server (20); send a call request to the server (20) through the websocket connection, wherein the call request is used to call parameters required by an application of the client (10); and receive parameters to be called by the call request; The server (20) is used to receive a websocket connection request from the client (10), establish a websocket connection with the client (10); and receive the call request; The parameters to be called by the calling request are obtained and sent to the client via the websocket connection (10).
9. An electronic device, characterized in that: include: processor; A memory storing a program, wherein the program is configured to implement the method based on RPC transmission parameters as described in any one of claims 1 to 6 when executed by the processor.
10. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the method based on RPC transmission parameters according to any one of claims 1 to 6 is implemented.
11. A non-transitory computer-readable storage medium storing instructions, characterized in that: When the instructions are executed by a processor, the processor is caused to perform the method based on RPC transmission parameters according to any one of claims 1 to 6.
Citation Information
Patent Citations
Message pushing method, system and device based on websocket and medium
CN112019625A
Data transmission method and system based on WebSocket, and medium
CN112565214A
Enterprise client-server system and methods of providing web application support through distributed emulation of websocket communications
US20100281107A1