Remote function call processing method, device, electronic device and storage medium

By deploying and compiling remote functions on the cloud computing platform, and executing or calling them on the client, the problems of complex cloud function development and difficult debugging are solved, the ability to simplify development and rapid launch is achieved, and the client development process is simplified.

CN112395096BActive Publication Date: 2024-10-29TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN201910746090.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-08-13
Publication Date
2024-10-29
Estimated Expiration
2039-09-02

AI Technical Summary

Technical Problem

Cloud functions of existing cloud computing platforms are mainly used for background services. Clients can only call them through explicit network services. Development is complex and requires additional learning of cloud function rules. Remote functions cannot be called like local code, and the development and debugging process is complicated. Split.

Method used

Obtain remote functions through the client, execute and return results, the server deploys and compiles remote functions, supports local execution or remote execution, implements interface function calls, provides authentication and network quality selection modules, and simplifies the client development process.

Benefits of technology

It enables client developers to call remote functions just like calling local code, simplifying the development process, providing local debugging capabilities, quickly modifying and launching logic codes, and circumventing device resource and network environment restrictions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112395096B_ABST
    Figure CN112395096B_ABST
Patent Text Reader

Abstract

The present invention provides a method, device, electronic device and storage medium for processing remote function calls, the method comprising: obtaining a remote function from a server via a client; in response to executing client code of the remote function in the client, executing the logic code encapsulated in the obtained remote function via an interface function encapsulated in the remote function, and returning the call result obtained by the execution to the client code; in response to executing the client code of the remote function in the server, sending a network request for calling the remote function to the server via the interface function encapsulated in the remote function, and returning the call result returned by the server to the client code.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technology, and in particular to a remote function call processing method, device, electronic equipment and storage medium. Background Art

[0002] Currently, major manufacturers have launched cloud computing platforms with cloud function functions. With cloud functions, there is no need to purchase and manage servers. Instead, you only need to write core code in a language supported by the platform and set the conditions for the code to run. The code can run elastically and securely on the cloud infrastructure. The underlying computing resources, including server CPU, memory, network and other configuration / resource maintenance, code deployment, elastic scaling, load balancing, etc. are hosted. These cloud functions focus on simplifying background services.

[0003] Currently, based on the cloud computing platform, the client can only explicitly call the relevant code by calling the network service. For the client, these functions are still in the scope of background services. When calling, the client still calls the cloud function according to the rules of these cloud functions, and still needs to debug with these cloud functions. In addition, the mobile client code can only run on Android devices or Apple devices. The specific process of code running is that the mobile device downloads and installs the application, and then runs the code in the application. Summary of the invention

[0004] The embodiments of the present invention provide a remote function call processing method, device, electronic device and storage medium, which can enable the code run by the client to be executed on the remote server and the client can call the remote code just like calling the local code.

[0005] The technical solution of the embodiment of the present invention is achieved as follows:

[0006] An embodiment of the present invention provides a method for processing a remote function call, comprising:

[0007] Get remote functions from the server through the client;

[0008] In response to executing the client code of the remote function in the client, executing the logic code encapsulated in the acquired remote function through the interface function encapsulated in the remote function, and

[0009] Returning the call result obtained by execution to the client code;

[0010] In response to the client code executing the remote function in the server, a network request for calling the remote function is sent to the server through the interface function encapsulated in the remote function, and

[0011] The calling result returned by the server is returned to the client code.

[0012] In the above scheme, the method further includes:

[0013] An update to the logic code is received from the client, an updated remote function is created according to the updated logic code, and the remote function is removed.

[0014] An embodiment of the present invention provides a method for processing a remote function call, comprising:

[0015] In response to the client receiving the logic code, inserting the interface code into the logic code to obtain a code file through the client, and scanning the logic code through the client to generate a configuration file corresponding to the logic code;

[0016] In response to the server receiving the code file and the configuration file, the server compiles the code file to generate a compressed file adapted to the remote function specification, and names the compressed file according to the configuration file;

[0017] By calling an application programming interface in a server for creating a remote function, the compressed file is created as a remote function encapsulating the logic code, the remote function encapsulating an interface function corresponding to the interface code, and the remote function is deployed in the server.

[0018] An embodiment of the present invention provides a remote function call processing device, the device comprising:

[0019] Function acquisition module, used to obtain remote functions from the server through the client;

[0020] A local execution module, configured to execute the logic code encapsulated in the acquired remote function through the interface function encapsulated in the remote function in response to the client code executing the remote function in the client, and return the call result obtained by the execution to the client code;

[0021] The remote execution module, in response to the client code executing the remote function in the server, sends a network request for calling the remote function to the server through the interface function encapsulated in the remote function, and returns the calling result returned by the server to the client code.

[0022] In the above scheme, the device also includes:

[0023] The authentication module is used to obtain the identifier representing the client identity information carried in the client code before executing the logic code encapsulated in the acquired remote function; based on the identifier, the client is authenticated through the remote function and it is determined that the authentication is passed.

[0024] In the above solution, the authentication module is also used for:

[0025] Before sending a network request for calling a remote function to a server, an identifier representing the identity information of the client carried in the client code is obtained; based on the identifier, the client is authenticated through the remote function, and it is determined that the authentication is successful.

[0026] In the above scheme, the device also includes:

[0027] A mode selection module is used to determine the client code for executing the remote function in the client when the network quality parameter of the network environment in which the client runs is lower than the network quality threshold; when the network quality parameter of the network environment in which the client runs is not lower than the network quality threshold, determine the client code for executing the remote function in the server.

[0028] In the above scheme, the device also includes:

[0029] The remote function deployment module is used to respond to the client receiving the logic code operation, pre-process the logic code through the client to obtain a code file and a configuration file, and send them to the server so that

[0030] The server compiles the code file to generate a compressed file adapted to the remote function specification, and names the compressed file according to the configuration file;

[0031] The remote function deployment module is also used to create the compressed file as a remote function encapsulating the logic code by calling an application programming interface in the server for creating a remote function, and deploy the remote function in the server.

[0032] An embodiment of the present invention provides a remote function call processing device, the device comprising:

[0033] A remote function configuration module, configured to, in response to a client receiving an operation of a logic code, insert an interface code into the logic code through the client to obtain a code file, and scan the logic code through the client to generate a configuration file corresponding to the logic code;

[0034] A remote function compilation module, configured to compile the code file through the server to generate a compressed file adapted to the remote function specification in response to the server receiving the code file and the configuration file, and name the compressed file according to the configuration file;

[0035] A remote function creation module is used to create the compressed file as a remote function encapsulating the logic code by calling an application programming interface in the server for creating remote functions, wherein the remote function encapsulates an interface function corresponding to the interface code, and deploy the remote function in the server.

[0036] In the above solution, the remote function configuration module is also used to:

[0037] Finding the logic code;

[0038] When the logic code marked as a remote function is found, the authentication code and the interface code are inserted into the logic code, and the class name and the method name of the logic code are recorded in the configuration file to obtain the code file and the configuration file.

[0039] In the above solution, the remote function configuration module is also used to:

[0040] The interface code is added to the logic code by bytecode editing, and the interface code includes an interface code for calling a remote function through a network request and an interface code for executing the remote function on the client through an inter-process communication mechanism.

[0041] In the above scheme, the device also includes:

[0042] The remote function management module is used to receive updates to the logic code from the client, create updated remote functions according to the updated logic code, and remove the remote functions.

[0043] An embodiment of the present invention provides an electronic device, including:

[0044] A memory for storing executable instructions;

[0045] The processor is used to implement the remote function call processing method provided by the embodiment of the present invention when executing the executable instructions stored in the memory.

[0046] An embodiment of the present invention provides a storage medium storing executable instructions for causing a processor to execute the instructions to implement a remote function call processing method provided by the embodiment of the present invention.

[0047] The embodiments of the present invention have the following beneficial effects:

[0048] By placing the logic code that can only be executed locally on a remote server for execution, and calling the interface function to implement local calls to the remotely executed logic code, in a scenario with changing business conditions, the logic code can be quickly modified and the functions can be put online during the client development process. At the same time, since the logic code can still be executed locally, developers have local debugging capabilities. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 It is an optional architecture diagram of a remote function call processing system 100 provided in an embodiment of the present invention;

[0050] Figure 2 is an optional structural diagram of an electronic device 400 provided in an embodiment of the present invention;

[0051] Figures 3A-3D It is an optional flow chart of a method for processing a remote function call provided by an embodiment of the present invention;

[0052] Figures 4A-4D It is an optional flow chart of a method for processing a remote function call provided by an embodiment of the present invention;

[0053] Figure 5 It is a schematic diagram of the client compilation function provided by an embodiment of the present invention;

[0054] Figure 6 It is a timing diagram of the development, integration, creation and deployment process of remote functions in the practical application of the present invention;

[0055] Figure 7 It is a schematic diagram of realizing remote function call in practical application of the present invention. DETAILED DESCRIPTION

[0056] In order to make the purpose, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present invention. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present invention.

[0057] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it can be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0058] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which the present invention belongs. The terms used herein are only for the purpose of describing the embodiments of the present invention and are not intended to limit the present invention.

[0059] Before further describing the embodiments of the present invention in detail, the nouns and terms involved in the embodiments of the present invention are described. The nouns and terms involved in the embodiments of the present invention are subject to the following interpretations.

[0060] 1) Inter-Process Communication (IPC), also known as cross-process communication, refers to the process of data exchange between two processes.

[0061] 2) HyperText Transfer Protocol (HTTP) request: a request message from the client to the server.

[0062] 3) Encapsulation: that is, hiding the properties and implementation details of the object and only exposing the interface to the outside world.

[0063] 4) Remote function: a function pre-deployed on the server to implement special functions, such as a listening function to implement a monitoring function or a message function to send a message.

[0064] 5) Client code: This is the code in the client that is used to implement functions in the client (such as query, display, etc.). The code can choose to execute remote functions locally on the client or on the server.

[0065] 6) Logic code: code encapsulated in a remote function to implement the functions of the remote function, such as code used to implement the listening function of a listening function or code used to implement the sending function of a message function.

[0066] Currently, cloud functions launched by cloud computing platforms are mainly developed for background functions. Clients can only explicitly call these codes by calling Hypertext Transfer Protocol services. For clients, these functions are still background services. When calling, clients still call remote functions according to the rules of these remote functions and still need to debug these remote functions.

[0067] In order to expand the client development capabilities, the code running on the client can be run on the remote background. The client can call the remote code developed on the client just like calling other local codes, without calling according to additional remote function rules. The client can debug this code locally, without debugging like other traditional background services.

[0068] The remote function in the prior art is a simplification of background development, or support for general language development. Client development and use require additional learning of how to develop these cloud functions, which will incur additional learning costs. The usage mode of remote functions is to develop online or locally, then deploy online, and finally call through network requests and other methods. In this mode, the process of developing functions and the process of executing functions are separated. After the remote function is developed and deployed, the client cannot call the remote function like calling local logic code, but requires another software development kit interface to call these remote functions, which involves calling remote functions according to the rules of remote functions and debugging these remote functions.

[0069] In order to meet the needs of the client to call and execute a remote function in a local call manner, an embodiment of the present invention provides a remote function call processing method, device, electronic device and storage medium, which can solve the technical problems that the client needs to learn how to develop remote functions during the development process using remote functions, and the client cannot call remote functions like calling local code.

[0070] The following describes an exemplary application of the electronic device provided by the embodiment of the present invention. The electronic device provided by the embodiment of the present invention can be implemented as various types of terminal devices such as a laptop computer, a tablet computer, a desktop computer, a set-top box, a mobile device (for example, a mobile phone, a portable music player, a personal digital assistant, a dedicated messaging device, a portable gaming device), and can also be implemented as a server. The following describes an exemplary application when the device is implemented as a terminal device.

[0071] See also Figure 1 , Figure 1 This is an optional architecture diagram of a remote function call processing system 100 provided by an embodiment of the present invention. The terminal device 400-1 is connected to the server 200 via the network 300, and the client 410-1 runs in the terminal device 400-1. The network 300 can be a wide area network or a local area network, or a combination of the two. The remote function can be executed locally on the terminal device, or the remote function can be called to the server via the network 300 through network communication so that the remote function is executed on the server.

[0072] The server 200 includes a remote function control platform, a code repository, an object storage platform, and a remote function running background. After the client of the terminal device receives the logic code, the client preprocesses the logic code to obtain a code file and a configuration file, and sends them to the server, so that the remote function control platform compiles the code file to generate a compressed file adapted to the remote function specification, and names the compressed file according to the configuration file, and creates a remote function encapsulated with logic code by calling the application programming interface for creating remote functions in the server, and deploys the remote function on the remote function running background, wherein the code file will be uploaded to the code repository by the remote function control platform, so that when the client of the terminal device needs to call it, the code file in the code repository will be loaded locally, and the compressed file will be uploaded to the object storage platform by the remote function control platform. The client requests the server to load the code and initiates a remote execution request to the server.

[0073] See also Figure 2 , Figure 2 is an optional structural diagram of an electronic device 400 provided in an embodiment of the present invention. Figure 2 The electronic device 400 shown includes: at least one processor 410, a memory 450, at least one network interface 420 and a user interface 430. The various components in the electronic device 400 are coupled together via a bus system 440. It can be understood that the bus system 440 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 440 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the bus system 440 is not described in detail. Figure 2 Various buses are labeled as bus system 440 .

[0074] Processor 410 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where the general-purpose processor can be a microprocessor or any conventional processor, etc.

[0075] The user interface 430 includes one or more output devices 431 that enable presentation of media content, including one or more speakers and / or one or more visual display screens. The user interface 430 also includes one or more input devices 432, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.

[0076] The memory 450 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard disk drives, optical disk drives, etc. The memory 450 may optionally include one or more storage devices that are physically remote from the processor 410.

[0077] The memory 450 includes a volatile memory or a nonvolatile memory, and may also include both volatile and nonvolatile memories. The nonvolatile memory may be a read-only memory (ROM), and the volatile memory may be a random access memory (RAM). The memory 450 described in the embodiment of the present invention is intended to include any suitable type of memory.

[0078] In some embodiments, memory 450 can store data to support various operations, examples of which include programs, modules, and data structures, or a subset or superset thereof, as exemplarily described below.

[0079] The operating system 451 includes system programs for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., which are used to implement various basic businesses and process hardware-based tasks.

[0080] The network communication module 452 is used to reach other computing devices via one or more (wired or wireless) network interfaces 420. Exemplary network interfaces 420 include: Bluetooth, Wireless Authentication (WiFi), and Universal Serial Bus (USB).

[0081] The presentation module 453 is used to enable presentation of information (eg, a user interface for operating peripheral devices and displaying content and information) via one or more output devices 431 (eg, a display screen, a speaker, etc.) associated with the user interface 430 .

[0082] The input processing module 454 is used to detect one or more user inputs or interactions from one of the one or more input devices 432 and translate the detected inputs or interactions.

[0083] In some embodiments, the remote function call processing device provided by the embodiments of the present invention can be implemented in software. Figure 2A processing device 455 for remote function calls stored in a memory 450 is shown, including a function acquisition module 4551, a local execution module 4552, and a remote execution module 4553. The function acquisition module 4551 can be software in the form of programs and plug-ins, and can be embedded in various clients. The function acquisition module 4551 is used to acquire remote functions from a server, the local execution module 4552 is used to respond to the client code that executes the remote function in the client, execute the logic code encapsulated in the acquired remote function through the interface function encapsulated in the remote function, and return the call result obtained by the execution to the client code, and the remote execution module 4553 is used to respond to the client code that executes the remote function in the server, send a network request to call the remote function to the server through the interface function encapsulated in the remote function, and return the call result returned by the server to the client code. The functions of each module will be specifically described below. These modules are logical, so they can be arbitrarily combined or further split according to the functions implemented.

[0084] Figure 2 Also shown is a remote function call processing device 456 stored in the memory 450. The memory 450 may store any one or all of the remote function call processing device 455 and the remote function call processing device 456. The remote function call processing device 456 includes three modules: a remote function configuration module 4554, a remote function compilation module 4555, and a remote function creation module 4556. The remote function configuration module 4554 is used to respond to the operation of receiving the logic code by the client, insert the interface code into the logic code through the client to obtain the code file, and scan the logic code through the client to generate a configuration file corresponding to the logic code. The remote function compilation module 4555 is used to respond to the server receiving the code file and the configuration file, and compile the code file through the server to generate a compressed file adapted to the remote function specification, and name the compressed file according to the configuration file. The remote function creation module 4556 is used to create the compressed file as a remote function encapsulated with the logic code by calling the application programming interface for creating the remote function in the server, and the remote function encapsulates the interface function corresponding to the interface code, and deploys the remote function in the server. The functions of each module will be specifically described below. These modules are logical, so they can be arbitrarily combined or further split according to the functions implemented.

[0085] In other embodiments, the cross-client communication device provided by the embodiment of the present invention can be implemented in hardware. As an example, the device provided by the embodiment of the present invention can be a processor in the form of a hardware decoding processor, which is programmed to execute the cross-client communication method provided by the embodiment of the present invention. For example, the processor in the form of a hardware decoding processor can adopt one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field programmable gate arrays (FPGAs) or other electronic components.

[0086] The method for processing a remote function call provided by an embodiment of the present invention will be described below in conjunction with an exemplary application and implementation of an electronic device provided by an embodiment of the present invention.

[0087] See also Figure 3A , Figure 3A is an optional flow chart of a remote function call processing method provided by an embodiment of the present invention, which will be combined with Figure 3A The steps shown are used to illustrate that the steps of the following method can be implemented on the above-mentioned electronic device.

[0088] In step 101, a remote function is obtained from a server through a client.

[0089] Remote functions can be built-in functions provided by the server for developers. Usually, remote functions are actively developed and created by developers according to different task requirements and then deployed to the server. Therefore, the remote functions here can be created independently by client developers. The creation of remote functions can be carried out collaboratively by the client development machine and the server.

[0090] The server here includes a remote function control platform, a code repository, an object storage platform, and a remote function running background. After the client of the terminal device receives the logic code that implements the functional requirements of the function to be created, the client preprocesses the logic code to obtain a code file and a configuration file, and sends them to the server, so that the remote function control platform compiles the code file to generate a compressed file that is adapted to the remote function specification, and names the compressed file according to the configuration file. By calling the application programming interface used to create a remote function in the server, the compressed file is created as a remote function encapsulated with the logic code, and the remote function is deployed on the remote function running background, wherein the code file will be uploaded to the code repository by the remote function control platform, so that when the client of the terminal device needs to call it, the code file in the code repository is loaded locally, and the compressed file will be uploaded to the object storage platform by the remote function control platform.

[0091] In some embodiments, when the client is initialized, the code of the remote function in the server's code repository is loaded locally. In this way, when the client needs to call the remote function, it can directly execute the obtained logic code encapsulated in the remote function locally through the interface function encapsulated in the remote function, and directly send a network request to call the remote function to the server through the interface function encapsulated in the remote function, so as to execute the logic code encapsulated in the remote function on the remote server. Before the client makes a call, it is not necessary to perform the remote function code loading process again, avoiding the problem that the network connection quality fluctuates during the use of the client, resulting in the inability to load in time and the inability to make subsequent calls.

[0092] In some embodiments, when it is necessary to execute client code related to a remote function, the code of the remote function in the server's code repository is loaded locally. In this way, when the client needs to execute client code related to a remote function, the remote function code loading process is performed, and the cache of the remote function code loaded locally is cleared every unit time. By such a loading method, the memory pressure of the local client can be reduced, and the code loading process is executed only when the call is needed. At the same time, the event of the client calling the remote function is monitored. When the listening time exceeds the listening time threshold, and no event of the client calling the remote function is monitored, it is assumed that the client does not need to call the remote function code, and the cache of the remote function code loaded locally is cleared. The above-mentioned unit time can be the listening time threshold.

[0093] In step 102, in response to the client code executing the remote function in the client, the obtained logic code encapsulated in the remote function is executed through the interface function encapsulated in the remote function, and the call result obtained by the execution is returned to the client code.

[0094] In some embodiments, when the client code of a remote function is executed locally in the client, the logic code encapsulated in the remote function is executed through the interface function encapsulated in the remote function, and the call result obtained by executing the logic code encapsulated in the remote function is returned to the client code.

[0095] In step 103, in response to the client code executing the remote function in the server, a network request for calling the remote function is sent to the server through the interface function encapsulated in the remote function, and the calling result returned by the server is returned to the client code.

[0096] In some embodiments, when the client code of a remote function is executed in a server, a network request to call the remote function is sent to the server through the interface function encapsulated in the remote function, and the call result obtained by executing the logic code encapsulated in the remote function on the server is returned to the client code.

[0097] Here, step 102 and step 103 correspond to two different code calling modes. When calling, the developer can choose whether to actually execute the local code or the remote function code on the network. The implementation is based on the interface encapsulation of the remote function during the creation process of the remote function. The interface function corresponding to the interface encapsulation encapsulates the logic code in the remote function and the remote function call code. In the actual calling process, the interface function is actually called. Therefore, for developers, two calling modes are provided: executing local code or executing remote code on the network. When the local execution calling mode is used to execute local code, it is conducive to code debugging; when the remote execution calling mode is used to execute the remote function code on the server, the code can be modified directly in the background so that the client version presented to the user is always the latest.

[0098] See also Figure 3B ,based on Figure 3A Before executing the logic code encapsulated in the acquired remote function in step 102, steps 104-105 may also be executed.

[0099] In step 104, an identifier representing the client identity information carried in the client code is obtained.

[0100] In some embodiments, the remote function includes an authentication code for implementing an authentication function. Before executing the logic code encapsulated in the remote function, the client identity information carried in the client code can be actively obtained through the authentication code for implementing the authentication function. Here, an identifier is used to represent the client's identity information. Different clients have different identity information and different identifiers.

[0101] In step 105, according to the identifier, the client is authenticated through a remote function, and it is determined that the authentication is successful.

[0102] In some embodiments, the authentication code carries a judgment code for judging whether the client is authorized to call the remote function. Here, not all clients have the authority to call the remote function. For the remote function created based on the logic code actively written by the client developer, the corresponding authorization object is pre-set when the remote function is initially created. The authorization object for calling the remote function is the client pre-set when the logic code encapsulated in the remote function is pre-processed locally. Different clients have different identifiers. Based on the identifier carrying the client identity information, it is identified whether the client that initiates the call to the remote function belongs to the pre-set client that has the authority to call the remote function, specifically whether the client's identifier matches the pre-set client identifier. When the client's identifier matches the pre-set client identifier, it is determined that the authentication is passed. In addition, the authentication function may not be set in the remote function. The remote function without the authentication function can serve all clients, not specific clients.

[0103] Before sending a network request for calling a remote function to the server in step 103, steps 104-105 are also executed.

[0104] In step 104, an identifier representing the client identity information carried in the client code is obtained.

[0105] In some embodiments, the remote function includes an authentication code for implementing an authentication function. Before sending a network request to the server to call the remote function, the client identity information carried in the client code can be actively obtained through the authentication code for implementing the authentication function. Here, an identifier is used to represent the client's identity information, and the identity information of different clients is different.

[0106] In step 105, according to the identifier, the client is authenticated through a remote function, and it is determined that the authentication is successful.

[0107] In some embodiments, the authentication code carries a judgment code for judging whether the client is authorized to call the remote function. Here, not all clients have the authority to call the remote function. For the remote function created based on the logic code actively written by the client developer, the corresponding authorization object is pre-set when the remote function is initially created. The authorization object for calling the remote function is the client pre-set when the logic code encapsulated in the remote function is pre-processed locally. Different clients have different identifiers. Based on the identifier carrying the client identity information, it is identified whether the client that initiates the call to the remote function belongs to the pre-set client that has the authority to call the remote function, and specifically identifies whether the client's identifier matches the pre-set client identifier. When the client's identifier matches the pre-set client identifier, it is determined that the authentication is passed. In addition, the authentication function may not be set in the remote function, so the remote function without the authentication function can serve all clients instead of specific clients.

[0108] See also Figure 3C ,based on Figure 3A , steps 106 - 107 may be included between step S101 and step S102 .

[0109] In some embodiments, there are multiple factors that affect whether the client uses a local execution call mode or a remote execution call mode. The factors include: hardware resources and network resources of the client's host device. The factors corresponding to the hardware resources of the client's host device may be the idle rate of the central processing unit and the idle rate of the storage space used for program operation. The factors corresponding to the network resources may be the network resource bandwidth.

[0110] In step 106, when the network quality parameter of the network environment in which the client runs is lower than a network quality threshold, it is determined to execute the client code of the remote function in the client.

[0111] In some embodiments, when the network quality parameter of the network environment in which the client is running is lower than the network quality threshold, the client code of the remote function is determined to be executed in the client. The network quality threshold here is pre-set. When the network quality parameter is lower than the network quality threshold, it indicates that the current network quality cannot support the network request to call the remote function to the server through the interface function encapsulated in the remote function in the form of network communication, then the client code of the remote function is determined to be executed in the client, and the local execution calling mode is adopted at this time. For example, in the absence of a network connection, and the code of the remote function has been pre-loaded locally on the client, the local execution calling mode is adopted; when the network communication environment is a cellular connection, the local execution calling mode is adopted.

[0112] In step 107, when the network quality parameter of the network environment in which the client runs is not lower than the network quality threshold, it is determined to execute the client code of the remote function in the server.

[0113] In some embodiments, when the network quality parameter of the network environment in which the client is running is not lower than the network quality threshold, the client code of the remote function is determined to be executed in the server. The network quality threshold here has the same meaning as the network quality threshold in the above embodiment. When the network quality parameter is not lower than the network quality threshold, it indicates that the current network quality can support sending a network request to call the remote function to the server through the interface function encapsulated in the remote function in the form of network communication, and then the client code of the remote function is determined to be executed in the server. At this time, the remote execution calling mode is adopted. For example, when the network communication environment is a Wi-Fi connection, the remote execution calling mode is adopted.

[0114] In some embodiments, when the idle rate of the central processor of the client's host device is lower than the corresponding processor idle rate threshold, a remote execution calling mode is adopted; when the idle rate of the storage space of the client's host device used for program running is lower than the corresponding storage space threshold, a remote execution calling mode is adopted to avoid increasing the processor load and occupying too much storage space, resulting in slower running speed.

[0115] In some embodiments, the calling mode is determined by combining the above-mentioned multiple influencing factors, and each of the above-mentioned influencing factors is assigned a weight. For example, the weight of the network quality parameter is 0.5, the weight of the idle rate of the central processing unit is 0.3, and the weight of the idle rate of the storage space used for program running is 0.2. Whether to adopt the remote execution calling mode is determined for each influencing factor. When it is determined to adopt the remote execution calling mode, it is recorded as 1, and when it is determined to adopt the local execution calling mode, it is recorded as 0. In combination with the above three influencing factors, the weighted reference value of the calling mode is calculated according to the weights corresponding to the three influencing factors. The threshold of the weighted reference value of the calling mode is pre-set to 0.8. When the weighted reference value of the calling mode exceeds the threshold, the remote execution calling mode is adopted. The threshold here is not limited to 0.8, and can be set according to the historical calling data of each remote function.

[0116] Based on the embodiments of the present invention, two calling modes are provided for developers: executing local code or executing remote code on the network. When the local execution calling mode is used to execute local code, it is conducive to code debugging; when the remote execution calling mode is used to execute the remote function code on the server, the code can be modified in the background so that the client version presented to the user is always the latest.

[0117] See also Figure 3D ,based on Figure 3A Before obtaining the remote function from the server through the client in step 101, the method further includes steps 108-109.

[0118] In step 108, in response to the client receiving the logic code operation, the client preprocesses the logic code to obtain a code file and a configuration file, and sends them to the server, so that the server compiles the code file to generate a compressed file that is adapted to the remote function specification, and names the compressed file according to the configuration file.

[0119] The server here includes a remote function control platform, a code repository, an object storage platform, and a remote function running background. After the client of the terminal device receives the logic code that implements the functional requirements of the function to be created, the client preprocesses the logic code to obtain a code file and a configuration file. During the preprocessing process, authentication code and interface code can be added on the basis of the logic code, so that the remote function has an authentication function, and an interface encapsulation is added to the remote function. The code file and configuration file obtained after preprocessing are sent to the server, so that the remote function control platform in the server compiles the code file to generate a compressed file that is adapted to the remote function specification, and the compressed file is named according to the configuration file.

[0120] In step 109, by calling an application programming interface in the server for creating a remote function, the compressed file is created as a remote function encapsulating the logic code, and the remote function is deployed in the server.

[0121] By calling the application programming interface for creating remote functions in the server, a compressed file is created as a remote function encapsulating the logic code, and the remote function is deployed on the remote function running background. The code file will be uploaded to the code repository by the remote function control platform, so that when the client of the terminal device needs to make a call, the code file in the code repository will be loaded locally, and the compressed file will be uploaded to the object storage platform by the remote function control platform.

[0122] In some embodiments, the creation of remote functions can also be achieved by compiling scripts. The creation and calling of remote functions can be performed on the same platform, for example, the remote function can be developed directly in the use platform. These two processes can also be performed on different platforms.

[0123] See also Figure 4A , Figure 4A is an optional flow chart of a remote function call processing method provided by an embodiment of the present invention, which will be combined with Figure 4A The steps shown are used to illustrate that the steps of the following method can be implemented collaboratively on the terminal device and the server.

[0124] In step 201, in response to the client receiving the logic code, the client inserts the interface code into the logic code to obtain a code file, and the client scans the logic code to generate a configuration file corresponding to the logic code.

[0125] In some embodiments, the initial step of creating a remote function is to receive the initial logic code that can realize the remote function function through the client, and the client developer writes the code on his own client development machine. When the client receives the logic code, the local compilation process is completed through the client, which is equivalent to the preprocessing stage of the code. During the preprocessing process, the interface code will be inserted to obtain the code file, and the code of the remote function will be scanned, and the function class name and method name will be recorded in the configuration file, so as to obtain the code file and the configuration file respectively. The purpose of inserting the interface code here is to add interface encapsulation on the basis of the original logic code, so as to realize remote calling through the interface code so that the client no longer needs to make a display call, and can call the remote function like calling the local code.

[0126] In step 202, in response to the server receiving the code file and the configuration file, the server compiles the code file to generate a compressed file adapted to the remote function specification, and names the compressed file according to the configuration file.

[0127] The server here includes a remote function control platform, a code repository, an object storage platform, and a remote function running background. After the client receives the logic code that implements the function requirements of the function to be created, the client preprocesses the logic code to obtain a code file and a configuration file, and sends them to the server, so that the remote function control platform compiles the code file to generate a compressed file that is adapted to the remote function specification, and names the compressed file according to the configuration file.

[0128] In step 203, by calling an application programming interface in the server for creating remote functions, a compressed file is created as a remote function encapsulating logic code, the remote function encapsulating an interface function corresponding to the interface code, and the remote function is deployed in the server.

[0129] Here, the remote function control platform calls the application programming interface of the remote function platform for creating remote functions, and creates the compressed file as a remote function. The remote function here has been encapsulated with an interface function corresponding to the interface code after the client's preprocessing process. At this point, the remote function is created and deployed to the remote function running background.

[0130] See also Figure 4B ,based on Figure 4AIn step 201, in response to the client receiving the logic code, the client inserts the interface code into the logic code to obtain a code file, and the client scans the logic code to generate a configuration file corresponding to the logic code, which can be achieved through steps 2011-2012.

[0131] In step 2011, the logic code is searched.

[0132] In step 2012, when the logic code marked as a remote function is found, the authentication code and the interface code are inserted into the logic code, and the class name and the method name of the logic code are recorded in the configuration file to obtain the code file and the configuration file.

[0133] In some embodiments, it is necessary to have an authentication function when the remote function is running, which is achieved by inserting an authentication code into the logic code during the local compilation stage of the client, searching the logic code, and inserting the authentication code and the interface code into the logic code when the logic code marked as the remote function is found. The authentication code can be used to implement the authentication function, and the client identity information carried in the client code can be actively obtained through the authentication code. The authentication code carries a judgment code for judging whether the client is authorized to call the remote function. Here, not all clients have the right to call the remote function. For the remote function created based on the logic code actively written by the client developer, the corresponding authorization object is pre-set when the remote function is initially created. The authorization object for calling the remote function is the client pre-set when the logic code encapsulated in the remote function is pre-processed locally. Different clients have different identifiers that represent the client identity information. Based on the identifier carrying the client identity information, it is identified whether the client that initiates the call to the remote function belongs to the pre-set client that has the right to call the remote function, and specifically identifies whether the client identifier matches the pre-set client identifier. When the client identifier matches the pre-set client identifier, it is determined that the authentication is passed. In addition, the authentication function may not be set in the remote function. Then the remote function without the authentication function can serve all clients instead of specific clients.

[0134] See also Figure 4C ,based on Figure 4B In step 2012, inserting the interface code into the logic code can be specifically implemented through step 2012A.

[0135] In step 2012A, interface code is added to the logic code by bytecode editing, and the interface code includes interface code for calling remote functions through network requests and interface code for executing remote functions on the client through an inter-process communication mechanism.

[0136] In some embodiments, the bytecode editing method in the computer programming language is used, and the logic code is first compiled into a class file. The class file is edited by the bytecode editing tool. When editing the class file, the client first identifies the remote function and creates an interface function with the same name as the remote function but different parameters. The interface function is used to implement two calling modes: initiating an HTTP request and directly calling the local logic code. The interface function here is implemented based on the interface code encapsulated in the interface function.

[0137] For users, the remote function interface function can be used to call the remote function just like calling local code, without having to worry about the specific call details or manually write the code for calling HTTP requests. At the same time, the client can also directly call the local remote function.

[0138] refer to Figure 5 , Figure 5 A schematic diagram of the client compilation function provided by an embodiment of the present invention. Based on the above embodiment, through the client preprocessing compilation technology, a software package for use by the host client is generated, which includes the interface function of the remote function, a software package for use by the local server client is generated, which includes the specific logic code of the remote function, and a compressed package for use by the remote function control platform is generated, which includes the code file of the logic code encapsulated in the remote function and the interface code encapsulated in the interface function, as well as the configuration file of the remote function.

[0139] The host client here is a client for users on terminal devices such as WeChat. The source of calling the logic code encapsulated in the remote function is the host client. The remote function runs on the remote function running background, which makes it impossible for developers to debug the logic code directly. By setting up the local server client, the logic code of the remote function can run on the local server client, so that developers can debug on the local server client. The debugged remote function can be uploaded to the remote function running background for execution. The role of the local server client is the same as that of the remote server. The remote function can be executed on the local server client or on the remote server. The host client can execute the logic code encapsulated in the remote function on the local server client, and can also call the logic code running on the remote function running background.

[0140] Here, the software package for the host client is the interface function added to the remote function through bytecode editing technology after the code file of the remote function is compiled into a class file. In the interface function, there is the interface code corresponding to calling HTTP request to access the remote function and the interface code corresponding to calling the local remote function through IPC. The software package for the local server client is the software package file directly packaged after the code file of the remote function is compiled into a class file. After the local server client integrates this software package file, the host client calls the remote function interface file in the local execution call mode, and then the logic code of the remote function will be called to the local server client through the Android IPC mechanism and executed. The compressed package for the remote function control platform is uploaded to the remote function control platform by the client. First, the code file of the remote function is traversed, then the package name, class name and method name of the remote function are recorded, and then the configuration file of the remote function is generated. Then, the configuration file and code file of the remote function are packaged together into a compressed package file, and finally uploaded to the remote function control platform.

[0141] refer to Figure 4D ,based on Figure 4A , the method also includes step 204.

[0142] In step 204, an update to the logic code is received from the client, an updated remote function is created according to the updated logic code, and the remote function is removed.

[0143] In some embodiments, remote functions do not remain constant. New remote functions are created based on task requirements. The remote function control platform creates, updates, and deletes remote functions. When an update to the logic code is received from the client, an updated remote function is created based on the updated logic code, and the remote function is removed.

[0144] In the remote function control platform, decompress the compressed file, compile the code file, get the compiled software package file, parse the remote function configuration file, and finally create a cloud function in the remote function running background according to the configuration file and software package file. The remote function control platform has the functions of creating, updating and deleting remote functions. Through the remote function control platform, you can control whether developers can submit remote functions. Developers need to apply for a proprietary key from the remote function control platform. Only requests with a proprietary key in the submission request can be recognized by the remote function control platform.

[0145] In some embodiments, encrypted communication is performed between the user and the remote function control platform. Both the client and the remote function control platform use asymmetric encryption methods for encryption and decryption. First, the remote function control platform generates a private key and a public key pair. The user pre-stores the public key of the remote function control platform. When the user submits the code file through the client, the public key of the remote function control platform is used to encrypt the code file, and the remote function control platform uses the private key to decrypt the code file. When the function remote control platform can successfully decrypt the code file, the user is allowed to use the remote function control platform to upload, create, update, and delete remote functions.

[0146] The present invention is not limited to the Android platform, but can also be implemented through Android and Apple dual systems.

[0147] The present invention is technically implemented in the following stages: remote function development, remote function integration, remote function creation and deployment, and remote function call. In actual applications, remote functions can be cloud functions.

[0148] See also Figure 6 , Figure 6 It is a timing diagram of the development, integration, creation and deployment process of remote functions in the practical application of the present invention.

[0149] like Figure 6 As shown in the figure, the client developer writes the code through the development machine, and the local preprocessing compilation can be completed on the development machine. In the process of compiling the logic code, the code marked as cloud function in the code will be scanned. The cloud function here is the remote function, and the function class name and method name will be recorded in the configuration file. At the same time, the authentication code will be inserted into the code marked as cloud function, and then the code file and configuration file will be uploaded to the remote function control platform. After uploading the code file, the cloud function control platform will compile the code file and generate a compressed package that adapts to the cloud specification. And upload the compressed package to the distributed storage platform, which is the object storage platform, and name the compressed package with the class name and method name in the configuration file. The cloud function control platform creates the compressed file previously uploaded to the distributed storage platform as a cloud function by calling the application programming interface used to create cloud functions in the cloud function platform. At this point, the cloud function is created, and then the created cloud function is deployed to the running background.

[0150] In the remote function call phase, the client needs to load the code in the code repository to the local computer first before calling the cloud function. Then, the cloud function code can be called just like other local methods. When calling, the developer can choose whether to actually execute the local code or the cloud function code on the network. During the code compilation process, a layer of interface encapsulation is added to the cloud function code. See Figure 7 , Figure 7This is a schematic diagram of implementing remote function calls in the actual application of the present invention. This interface function has two implementations: the logic code in the cloud function and the cloud function remote call code. The developer actually calls the interface function in the code, so the developer can choose to call the local logic to facilitate debugging, or call remote execution. Therefore, client development does not need to learn various cloud function calling methods, and there is no learning cost. At the same time, by using local code, developers have the ability to debug cloud functions locally.

[0151] Here, in the normal development mode, if you need to call an HTTP request, you need to actively write the code that initiates the HTTP request. The cloud function runs on the cloud function running background and is triggered by HTTP. Therefore, in the normal development mode, if you need to call the cloud function in the developed client, you need to manually write the HTTP request code to make an explicit call. However, in the present invention, when the developer calls the cloud function in the developed client, there is no need to actively write the HTTP request code that calls the cloud function. This is because when the code is compiled through the client, an interface function will be generated for the cloud function during the compilation of the code, and the interface function has its own code for calling the HTTP request. Here, the means of Java bytecode editing is used. The Java code is first compiled into a class file. Java provides a bytecode editing tool to edit the class file. When editing the class file, the cloud function is first identified, and then an interface function with the same name and different parameters as the cloud function is edited. The HTTP request is written in the interface function and the local cloud function is directly called. The user uses the interface function of the cloud function, so the user does not need to manually write the code for calling the HTTP request, and the client code written by the user can choose to directly call the local cloud function.

[0152] Next, the exemplary structure of the remote function call processing device 455 provided in the embodiment of the present invention implemented as a software module is described. In some embodiments, Figure 2 As shown, the software modules stored in the remote function call processing device 455 of the memory 440 may include: a function acquisition module 4551 , a local execution module 4552 and a remote execution module 4553 .

[0153] The function acquisition module 4551 is used to acquire the remote function from the server through the client.

[0154] The local execution module 4552 is used to respond to the client code executing the remote function in the client, execute the logic code encapsulated in the acquired remote function through the interface function encapsulated in the remote function, and return the call result obtained by the execution to the client code.

[0155] The remote execution module 4553, in response to the client code executing the remote function in the server, sends a network request for calling the remote function to the server through the interface function encapsulated in the remote function, and returns the calling result returned by the server to the client code.

[0156] In some embodiments, the device also includes: an authentication module, which is used to obtain an identifier representing the client identity information carried in the client code before executing the logic code encapsulated in the acquired remote function; based on the identifier, the client is authenticated through the remote function, and it is determined that the authentication is successful.

[0157] In some embodiments, the authentication module is also used to: obtain an identifier representing the client identity information carried in the client code before sending a network request to the server to call a remote function; authenticate the client through the remote function based on the identifier, and determine that the authentication is successful.

[0158] In some embodiments, the device also includes: a mode selection module, which is used to determine the client code for executing the remote function in the client when the network quality parameter of the network environment in which the client is running is lower than the network quality threshold; when the network quality parameter of the network environment in which the client is running is not lower than the network quality threshold, determine the client code for executing the remote function in the server.

[0159] In some embodiments, the device further includes: a remote function deployment module, which is used to, in response to the client receiving the operation of the logic code, preprocess the logic code through the client to obtain a code file and a configuration file, and send them to the server, so that the server compiles the code file to generate a compressed file adapted to the remote function specification, and names the compressed file according to the configuration file;

[0160] The remote function deployment module is also used to create the compressed file as a remote function encapsulating the logic code by calling an application programming interface in the server for creating a remote function, and deploy the remote function in the server.

[0161] The following continues to describe an exemplary structure of the remote function call processing device 456 provided in an embodiment of the present invention implemented as a software module. In some embodiments, Figure 2 As shown, the software modules stored in the remote function call processing device 456 of the memory 440 may include: a remote function configuration module 4554, a remote function compilation module 4555 and a remote function creation module 4556.

[0162] The remote function configuration module is used to respond to the operation of receiving the logic code by the client, insert the interface code into the logic code through the client to obtain the code file, and scan the logic code through the client to generate a configuration file corresponding to the logic code.

[0163] The remote function compilation module is used for compiling the code file through the server to generate a compressed file adapted to the remote function specification in response to the server receiving the code file and the configuration file, and naming the compressed file according to the configuration file.

[0164] A remote function creation module is used to create the compressed file as a remote function encapsulating the logic code by calling an application programming interface in the server for creating remote functions, wherein the remote function encapsulates an interface function corresponding to the interface code, and deploy the remote function in the server.

[0165] In some embodiments, the remote function configuration module 4554 is further used to:

[0166] Finding the logic code;

[0167] When the logic code marked as a remote function is found, the authentication code and the interface code are inserted into the logic code, and the class name and the method name of the logic code are recorded in the configuration file to obtain the code file and the configuration file.

[0168] In some embodiments, the remote function configuration module 4554 is further used to:

[0169] The interface code is added to the logic code by bytecode editing, and the interface code includes an interface code for calling a remote function through a network request and an interface code for executing the remote function on the client through an inter-process communication mechanism.

[0170] In some embodiments, the apparatus further comprises:

[0171] The remote function management module is used to receive updates to the logic code from the client, create updated remote functions according to the updated logic code, and remove the remote functions.

[0172] An embodiment of the present invention provides an electronic device, including:

[0173] A memory for storing executable instructions;

[0174] The processor is used to implement the remote function call processing method provided by the embodiment of the present invention when executing the executable instructions stored in the memory.

[0175] The embodiment of the present invention further provides a storage medium storing executable instructions, wherein the executable instructions are stored. When the executable instructions are executed by a processor, the processor will execute the remote function call processing method provided by the embodiment of the present invention, for example, FIG. 3A to FIG. 3D The remote function call processing method shown in any of the accompanying drawings and FIG. 4A to FIG. 4D Any one of the accompanying drawings shows a method for processing a remote function call.

[0176] In some embodiments, the storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or various devices including one or any combination of the above memories.

[0177] In some embodiments, executable instructions may be in the form of a program, software, software module, script or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine or other unit suitable for use in a computing environment.

[0178] As an example, executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, such as in one or more scripts in an HTML document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files storing one or more modules, subroutines, or code portions).

[0179] By way of example, executable instructions may be deployed to be executed on one computing device, or on multiple computing devices located at one site, or on multiple computing devices distributed across multiple sites and interconnected by a communication network.

[0180] In summary, the embodiments of the present invention have the following beneficial effects:

[0181] 1) It provides the client development with the ability to remotely execute code. The client development can execute the logic that could only be executed locally on the remote server. In the scenario of changing business, it can help the client development to quickly modify the logic and put it online.

[0182] 2) Since the logic code is executed in the remote server, it can avoid problems such as insufficient processing power of the client device processor, insufficient device storage space and unstable network environment.

[0183] 3) Developers have the ability to debug remote functions locally.

[0184] The above description is only an embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement and improvement made within the spirit and scope of the present invention are included in the protection scope of the present invention.

Claims

1. A method for processing remote function calls, It is characterized in that include: In response to the client receiving the logic code, the client preprocesses the logic code to obtain a code file and a configuration file, and sends them to the server so that The server compiles the code file to generate a compressed file adapted to the remote function specification, and names the compressed file according to the configuration file; By calling an application programming interface in the server for creating a remote function, the compressed file is created as a remote function encapsulating the logic code, and the remote function is deployed in the server; Loading the remote function from the server to the local of the client through the client; In response to executing the client code of the remote function in the client, executing the obtained logic code encapsulated in the remote function through the interface function encapsulated in the remote function locally on the client, and Returning the call result obtained by execution to the client code; In response to the client code executing the remote function in the server, sending a network request to call the remote function to the server through the interface function encapsulated in the remote function in the server, and The calling result returned by the server is returned to the client code.

2. The method according to claim 1, It is characterized in that Before executing the logic code encapsulated in the acquired remote function, the method further includes: Obtaining an identifier representing the client identity information carried in the client code; According to the identifier, the client is authenticated through the remote function, and it is determined that the authentication is successful.

3. The method according to claim 1, It is characterized in that Before sending a network request to the server to call a remote function, the method further includes: Obtaining an identifier representing the client identity information carried in the client code; According to the identifier, the client is authenticated through the remote function, and it is determined that the authentication is successful.

4. The method according to claim 1, It is characterized in that The method further comprises: When a network quality parameter of a network environment in which the client runs is lower than a network quality threshold, determining to execute a client code of the remote function in the client; When a network quality parameter of a network environment in which the client runs is not lower than a network quality threshold, it is determined to execute the client code of the remote function in the server.

5. The method according to claim 1, It is characterized in that The preprocessing of the logic code by the client to obtain a code file and a configuration file includes: Finding the logic code; When the logic code marked as the remote function is found, the authentication code and the interface code are inserted into the logic code, and the class name and the method name of the logic code are recorded in the configuration file to obtain the code file and the configuration file.

6. The method according to claim 5, It is characterized in that The inserting of the interface code into the logic code comprises: The interface code is added to the logic code by bytecode editing, and the interface code includes an interface code for calling a remote function through a network request and an interface code for executing the remote function on the client through an inter-process communication mechanism.

7. A remote function call processing device, It is characterized in that The device comprises: A function acquisition module is used for, in response to the operation of receiving the logic code by the client, preprocessing the logic code through the client to obtain a code file and a configuration file, and sending them to the server, so that the server compiles the code file to generate a compressed file adapted to the remote function specification, and names the compressed file according to the configuration file; by calling the application programming interface for creating remote functions in the server, the compressed file is created as a remote function encapsulating the logic code, and the remote function is deployed in the server; and the remote function is loaded from the server to the local of the client through the client; A local execution module, configured to execute the obtained logic code encapsulated in the remote function through the interface function encapsulated in the remote function locally on the client in response to the client code executing the remote function in the client, and return the call result obtained by the execution to the client code; The remote execution module, in response to the client code executing the remote function in the server, sends a network request for calling the remote function to the server through the interface function encapsulated in the remote function in the server, and returns the calling result returned by the server to the client code.

8. An electronic device, It is characterized in that The electronic device comprises: A memory for storing computer executable instructions; A processor, used to implement the remote function call processing method described in any one of claims 1 to 6 when executing the computer executable instructions stored in the memory.

9. A computer-readable storage medium storing computer-executable instructions, It is characterized in that When the computer executable instructions are executed by a processor, the remote function call processing method described in any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Remote communication and remote programming through application programming interface

    CN108306844A

  • Golang reflection technology-based rpc cross-language call service governance method

    CN108509282A

  • Method and apparatus for providing remote function using proxy

    KR1020160049997A

  • Tamper proof mutating software

    US20130086643A1