CN112395096A - Remote function call processing method and device, electronic equipment and storage medium - Google Patents

Remote function call processing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN112395096A
CN112395096A CN201910746090.1A CN201910746090A CN112395096A CN 112395096 A CN112395096 A CN 112395096A CN 201910746090 A CN201910746090 A CN 201910746090A CN 112395096 A CN112395096 A CN 112395096A
Authority
CN
China
Prior art keywords
code
remote function
client
function
server
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
Application number
CN201910746090.1A
Other languages
Chinese (zh)
Inventor
姬鹏
黄志恒
程力
马干宣
王辅佳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201910746090.1A priority Critical patent/CN112395096A/en
Publication of CN112395096A publication Critical patent/CN112395096A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/549Remote execution

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The invention provides a method and a device for processing remote function call, electronic equipment and a storage medium, wherein the method comprises the following steps: acquiring a remote function from a server through a client; responding to a client code for executing the remote function in the client, executing the logic code encapsulated in the acquired remote function through an interface function encapsulated in the remote function, and returning a calling result obtained by the execution to the client code; responding to the client code of the remote function executed in the server, sending a network request for calling the remote function to the server through the interface function packaged in the remote function, and returning a calling result returned by the server to the client code.

Description

Remote function call processing method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method and an apparatus for processing a remote function call, an electronic device, and a storage medium.
Background
At present, cloud computing platforms with cloud function functions are provided by various major manufacturers, servers do not need to be purchased and managed by using cloud functions, only core codes are compiled by using languages supported by the platforms and code running conditions are set, and the codes can run flexibly and safely on cloud infrastructure. Underlying computing resources, including server CPUs, memory, network and other configuration/resource maintenance, code deployment, elastic scaling, load balancing, etc. are hosted, these cloud functions focus on simplifying background services.
At present, based on a cloud computing platform, a client can only explicitly call related codes in a network service calling mode, for the client, the functions are still in the scope of background services, the client still calls the cloud functions according to the rules of the cloud functions when calling, and the client still needs to debug the cloud functions. And, currently, mobile client code can only run on android devices or apple devices. The specific flow of the code running is that after the mobile device downloads and installs the application, the code in the application is then run.
Disclosure of Invention
The embodiment of the invention provides a processing method and device for remote function call, electronic equipment and a storage medium, which can enable codes run by a client to be executed on a remote server and the client can call remote codes like local codes.
The technical scheme of the embodiment of the invention is realized as follows:
the embodiment of the invention provides a method for processing remote function call, which comprises the following steps:
acquiring a remote function from a server through a client;
executing the logic code encapsulated in the retrieved remote function through an interface function encapsulated in the remote function in response to the client code executing the remote function in the client, and
returning a calling result obtained by execution to the client code;
in response to client code executing the remote function in a server, sending a network request to the server to invoke the remote function through an interface function encapsulated in the remote function, an
And returning the calling result returned by the server to the client code.
In the above scheme, the method further comprises:
receiving an update for the logic code from the client, creating an updated remote function from the updated logic code, and removing the remote function.
The embodiment of the invention provides a method for processing remote function call, which comprises the following steps:
responding to an operation that a client receives a logic code, inserting an interface code into the logic code through the client to obtain a code file, and scanning the logic code through the client to generate a configuration file corresponding to the logic code;
in response to the server receiving the code file and the configuration file, compiling the code file through the server to generate a compressed file which is suitable for a remote function specification, and naming the compressed file according to the configuration file;
creating the compressed file as a remote function encapsulated with the logic code by calling an application programming interface in a server for creating the remote function, the remote function being encapsulated with an interface function corresponding to the interface code, and deploying the remote function in the server.
The embodiment of the invention provides a processing device for remote function call, which comprises:
the function acquisition module is used for acquiring a remote function from the server through the client;
the local execution module is used for responding to a client code for executing the remote function in the client, executing the logic code encapsulated in the acquired remote function through an interface function encapsulated in the remote function, and returning a calling result obtained by the execution to the client code;
and the remote execution module responds to the client code for executing the remote function in the server, sends a network request for calling the remote function to the server through the interface function packaged in the remote function, and returns a calling result returned by the server to the client code.
In the above scheme, the apparatus further comprises:
the authentication module is used for acquiring an identifier which is carried in the client code and used for representing the client identity information before executing the logic code encapsulated in the acquired remote function; and according to the identification, carrying out authentication processing on the client through the remote function, and determining that the authentication is passed.
In the foregoing solution, the authentication module is further configured to:
before sending a network request for calling a remote function to a server, acquiring an identifier which represents client identity information and is carried in a client code; and according to the identification, carrying out authentication processing on the client through the remote function, and determining that the authentication is passed.
In the above scheme, the apparatus further comprises:
a mode selection module for determining client code for executing the remote function in a client when a network quality parameter of a network environment in which the client is operating is below a network quality threshold; determining client code to execute the remote function in the server when a network quality parameter of a network environment in which the client operates is not below a network quality threshold.
In the above scheme, the apparatus further comprises:
a remote function deployment module, configured to, in response to an operation that the client receives the logic code, preprocess the logic code by the client to obtain a code file and a configuration file, and send the code file and the configuration file to the server, so that the server can execute the logic code deployment process
The server compiles the code file to generate a compressed file which is suitable for the remote function specification, and names the compressed file according to the configuration file;
the remote function deployment module is further used for creating the compressed file into a remote function encapsulated with the logic code by calling an application programming interface in a server for creating the remote function, and deploying the remote function in the server.
The embodiment of the invention provides a processing device for remote function call, which comprises:
the remote function configuration module is used for responding to the operation that a client receives a logic code, inserting an interface code into the logic code through the client to obtain a code file, and scanning the logic code through the client to generate a configuration file corresponding to the logic code;
the remote function compiling module is used for compiling the code file to generate a compressed file which is suitable for remote function specifications through the server in response to the code file and the configuration file received by the server, and naming the compressed file according to the configuration file;
and the remote function creating module is used for creating the compressed file into a remote function encapsulated with the logic code by calling an application programming interface in the server for creating the remote function, encapsulating an interface function corresponding to the interface code in the remote function, and deploying the remote function in the server.
In the foregoing solution, the remote function configuration module is further configured to:
searching the logic code;
when the logic code marked as the remote function is found, an authentication code and an interface code are inserted into the logic code, and the class name and the method name of the logic code are recorded into the configuration file, so that the code file and the configuration file are obtained.
In the foregoing solution, the remote function configuration module is further configured to:
and adding the interface code into the logic code in a byte code editing mode, wherein the interface code comprises an interface code for calling a remote function through a network request and an interface code for executing the remote function at the client through an interprocess communication mechanism.
In the above solution, the apparatus further comprises:
and the remote function management module is used for receiving the update aiming at the logic code from the client, creating an updated remote function according to the updated logic code and removing the remote function.
An embodiment of the present invention provides an electronic device, including:
a memory for storing executable instructions;
and the processor is used for realizing the processing method of the remote function call provided by the embodiment of the invention when the executable instruction stored in the memory is executed.
The embodiment of the invention provides a storage medium, which stores executable instructions and is used for causing a processor to execute so as to realize the processing method for remote function call provided by the embodiment of the invention.
The embodiment of the invention has the following beneficial effects:
the logic code which can only be locally executed originally is placed on the remote server to be executed, and the interface function is called to realize the local calling of the remotely executed logic code, so that the logic code can be rapidly modified and the on-line function can be realized in the development process of the client under the scene of changeable service, and meanwhile, the logic code can still be locally executed, so that a developer has local debugging capability.
Drawings
FIG. 1 is an alternative architectural diagram of a remote function call processing system 100 provided by embodiments of the present invention;
fig. 2 is an alternative structural diagram of an electronic device 400 according to an embodiment of the present invention;
3A-3D are alternative flow diagrams of methods for processing remote function calls provided by embodiments of the present invention;
4A-4D are alternative flow diagrams of methods for processing remote function calls provided by embodiments of the present invention;
FIG. 5 is a diagram illustrating client-side compilation functionality provided by an embodiment of the invention;
FIG. 6 is a timing diagram of the development, integration, creation, and deployment processes of remote functions in a practical application of the present invention;
fig. 7 is a schematic diagram of implementing remote function call in practical application of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail with reference to the accompanying drawings, the described embodiments should not be construed as limiting the present invention, and all other embodiments obtained by a person of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
In the following description, reference is made to "some embodiments" which describe a subset of all possible embodiments, but it is 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.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used herein is for the purpose of describing embodiments of the invention only and is not intended to be limiting of the invention.
Before further detailed description of the embodiments of the present invention, terms and expressions mentioned in the embodiments of the present invention are explained, and the terms and expressions mentioned in the embodiments of the present invention are applied to the following explanations.
1) Inter-Process Communication (IPC), also called cross-Process Communication, refers to a Process of exchanging data between two processes.
2) HyperText Transfer Protocol (HTTP) request: client-to-server request messages.
3) Packaging: i.e. hide the properties and implementation details of the object, and only expose the interface to the outside.
4) Remote function: a function for implementing a special function, such as a listening function for implementing a listening function or a message function for sending a message, pre-deployed to the server.
5) Client code: i.e., code in the client that implements functions in the client (e.g., querying, displaying, etc.) that may select whether to execute remote functions locally at the client or locally at the server.
6) Logic code: code for implementing the functionality of the remote function, such as code for implementing a listening function or code for implementing a messaging function sending message function, encapsulated in the remote function.
Currently, cloud functions introduced by a cloud computing platform are mainly developed aiming at background functions, and a client can only explicitly call the codes in a mode of calling hypertext transfer protocol services. These functions are still background services to the client. When the client calls, the client still calls the remote functions according to the rules of the remote functions, and debugging and the like are still needed to be carried out on the remote functions.
To extend client development capabilities, code that the client runs is enabled to run on the remote background. The client can call the remote code developed at the client as well as other local code without calling according to additional remote function rules. The client can debug the code locally without the need to do so as other traditional background services do.
In the prior art, remote functions are simplified for background development or support for universal language development, and clients need to learn how to develop the cloud functions additionally during development and use, so that extra learning cost is paid. The use mode of the remote function is developed on line or locally, then is deployed on line, and finally is called by a network request and the like. In this mode, the process of developing the functions and the process of executing the functions are split, and after the remote functions are developed and deployed, the client cannot call the remote functions as calling the local logic code, but needs an additional software development kit interface to call the remote functions, and the remote functions are called according to the rules of the remote functions and debugged.
In order to meet the requirement that a client side realizes the call execution of a remote function in a local call mode, embodiments of the present invention provide a method, an apparatus, an electronic device, and a storage medium for processing remote function call, which can solve the technical problems that the client side needs to learn how to develop a remote function in addition in the process of developing by using the remote function, and the client side cannot call the remote function like calling a local code.
An exemplary application of the electronic device provided by the embodiment of the present invention is described below, and the electronic device provided by the embodiment of the present invention may be implemented as various types of terminal devices such as a notebook computer, a tablet computer, a desktop computer, a set-top box, a mobile device (e.g., a mobile phone, a portable music player, a personal digital assistant, a dedicated messaging device, and a portable game device), and may also be implemented as a server. In the following, an exemplary application will be explained when the device is implemented as a terminal device.
Referring to fig. 1, fig. 1 is an alternative architecture diagram of a remote function call processing system 100 according to an embodiment of the present invention, in which a terminal device 400-1 is connected to a server 200 through a network 300, a client 410-1 runs in the terminal device 400-1, and the network 300 may be a wide area network or a local area network, or a combination of the two. The remote function may be executed locally on the terminal device or may be invoked to the server via the network 300 by way of network communication such that the remote function is executed on the server.
The server 200 includes a remote function control platform, a code repository, an object storage platform, and a remote function runtime background. After the client of the terminal equipment receives the logic code, the logic code is preprocessed by the client to obtain a code file and a configuration file, and the code file and the configuration file are sent to the server, so that the remote function control platform compiles the code file to generate a compressed file which is suitable for the remote function specification and names the compressed file according to the configuration file, creating the compressed file as a remote function encapsulated with logic code by calling an application programming interface in the server for creating the remote function, and deploying the remote function on a remote function running background, the code file is uploaded to the code warehouse by the remote function control platform, so that the code file in the code warehouse is loaded to the local when a client of the terminal device needs to be called, and the compressed file is uploaded to the object storage platform by the remote function control platform. The client requests the server to load the code and initiates a call remote execution request to the server.
Referring to fig. 2, fig. 2 is a schematic diagram of an alternative structure of an electronic device 400 according to an embodiment of the present invention, where the electronic device 400 shown in fig. 2 includes: at least one processor 410, memory 450, at least one network interface 420, and a user interface 430. The various components in electronic device 400 are coupled together by a bus system 440. It will be appreciated that the bus system 440 is used to enable communications among the components. The bus system 440 includes a power bus, a control bus, and a status signal bus in addition to a data bus. For clarity of illustration, however, the various buses are labeled as bus system 440 in fig. 2.
The Processor 410 may be an integrated circuit chip having Signal processing capabilities, such as a general purpose Processor, a Digital Signal Processor (DSP), or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like, wherein the general purpose Processor may be a microprocessor or any conventional Processor, or the like.
The user interface 430 includes one or more output devices 431, including one or more speakers and/or one or more visual displays, that enable the presentation of media content. 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.
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, and the like. Memory 450 optionally includes one or more storage devices physically located remote from processor 410.
The memory 450 includes either volatile memory or nonvolatile memory, and may include both volatile and nonvolatile memory. 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 embodiments of the invention is intended to comprise any suitable type of memory.
In some embodiments, memory 450 is capable of storing data, examples of which include programs, modules, and data structures, or a subset or superset thereof, to support various operations, as exemplified below.
The operating system 451, which includes system programs for handling various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., is used for implementing various basic services and for processing hardware-based tasks.
A network communication module 452 for communicating to other computing devices via one or more (wired or wireless) network interfaces 420, exemplary network interfaces 420 including: bluetooth, wireless compatibility authentication (WiFi), and Universal Serial Bus (USB), among others.
A presentation module 453 for enabling presentation of information (e.g., user interfaces for operating peripherals and displaying content and information) via one or more output devices 431 (e.g., display screens, speakers, etc.) associated with user interface 430.
An input processing module 454 for detecting one or more user inputs or interactions from one of the one or more input devices 432 and translating the detected inputs or interactions.
In some embodiments, the processing apparatus for remote function call provided by the embodiments of the present invention may be implemented in software, fig. 2 shows the processing apparatus 455 for remote function call stored in the memory 450, and includes three modules, which may be software in the form of program and plug-in, a function obtaining module 4551, a local execution module 4552 and a remote execution module 4553, which may be embedded in various clients, the function obtaining module 4551 is configured to obtain a remote function from a server, the local execution module 4552 is configured to execute logic code encapsulated in the obtained remote function through an interface function encapsulated in the remote function in response to client code for executing the remote function in the client, and return a result of executing the obtained call to the client code, the remote execution module 4553 is configured to respond to client code for executing the remote function in the server, and sending a network request for calling the remote function to the server through the interface function encapsulated in the remote function, and returning a calling result returned by the server to the client code. The functionality of the various modules will be described in greater detail below, and these modules are logical and may therefore be arbitrarily combined or further separated depending on the functionality implemented.
Also shown in fig. 2 is remote function call processing means 456 stored in memory 450, where memory 450 may store any or all of remote function call processing means 455, remote function call processing means 456. The remote function call processing device 456 includes a remote function configuration module 4554, a remote function compilation module 4555 and a remote function creation module 4556, which may be software in the form of programs, plug-ins and the like, and may be embedded in various clients, the remote function configuration module 4554 is configured to insert an interface code in a logic code through a client to obtain a code file in response to an operation of the logic code received by the client, 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 configured to compile the code file through a server to generate a compressed file adapted to a specification of a remote function in response to the code file and the configuration file received by the server, name the compressed file according to the configuration file, the remote function creation module 4556 is configured to create a remote function by calling an application programming interface in the server, creating the compressed file as a remote function encapsulated with the logic code, wherein the remote function is encapsulated with an interface function corresponding to the interface code, and deploying the remote function in the server. The functionality of the various modules will be described in greater detail below, and these modules are logical and may therefore be arbitrarily combined or further separated depending on the functionality implemented.
In other embodiments, the communication Device across the clients provided by the embodiments of the present invention may be implemented in hardware, for example, the Device provided by the embodiments of the present invention may be a processor in the form of a hardware decoding processor, which is programmed to execute the communication method across the clients provided by the embodiments of the present invention, for example, the processor in the form of the hardware decoding processor may be 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.
The following describes a method for processing a remote function call according to an embodiment of the present invention, with reference to an exemplary application and implementation of an electronic device according to an embodiment of the present invention.
Referring to fig. 3A, fig. 3A is an optional flowchart of a method for processing a remote function call according to an embodiment of the present invention, which will be described in conjunction with the steps shown in fig. 3A, where the steps of the following method may be implemented on the electronic device.
In step 101, a remote function is obtained from a server by a client.
The remote function can be a self-contained function provided for a developer in the server, and the remote function is usually deployed on the server after the developer actively develops and creates the remote function according to different task requirements. Thus, the remote functions herein may result from the autonomous creation of a client developer. The creation of the remote function may be performed in cooperation with the client developer and the server.
The server comprises a remote function control platform, a code warehouse, an object storage platform and a remote function running background. After the client of the terminal device receives the logic code implementing the functional requirements of the function to be created, preprocessing the logic code by the client to obtain a code file and a configuration file, sending the code file and the configuration file to the server, so that the remote function control platform compiles the code file to generate a compressed file which is suitable for the remote function specification and names the compressed file according to the configuration file, creating the compressed file as a remote function encapsulated with logic code by calling an application programming interface in the server for creating the remote function, and deploying the remote function on a remote function running background, the code file is uploaded to the code warehouse by the remote function control platform, so that the code file in the code warehouse is loaded to the local when a client of the terminal device needs to be called, and the compressed file is uploaded to the object storage platform by the remote function control platform.
In some embodiments, the code for the remote functions in the server's code repository is loaded locally when the client initializes. Therefore, when the client needs to call the remote function, the logic codes encapsulated in the obtained remote function can be executed locally through the interface function encapsulated in the remote function directly, and the network request for calling the remote function is sent to the server through the interface function encapsulated in the remote function directly, so that the logic codes encapsulated in the remote function can be executed on the remote server, the process of loading the remote function codes is not required to be executed before the client calls, and the problem that the subsequent call cannot be carried out due to the fact that the network connection quality fluctuates in the using process of the client and the timely loading cannot be carried out is avoided.
In some embodiments, the code for the remote function in the code repository of the server is loaded locally when execution of client code associated with the remote function is required. Therefore, when the client needs to execute the client code related to the remote function, the remote function code loading process is carried out, the cache of the code loaded to the local remote function is cleared every unit time, the memory pressure of the local client can be relieved through the loading mode, and the code loading process is executed only when the code needs to be called. And meanwhile, monitoring an event that the client calls the remote function, and when the monitoring time exceeds a monitoring time threshold value and the event that the client calls the remote function is not monitored, if the default is that the client does not need to call the code of the remote function, clearing the cache of the code loaded to the local remote function, wherein the unit time can be the monitoring time threshold value.
In step 102, in response to the client code for 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.
In some embodiments, when the client code of the 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 a call result obtained by executing the logic code encapsulated in the remote function is returned to the client code.
In step 103, in response to the client code of the remote function executed in the server, a network request for calling the remote function is sent to the server through an interface function encapsulated in the remote function, and a calling result returned by the server is returned to the client code.
In some embodiments, when the client code of the remote function is executed 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 a calling result obtained by executing the logic code encapsulated in the remote function on the server is returned to the client code.
Here, step 102 and step 103 correspond to two different code calling modes, and the developer can choose to actually execute the local code or execute the remote function code on the network when calling, which is implemented based on the interface packaging of the remote function in the creation process of the remote function. And the interface function corresponding to the interface package is packaged with the logic code in the remote function and the remote function calling code. In the actual calling process, the interface function is actually called, so that for a developer, two calling modes of executing local codes or remote codes on a network are provided, and when the local codes are executed by adopting the local executing calling mode, the code debugging is facilitated; when executing remote function code on a server in a remotely executed call mode, the code can be modified directly in the background so that the client version presented to the user is always up-to-date.
Referring to FIG. 3B, based on FIG. 3A, step 104 and step 105 may also be performed before the logic code encapsulated in the obtained remote function is executed in step 102.
In step 104, an identifier representing the client identity information carried in the client code is obtained.
In some embodiments, the remote function includes an authentication code for implementing an authentication function, and before executing obtaining the logic code encapsulated in the remote function, the client identity information carried in the client code may be actively obtained through the authentication code for implementing the authentication function, where the identity information of the client is represented by an identifier, and the identity information of different clients is different and has different identifiers.
In step 105, according to the identifier, the client is authenticated through the remote function, and it is determined that the authentication is passed.
In some embodiments, the authentication code carries a determination code for determining 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 preset when the remote function is initially created, and the authorization object calling the remote function is the client preset when the logic code encapsulated in the remote function is locally preprocessed. Different clients have different identifications, and whether the client initiating the remote function call belongs to a preset client having authority to call the remote function is identified based on the identification carrying the identity information of the client, specifically, whether the identification of the client is matched with the identification of the preset client. And when the identification of the client side is matched with the preset identification of the client side, the authentication is determined to be passed. In addition, the authentication function may not be provided in the remote function, and the remote function without the authentication function may serve all clients, not a specific client.
Step 104 and 105 are also performed before the network request to invoke the remote function is sent to the server in step 103.
In step 104, an identifier representing the client identity information carried in the client code is obtained.
In some embodiments, the remote function includes an authentication code for implementing an authentication function, and before sending a network request for invoking the remote function to the server, the client identity information carried in the client code may be actively acquired by the authentication code for implementing the authentication function, where the identity information of the client is represented by an identifier, and the identity information of different clients is different.
In step 105, according to the identifier, the client is authenticated through the remote function, and it is determined that the authentication is passed.
In some embodiments, the authentication code carries a determination code for determining 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 preset when the remote function is initially created, and the authorization object calling the remote function is the client preset when the logic code encapsulated in the remote function is locally preprocessed. Different clients have different identifications, and whether the client initiating the remote function calling belongs to a preset client having authority to call the remote function is identified based on the identification carrying the identity information of the client, and whether the identification of the specific identification client is matched with the identification of the preset client. And when the identification of the client side is matched with the preset identification of the client side, the authentication is determined to be passed. In addition, the authentication function may not be provided in the remote function, and the remote function without the authentication function may serve all clients, not a specific client.
Referring to fig. 3C, based on fig. 3A, step 106 and step 107 may be included between step S101 and step S102.
In some embodiments, there are multiple factors that affect whether the client uses a locally executed call mode or a remotely executed call mode. The influencing factors include: hardware resources of a host device of the client, and network resources. The influencing factors of the hardware resources of the host device corresponding to the client may be an idle rate of the central processor and an idle rate of the storage space for program execution. The contributing factor corresponding to the network resource may be the network resource bandwidth.
In step 106, when a network quality parameter of a network environment in which the client operates is below a network quality threshold, client code is determined to execute the remote function in the client.
In some embodiments, the client code to execute the remote function in the client is determined when a network quality parameter of a network environment in which the client is operating is below a network quality threshold. The network quality threshold is preset, when the network quality parameter is lower than the network quality threshold, it indicates that the current network quality can not support the network communication mode, and sends the network request for calling the remote function to the server through the interface function encapsulated in the remote function, and then determines the client code for executing the remote function in the client, and at this time, the local execution calling mode is adopted. For example, in the case of no network connection and the client has been locally preloaded with the code of the remote function, a locally executed call mode is adopted; when the network communication environment is cellular, then a locally executed call mode is assumed.
In step 107, when the network quality parameter of the network environment in which the client operates is not lower than the network quality threshold, the client code for executing the remote function in the server is determined.
In some embodiments, the client code to execute the remote function in the server is determined when a network quality parameter of a network environment in which the client is operating is not below a network quality threshold. The network quality threshold here is the same as the network quality threshold in the above embodiment, and when the network quality parameter is not lower than the network quality threshold, it indicates that the current network quality can support network communication through an interface function encapsulated in a remote function, and sends a network request for calling the remote function to a server, and determines to execute the client code of the remote function in the server, and at this time, a remote execution calling mode is adopted. For example, when the network communication environment is a Wi-Fi connection, a remote execution call mode is adopted.
In some embodiments, when the idle rate of the central processing unit of the host device of the client is lower than the corresponding processor idle rate threshold, a remote execution calling mode is adopted; when the free rate of the storage space of the host equipment of the client for program operation is lower than the corresponding storage space threshold, a remote execution calling mode is adopted, so that the increase of processor load and the occupation of excessive storage space are avoided, and the operation speed is slowed.
In some embodiments, the invoking pattern is determined by combining the plurality of influencing factors, each of which 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, the weight of the idle rate of the storage space for program operation is 0.2, whether to use the remotely executed invoking pattern is determined for each influencing factor, respectively, and when it is determined that the remotely executed invoking pattern is used, the record is 1, and when it is determined that the locally executed invoking pattern is used, the record is 0, combining the above three influencing factors, calculating the invoking pattern weighted reference value according to the weights corresponding to the three influencing factors, presetting the threshold of the invoking pattern weighted reference value to be 0.8, when the invoking pattern weighted reference value exceeds the threshold, the remotely executed invoking pattern is used, where the threshold is not limited to 0.8, may be set according to historical call data for each remote function.
Based on the embodiment of the invention, for a developer, two calling modes of executing the local code or executing the remote code on a network are provided, and when the local code is executed by adopting the calling mode of local execution, the code debugging is facilitated; when executing remote function code on a server in a remotely executed call mode, the code can be modified in the background so that the client version presented to the user is always up-to-date.
Referring to fig. 3D, based on fig. 3A, the method further comprises step 108 and step 109 before the remote function is obtained from the server by the client in step 101.
In step 108, in response to the operation that the client receives the logic code, the logic code is preprocessed by the client to obtain a code file and a configuration file, and the code file and the configuration file are sent to the server, so that the server compiles the code file to generate a compressed file adapted to the remote function specification, and the compressed file is named according to the configuration file.
The server comprises a remote function control platform, a code warehouse, an object storage platform and a remote function running background. After a client of the terminal equipment receives a logic code for realizing the function requirement of the function to be created, the logic code is preprocessed through the client to obtain a code file and a configuration file. In the preprocessing process, an authentication code and an interface code can be added on the basis of the logic code, so that the remote function has an authentication function, and an interface package is added on the remote function. And sending the code file and the configuration file obtained by preprocessing to a server so that a remote function control platform in the server compiles the code file to generate a compressed file which is suitable for a remote function specification, and naming the compressed file according to the configuration file.
In step 109, the compressed file is created as a remote function encapsulated with logic code by calling an application programming interface in the server for creating the remote function, and the remote function is deployed in the server.
The method comprises the steps of creating a compressed file into a remote function packaged with logic codes by calling an application programming interface used for creating the remote function in a server, and deploying the remote function on a remote function running background, wherein the code file is uploaded to a code warehouse by a remote function control platform, so that the code file in the code warehouse is loaded to the local when a client of a terminal device needs to be called, and the compressed file is uploaded to an object storage platform by the remote function control platform.
In some embodiments, the creation of the remote function may also be implemented by compiling a script, and the creation and calling of the remote function may be performed on the same platform, for example, the remote function is directly developed in a use platform, and the two processes may also be performed on different platforms.
Referring to fig. 4A, fig. 4A is an optional flowchart of a method for processing a remote function call according to an embodiment of the present invention, which will be described with reference to the steps shown in fig. 4A, where the steps of the following method may be cooperatively implemented on a terminal device and a server.
In step 201, in response to an operation that a client receives a logic code, inserting an interface code in the logic code by the client to obtain a code file, and scanning the logic code by the client to generate a configuration file corresponding to the logic code.
In some embodiments, the initial step of creating the remote function is to receive an initial logic code that can implement the remote function through a client, a client developer writes the code on its own client development machine, when the client receives the logic code, a local compilation process is completed through the client, which is equivalent to a preprocessing stage of the code, an interface code is inserted in the preprocessing process to obtain a code file, the code of the remote function is scanned, and a function class name and a method name are recorded in a configuration file, so that the code file and the configuration file are obtained respectively. The interface code is inserted to increase interface packaging on the basis of the original logic code, so that the remote calling is realized through the interface code, the client does not need to perform display calling any more, and the remote function can be called like calling a local code.
In step 202, in response to the server receiving the code file and the configuration file, the code file is compiled by the server to generate a compressed file adapted to the remote function specification, and the compressed file is named according to the configuration file.
The server comprises a remote function control platform, a code warehouse, an object storage platform and a remote function running background. After the client receives the logic code for realizing the function requirement to be created, the logic code is preprocessed through the client to obtain a code file and a configuration file, and the code file and the configuration file are sent to the server, so that the remote function control platform compiles the code file to generate a compressed file which is suitable for the remote function specification, and the compressed file is named according to the configuration file.
In step 203, the compressed file is created as a remote function encapsulated with logic code by calling an application programming interface in the server for creating the remote function, the remote function being encapsulated with an interface function corresponding to the interface code, and the remote function is deployed in the server.
The remote function control platform calls an application programming interface of the remote function platform for creating a remote function, creates the compressed file into the remote function, packages the interface function corresponding to the interface code in the remote function through the preprocessing process of the client, and deploys the remote function to the remote function operating background after the creation of the remote function is completed.
Referring to fig. 4B, based on fig. 4A, in response to the operation that the client receives the logic code in step 201, inserting an interface code in the logic code by the client to obtain a code file, and scanning the logic code by the client to generate a configuration file corresponding to the logic code, may be implemented in step 2011 and 2012.
In step 2011, the logic code is looked up.
In step 2012, 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 into the configuration file, so as to obtain a code file and a configuration file.
In some embodiments, it is necessary to have an authentication function when the remote function is running, and this is achieved by inserting an authentication code into the logic code in 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 for realizing an authentication function, and the client identity information carried in the client code can be actively acquired 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 preset when the remote function is initially created, and the authorization object calling the remote function is the client preset when the logic code encapsulated in the remote function is locally preprocessed. Different clients have different identifications for representing client identity information, and whether the client initiating the remote function call belongs to a preset client with permission to call the remote function is identified based on the identification carrying the client identity information, and whether the identification of the specific identification client is matched with the preset identification of the client. And when the identification of the client side is matched with the preset identification of the client side, the authentication is determined to be passed. In addition, the authentication function may not be provided in the remote function, and the remote function without the authentication function may serve all clients, not a specific client.
Referring to fig. 4C, based on fig. 4B, the step 2012 of inserting the interface code into the logic code may specifically be implemented by the step 2012A.
In step 2012A, an interface code is added to the logic code by means of bytecode editing, where 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 at the client through an interprocess communication mechanism.
In some embodiments, the logic code is first compiled into a class file using a means of bytecode editing in a computer programming language. The class file is edited by a bytecode editing tool, a client firstly identifies a remote function when editing the class file, and creates an interface function with the same name and different parameters as the remote function, two calling modes of initiating an HTTP request and directly calling a local logic code are realized by the interface function, and the interface function is realized based on the interface code packaged in the interface function.
For a user, calling a remote function as calling a local code can be realized through an interface function of the remote function without paying attention to specific calling details or manually writing the code for calling the HTTP request, and meanwhile, a client can directly call the local remote function.
Referring to fig. 5, fig. 5 is a schematic diagram illustrating a client compiling function according to an embodiment of the present invention. Based on the above embodiment, a software package for a host client to use is generated by a client preprocessing and compiling technology, the software package includes an interface function of a remote function, generates a software package for a local server client to use, the software package includes a specific logic code of the remote function, generates a compressed package for a remote function control platform to use, and the code package includes a logic code encapsulated in the remote function and a code file of the interface code encapsulated in the interface function, and a configuration file of the remote function.
The host client is a client for users on a terminal device similar to WeChat, the source for calling the logic codes encapsulated in the remote functions is the host client, the remote functions are operated on a remote function operation background, so that a developer cannot directly debug the logic codes, the logic codes of the remote functions can be operated on the local server client by arranging the local server client, so that the developer can debug on the local server client, the remote functions after debugging can be uploaded to the remote function operation background to be executed, the action of the local server client is the same as that of the remote server, the remote functions can be executed on the local server client and can also be executed on the remote server, and the logic codes encapsulated in the remote functions on the local server client can be executed on the host client, logic code running on the remote function runtime background may also be invoked.
Here, the software package for use by the host client is an interface function added to the remote function by a bytecode editing technique after the code file of the remote function is compiled into a class file. The interface function is provided with an interface code corresponding to calling an HTTP request to access the remote function and an interface code corresponding to calling the local remote function through IPC. The software package for use by the local server client is a software package file that is packaged directly after the code file of the remote function is compiled into a class file. After the local server client integrates the software package file, the host client calls the remote function interface file according to a local execution calling mode, and then the logic code of the remote function is called to the local server client through an android IPC mechanism to be executed. The compressed package for the remote function control platform is uploaded to the remote function control platform by a client, firstly, a code file of a remote function is traversed, then, a package name, a class name and a method name of the remote function are recorded, then, a configuration file of the remote function is generated, then, the configuration file and the code file of the remote function are packaged into a compressed package file together, and finally, the compressed package file is uploaded to the remote function control platform.
Referring to fig. 4D, based on fig. 4A, the method further includes step 204.
In step 204, an update for the logical code is received from the client, an updated remote function is created from the updated logical code, and the remote function is removed.
In some embodiments, the remote function is not kept constant, a new remote function is created according to task requirements, the remote function is subjected to creation, updating and deletion processes through the remote function control platform, and when an update for the logic code is received from the client, the updated remote function is created according to the updated logic code and the remote function is removed.
In the remote function control platform, the compressed package file is decompressed, the code file in the compressed package file is compiled to obtain a compiled software package file, the configuration file of the remote function is analyzed, and finally the cloud function is created to the remote function operating background according to the configuration file and the software package file. The remote function control platform has the functions of creating, updating and deleting the remote functions, whether a developer can submit the remote functions can be controlled through the remote function control platform, the developer needs to apply for a special secret key to the remote function control platform, and only the request carrying the special secret key in the submission request can be identified by the remote function control platform.
In some embodiments, the user and the remote function control platform perform encryption communication, the client and the remote function control platform both perform encryption and decryption by using an asymmetric encryption method, the remote function control platform first generates a private key and a public key pair, the user prestores the public key of the remote function control platform, the user encrypts the code file by using the public key of the remote function control platform when submitting the code file through the client, and the remote function control platform decrypts the code file by using the private key. When the function remote control platform can successfully decrypt the code file, the user is allowed to use the remote function control platform to realize the uploading, creation, updating and deletion of the remote function.
The invention is not limited to the android-based platform, and can also be realized by an android and apple dual system.
The invention is technically divided into a remote function development stage, a remote function integration stage, a remote function creation and deployment stage and a remote function calling stage. The remote function can be a cloud function in practical application.
Referring to fig. 6, fig. 6 is a timing diagram of the development, integration, creation, and deployment processes of remote functions in the practical application of the present invention.
As shown in fig. 6, a client developer writes codes through a development machine, can complete local preprocessing compilation on the development machine, and scans codes marked as cloud functions in the codes in the process of compiling logic codes, where the cloud functions are remote functions, records function class names and method names in configuration files, inserts authentication codes in the codes marked as cloud functions, and uploads the code files and the configuration files to a remote function control platform. After the code file is uploaded, the cloud function control platform compiles the code file to generate a compressed package which is adaptive to the cloud specification. And uploading the compressed package to a distributed storage platform, wherein the distributed storage platform is an object storage platform, and naming the compressed package by using the class name and the method name in the configuration file. The cloud function control platform creates the compressed file which is uploaded to the distributed storage platform into a cloud function by calling an application programming interface which is used for creating the cloud function in the cloud function platform, and deploys the created cloud function to the operation background when the creation of the cloud function is finished.
In the remote function calling stage, the client calls the cloud function, firstly, the code in the code warehouse needs to be loaded to the local, and then the cloud function code can be called like calling other local methods. The developer can choose to actually execute the native code or execute the cloud function code on the network when calling. In the process of compiling the code, a layer of interface package is added in the cloud function code. Referring to fig. 7, fig. 7 is a schematic diagram of implementing remote function call in practical application of the present invention. This interface function has two implementations: logic code in the cloud function and cloud function remote call code. The developer actually calls the interface function in the code, so that the developer can choose to call the local logic to facilitate debugging and can call remote execution. Therefore, the client develops calling methods without learning various cloud functions, learning cost is avoided, and meanwhile, developers have the capability of locally debugging the cloud functions by utilizing local codes.
Here, if it is necessary to call an HTTP request in the normal development mode, a code for initiating the HTTP request is actively written, and a cloud function is executed by HTTP trigger, which is run on a cloud function running background, so that in the normal development mode, if it is necessary to call the cloud function in a developed client, the code for the HTTP request needs to be manually written to be explicitly called, but in the present invention, when a developer calls the cloud function in the developed client, it is not necessary to actively write the code for the HTTP request for calling the cloud function. The method is characterized in that when code compiling is carried out through a client, an interface function is generated for a cloud function during compiling of the code, and a code for calling an HTTP request is carried in the interface function. 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 directly call the local cloud function.
Continuing with the exemplary structure in which the remote function call processing device 455 provided by the embodiments of the present invention is implemented as a software module, in some embodiments, as shown in fig. 2, the software module 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.
A function obtaining module 4551, configured to obtain the remote function from the server through the client.
A local execution module 4552, configured to, in response to the client code for executing the remote function in the client, execute the logic code encapsulated in the obtained remote function through the interface function encapsulated in the remote function, and return a call result obtained by the execution to the client code.
The remote execution module 4553, in response to the client code for 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.
In some embodiments, the apparatus further comprises: the authentication module is used for acquiring an identifier which is carried in the client code and used for representing the client identity information before executing the logic code encapsulated in the acquired remote function; and according to the identification, carrying out authentication processing on the client through the remote function, and determining that the authentication is passed.
In some embodiments, the authentication module is further configured to: before sending a network request for calling a remote function to a server, acquiring an identifier which represents client identity information and is carried in a client code; and according to the identification, carrying out authentication processing on the client through the remote function, and determining that the authentication is passed.
In some embodiments, the apparatus further comprises: a mode selection module for determining client code for executing the remote function in a client when a network quality parameter of a network environment in which the client is operating is below a network quality threshold; determining client code to execute the remote function in the server when a network quality parameter of a network environment in which the client operates is not below a network quality threshold.
In some embodiments, the apparatus further comprises: the remote function deployment module is used for responding to the operation that the client receives the logic code, preprocessing the logic code through the client to obtain a code file and a configuration file, and sending the code file and the configuration file to the server so that the server compiles the code file to generate a compressed file which is suitable for a remote function specification, and naming the compressed file according to the configuration file;
the remote function deployment module is further used for creating the compressed file into a remote function encapsulated with the logic code by calling an application programming interface in a server for creating the remote function, and deploying the remote function in the server.
Continuing with the exemplary structure in which remote function call processing device 456 provided by embodiments of the present invention is implemented as software modules, in some embodiments, as shown in fig. 2, the software modules stored in remote function call processing device 456 in memory 440 may include: a remote function configuration module 4554, a remote function compilation module 4555 and a remote function creation module 4556.
The remote function configuration module is used for responding to the operation that the client receives the logic code, inserting an interface code into the logic code through the client to obtain a code file, and scanning the logic code through the client to generate a configuration file corresponding to the logic code.
And the remote function compiling module is used for compiling the code file to generate a compressed file which is suitable for the remote function specification through the server in response to the code file and the configuration file received by the server, and naming the compressed file according to the configuration file.
And the remote function creating module is used for creating the compressed file into a remote function encapsulated with the logic code by calling an application programming interface in the server for creating the remote function, encapsulating an interface function corresponding to the interface code in the remote function, and deploying the remote function in the server.
In some embodiments, the remote function configuration module 4554 is further configured to:
searching the logic code;
when the logic code marked as the remote function is found, an authentication code and an interface code are inserted into the logic code, and the class name and the method name of the logic code are recorded into the configuration file, so that the code file and the configuration file are obtained.
In some embodiments, the remote function configuration module 4554 is further configured to:
and adding the interface code into the logic code in a byte code editing mode, wherein the interface code comprises an interface code for calling a remote function through a network request and an interface code for executing the remote function at the client through an interprocess communication mechanism.
In some embodiments, the apparatus further comprises:
and the remote function management module is used for receiving the update aiming at the logic code from the client, creating an updated remote function according to the updated logic code and removing the remote function.
An embodiment of the present invention provides an electronic device, including:
a memory for storing executable instructions;
and the processor is used for realizing the processing method of the remote function call provided by the embodiment of the invention when the executable instruction stored in the memory is executed.
Embodiments of the present invention further provide a storage medium storing executable instructions, where the executable instructions are stored, and when executed by a processor, the executable instructions will cause the processor to execute a processing method of a remote function call provided by an embodiment of the present invention, for example, a processing method of a remote function call as shown in any one of fig. 3A to 3D and a processing method of a remote function call as shown in any one of fig. 4A to 4D.
In some embodiments, the storage medium may be memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or may be various devices including one or any combination of the above memories.
In some embodiments, executable instructions may be written in any form of programming language (including compiled or interpreted languages), in the form of programs, software modules, scripts or code, 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.
By way of example, executable instructions may, but need not, correspond to files in a file system, and may be stored in a portion of a file that holds other programs or data, e.g., 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 that store one or more modules, sub-programs, or portions of code).
By way of example, executable instructions may be deployed to be executed on one computing device or on multiple computing devices at one site or distributed across multiple sites and interconnected by a communication network.
In summary, the embodiment of the invention has the following beneficial effects:
1) the remote code execution capability is provided for the client development, the client development can put the logic which can only be executed locally originally on a remote server for execution, and under the scene of changeable service, the client development can be helped to quickly modify the logic and be on line.
2) Because the logic code is executed in the remote server, the problems of insufficient computing power of a processor of the client device, insufficient storage space of the device, unstable network environment and the like can be avoided.
3) Developers have local debug capabilities for remote functions.
The above description is only an example of the present invention, and is not intended to limit the 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 (10)

1. A method for processing a remote function call, comprising:
acquiring a remote function from a server through a client;
executing the logic code encapsulated in the retrieved remote function through an interface function encapsulated in the remote function in response to the client code executing the remote function in the client, and
returning a calling result obtained by execution to the client code;
in response to client code executing the remote function in a server, sending a network request to the server to invoke the remote function through an interface function encapsulated in the remote function, an
And returning the calling result returned by the server to the client code.
2. The method of claim 1, wherein prior to executing the logic code encapsulated in the obtained remote function, the method further comprises:
acquiring an identifier which represents client identity information and is carried in the client code;
and according to the identification, carrying out authentication processing on the client through the remote function, and determining that the authentication is passed.
3. The method of claim 1, wherein prior to sending the network request to the server to invoke the remote function, the method further comprises:
acquiring an identifier which represents client identity information and is carried in the client code;
and according to the identification, carrying out authentication processing on the client through the remote function, and determining that the authentication is passed.
4. The method of claim 1, further comprising:
determining client code to execute the remote function in a client when a network quality parameter of a network environment in which the client operates is below a network quality threshold;
determining client code to execute the remote function in the server when a network quality parameter of a network environment in which the client operates is not below a network quality threshold.
5. The method of claim 1, wherein prior to obtaining the remote function from the server via the client, the method further comprises:
responding to the operation that the client receives the logic code, preprocessing the logic code through the client to obtain a code file and a configuration file, and sending the code file and the configuration file to the server so that the server can use the code file and the configuration file to enable the logic code to be preprocessed
The server compiles the code file to generate a compressed file which is suitable for the remote function specification, and names the compressed file according to the configuration file;
and creating the compressed file into a remote function encapsulated with the logic code by calling an application programming interface in a server for creating the remote function, and deploying the remote function in the server.
6. A method for processing a remote function call, comprising:
responding to an operation that a client receives a logic code, inserting an interface code into the logic code through the client to obtain a code file, and scanning the logic code through the client to generate a configuration file corresponding to the logic code;
in response to the server receiving the code file and the configuration file, compiling the code file through the server to generate a compressed file which is suitable for a remote function specification, and naming the compressed file according to the configuration file;
creating the compressed file as a remote function encapsulated with the logic code by calling an application programming interface in a server for creating the remote function, the remote function being encapsulated with an interface function corresponding to the interface code, and deploying the remote function in the server.
7. The method of claim 6, wherein inserting, by the client, an interface code into the logic code to obtain a code file, and scanning, by the client, the logic code to generate a configuration file corresponding to the logic code comprises:
searching the logic code;
when the logic code marked as the remote function is found, an authentication code and an interface code are inserted into the logic code, and the class name and the method name of the logic code are recorded into the configuration file, so that the code file and the configuration file are obtained.
8. The method of claim 7, wherein inserting interface code into the logic code comprises:
and adding the interface code into the logic code in a byte code editing mode, wherein the interface code comprises an interface code for calling a remote function through a network request and an interface code for executing the remote function at the client through an interprocess communication mechanism.
9. An apparatus for processing a remote function call, the apparatus comprising:
the function acquisition module is used for acquiring a remote function from the server through the client;
the local execution module is used for responding to a client code for executing the remote function in the client, executing the logic code encapsulated in the acquired remote function through an interface function encapsulated in the remote function, and returning a calling result obtained by the execution to the client code;
and the remote execution module responds to the client code for executing the remote function in the server, sends a network request for calling the remote function to the server through the interface function packaged in the remote function, and returns a calling result returned by the server to the client code.
10. An apparatus for processing a remote function call, the apparatus comprising:
the remote function configuration module is used for responding to the operation that a client receives a logic code, inserting an interface code into the logic code through the client to obtain a code file, and scanning the logic code through the client to generate a configuration file corresponding to the logic code;
the remote function compiling module is used for compiling the code file to generate a compressed file which is suitable for remote function specifications through the server in response to the code file and the configuration file received by the server, and naming the compressed file according to the configuration file;
and the remote function creating module is used for creating the compressed file into a remote function encapsulated with the logic code by calling an application programming interface in the server for creating the remote function, encapsulating an interface function corresponding to the interface code in the remote function, and deploying the remote function in the server.
CN201910746090.1A 2019-08-13 2019-08-13 Remote function call processing method and device, electronic equipment and storage medium Pending CN112395096A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910746090.1A CN112395096A (en) 2019-08-13 2019-08-13 Remote function call processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910746090.1A CN112395096A (en) 2019-08-13 2019-08-13 Remote function call processing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112395096A true CN112395096A (en) 2021-02-23

Family

ID=74602678

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910746090.1A Pending CN112395096A (en) 2019-08-13 2019-08-13 Remote function call processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112395096A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113722126A (en) * 2021-09-09 2021-11-30 北京沃东天骏信息技术有限公司 Request processing method and device
CN115314536A (en) * 2022-08-03 2022-11-08 平安付科技服务有限公司 Method and device for remotely executing command, storage medium and computer equipment
WO2024044914A1 (en) * 2022-08-29 2024-03-07 西门子股份公司 Method for generating code for describing remote procedure call, and electronic device, medium and program product

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130086643A1 (en) * 2011-10-04 2013-04-04 Kevin Dale Morgan Tamper proof mutating software
KR20160049997A (en) * 2014-10-28 2016-05-10 한국전자통신연구원 Method and apparatus for providing remote function using proxy
CN108306844A (en) * 2016-10-09 2018-07-20 上海思立微电子科技有限公司 Telecommunication by Application Programming Interface and long-range programming
CN108509282A (en) * 2018-02-08 2018-09-07 厦门快商通信息技术有限公司 Across the language call service administering methods of rpc based on golang reflection technologies

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130086643A1 (en) * 2011-10-04 2013-04-04 Kevin Dale Morgan Tamper proof mutating software
KR20160049997A (en) * 2014-10-28 2016-05-10 한국전자통신연구원 Method and apparatus for providing remote function using proxy
CN108306844A (en) * 2016-10-09 2018-07-20 上海思立微电子科技有限公司 Telecommunication by Application Programming Interface and long-range programming
CN108509282A (en) * 2018-02-08 2018-09-07 厦门快商通信息技术有限公司 Across the language call service administering methods of rpc based on golang reflection technologies

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113722126A (en) * 2021-09-09 2021-11-30 北京沃东天骏信息技术有限公司 Request processing method and device
CN115314536A (en) * 2022-08-03 2022-11-08 平安付科技服务有限公司 Method and device for remotely executing command, storage medium and computer equipment
CN115314536B (en) * 2022-08-03 2024-02-02 平安付科技服务有限公司 Remote command execution method and device, storage medium and computer equipment
WO2024044914A1 (en) * 2022-08-29 2024-03-07 西门子股份公司 Method for generating code for describing remote procedure call, and electronic device, medium and program product

Similar Documents

Publication Publication Date Title
CN111459539B (en) Continuous integration pipeline operation method and device based on mirror layering
CN107239309B (en) Patch generation method and device, updating method, electronic device and storage medium
CN112395096A (en) Remote function call processing method and device, electronic equipment and storage medium
WO2021164367A1 (en) Container mirror image providing method, container mirror image loading method, and related device and system
US11474842B2 (en) Integration application creator design
WO2020015191A1 (en) Business rule releasing and managing method, electronic device and readable storage medium
CN111142884A (en) Applet version deployment method and device, electronic equipment and storage medium
CN111831396A (en) Docker software and hardware integration-based delivery method and device
CN116860266A (en) Application containerized deployment method and device, electronic equipment and storage medium
EP3374858A1 (en) Creating and modifying applications from a mobile device
CN112154417B (en) Sharing code libraries between stand-alone and Web-based versions of an application via an emulated network communication channel
JP2007527562A (en) How to manage software components integrated into an embedded system
CN114691157A (en) Cloud-based FPGA management control system and method and electronic equipment
US20240078072A1 (en) Method and apparatus for displaying message box, terminal device and non-transitory computer-readable storage medium
CN111367561B (en) Remote development method and device for software program
CN112363771B (en) Application processing method and related product
CN106775608B (en) Method and device for realizing independent system process
CN116382718A (en) Code offline deployment method and device, computer equipment and storage medium
CN107092472A (en) A kind of dynamic publishing method and equipment
CN110727423A (en) Method and system for developing mobile application program across platforms
CN110046504B (en) SO file hiding method, storage medium and device based on Linker
JP2016515243A (en) Method for automatic conversion of package for taizen installation of android application and computer-readable recording medium therefor
CN113515299A (en) Software development kit SDK hot upgrading method, device, equipment and storage medium
CN112564979A (en) Execution method and device for construction task, computer equipment and storage medium
CN114327742A (en) Cloud platform and program code processing method based on cloud platform

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