CN114301896A - Communication method, communication system, and computer-readable storage medium - Google Patents
Communication method, communication system, and computer-readable storage medium Download PDFInfo
- Publication number
- CN114301896A CN114301896A CN202111670089.9A CN202111670089A CN114301896A CN 114301896 A CN114301896 A CN 114301896A CN 202111670089 A CN202111670089 A CN 202111670089A CN 114301896 A CN114301896 A CN 114301896A
- Authority
- CN
- China
- Prior art keywords
- client
- rpc
- server
- communication
- information
- 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.)
- Pending
Links
- 238000004891 communication Methods 0.000 title claims abstract description 90
- 238000000034 method Methods 0.000 title claims abstract description 68
- 230000008569 process Effects 0.000 claims abstract description 12
- 238000012545 processing Methods 0.000 claims description 10
- 238000004590 computer program Methods 0.000 claims description 7
- 230000008676 import Effects 0.000 claims description 6
- 238000005516 engineering process Methods 0.000 claims description 4
- 230000003993 interaction Effects 0.000 claims description 3
- 238000004806 packaging method and process Methods 0.000 abstract description 6
- 230000006870 function Effects 0.000 description 13
- 238000010586 diagram Methods 0.000 description 3
- 230000004044 response Effects 0.000 description 3
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000008901 benefit Effects 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- XLYOFNOQVPJJNP-UHFFFAOYSA-N water Substances O XLYOFNOQVPJJNP-UHFFFAOYSA-N 0.000 description 1
Images
Landscapes
- Telephonic Communication Services (AREA)
Abstract
The invention provides a communication method, a communication system and a computer readable storage medium, and belongs to the technical field of communication. According to the method and the system, a Remote interface is directly called at a client, a user codes calling information and sends a calling request through an RPC (Remote procedure call) pointer by using parameters called by a Remote API (application program interface) and equipment information to be executed, the calling information is transferred to an RPC Protocol to complete Protocol coding and packaging, and then the coded request message is sent to a corresponding server through a PRC Trans. And the server receives the call request of the client through the RPC Trans, decodes the call request, and transmits the decoded call information to the RPC explorer to execute and return a result. According to the method and the system, the user can remotely control and process various problems encountered by the server by directly calling the corresponding function interface through the RPC Client at the Client, and the convenience can be greatly improved.
Description
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a communication method, a communication system, and a computer-readable storage medium.
Background
RPC is called Remote Procedure Call, and is an inter-process communication mode. It allows a program to call a procedure or function of another address space (another computer of the network) without the programmer displaying details encoding this remote call, i.e. the user can call an interface function to control a function of the corresponding interface of another computer (remote) in the network by calling the local client computer (client).
Meanwhile, with the abundance of network connection and the great expansion of the service scene of the internet of things, the scene of the internet of things used by the current user is mostly: however, since the hardware cost of the MCU itself is high, and if the service scenario changes, it is necessary for the user to go to the site to locate the problem or upgrade the MCU program, which is troublesome, and if the service scenario of the user is complicated, for example: if the service scene is in a mountain area, an electric pole or a gas or water meter, the on-site maintenance cost is extremely high, and the flexibility of on-site processing software and hardware is poor.
Based on the problems that the service scene of the internet of things is complex and inconvenient to process on site at present, a method capable of remotely controlling and processing the service scene problem is urgently needed.
Disclosure of Invention
In view of the above, the present invention provides a communication method, a communication system and a computer-readable storage medium, which are used for solving the problems that the existing communication method is complex in the service scenario of the internet of things and the problem needs to be processed on site, and the present application provides a solution for a communication method capable of remotely controlling and processing the service scenario of a server.
The technical scheme adopted by the invention for solving the technical problems is as follows:
the first aspect of the present invention provides a communication method, which is applied to a communication system based on an RPC technology, wherein the communication system includes a client and a server, the server includes at least one communication module, and the method includes the following steps:
the Server exports a remote interface through an RPC Server;
the Client introduces a remote interface through an RPC Client;
the client transmits parameters to be called and equipment information of the server to be executed through a Remote API; controlling to call information through an RPC explorer, transferring the called information to an RPC Protocol to complete Protocol coding, and packaging;
sending the coded request message to a corresponding server through PRC Trans;
the server receives the call request information of the client through the RPC Trans and executes the decoding of the Protocol by using the RPC Protocol;
and decoding the coded information, transmitting the decoded information to an RPC explorer to control the execution and return a result.
In some embodiments, the Server exporting the remote interface via the RPC Server comprises:
the server exports the remote interface, and controls and executes the corresponding service unit.
In some embodiments, the Client introducing the remote interface via the RPC Client comprises:
and the client end imports a remote interface, and a user controls the remote interface through an operation interface.
In some embodiments, the Remote API is used to implement Remote interface abstraction at the client and to specify processing of the corresponding server call Remote interface.
In some embodiments, the controlling further comprises, after calling the information by the RPC invoke:
the client encodes the calling information, sends a calling request to the server and waits for the return of a calling result;
and after receiving the calling request, the server is responsible for calling the specific implementation of the server interface and controlling the calling process, including managing a calling thread pool and overtime, and finally returning a calling result to the client.
In some embodiments, the RPC Trans implementation is responsible for maintaining the connection channels of the client and the server, differentiating the devices to be controlled in the encoding, and sending data to the corresponding channels.
In some embodiments, the method further comprises:
after the communication module is started, the RPC Server can be automatically controlled and started;
the Client controls to locally start RPC Client;
controlling the communication module to be connected with an RPC Client;
the RPC Client acquires the IP address reported by the communication module, and the Client senses and controls the access of the RPC Server.
The second aspect of the present invention further provides a communication system, where the communication system includes a client and a server, the server includes at least one communication module, and the server performs communication interaction with the client through the communication module by executing the communication method.
In some embodiments, the Client has an RPC Client function interface, and the RPC Client function interface is modified to correspondingly control the communication module of the server to adapt to different service application scenarios.
The present application also provides a computer-readable storage medium comprising a processor, a computer-readable storage medium and a computer program stored on the computer-readable storage medium, which computer program, when executed by the processor, performs the steps of the method as described above.
According to the communication method, the communication system and the computer storage medium provided by the embodiment of the invention, the Remote interface can be directly called locally through the client, the user can transmit the parameters to be called and the device information to be executed by calling the Remote API (Remote API), the calling information is coded and the calling request is sent through the RPC explorer, the calling information is transferred to the RPC Protocol to complete Protocol coding and packaging, and the coded request message is sent to the corresponding server through the PRC Trans. The server receives a call request of the client through the RPC Trans, similarly uses the decoding (decode) of the RPC Protocol execution Protocol, and transmits the decoded call information to the RPC explorer to actually execute and return a result. Compared with the existing problems that the service scene of the Internet of things is complex and the problems need to be solved, the communication method has the inconvenience in field processing, a user can directly call the corresponding function interface locally through the RPC Client at the Client, the communication module of a plurality of servers can be remotely controlled, various problems encountered by the servers can be remotely processed, and convenience can be greatly improved.
Drawings
Fig. 1 is a flowchart of a communication method according to an embodiment of the present invention;
fig. 2 is a block diagram of a communication system according to an embodiment of the present invention;
fig. 3 is an architecture diagram of a communication system according to an embodiment of the present invention;
fig. 4 is a schematic block diagram of a specific implementation of a communication system according to an embodiment of the present invention.
Detailed Description
In order to make the technical problems, technical solutions and advantageous effects to be solved by the present invention clearer and clearer, the present invention is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
In the following description, suffixes such as "module", "component", or "unit" used to denote elements are used only for facilitating the explanation of the present invention, and have no specific meaning in itself. Thus, "module", "component" or "unit" may be used mixedly.
The terminal may be implemented in various forms. For example, the terminal described in the present invention may include a mobile terminal such as a mobile phone, a tablet computer, a notebook computer, a palmtop computer, a Personal Digital Assistant (PDA), a Portable Media Player (PMP), a navigation device, a wearable device, a smart band, a pedometer, and the like, and a fixed terminal such as a Digital TV, a desktop computer, and the like.
The following description will be given by way of example of a mobile terminal, and it will be understood by those skilled in the art that the construction according to the embodiment of the present invention can be applied to a fixed type terminal, in addition to elements particularly used for mobile purposes.
The first embodiment is as follows:
noun functional explanations introduce:
1.RPC Server
and the system is responsible for exporting (export) the remote interface and executing the service unit.
2.RPC Client
The user is responsible for the implementation of an import (import) remote interface at the operational level.
3.Remote API
The client side realizes that: the remote interface is abstract, and a processing server is specified;
the server side realizes that: the remote interface is invoked.
4.RPC Invoker
The client side realizes that: the server side is responsible for encoding the calling information, sending a calling request to the server side and waiting for the calling result to return;
the server side realizes that: and the system is responsible for calling the specific implementation of the server-side interface and controlling the calling process, such as managing a calling thread pool, and finally returning a calling result after timeout.
5.RPC Protocol
Responsible for the encoding/decoding of the protocol;
6.RPC Trans
and the device is responsible for maintaining the connection channel of the client and the server, distinguishing the devices to be controlled in the codes and sending data to the corresponding channel.
7.RPC Channel
And different channels are used when different servers are connected with the client.
The following describes a specific implementation procedure of the communication method of the present invention in detail.
The embodiment of the present application provides a communication method, which is applied to a communication system based on an RPC technology, please refer to fig. 1 to 4, the communication system includes a client and a server, the server includes at least one communication module, the method includes the following steps:
s101, the Server exports a remote interface through an RPC Server;
specifically, after the communication module of the Server side is started and network-injected, an RPC Server in the communication module is started, and the remote interface is exported through the RPC Server.
S102, a Client introduces a remote interface through an RPC Client;
specifically, the user locally starts the RPC Client at the Client, the communication module of the Server can be connected with the RPC Client at the moment, and the RPC Client can obtain the IP address reported by the communication module of the Server so as to sense the access of the RPC Server of the Server. And the user calls a remote interface method provided by the server side at the Client side through the RPC Client.
S103, the client transmits parameters to be called and equipment information of the server to be executed through a Remote API; controlling to call information through an RPC explorer, transferring the called information to an RPC Protocol to complete Protocol coding, and packaging;
specifically, the client transmits an interface, a method and parameters to be called and device information of a server to be executed through a Remote API; and controlling to call information through an RPC (remote procedure call) pointer, and completing the encoding and packaging of the Protocol encode of the call information through an RPC Protocol.
S104, sending the coded request message to a corresponding server through PRC Trans;
the RPC Trans executes the connection channel responsible for maintaining the client and the server, distinguishes the equipment to be controlled in the code and sends the data to the corresponding channel.
Specifically, devices to be sent in the encode of the encode are distinguished in the RPC Trans, and then request information data is sent to the RPC Server at the Server side through different RPC channels (networks).
S105, the server receives the call request information of the client through the RPC Trans and executes the decoding of the Protocol by using the RPC Protocol;
s106, decoding the coded information, transmitting the decoded information to an RPC explorer to control execution and return a result;
and after receiving the calling request, the server is responsible for calling the specific implementation of the server interface and controlling the calling process, including managing a calling thread pool and overtime, and finally returning a calling result to the client.
And S107, the Server transmits the parameters to be called through the Remote API, and controls the RPC Server to execute the service unit.
Specifically, the RPC Server in the communication module unpacks the received data, executes a function method of Client response, packs the result to the RPC Client of the Client, unpacks the response after the Client receives the response, and reports the returned result.
The communication method can directly call a Remote interface in the same way as a local method through a client, in the RPC framework, a user transmits parameters to be called and equipment information to be executed by calling a Remote API (Remote API), the calling information is coded and a calling request is sent by an RPC explorer, the calling information is transferred to an RPC Protocol to complete Protocol coding and packaging, and then the coded request information is sent to a corresponding server through a PRC Trans. The server receives a call request of the client through the RPC Trans, similarly, decoding (decode) of an RPC Protocol execution Protocol is used, and call information after decoding is transmitted to an RPC explorer to be actually executed and return a result. Compared with the existing problems that the service scene of the Internet of things is complex and the problems need to be solved, the communication method has the advantage that the user can directly call the corresponding function interface through the RPC Client locally at the Client, the plurality of communication modules are remotely controlled, various problems encountered by the remote processing server are solved, and the convenience is greatly improved.
According to the communication method, the Client can control the plurality of servers simultaneously, MCU hardware resources can be greatly saved, only one RPC Client is used for uniformly controlling and managing the plurality of communication module devices, the problems encountered by remote processing can be solved, and when the application scene of the server is changed, the function interface of the local Client (RPC Client) can be directly modified to adapt to different service application scenes of the server, so that the flexibility of the use of the communication module is improved.
Example two:
referring to fig. 2 to 4, an embodiment of the present application provides a communication system, where the communication system includes a client and a server, the server includes at least one communication module, and the server performs communication interaction with the client by executing the communication method through the communication module.
The client comprises the following interconnected modules: RPC Client, Remote API, RPC explorer, RPC Protocol and RPC Trans, wherein RPC explorer, RPC Protocol and RPC Trans module constitute the communication module of Client.
The RPC Client is used for a user to realize an import (import) remote interface on an operation level.
The Remote API is used for realizing Remote interface abstraction at a client and appointing a processing server.
And the RPC explorer is used for realizing the responsibility of encoding the calling information at the client, sending the calling request to the server and waiting for the return of the calling result.
And the RPC Protocol is used for realizing coding at the client.
The RPC Trans is used for maintaining the connection channel of the client and the server, distinguishing the equipment to be controlled in the code and sending data to the corresponding channel.
The server comprises the following interconnected modules: RPC Server, Remote API, RPC explorer, RPC Protocol, RPC Trans; the RPC explorer module, the RPC Protocol module and the RPC Trans module form a communication module of the server.
The RPC Server, a user Server exports (export) remote interface and executes a service unit;
and the Remote API is used for realizing the calling of the Remote interface at the server.
And the RPC explorer is used for realizing the specific realization of calling the server-side interface and controlling the calling process at the server-side, and the RPC explorer is used for managing a calling thread pool, overtime time and the like and finally returning a calling result.
And the RPC Protocol is used for decoding the coding information at the server side.
The RPC Trans is used for maintaining the connection channel of the server and the client, distinguishing the equipment to be controlled in the code and sending data to the corresponding channel.
The communication system comprises a server side and a Client side, wherein the server side comprises a plurality of communication modules, the communication modules of the Client side are controlled through one Client side, the Client side calls corresponding interface functions through an RPC Client (remote procedure call request terminal), and the communication modules of a plurality of remote server sides are controlled through a network. By using the method, a plurality of module devices can be controlled in a centralized manner, the hardware cost of the MCU is saved, and when the application scene of the server is changed, the service application scene of the server can be adapted by directly modifying a function interface of a local Client (RPC Client). And if the user adds new module equipment at the server, the user does not need to start additional RPC clients at the Client, and the modification of the parameters of the new module equipment by using the original Client can be completed.
In an embodiment, the Client can control a plurality of servers, at least one communication module can be arranged in each server, and the communication module of the server is remotely controlled through the Client, so that a user can directly call a corresponding function interface locally through an RPC Client without using a service field, the communication modules of the plurality of servers are remotely controlled, various problems encountered by remote processing are realized, and convenience is greatly improved.
Example three:
according to an embodiment of the present invention, a computer-readable storage medium is provided, on which a computer program is stored, and the computer program, when executed by a processor, implements the steps in the communication method, where the specific steps are as described in the first embodiment, and are not described herein again.
The memory in the present embodiment may be used to store software programs as well as various data. The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created according to the use of the mobile phone, and the like. Further, the memory may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
According to an example of this embodiment, all or part of the processes in the methods of the embodiments described above may be implemented by a computer program to instruct related hardware, where the program may be stored in a computer-readable storage medium, and in this embodiment of the present invention, the program may be stored in the storage medium of a computer system and executed by at least one processor in the computer system, so as to implement the processes including the embodiments of the methods described above. The storage medium includes, but is not limited to, a magnetic disk, a flash disk, an optical disk, a Read-Only Memory (ROM), and the like.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202111670089.9A CN114301896A (en) | 2021-12-31 | 2021-12-31 | Communication method, communication system, and computer-readable storage medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202111670089.9A CN114301896A (en) | 2021-12-31 | 2021-12-31 | Communication method, communication system, and computer-readable storage medium |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN114301896A true CN114301896A (en) | 2022-04-08 |
Family
ID=80973948
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202111670089.9A Pending CN114301896A (en) | 2021-12-31 | 2021-12-31 | Communication method, communication system, and computer-readable storage medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN114301896A (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN115834649A (en) * | 2022-11-24 | 2023-03-21 | 中国银行股份有限公司 | Remote procedure call method, device and system |
Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1852209A (en) * | 2006-05-31 | 2006-10-25 | 北京和利时系统工程股份有限公司 | Remote process transfering method and system in distribution type control system |
| US7475402B1 (en) * | 2003-04-30 | 2009-01-06 | Sun Microsystems, Inc. | Method and apparatus to isolate changes in remoting system servers |
| CN104598257A (en) * | 2013-10-30 | 2015-05-06 | 华为技术有限公司 | Method and device for remotely operating application program |
| CN108306844A (en) * | 2016-10-09 | 2018-07-20 | 上海思立微电子科技有限公司 | Telecommunication by Application Programming Interface and long-range programming |
| CN108965312A (en) * | 2018-07-30 | 2018-12-07 | 深圳高新兴物联科技有限公司 | Remote invocation method, device, system and storage medium |
| CN112783672A (en) * | 2021-01-27 | 2021-05-11 | 传神语联网网络科技股份有限公司 | Remote procedure call processing method and system |
-
2021
- 2021-12-31 CN CN202111670089.9A patent/CN114301896A/en active Pending
Patent Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US7475402B1 (en) * | 2003-04-30 | 2009-01-06 | Sun Microsystems, Inc. | Method and apparatus to isolate changes in remoting system servers |
| CN1852209A (en) * | 2006-05-31 | 2006-10-25 | 北京和利时系统工程股份有限公司 | Remote process transfering method and system in distribution type control system |
| CN104598257A (en) * | 2013-10-30 | 2015-05-06 | 华为技术有限公司 | Method and device for remotely operating application program |
| CN108306844A (en) * | 2016-10-09 | 2018-07-20 | 上海思立微电子科技有限公司 | Telecommunication by Application Programming Interface and long-range programming |
| CN108965312A (en) * | 2018-07-30 | 2018-12-07 | 深圳高新兴物联科技有限公司 | Remote invocation method, device, system and storage medium |
| CN112783672A (en) * | 2021-01-27 | 2021-05-11 | 传神语联网网络科技股份有限公司 | Remote procedure call processing method and system |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN115834649A (en) * | 2022-11-24 | 2023-03-21 | 中国银行股份有限公司 | Remote procedure call method, device and system |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| EP0860966B1 (en) | Distributed network computing system, and data exchange apparatus | |
| CN102377739A (en) | Mobile terminal as well as realization method, service system and cloud server thereof | |
| CN101958932B (en) | A kind of method and apparatus realizing telecommunication service | |
| EP3131303B1 (en) | Method and device for transmitting data in intelligent terminal to television terminal | |
| CN1575461A (en) | Mobile client provisioning web service | |
| JP4527144B2 (en) | Network robot system and communication method in network robot system | |
| EP4206919B1 (en) | Proxy service-based device calling method, electronic device, and readable storage medium | |
| CN113472889A (en) | Scheduling system and method of microservice | |
| CN101945322A (en) | Method and system for communicating with wireless network by using data card and data card | |
| CN107643930A (en) | Using operation method and Cloud Server | |
| CN114301896A (en) | Communication method, communication system, and computer-readable storage medium | |
| US8918516B2 (en) | Symbiotic client and server for embedded network system | |
| CN112835632B (en) | A terminal capability calling method, device and computer storage medium | |
| WO2011130962A1 (en) | Remote processing method, device and system | |
| CN111767271A (en) | Data processing method and device | |
| KR101727143B1 (en) | Method and Apparatus for Device Capability Information based Incompatible Media Contents Transformation | |
| EP4207753B1 (en) | Video call method, electronic device and system | |
| CN101835142B (en) | Realizing method and device of user identification STK (SIM Card Tool Kit) | |
| CN114520806A (en) | Screen application remote control interaction method and system, electronic equipment and storage medium | |
| CN117938822B (en) | WASM-based real-time voice communication method, terminal and camera | |
| CN113498109A (en) | Information processing method, device and system and computer equipment | |
| KR20140094290A (en) | System for virtualizing mobile phone using software based gateway and method thereof | |
| CN108900636B (en) | Transaction data processing method and platform | |
| US20110119336A1 (en) | Remote command execution over a network | |
| CN117201577A (en) | Communication method and system of cross-platform API and SPI based on PISA |
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 | ||
| RJ01 | Rejection of invention patent application after publication |
Application publication date: 20220408 |
|
| RJ01 | Rejection of invention patent application after publication |