Unlock instant, AI-driven research and patent intelligence for your innovation.

Node.js-based RPC synchronous communication method and equipment

A technology of synchronous communication and remote terminal, which is applied in the field of RPC synchronous communication method and equipment based on Node.js, and can solve problems such as synchronization and increasing the complexity of remote calls

Pending Publication Date: 2021-12-21
CHANGSHA BIOVISION SOFTWARE TECH CO LTD
View PDF0 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

This will lead to the need to change the method called by the module interface, especially when reusing the local synchronous module, if the local module called by a certain function is changed to a remote module, a large number of functions related to this function need to be changed to asynchronous functions, adding The complexity of remote calls, and it is easy to ignore the synchronization wait in the change and cause synchronization problems

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Node.js-based RPC synchronous communication method and equipment
  • Node.js-based RPC synchronous communication method and equipment

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0023] Embodiments of the present invention are described in detail below, examples of which are shown in the drawings, wherein the same or similar reference numerals designate the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by referring to the figures are exemplary only for explaining the present invention and should not be construed as limiting the present invention.

[0024] The existing technology is: RPC synchronous communication based on Node.js uses async / await and other similar methods to simulate synchronous communication: the client or server initiates a request, waits for the other party to process and returns the result synchronously, when the locally dependent module is changed to a remote module When calling synchronously, you need to modify the interface of the calling module and the functions called by the interface to asynchronous functions, and use the waiting syntax when calling or obta...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a Node.js-based RPC synchronous communication method and device, the method is applied to a local end, the local end is connected with a remote end through a TCP, and the method comprises the following steps: sending a request of a remote call function to the remote end, and after the request is sent, carrying out loop detection in a cache by using a c++-based Application.DoEvent; and if the response packet is detected in the cache, obtaining a response value corresponding to the response packet, wherein the response packet is generated after the remote end processes the request and is sent to the cache by the remote end. According to the method, the Application.DoEvent event processing interface operation of the c++ layer is cyclically called through the local end, the function of the calling module and the function of the called module do not need to be changed into an asynchronous function, the complexity of remote calling is reduced, and the efficiency is improved.

Description

technical field [0001] The invention relates to the technical field of data communication, in particular to a Node.js-based RPC synchronous communication method and device. Background technique [0002] RPC (Remote Procedure Call, remote procedure call), a simple understanding is that a node requests a service provided by another node. [0003] At present, RPC synchronous communication based on Node.js (a JavaScript operating environment based on Chrome V8 engine) uses async / await (asynchronous / wait) and other similar methods to simulate synchronous communication, that is, the client or server initiates a request, waits for the other party to process and Return the result synchronously. However, in the actual development process, sometimes it is necessary to change the local module to a remote call. The current method used is to use RPC remote call. [0004] When the locally dependent module is changed to a remote module, if a synchronous call is required (i.e. to achieve ...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
IPC IPC(8): G06F9/54
CPCG06F9/547G06F9/542G06F2209/544G06F2209/545
Inventor 梁威阳坤
Owner CHANGSHA BIOVISION SOFTWARE TECH CO LTD