CN117076159A - Plug-in calling method and device, electronic equipment and computer readable storage medium - Google Patents

Plug-in calling method and device, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN117076159A
CN117076159A CN202311308230.XA CN202311308230A CN117076159A CN 117076159 A CN117076159 A CN 117076159A CN 202311308230 A CN202311308230 A CN 202311308230A CN 117076159 A CN117076159 A CN 117076159A
Authority
CN
China
Prior art keywords
plug
instance
target
information
call
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.)
Granted
Application number
CN202311308230.XA
Other languages
Chinese (zh)
Other versions
CN117076159B (en
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.)
Uniontech Software Technology Co Ltd
Original Assignee
Uniontech Software Technology 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 Uniontech Software Technology Co Ltd filed Critical Uniontech Software Technology Co Ltd
Priority to CN202311308230.XA priority Critical patent/CN117076159B/en
Publication of CN117076159A publication Critical patent/CN117076159A/en
Application granted granted Critical
Publication of CN117076159B publication Critical patent/CN117076159B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/541Client-server

Abstract

The disclosure relates to a plug-in calling method and device, an electronic device and a computer readable storage medium, wherein the plug-in calling method comprises the following steps: receiving a plug-in call request through a plug-in management process, wherein the plug-in call request is used for calling a target plug-in instance and is sent by a front end based on a network transmission protocol; converting the plug-in call request into an inter-process call instruction; transmitting an inter-process call instruction to the plug-in process based on an inter-process communication protocol; returning an execution result to the plug-in management process based on the inter-process communication protocol, wherein the execution result is obtained by executing a target plug-in instance by the plug-in process; and returning the execution result to the front end based on the network transmission protocol through the plug-in management process.

Description

Plug-in calling method and device, electronic equipment and computer readable storage medium
Technical Field
The disclosure relates to the field of computers, and in particular relates to a plug-in calling method and device, electronic equipment and a computer readable storage medium.
Background
Plug-in (also called add in, add-on or add-on, and translate Plug-in) is a program written by an application program interface conforming to a certain specification, and can implement a specific function, so that the function of existing software (such as a browser) is expanded.
The plug-in can only run under a system platform specified by a program (possibly supporting multiple system platforms at the same time, and a typical system platform includes a hardware architecture of a computer, an operating system, a runtime library, etc.), and cannot run separately from a specified system platform. Thus, to facilitate the use of plug-ins in different system platforms, and in particular different operating systems, specialized plug-in management platforms exist in the related art.
However, when calling a plug-in, the existing plug-in management platform (as shown in fig. 1) adopts a plug-in management process running on a service end of the plug-in management platform to implement a Dbus (message bus system) client and implement a Dbus service on a plug-in process end. The plug-in process registers all the plug-in functions to the Dbus, and the plug-in management process remotely calls the functions of the plug-in process through the Dbus. However, the solution adopts Dbus communication, and if the Dbus communication is transplanted to a system platform (such as windows platform) which does not support Dbus, the Dbus communication cannot be used normally, so that the compatibility of different system platforms is limited.
Disclosure of Invention
The disclosure provides a plug-in calling method and device, electronic equipment and a computer readable storage medium, so as to at least solve the problem that a related art plug-in management platform has limitation on compatibility of different system platforms when calling plug-ins.
According to a first aspect of an embodiment of the present disclosure, there is provided a plug-in calling method, including: receiving a plug-in call request through a plug-in management process, wherein the plug-in call request is used for calling a target plug-in instance and is sent by a front end based on a network transmission protocol; converting the plug-in call request into an inter-process call instruction; transmitting the inter-process call instruction to a plug-in process based on an inter-process communication protocol; returning an execution result to the plug-in management process based on an inter-process communication protocol, wherein the execution result is obtained by executing the target plug-in instance by the plug-in process; and returning the execution result to the front end based on a network transmission protocol through the plug-in management process.
Optionally, the converting the plug-in call request into an inter-process call instruction includes: determining the target plug-in instance from the plug-in registration information according to the plug-in call request; an inter-process call instruction is generated for invoking the target plug-in instance.
Optionally, the determining the target plug-in instance from the plug-in registration information according to the plug-in call request includes: checking plug-in information in the plug-in call request; and under the condition that the plug-in information passes the verification, determining the target plug-in instance from the plug-in registration information according to the plug-in call request.
Optionally, the plug-in management process is configured with a remote procedure call client, the plug-in process is configured with a remote procedure call server, and the plug-in call method further includes: and establishing a bidirectional flow between the remote procedure call client and the remote procedure call server for the plug-in management process to communicate with the plug-in process.
Optionally, the plug-in call request is sent by the front end based on a bidirectional long connection network transport protocol.
Optionally, the plug-in calling method further includes: receiving a plug-in instance creation request through the plug-in management process, wherein the plug-in instance creation request is used for creating the target plug-in instance and is sent by the front end based on a network transmission protocol; starting the plug-in process based on the plug-in instance creation request; creating the target plug-in instance through the plug-in process to obtain target plug-in instance information; returning the target plug-in instance information to the plug-in management process based on an inter-process communication protocol; adding the target plug-in instance information into plug-in registration information, and generating creation success information of the target plug-in instance; and returning the creation success information to the front end based on a network transmission protocol.
Optionally, the plug-in calling method further includes: starting a remote procedure call server through the plug-in process, wherein the remote procedure call server is used for creating the target plug-in instance and obtaining the target plug-in instance information, and the remote procedure call server is also used for generating handshake information; the process-to-process communication protocol-based return of the target plug-in instance information to the plug-in management process comprises the following steps: returning the handshake information to the plug-in management process; starting a remote procedure call client in response to the handshake information through the plug-in management process, and establishing and maintaining inter-process communication connection between the remote procedure call client and the remote procedure call server; and receiving the target plug-in instance information sent by the remote procedure call server through the remote procedure call client.
According to a second aspect of the embodiments of the present disclosure, there is provided a plug-in calling device, including: the network communication unit is configured to receive a plug-in call request through a plug-in management process, wherein the plug-in call request is used for calling a target plug-in instance and is sent by a front end based on a network transmission protocol; a conversion unit configured to convert the plug-in call request into an inter-process call instruction; the process communication unit is configured to send the inter-process call instruction to a plug-in process based on an inter-process communication protocol; the process communication unit is further configured to return an execution result to the plug-in management process based on an inter-process communication protocol, wherein the execution result is obtained by the plug-in process executing the target plug-in instance; the network communication unit is further configured to return the execution result to the front end based on a network transmission protocol through the plug-in management process.
Optionally, the conversion unit is further configured to: determining the target plug-in instance from the plug-in registration information according to the plug-in call request; an inter-process call instruction is generated for invoking the target plug-in instance.
Optionally, the conversion unit is further configured to: checking plug-in information in the plug-in call request; and under the condition that the plug-in information passes the verification, determining the target plug-in instance from the plug-in registration information according to the plug-in call request.
Optionally, the plug-in management process is configured with a remote procedure call client, the plug-in process is configured with a remote procedure call server, and the process communication unit is further configured to establish a bidirectional flow between the remote procedure call client and the remote procedure call server for the plug-in management process and the plug-in process to communicate.
Optionally, the plug-in call request is sent by the front end based on a bidirectional long connection network transport protocol.
Optionally, the network communication unit is further configured to receive a plug-in instance creation request through the plug-in management process, where the plug-in instance creation request is used to create the target plug-in instance, and is sent by the front end based on a network transport protocol; the plug-in calling device further comprises a process starting unit, a plug-in calling unit and a plug-in calling unit, wherein the process starting unit is configured to start the plug-in process based on the plug-in instance creation request; the plug-in calling device further comprises a creating unit, wherein the creating unit is configured to create the target plug-in instance through the plug-in process to obtain target plug-in instance information; the process communication unit is further configured to return the target plug-in instance information to the plug-in management process based on an inter-process communication protocol; the plug-in calling device further comprises a registration unit, a plug-in calling unit and a plug-in calling unit, wherein the registration unit is configured to add the target plug-in instance information into plug-in registration information and generate creation success information of the target plug-in instance; the network communication unit is further configured to return the creation success information to the front end based on a network transport protocol.
Optionally, the plug-in calling device further includes a call starting unit configured to start a remote procedure call server through the plug-in process, where the remote procedure call server is used to create the target plug-in instance and obtain the target plug-in instance information, and the remote procedure call server is further used to generate handshake information; the process communication unit is further configured to: returning the handshake information to the plug-in management process; starting a remote procedure call client in response to the handshake information through the plug-in management process, and establishing and maintaining inter-process communication connection between the remote procedure call client and the remote procedure call server; and receiving the target plug-in instance information sent by the remote procedure call server through the remote procedure call client.
According to a third aspect of embodiments of the present disclosure, there is provided an electronic device, comprising: at least one processor; at least one memory storing computer-executable instructions, wherein the computer-executable instructions, when executed by the at least one processor, cause the at least one processor to perform a plug-in invocation method according to an embodiment of the present disclosure.
According to a fourth aspect of embodiments of the present disclosure, there is provided a computer-readable storage medium, which when executed by at least one processor, causes the at least one processor to perform a plug-in invocation method as described above according to embodiments of the present disclosure.
According to a fifth aspect of embodiments of the present disclosure, there is provided a computer program product comprising computer instructions which, when executed by a processor, implement a plug-in invocation method according to embodiments of the present disclosure.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
according to the plug-in calling method and device, the electronic equipment and the computer readable storage medium, the network request which is sent by the front end and used for calling the target plug-in instance is converted into the inter-process calling instruction by adopting the inter-process communication mode, and then the inter-process calling instruction is utilized to directly call the function of the target plug-in instance in the plug-in process, so that the plug-in communication scheme which is universal among different system platforms is not limited by the system platform, and the compatibility of the plug-in management platform to the different system platforms when the plug-in is called is improved.
Meanwhile, the front end can realize communication with the plug-in process by means of information forwarding of the plug-in management process, so that the plug-in is directly called, and the plug-in is not required to be indirectly called by depending on the function of calling the plug-in process to register to the Dbus, and therefore the calling efficiency of the front end on the plug-in can be effectively improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure and do not constitute an undue limitation on the disclosure.
FIG. 1 is a schematic diagram of a related art plug-in management platform architecture;
FIG. 2 is a flowchart of a plug-in invocation method according to an exemplary embodiment of the present disclosure;
FIG. 3 is a schematic architecture diagram of a plug-in management platform according to one particular embodiment of the present disclosure;
FIG. 4 is a schematic diagram of a plug-in creation flow according to one particular embodiment of the present disclosure;
FIG. 5 is a diagram of a plug-in call flow diagram according to one particular embodiment of the present disclosure;
FIG. 6 is a block diagram of a plug-in invocation apparatus according to an exemplary embodiment of the present disclosure;
fig. 7 is a block diagram of an electronic device according to an exemplary embodiment of the present disclosure.
Detailed Description
In order to enable those skilled in the art to better understand the technical solutions of the present disclosure, the technical solutions of the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the foregoing figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the disclosure described herein may be capable of operation in sequences other than those illustrated or described herein. The embodiments described in the examples below are not representative of all embodiments consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as detailed in the accompanying claims.
It should be noted that, in this disclosure, "at least one of the items" refers to a case where three types of juxtaposition including "any one of the items", "a combination of any of the items", "an entirety of the items" are included. For example, "including at least one of a and B" includes three cases side by side as follows: (1) comprises A; (2) comprising B; (3) includes A and B. For example, "at least one of the first and second steps is executed", that is, three cases are juxtaposed as follows: (1) performing step one; (2) executing the second step; (3) executing the first step and the second step.
A card calling method and apparatus, an electronic device, and a computer-readable storage medium according to exemplary embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.
Fig. 2 is a flowchart of a plug-in invocation method according to an exemplary embodiment of the present disclosure. The plug-in calling method is applied to a server side of the plug-in management platform, the plug-in management process and the plug-in process can be simultaneously operated on the server side of the plug-in management platform, and the server side can be installed on a terminal taking a server as an example. The front end of the calling plug-in can send information with the service end of the plug-in management platform so as to realize the calling of the plug-in. The front end may be installed on a terminal used by a user, or may be installed on the same terminal (e.g., the aforementioned server) as the service end of the plug-in management platform.
Referring to fig. 1, in step 201, a plug-in call request is received by a plug-in management process, where the plug-in call request is used to call a target plug-in instance, and is sent by a front end based on a network transport protocol. In other words, the plug-in invocation request belongs to a network request, which may be transmitted via a network based on a network transmission protocol. It should be understood that a plug-in is a program capable of implementing a specific function, and a plug-in correspondingly implements a function, often includes corresponding input parameters and output parameters, and in the program, these parameters appear in the form of variable names, and when the front end needs to implement the corresponding function, it is a specific implementation, and a specific value needs to be assigned to a corresponding input parameter variable so as to obtain a corresponding output value, where a plug-in with a specific input value is called a plug-in instance. It should be understood that multiple plug-in instances may be configured in the plug-in management process for the front-end to invoke, accordingly, the target plug-in instance is one of the multiple plug-in instances, and refers to the one that the front-end is currently invoking, and does not refer specifically to a particular one of the multiple plug-in instances.
Optionally, the plug-in invocation request is sent by the front-end based on a bi-directional long connection network transport protocol. The bidirectional long-connection network transmission protocol (such as WebSocket) can perform full duplex communication on a single TCP (Transmission Control Protocol ) connection, and the front end and the service end only need to complete one handshake, so that a persistent connection can be directly created between the front end and the service end, and bidirectional data transmission can be performed. The network communication is realized by adopting a bidirectional long-connection network transmission protocol between the plug-in management process and the front end, so that the data exchange between the front end and the plug-in management process can be simplified, and the communication efficiency can be improved.
In step 202, the plug-in call request is converted into an inter-process call instruction. The inter-process call instruction is used for realizing information transmission between different processes on the same terminal, and is equivalent to converting a request transmitted through a network into an instruction which can be transmitted between different processes of the same terminal, and a process running at the front end can also be called a host process, so that the conversion can realize information transmission between three different processes.
Optionally, step 202 includes: determining a target plug-in instance from the plug-in registration information according to the plug-in call request; an inter-process call instruction is generated for invoking the target plug-in instance. The plug-in call request sent by the front end can be converted into the inter-process call request by combining the plug-in registration information and the plug-in call request to solve and separate out the target plug-in instance currently called by the front end and then generating the inter-process call instruction according to the inter-process communication rule, so that the reliable conversion of different forms of information can be realized.
Further optionally, the step of determining the target plug-in instance from the plug-in registration information according to the plug-in call request in step 202 includes: checking plug-in information in a plug-in call request; and under the condition that the plug-in information passes the verification, determining a target plug-in instance from the plug-in registration information according to the plug-in calling request. The plug-in information in the plug-in call request is initially checked to determine whether the plug-in information is reliable or not, and further the target plug-in instance is determined based on the reliable plug-in information, so that the smooth confirmation of the target plug-in instance is guaranteed, the plug-in information can be interrupted in advance when the plug-in information is wrong, the target plug-in instance is not required to be determined from the plug-in registration information, and the error is reported when the determination cannot be realized, so that waiting time is shortened, time is saved, unnecessary calculation power consumption is reduced, and operation efficiency is improved. As an example, when checking the plug-in information, the plug-in reservation information, for example, the signature information of the plug-in, included in the plug-in call request may be specifically checked to confirm whether the reservation information is legal, and if the reservation information is legal, the plug-in information passes the check, otherwise, the plug-in information does not pass the check.
In step 203, an inter-process call instruction is sent to the plug-in process based on the inter-process communication protocol. The step adopts an inter-process communication protocol to transmit an inter-process call instruction to the plug-in process, which is equivalent to sending a plug-in call request of the front end to the plug-in process in a form and a way which can be received by the plug-in process, so that the front end can directly call the plug-in without being limited by a system platform.
Optionally, the plug-in management process is configured with a remote procedure call client, and the plug-in process is configured with a remote procedure call server, and accordingly, the plug-in call method of the exemplary embodiment of the present disclosure further includes: and establishing a bidirectional flow between the remote procedure call client and the remote procedure call server for the plug-in management process to communicate with the plug-in process. By establishing the bidirectional flow between the remote procedure call client of the plug-in management process and the remote procedure call server of the plug-in process, stable and reliable connection based on an inter-process communication protocol can be established between the plug-in management process and the plug-in process, and mutual information transmission between the two parties is realized, so that a reliable basis is provided for frequent information mutual transmission possibly existing in the plug-in call process.
In step 204, the execution result is returned to the plugin management process based on the inter-process communication protocol, and the execution result is obtained by the plugin process executing the target plugin instance. This step is the feedback of the results after the plug-in process executes the target plug-in instance, still implemented based on the interprocess communication protocol, e.g., can continue to be implemented based on the bi-directional flow described above.
In step 205, the execution result is returned to the front end based on the network transmission protocol by the plug-in management process. And the network transmission protocol is used for communicating with the front end again, so that an execution result of the target plug-in instance can be returned to the front end, and finally, the call of the front end to the target plug-in instance is completely realized. As an example, the plug-in program may write, so that after the call is completed, the plug-in process ends itself to release the corresponding memory resource.
According to the plug-in calling method of the exemplary embodiment of the disclosure, by adopting an inter-process communication mode, a network request sent by a front end and used for calling a target plug-in instance is converted into an inter-process calling instruction, and then the inter-process calling instruction is utilized to directly call a function of the target plug-in instance in a plug-in process, so that the plug-in communication scheme which is universal among different system platforms is provided without being limited by the system platform, and the compatibility of the plug-in management platform to the different system platforms when the plug-in is called is improved.
Meanwhile, the front end can realize communication with the plug-in process by means of information forwarding of the plug-in management process, so that the plug-in is directly called, and the plug-in is not required to be indirectly called by depending on the function of calling the plug-in process to register to the Dbus, and therefore the calling efficiency of the front end on the plug-in can be effectively improved.
In addition, before the target plug-in instance is called, the target plug-in instance can be created, so that the plug-in registration information contains the information of the target plug-in instance. It should be understood that, as in the foregoing explanation of the target plug-in instance in the call flow, the target plug-in instance created herein does not refer specifically to a specific one of the plug-in instances, but rather refers to one plug-in instance that is currently being created by the front end.
Next, the creation flow of the target plug-in instance will be described.
In some embodiments, optionally, the plug-in invocation method according to an exemplary embodiment of the present disclosure further comprises: receiving a plug-in instance creation request through a plug-in management process, wherein the plug-in instance creation request is used for creating a target plug-in instance and is sent by a front end based on a network transmission protocol; starting a plug-in process based on a plug-in instance creation request; creating a target plug-in instance through a plug-in process to obtain target plug-in instance information; returning the target plug-in instance information to a plug-in management process based on an inter-process communication protocol; adding the target plug-in instance information into plug-in registration information, and generating creation success information of the target plug-in instance; and returning the creation success information to the front end based on the network transmission protocol. By starting the corresponding plug-in process when the plug-in instance creation request sent by the front end is received, the plug-in process can create the target plug-in instance, the corresponding plug-in process can be started as required, each plug-in process does not need to be continuously started, and the system overhead is saved. After the plug-in management process is successfully established, the plug-in management process sequentially executes the steps of receiving the target plug-in instance information established by the plug-in process based on the inter-process communication protocol, registering the target plug-in instance, feeding back the establishment success information to the front end based on the network transmission protocol, and can ensure the reliable establishment of the target plug-in instance with a perfect flow, so that the front end establishes and invokes the plug-in instance according to the self requirement, and the control of the front end on the life cycle of the plug-in process is improved. It should be understood that, because each plug-in instance is created by starting a corresponding plug-in process, even for the same plug-in, plug-in processes running corresponding to different plug-in instances are independent of each other (except for the plug-in instance with a data dependency relationship on input and output, of course), and these plug-in processes can all communicate with the plug-in management process, so that reliable implementation of each plug-in instance is ensured. As an example, similar to the flow of invoking the target plug-in instance, the plug-in management process may also verify plug-in information in the plug-in instance creation request before starting the plug-in process.
Further alternatively, the plug-in calling method according to an exemplary embodiment of the present disclosure further includes: starting a remote procedure call server through a plug-in process, wherein the remote procedure call server is used for creating a target plug-in instance and obtaining target plug-in instance information, and is also used for generating handshake information; accordingly, the step of returning the target plug-in instance information to the plug-in management process based on the inter-process communication protocol includes: returning the handshake information to the plug-in management process; starting a remote procedure call client through the plug-in management process in response to the handshake information, and establishing and maintaining inter-process communication connection between the remote procedure call client and a remote procedure call server; and receiving target plug-in instance information sent by the remote procedure call server through the remote procedure call client. By means of handshake and connection between the remote procedure call client of the plug-in management process and the remote procedure call server of the plug-in process, reliable connection based on an inter-process communication protocol can be established between the plug-in management process and the plug-in process, and therefore a reliable basis is provided for information transmission. By way of example, only the created target plug-in example information needs to be returned from the plug-in process to the plug-in management process, so that only one-way information transmission is needed, that is, the two-way flow of the calling stage is not needed to be established, and the system overhead is reduced. At this time, in order to maintain the unidirectional connection, for example, a heartbeat protocol may be used, and the present disclosure is not limited to a specific form of how to maintain the connection.
The flow of creating and invoking a target plug-in instance by the plug-in management platform of one particular embodiment is described next in connection with fig. 3-5.
The overall design of this embodiment consists of a plug-in management process side and a plug-in process side, and the architecture diagram thereof is referred to in fig. 3.
The technical stack such as WebSocket, gRPC (Google Remote Procedure Call ) file programming and the like is used in the scheme, modules such as ws instruction (called WebSocket instruction) instance management, plugin management, gRPC management, a client and instruction conversion and the like are realized on the plugin process side, and modules such as plugin instance creation, function registration, plugin information registration, gRPC communication and function call are provided on the plugin process side, and can be respectively divided into plugin management SDK (Software Development Kit ), plugin information management and communication SDK according to different functions by bidirectional flow based on gRPC, UDS (Unix domain socket ) protocols.
In one aspect, the creation flow of the target plugin instance is shown in fig. 4, and the flow includes the following steps:
the front end creates a target plug-in instance, and in particular sends a plug-in instance creation request to connect the plug-in management process through ws.
The plug-in management module of the plug-in management process verifies the plug-in information in the plug-in instance creation request.
The plug-in management module uses a fork function or a reattach function to pull up the plug-in binary file and starts the plug-in process.
And the plug-in process executes initialization work, starts gRPC service to create a target plug-in instance, and generates handshake information.
The plug-in process standard outputs handshake information to the plug-in management process.
And the plug-in management process responds to the handshake information to start the gRPC client, is connected with gRPC service of the plug-in process, and establishes heartbeat.
And the plug-in management process receives the target plug-in instance information created and returned by the plug-in process and registers the target plug-in instance information into plug-in registration information in the plug-in management module.
The plug-in management process responds to the front end to prompt that the target instance is successfully created.
On the other hand, as shown in fig. 5, the call flow of the target plug-in instance includes the following steps:
the front end calls the target plug-in instance, calls the function interface, and particularly sends a plug-in call request to the plug-in management process so as to connect the plug-in management process through ws.
The plug-in management module of the plug-in management process verifies the plug-in information in the plug-in call request.
The plug-in management module loads the target plug-in instance under the condition that the verification is passed.
The plug-in management process converts the ws instruction into a gRPC instruction.
The gRPC client of the plug-in management process establishes a bidirectional flow with the gRPC service of the plug-in process.
The plug-in process waits for the instruction of the plug-in management process to be sent.
And the plug-in process executes the gRPC instruction sent by the plug-in management process, calls the function of the corresponding plug-in, obtains an execution result and responds to the gRPC client.
And the plug-in management process returns an execution result of the target plug-in instance in response to the front end.
Fig. 6 is a block diagram of a plug-in invocation apparatus according to an exemplary embodiment of the present disclosure. Referring to fig. 6, the apparatus includes a network communication unit 601, a conversion unit 602, and a process communication unit 603.
The network communication unit 601 may receive a plug-in call request through a plug-in management process, where the plug-in call request is used to call a target plug-in instance, and the plug-in call request is sent by a front end based on a network transport protocol.
Optionally, the plug-in invocation request is sent by the front-end based on a bi-directional long connection network transport protocol.
The translation unit 602 may translate the plug-in call request into an inter-process call instruction.
Optionally, the conversion unit 602 may further: determining a target plug-in instance from the plug-in registration information according to the plug-in call request; an inter-process call instruction is generated for invoking the target plug-in instance.
Optionally, the conversion unit 602 may further: checking plug-in information in a plug-in call request; and under the condition that the plug-in information passes the verification, determining a target plug-in instance from the plug-in registration information according to the plug-in calling request.
The process communication unit 603 may send an inter-process call instruction to the plug-in process based on the inter-process communication protocol.
Optionally, the plugin management process is configured with a remote procedure call client, the plugin process is configured with a remote procedure call server, and the process communication unit 603 may further establish a bidirectional flow between the remote procedure call client and the remote procedure call server, so that the plugin management process and the plugin process can communicate.
The process communication unit 603 may also return an execution result to the plug-in management process based on the inter-process communication protocol, where the execution result is obtained by the plug-in process executing the target plug-in instance.
The network communication unit 601 may also return the execution result to the front end based on the network transmission protocol through the plug-in management process.
Optionally, the network communication unit 601 may further receive a plug-in instance creation request through a plug-in management process, where the plug-in instance creation request is used to create a target plug-in instance, and is sent by the front end based on a network transport protocol; the plug-in calling device further comprises a process starting unit (not shown in the figure) for starting the plug-in process based on the plug-in instance creation request; the plug-in calling device also comprises a creating unit (not shown in the figure) which can create a target plug-in instance through a plug-in process to obtain target plug-in instance information; the process communication unit 603 may also return the target plug-in instance information to the plug-in management process based on the inter-process communication protocol; the plug-in calling device further comprises a registration unit (not shown in the figure) which can add the target plug-in instance information to the plug-in registration information and generate the creation success information of the target plug-in instance; the network communication unit 601 may also return creation success information to the front end based on the network transport protocol.
Optionally, the plug-in calling device further includes a call starting unit (not shown in the figure), and the remote procedure call server can be started through the plug-in process, and is used for creating a target plug-in instance and obtaining target plug-in instance information, and is further used for generating handshake information; the process communication unit 603 may further: returning the handshake information to the plug-in management process; starting a remote procedure call client through the plug-in management process in response to the handshake information, and establishing and maintaining inter-process communication connection between the remote procedure call client and a remote procedure call server; and receiving target plug-in instance information sent by the remote procedure call server through the remote procedure call client.
The specific manner in which the individual units perform the operations in relation to the apparatus of the above embodiments has been described in detail in relation to the embodiments of the method and will not be described in detail here.
According to embodiments of the present disclosure, an electronic device may be provided. Fig. 7 is a block diagram of an electronic device according to an exemplary embodiment of the present disclosure, the electronic device 700 including at least one memory 701 having stored therein a set of computer-executable instructions 7011 and an operating system 7012, which when executed by the at least one processor, performs a plug-in invocation method according to an embodiment of the present disclosure.
By way of example, the electronic device 700 may be a PC computer, tablet device, personal digital assistant, smart phone, or other device capable of executing the above-described set of instructions. Here, the electronic device 700 is not necessarily a single electronic device, but may be any apparatus or a collection of circuits capable of executing the above-described instructions (or instruction set) individually or in combination. The electronic device 700 may also be part of an integrated control system or system manager, or may be configured as a portable electronic device that interfaces with either locally or remotely (e.g., via wireless transmission).
In electronic device 700, processor 702 may include a Central Processing Unit (CPU), a Graphics Processor (GPU), a programmable logic device, a special purpose processor system, a microcontroller, or a microprocessor. By way of example, and not limitation, the processor 702 may also include an analog processor, a digital processor, a microprocessor, a multi-core processor, a processor array, a network processor, and the like.
The processor 702 may execute instructions or code stored in the memory, wherein the memory 701 may also store data. The instructions and data may also be transmitted and received over a network via a network interface device, which may employ any known transmission protocol.
The memory 701 may be integrated with the processor 702, for example, RAM or flash memory disposed within an integrated circuit microprocessor or the like. In addition, the memory 701 may include a separate device, such as an external disk drive, a storage array, or any other storage device usable by a database system. The memory 701 and the processor 702 may be operatively coupled or may communicate with each other, for example, through an I/O port, a network connection, etc., such that the processor 702 is able to read files stored in the memory 701.
In addition, the electronic device 700 may also include a video display (such as a liquid crystal display) and a user interaction interface (such as a keyboard, mouse, touch input device, etc.). All components of the electronic device may be connected to each other via a bus and/or a network.
According to an embodiment of the present disclosure, there may also be provided a computer-readable storage medium, wherein instructions in the computer-readable storage medium, when executed by at least one processor, cause the at least one processor to perform a plug-in invocation method of an embodiment of the present disclosure. Examples of the computer readable storage medium herein include: read-only memory (ROM), random-access programmable read-only memory (PROM), electrically erasable programmable read-only memory (EEPROM), random-access memory (RAM), dynamic random-access memory (DRAM), static random-access memory (SRAM), flash memory, nonvolatile memory, CD-ROM, CD-R, CD + R, CD-RW, CD+RW, DVD-ROM, DVD-R, DVD + R, DVD-RW, DVD+RW, DVD-RAM, BD-ROM, BD-R, BD-R LTH, BD-RE, blu-ray or optical disk storage, hard Disk Drives (HDD), solid State Disks (SSD), card memory (such as multimedia cards, secure Digital (SD) cards or ultra-fast digital (XD) cards), magnetic tape, floppy disks, magneto-optical data storage, hard disks, solid state disks, and any other means configured to store computer programs and any associated data, data files and data structures in a non-transitory manner and to provide the computer programs and any associated data, data files and data structures to a processor or computer to enable the processor or computer to execute the programs. The computer programs in the computer readable storage media described above can be run in an environment deployed in a computer device, such as a client, host, proxy device, server, etc., and further, in one example, the computer programs and any associated data, data files, and data structures are distributed across networked computer systems such that the computer programs and any associated data, data files, and data structures are stored, accessed, and executed in a distributed fashion by one or more processors or computers.
According to an embodiment of the present disclosure, there is provided a computer program product comprising computer instructions which, when executed by a processor, implement a plug-in calling method of an embodiment of the present disclosure.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any adaptations, uses, or adaptations of the disclosure following the general principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It is to be understood that the present disclosure is not limited to the precise arrangements and instrumentalities shown in the drawings, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (10)

1. A plug-in calling method, comprising:
receiving a plug-in call request through a plug-in management process, wherein the plug-in call request is used for calling a target plug-in instance and is sent by a front end based on a network transmission protocol;
converting the plug-in call request into an inter-process call instruction;
transmitting the inter-process call instruction to a plug-in process based on an inter-process communication protocol;
returning an execution result to the plug-in management process based on an inter-process communication protocol, wherein the execution result is obtained by executing the target plug-in instance by the plug-in process;
and returning the execution result to the front end based on a network transmission protocol through the plug-in management process.
2. The plug-in call method of claim 1, wherein the converting the plug-in call request into an inter-process call instruction comprises:
determining the target plug-in instance from the plug-in registration information according to the plug-in call request;
an inter-process call instruction is generated for invoking the target plug-in instance.
3. The plug-in calling method of claim 2, wherein the determining the target plug-in instance from the plug-in registration information according to the plug-in calling request includes:
checking plug-in information in the plug-in call request;
and under the condition that the plug-in information passes the verification, determining the target plug-in instance from the plug-in registration information according to the plug-in call request.
4. The plug-in invocation method of claim 1, wherein the plug-in management process is configured with a remote procedure invocation client, the plug-in process is configured with a remote procedure invocation server, the plug-in invocation method further comprising:
and establishing a bidirectional flow between the remote procedure call client and the remote procedure call server for the plug-in management process to communicate with the plug-in process.
5. The plug-in calling method of claim 1,
the plug-in call request is sent by the front end based on a bidirectional long connection network transmission protocol.
6. The plug-in invocation method of any one of claims 1 to 5, wherein the plug-in invocation method further comprises:
receiving a plug-in instance creation request through the plug-in management process, wherein the plug-in instance creation request is used for creating the target plug-in instance and is sent by the front end based on a network transmission protocol;
starting the plug-in process based on the plug-in instance creation request;
creating the target plug-in instance through the plug-in process to obtain target plug-in instance information;
returning the target plug-in instance information to the plug-in management process based on an inter-process communication protocol;
adding the target plug-in instance information into plug-in registration information, and generating creation success information of the target plug-in instance;
and returning the creation success information to the front end based on a network transmission protocol.
7. The plug-in invocation method of claim 6, wherein the plug-in invocation method further comprises:
starting a remote procedure call server through the plug-in process, wherein the remote procedure call server is used for creating the target plug-in instance and obtaining the target plug-in instance information, and the remote procedure call server is also used for generating handshake information;
the process-to-process communication protocol-based return of the target plug-in instance information to the plug-in management process comprises the following steps:
returning the handshake information to the plug-in management process;
starting a remote procedure call client in response to the handshake information through the plug-in management process, and establishing and maintaining inter-process communication connection between the remote procedure call client and the remote procedure call server;
and receiving the target plug-in instance information sent by the remote procedure call server through the remote procedure call client.
8. A plug-in calling device, comprising:
the network communication unit is configured to receive a plug-in call request through a plug-in management process, wherein the plug-in call request is used for calling a target plug-in instance and is sent by a front end based on a network transmission protocol;
a conversion unit configured to convert the plug-in call request into an inter-process call instruction;
the process communication unit is configured to send the inter-process call instruction to a plug-in process based on an inter-process communication protocol;
the process communication unit is further configured to return an execution result to the plug-in management process based on an inter-process communication protocol, wherein the execution result is obtained by the plug-in process executing the target plug-in instance;
the network communication unit is further configured to return the execution result to the front end based on a network transmission protocol through the plug-in management process.
9. An electronic device, comprising:
at least one processor;
at least one memory storing computer-executable instructions,
wherein the computer executable instructions, when executed by the at least one processor, cause the at least one processor to perform the plug-in invocation method of any of claims 1 to 7.
10. A computer-readable storage medium, wherein instructions in the computer-readable storage medium, when executed by at least one processor, cause the at least one processor to perform the plug-in invocation method of any of claims 1 to 7.
CN202311308230.XA 2023-10-10 2023-10-10 Plug-in calling method and device, electronic equipment and computer readable storage medium Active CN117076159B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311308230.XA CN117076159B (en) 2023-10-10 2023-10-10 Plug-in calling method and device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311308230.XA CN117076159B (en) 2023-10-10 2023-10-10 Plug-in calling method and device, electronic equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN117076159A true CN117076159A (en) 2023-11-17
CN117076159B CN117076159B (en) 2024-01-05

Family

ID=88708326

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311308230.XA Active CN117076159B (en) 2023-10-10 2023-10-10 Plug-in calling method and device, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN117076159B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107402782A (en) * 2017-06-30 2017-11-28 武汉斗鱼网络科技有限公司 A kind of method and device for being used to load plug-in unit in live software
CN107678801A (en) * 2017-10-09 2018-02-09 武汉斗鱼网络科技有限公司 A kind of method and apparatus of plug-in unit loading
CN110708366A (en) * 2019-09-24 2020-01-17 深圳市迅雷网络技术有限公司 Plug-in process management method, related method and related device
CN111158779A (en) * 2019-12-24 2020-05-15 深圳云天励飞技术有限公司 Data processing method and related equipment
CN113419783A (en) * 2021-04-27 2021-09-21 中国电子科技集团公司第十四研究所 Cross-platform multi-process plug-in management and process calling method
CN114168937A (en) * 2022-02-10 2022-03-11 广东统信软件有限公司 Resource access method, computing device and readable storage medium
CN114328197A (en) * 2021-12-17 2022-04-12 中国银联股份有限公司 Applet plug-in debugging method, system and computer readable storage medium
CN114816707A (en) * 2021-12-24 2022-07-29 统信软件技术有限公司 Method and device for creating sandbox environment for plug-in operation and computing equipment
CN115514667A (en) * 2022-09-14 2022-12-23 京东方科技集团股份有限公司 Access service processing method, system, device, electronic equipment and storage medium
US20230068519A1 (en) * 2021-08-30 2023-03-02 Kyocera Document Solutions, Inc. Extensible format-independent middleware message interpreter

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107402782A (en) * 2017-06-30 2017-11-28 武汉斗鱼网络科技有限公司 A kind of method and device for being used to load plug-in unit in live software
CN107678801A (en) * 2017-10-09 2018-02-09 武汉斗鱼网络科技有限公司 A kind of method and apparatus of plug-in unit loading
CN110708366A (en) * 2019-09-24 2020-01-17 深圳市迅雷网络技术有限公司 Plug-in process management method, related method and related device
CN111158779A (en) * 2019-12-24 2020-05-15 深圳云天励飞技术有限公司 Data processing method and related equipment
CN113419783A (en) * 2021-04-27 2021-09-21 中国电子科技集团公司第十四研究所 Cross-platform multi-process plug-in management and process calling method
US20230068519A1 (en) * 2021-08-30 2023-03-02 Kyocera Document Solutions, Inc. Extensible format-independent middleware message interpreter
CN114328197A (en) * 2021-12-17 2022-04-12 中国银联股份有限公司 Applet plug-in debugging method, system and computer readable storage medium
CN114816707A (en) * 2021-12-24 2022-07-29 统信软件技术有限公司 Method and device for creating sandbox environment for plug-in operation and computing equipment
CN114168937A (en) * 2022-02-10 2022-03-11 广东统信软件有限公司 Resource access method, computing device and readable storage medium
CN115514667A (en) * 2022-09-14 2022-12-23 京东方科技集团股份有限公司 Access service processing method, system, device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN117076159B (en) 2024-01-05

Similar Documents

Publication Publication Date Title
US9690637B2 (en) Web services message processing runtime framework
US8146096B2 (en) Method and system for implementing built-in web services endpoints
EP1768348B1 (en) Web services message processing runtime framework
US8024425B2 (en) Web services deployment
US7519950B2 (en) Method and system for version negotiation of distributed objects
CN107241315B (en) Access method and device of bank gateway interface and computer readable storage medium
US8549474B2 (en) Method and system for implementing WS-policy
US10353750B2 (en) Discovery and exposure of transactional middleware server-based applications as consumable service endpoints
US8914482B2 (en) Translation of technology-agnostic management commands into multiple management protocols
US20160150015A1 (en) Methods for integrating applications with a data storage network and devices thereof
US6973657B1 (en) Method for middle-tier optimization in CORBA OTS
CN112416453A (en) Method for integrating domestic external equipment unified data under trusted environment and storage equipment
US8738755B2 (en) Providing external access to service versions via a bundle framework
CN117076159B (en) Plug-in calling method and device, electronic equipment and computer readable storage medium
US7606921B2 (en) Protocol lifecycle
US8280950B2 (en) Automatic client-server code generator
US10831590B2 (en) Error handling
US8156509B2 (en) Exchanging data using data transformation
US20100030599A1 (en) Method and apparatus for integrating health care payers and provider systems with health care transaction systems using a single hipaa edi response generation component
US20060195834A1 (en) Method and system for availability checking on distributed objects
CN115185599A (en) Project deployment method, system and storage medium based on Golang
WO2021057351A1 (en) Apparatus and method for controlling android bluetooth in glibc environment, and terminal device
CN114024822A (en) Block chain-based Internet of things equipment management method, equipment, server and medium
CN113791819A (en) Interface document generation method and device, storage medium and electronic equipment
JP2012128581A (en) Communication code generation apparatus, function utilization computer, function disclosure computer, computer system, communication code generation method and program

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
GR01 Patent grant
GR01 Patent grant