CN107315628B - Plug-in calling method and device, computer readable storage medium and terminal - Google Patents
Plug-in calling method and device, computer readable storage medium and terminal Download PDFInfo
- Publication number
- CN107315628B CN107315628B CN201710441643.3A CN201710441643A CN107315628B CN 107315628 B CN107315628 B CN 107315628B CN 201710441643 A CN201710441643 A CN 201710441643A CN 107315628 B CN107315628 B CN 107315628B
- Authority
- CN
- China
- Prior art keywords
- plug
- script
- script engine
- calling
- layer
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 31
- 230000006870 function Effects 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 238000010586 diagram Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000004886 process control Methods 0.000 description 1
- 230000000717 retained effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/54—Interprogram communication
- G06F9/545—Interprogram communication where tasks reside in different layers, e.g. user- and kernel-space
Abstract
A plug-in calling method and device, a computer readable storage medium and a terminal are provided, and the method comprises the following steps: the corresponding script engine calls the plug-in through a corresponding plug-in proxy in a preset plug-in proxy layer; and when the script engine is released, releasing the corresponding plug-in agent in the plug-in agent layer and reserving the plug-in. The above scheme can improve the reliability of plug-in calling under the multi-script engine environment.
Description
Technical Field
The present invention relates to the field of plug-in technologies, and in particular, to a plug-in calling method and apparatus, a computer-readable storage medium, and a terminal.
Background
Plug-in is a program written in an application program interface that complies with a certain specification. The plug-in can only run under the system platform specified by the program (possibly supporting multiple platforms simultaneously), and cannot run independently from the specified platform. Since the plug-in needs to call the function library or data provided by the original clean system.
The script engine, which is an interpreter of a computer programming language, can also implement extensions of functionality by calling plug-ins. Wherein, in a multi-script engine environment, multiple script engines can use the same plug-in.
However, the plug-in calling method in the conventional multi-script engine environment has the problem of poor reliability.
Disclosure of Invention
The technical problem solved by the embodiment of the invention is how to improve the reliability of plug-in calling under the multi-script engine environment.
In order to solve the above problem, an embodiment of the present invention provides a plug-in calling method, which is used for a plurality of script engines to call a same plug-in, and includes:
the corresponding script engine calls the plug-in through a corresponding plug-in proxy in a preset plug-in proxy layer;
and when the script engine is released, releasing the corresponding plug-in agent in the plug-in agent layer and reserving the plug-in.
Optionally, before the corresponding script engine calls the plug-in through the corresponding plug-in proxy in the preset plug-in proxy layer, the method further includes:
and respectively registering the plug-ins in a plurality of script engines through corresponding plug-in agents in a preset plug-in agent layer.
Optionally, the plug-in is a QT low level plug-in.
Optionally, the plug-in proxy layer is implemented using QT meta-objects.
The embodiment of the invention also provides a plug-in calling device, which is used for calling the same plug-in by a plurality of script engines, and the device comprises:
the calling unit is suitable for the corresponding script engine to call the plug-in through the corresponding plug-in proxy in the preset plug-in proxy layer;
and the release unit is suitable for releasing the corresponding plug-in agent in the plug-in agent layer and reserving the plug-in when the script engine is released.
Optionally, the apparatus further comprises:
and the registration unit is suitable for registering the plug-ins in the script engines respectively through corresponding plug-in agents in the preset plug-in agent layer before the corresponding script engines call the plug-ins through the corresponding plug-in agents in the preset plug-in agent layer.
Optionally, the plug-in is a QT low level plug-in.
Optionally, the plug-in proxy layer is implemented using QT meta-objects.
The embodiment of the present invention further provides a computer-readable storage medium, on which computer instructions are stored, where the computer instructions, when executed, perform the steps of any of the above plug-in calling methods.
The embodiment of the present invention further provides a terminal, which includes a memory and a processor, where the memory stores a computer instruction capable of running on the processor, and the processor executes the step of any one of the plug-in calling methods when running the computer instruction.
Compared with the prior art, the technical scheme of the invention has the following advantages:
according to the scheme, the plug-in agent layer is established between the plug-in and the script engine, different script engines can call the plug-in through different plug-in agents, only the corresponding plug-in agent in the plug-in agent layer is released when the script engine is released, the plug-in is reserved, other unreleased script engines can continue to call the plug-in, and therefore the plug-in calling reliability can be improved under the multi-script engine environment.
Drawings
FIG. 1 is a flow chart of a plug-in invocation method in an embodiment of the invention;
FIG. 2 is a flow chart illustrating another method for calling a plug-in according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a plug-in calling device in an embodiment of the present invention.
Detailed Description
In the prior art, in a multi-script engine environment, the same plug-in can be called by a plurality of script engines. Specifically, the plug-ins are registered in a plurality of script engines respectively; when the registration is successful, the script engines can generate corresponding calling requests and send the calling requests to the plug-in unit when needed; and when receiving the calling request, the plug-in responds to the calling request and sends a corresponding processing result to a corresponding script engine.
However, when one script engine in the multiple script engine environments is released, the plug-in registered in the released script engine is also released, which causes that other unreleased script engines cannot call the plug-in, and thus, there is a problem of poor call reliability.
In order to solve the above problems in the prior art, in the technical scheme adopted in the embodiment of the present invention, a plug-in agent layer is created between a plug-in and a script engine, different script engines can call the plug-in through different plug-in agents, and only corresponding plug-in agents in the plug-in agent layer are released when the script engine is released, while the plug-in is retained, so that other unreleased script engines can continue to call the plug-in, and the reliability of plug-in calling can be improved in a multi-script engine environment.
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in detail below.
Fig. 1 shows a flowchart of a flow control method in an embodiment of the present invention. The process control method shown in fig. 1 is suitable for multiple script engines to call the same plug-in, and may specifically include the following operations:
step S101: and the corresponding script engine calls the plug-in through the corresponding plug-in proxy in the plug-in proxy layer.
In specific implementation, the plug-in agent layer serves as a forwarding layer between the plug-in and the script engine, and can forward information from the plug-in to the script engine and also forward information sent by the script engine to the plug-in, so that information interaction between the script engine and the plug-in is realized. In other words, the plug-in agent layer can be regarded as the interfaces of the plug-ins, and the interfaces of the plug-ins are respectively presented to the corresponding script engines, so that the corresponding script engines can realize the call of the plug-ins through the plug-in agent layer.
Step S102: and when the script engine is released, releasing the corresponding plug-in agent in the plug-in agent layer and reserving the plug-in.
In specific implementation, by creating a plug-in agent layer between a plug-in and a script engine, different script engines can call the plug-in through different plug-in agents, and only release the corresponding plug-in agent in the plug-in agent layer when the script engine is released, and retain the plug-in, so that other unreleased script engines can continue to call the plug-in, and the reliability of plug-in calling can be improved under the environment of the multi-script engine.
The plug-in calling method in the embodiment of the present invention will be described in detail with reference to fig. 2.
FIG. 2 is a flow chart illustrating a plug-in invocation method in an embodiment of the present invention. Referring to fig. 2, the plug-in calling method in the embodiment of the present invention is suitable for multiple script engines to call the same plug-in, and may specifically be implemented by the following operations:
step S201: a plug-in agent layer is created between the plug-in and the plurality of script engines.
In a specific implementation, the number of plug-in agents in the plug-in agent layer is related to the script engine data that needs to invoke the plug-in. In an embodiment of the present invention, the plugin agents in the plugin agent layer have a preset one-to-one correspondence with the script engines, that is, different script engines perform information interaction with plugins through different plugin agents in the plugin agent layer.
In an embodiment of the present invention, the plug-in is a QT low-level (lower level) plug-in, and the plug-in agent layer is implemented by using a QT meta object.
Step S202: and respectively registering the plug-ins in a plurality of script engines through corresponding plug-in agents in a preset plug-in agent layer.
In specific implementation, in order to implement the call of the script engine to the plug-in, the plug-in may first register in the corresponding script engine through a plug-in agent corresponding to the script engine in a plug-in agent layer, so that the script engine may obtain the relevant information of the plug-in, and thus the script engine may successfully call the plug-in a subsequent operation process.
Step S203: and when the plug-in is required to be called, the corresponding script engine calls the plug-in through the corresponding plug-in proxy in the plug-in proxy layer.
In specific implementation, when the plug-ins are successfully registered in the corresponding script engines respectively through the corresponding plug-in agents in the plug-in agent layer, the corresponding script engines can call the plug-ins according to actual needs to realize corresponding functions.
Specifically, when the plug-in needs to be called, the script engine generates a corresponding calling request; a corresponding plug-in agent in a plug-in agent layer intercepts a calling request sent by a corresponding script engine and sends the calling request to the plug-in; when receiving a call request sent by a corresponding plugin agent, the plugin can respond to the call request to perform corresponding processing and send a corresponding processing result to the corresponding plugin agent in the plugin agent layer; when a corresponding plug-in agent in the plug-in agent layer receives a processing result sent by the plug-in, sending the received processing result to a corresponding script engine; the script engine can receive the processing result sent by the corresponding plug-in the plug-in agent layer. And finishing the calling of the script engine to the plug-in.
Step S204: and when the script engine releases, releasing the corresponding plug-in agent in the plug-in agent layer, and reserving the plug-in.
In particular implementations, when the script engine usage is complete, the corresponding script engine environment will be released. At this time, the corresponding plug-in agent in the plug-in agent layer is released along with the corresponding script engine, and the plug-in is continuously reserved and is not released along with the release of the script engine.
In the above manner, when one script engine in the script engines is released, only the corresponding plug-in agent in the plug-in agent layer is released, instead of the plug-in. When other unreleased script engines need to call the plug-in the subsequent operation process, the plug-in is called continuously through corresponding plug-in agents in the plug-in agent layer, so that the situation that other unreleased script engines cannot call the plug-in due to the release of the plug-in along with the script engines can be avoided, and the plug-in calling reliability can be improved under the environment of the multi-script engines.
The method in the embodiment of the present invention is described in detail above, and the apparatus corresponding to the method will be described below.
Fig. 3 shows a structure of a plug-in calling device in the embodiment of the present invention. Referring to fig. 3, a plug-in calling apparatus 300 in an embodiment of the present invention is used for multiple script engines to call the same plug-in, and specifically may include a calling unit 301 and a releasing unit 302, where:
the calling unit 301 is adapted to call the plug-in by the corresponding script engine through the corresponding plug-in proxy in the preset plug-in proxy layer; in an embodiment of the invention, the plug-in is a QT low-level plug-in, and the plug-in proxy layer is implemented using QT meta-objects.
The releasing unit 302 is adapted to release the corresponding plug-in agent in the plug-in agent layer and reserve the plug-in when the script engine releases.
In an embodiment of the present invention, the plugin calling apparatus 300 may further include a registration unit 303, where:
the registering unit 303 is adapted to register the plug-ins in the plurality of script engines respectively through corresponding plug-in agents in a preset plug-in agent layer before the corresponding script engines call the plug-ins through the corresponding plug-in agents in the preset plug-in agent layer.
The embodiment of the invention also provides a computer-readable storage medium, wherein computer instructions are stored on the computer-readable storage medium, and the computer instructions are characterized in that when running, the step of calling the method by the plug-in is executed. Please refer to the above description, and details are not repeated.
The embodiment of the invention also provides a terminal which comprises a memory and a processor, wherein the memory is stored with computer instructions capable of running on the processor, and the processor executes the step of the plug-in calling method when running the computer instructions. Please refer to the above description, and details are not repeated.
By adopting the scheme in the embodiment of the invention, different script engines can call the plug-ins through different plug-in agents by establishing the plug-in agent layer between the plug-ins and the script engines, and only release the corresponding plug-in agents in the plug-in agent layer when the script engines are released, but reserve the plug-ins, so that other unreleased script engines can continue to call the plug-ins, and the reliability of plug-in calling can be improved under the environment of the multi-script engines.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by instructions associated with hardware via a program, which may be stored in a computer-readable storage medium, and the storage medium may include: ROM, RAM, magnetic or optical disks, and the like.
The method and system of the embodiments of the present invention have been described in detail, but the present invention is not limited thereto. Various changes and modifications may be effected therein by one skilled in the art without departing from the spirit and scope of the invention as defined in the appended claims.
Claims (10)
1. A plug-in calling method for a plurality of script engines to call the same plug-in, comprising:
the corresponding script engine calls the plug-in through a corresponding plug-in proxy in a preset plug-in proxy layer; the plug-in agent layer is used as a forwarding layer between the plug-in and the script engine, forwards information from the plug-in to the script engine and forwards information sent by the script engine to the plug-in;
and when the script engine is released, releasing the corresponding plug-in agent in the plug-in agent layer and reserving the plug-in.
2. The plugin calling method according to claim 1, before the corresponding script engine calls the plugin through the corresponding plugin agent in the preset plugin agent layer, further comprising:
and respectively registering the plug-ins in a plurality of script engines through corresponding plug-in agents in a preset plug-in agent layer.
3. The plug-in calling method of claim 1, wherein the plug-in is a QT low level plug-in.
4. The plug-in invocation method according to claim 3, wherein said plug-in proxy layer is implemented using QT meta-objects.
5. A plug-in calling apparatus for calling a same plug-in by a plurality of script engines, comprising:
the calling unit is suitable for the corresponding script engine to call the plug-in through the corresponding plug-in proxy in the preset plug-in proxy layer; the plug-in agent layer is used as a forwarding layer between the plug-in and the script engine, forwards information from the plug-in to the script engine and forwards information sent by the script engine to the plug-in;
and the release unit is suitable for releasing the corresponding plug-in agent in the plug-in agent layer and reserving the plug-in when the script engine is released.
6. The plug-in invocation device according to claim 5, further comprising:
and the registration unit is suitable for registering the plug-ins in the script engines respectively through corresponding plug-in agents in the preset plug-in agent layer before the corresponding script engines call the plug-ins through the corresponding plug-in agents in the preset plug-in agent layer.
7. The plug-in invocation device according to claim 5, wherein the plug-in is a QT low-level plug-in.
8. The plugin calling device of claim 7, wherein the plugin proxy layer is implemented using QT meta-objects.
9. A computer readable storage medium having computer instructions stored thereon, wherein the computer instructions when executed perform the steps of the plug-in calling method of any of claims 1 to 4.
10. A terminal, characterized in that it comprises a memory and a processor, said memory having stored thereon computer instructions capable of being executed on said processor, said processor executing the steps of the plug-in calling method according to any one of claims 1 to 4 when executing said computer instructions.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710441643.3A CN107315628B (en) | 2017-06-13 | 2017-06-13 | Plug-in calling method and device, computer readable storage medium and terminal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710441643.3A CN107315628B (en) | 2017-06-13 | 2017-06-13 | Plug-in calling method and device, computer readable storage medium and terminal |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107315628A CN107315628A (en) | 2017-11-03 |
CN107315628B true CN107315628B (en) | 2020-11-17 |
Family
ID=60183175
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710441643.3A Active CN107315628B (en) | 2017-06-13 | 2017-06-13 | Plug-in calling method and device, computer readable storage medium and terminal |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107315628B (en) |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101950255A (en) * | 2010-09-16 | 2011-01-19 | 深圳市迎风传讯科技有限公司 | Plug-in management method, plug-in manager and set top box |
CN102253840A (en) * | 2011-08-04 | 2011-11-23 | 深圳芯智汇科技有限公司 | Plugin management method and plugin manager |
CN102402455A (en) * | 2010-09-14 | 2012-04-04 | 北大方正集团有限公司 | Method and device for calling dynamic link library (DLL) |
CN102523295A (en) * | 2011-12-20 | 2012-06-27 | 深圳市茁壮网络股份有限公司 | Plug-in registration method and system thereof |
CN103176789A (en) * | 2011-12-26 | 2013-06-26 | 腾讯科技(深圳)有限公司 | Method and system used for realizing function extension of open platform |
CN103544013A (en) * | 2013-10-25 | 2014-01-29 | 优视科技有限公司 | Plug-in system and plug-in management method |
US10025702B1 (en) * | 2014-12-10 | 2018-07-17 | Amazon Technologies, Inc. | Browser capable of saving and restoring content item state |
-
2017
- 2017-06-13 CN CN201710441643.3A patent/CN107315628B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102402455A (en) * | 2010-09-14 | 2012-04-04 | 北大方正集团有限公司 | Method and device for calling dynamic link library (DLL) |
CN101950255A (en) * | 2010-09-16 | 2011-01-19 | 深圳市迎风传讯科技有限公司 | Plug-in management method, plug-in manager and set top box |
CN102253840A (en) * | 2011-08-04 | 2011-11-23 | 深圳芯智汇科技有限公司 | Plugin management method and plugin manager |
CN102523295A (en) * | 2011-12-20 | 2012-06-27 | 深圳市茁壮网络股份有限公司 | Plug-in registration method and system thereof |
CN103176789A (en) * | 2011-12-26 | 2013-06-26 | 腾讯科技(深圳)有限公司 | Method and system used for realizing function extension of open platform |
CN103544013A (en) * | 2013-10-25 | 2014-01-29 | 优视科技有限公司 | Plug-in system and plug-in management method |
US10025702B1 (en) * | 2014-12-10 | 2018-07-17 | Amazon Technologies, Inc. | Browser capable of saving and restoring content item state |
Non-Patent Citations (1)
Title |
---|
插件平台在3D游戏引擎系统中的应用;熊伟;《福建电脑》;20091231(第10期);参见第147-148页 * |
Also Published As
Publication number | Publication date |
---|---|
CN107315628A (en) | 2017-11-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9614931B2 (en) | Identifying a resource set require for a requested application and launching the resource set in a container for execution in a host operating system | |
CN107526598B (en) | Network page jump control method and system | |
CN109309693B (en) | Multi-service system based on docker, deployment method, device, equipment and storage medium | |
CN105955779B (en) | Process closing method and device | |
EP3220269A1 (en) | Mobile terminal and resource management method thereof | |
CN108255429B (en) | Write operation control method, system, device and computer readable storage medium | |
CN113990354B (en) | Audio control method, device, equipment and storage medium based on Linux | |
US20170322793A1 (en) | Upgrade of an operating system of a virtual machine | |
CN111666199B (en) | Debugging method executed on intelligent terminal and software debugger | |
CN107645476B (en) | Request processing method and device | |
CN107315628B (en) | Plug-in calling method and device, computer readable storage medium and terminal | |
CN108132816B (en) | Method and device for realizing local framework layer calling in application | |
US20040024856A1 (en) | Method and system for a services environment management engine | |
CN115629809A (en) | Data processing method and device, electronic equipment and computer readable storage medium | |
CA2878759A1 (en) | Methods and systems for providing software applications | |
CN111274176B (en) | Information processing method, electronic equipment, system and storage medium | |
CN110286956B (en) | Plug-in operation method and device and electronic equipment | |
JP2019536173A (en) | Reduce application resource usage | |
CN114237684A (en) | Component management system, method, device, electronic device and storage medium | |
CN113986368A (en) | Linux-based camera control method, device, equipment and storage medium | |
CN107885461B (en) | Data local storage method and device | |
CN108874557B (en) | Front-end interface processing method and system | |
EP3783484A1 (en) | Data processing method and computer device | |
CN107463438B (en) | Information processing method, device and system for multi-Openstack environment | |
CN112306638A (en) | Method for acquiring resource information of docker container |
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 |