CN105912362B - A kind of method, apparatus and electronic equipment loading plug-in unit - Google Patents
A kind of method, apparatus and electronic equipment loading plug-in unit Download PDFInfo
- Publication number
- CN105912362B CN105912362B CN201610219485.2A CN201610219485A CN105912362B CN 105912362 B CN105912362 B CN 105912362B CN 201610219485 A CN201610219485 A CN 201610219485A CN 105912362 B CN105912362 B CN 105912362B
- Authority
- CN
- China
- Prior art keywords
- plug
- unit
- card
- file
- function
- 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
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/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44521—Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
- G06F9/44526—Plug-ins; Add-ons
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
The embodiment of the present invention discloses a kind of method, apparatus and electronic equipment for loading plug-in unit, is related to application plug technology, is able to ascend the loading efficiency of plug-in unit.The method of the load plug-in unit includes: to read the entry data of plug-in unit to be loaded;The plug-in unit relative path name in entry data is extracted, the installation root pathname of connected applications program obtains plug-in unit absolute path title;If there are files under plug-in unit absolute path title, file acquisition function is called to obtain the file signature of existing file;If file signature is identical as any plug-in unit signature in stored plug-in card configuration message file, calls plug-in unit to export function, obtain the card i/f discre value of the plug-in unit;If the card i/f discre value of the plug-in unit is identical as the Universally Unique Identifier value of card i/f in stored plug-in card configuration message file, plug-in unit loading function is called, loads the plug-in unit using the card i/f of the plug-in unit.The present invention is suitable for the plug-in unit of loading application programs.
Description
Technical field
The present invention relates to application plug technology more particularly to a kind of method, apparatus and electronic equipment for loading plug-in unit.
Background technique
With computer communication and the continuous development of Internet technology, electronic equipment using more and more common, for example,
Intelligent mobile phone, personal digital assistant, palm PC, laptop are more and more widely used.Electronic equipment
The application program (APP, Application) of upper installation is also more and more, in order to meet the ever-increasing application function need of user
It asks, it is desirable that the application function that application program provides is also more and more, as such, it is desirable in one application function of every addition or update, liter
When grade application function, require to be modified application program, to need user's frequent downloads application program update packet, not only
The maintenance workload of application program is increased, experience of the user to application program can be also reduced.
In order to not only be able to satisfy the continuous extension of application program, but can be reduced change to application program and user it is frequent under
Application program update packet is carried, the prior art proposes the technical solution of application plug, and plug-in unit (Plug-in) is that one kind is abided by
Follow what the application programming interface (API, Application Programming Interface) centainly standardized write out
Application program, depends on application program, and application program allows plug-in unit to be loaded into application program and network biography by providing plug-in unit
In defeated agreement, the multinomial expansion service of the application program can be provided, without being modified to the application program.Plug-in unit has
Conducive to the modularization of application program, convenient for application program by different level and maintain easily management.It is answered for example, plug-in unit can be loaded into
With can update in program and dynamically, and any change will not be caused to application program.For example, in IE browser application
In program, by installing related plug-in unit, IE browser can call directly plug-in unit, realize the application function being arranged in plug-in unit.
But the method for existing load plug-in unit, since different plug-in units is correspondingly arranged on different interfaces, when loading plug-in unit,
It needs to write corresponding interface code section for the different interface of plug-in unit in advance, so that compiling in the application function of expansion plugin
Time needed for writing distinct interface code segment is longer, leads to the higher cost of expansion plugin application function, reduces adding for plug-in unit
Efficiency is carried, the subsequent expansion and aggregate maintenance of plug-in unit are unfavorable for.
Summary of the invention
In view of this, the embodiment of the present invention provides a kind of method, apparatus and electronic equipment for loading plug-in unit, expansion can reduce
The cost for opening up plug-in application function, promotes the loading efficiency of plug-in unit, cannot make difference in the method for solving existing load plug-in unit
The interface of plug-in unit uses the problem of unified interface code section.
In a first aspect, the embodiment of the present invention provides a kind of method for loading plug-in unit, comprising:
It monitors that application program loads plug-in unit, reads the entry data of the plug-in unit, the entry data according to setting in advance
The plug-in card configuration message file set is configured;
The plug-in unit relative path name in the entry data is extracted, the installation root path according to the application program
Title and the plug-in unit relative path name, obtain plug-in unit absolute path title;
If there are files under the plug-in unit absolute path title, file acquisition function is called to obtain the absolute road of plug-in unit
The file signature of existing file under diameter title;
If the file signature is identical as any plug-in unit signature in stored plug-in card configuration message file, calls and insert
Part exports function, obtains the card i/f discre value of the plug-in unit;
If the card i/f discre value of the plug-in unit and the card i/f in stored plug-in card configuration message file
Universally Unique Identifier value is identical, calls plug-in unit loading function, loads the plug-in unit using the card i/f of the plug-in unit.
With reference to first aspect, in the first embodiment of first aspect, the plug-in card configuration message file uses can
Extending mark language editor, comprising: plug-in unit mark, plug-in unit relative path name, plug-in unit signature and card i/f it is general only
One identity value.
With reference to first aspect, in second of embodiment of first aspect, the plug-in unit export function is
DllGetClassObject function.
With reference to first aspect, in the third embodiment of first aspect, the card i/f includes: plug-in initialization
Sub-interface, plug-in unit are counter to be initialized sub-interface, starting plug-in unit sub-interface and stops plug-in unit sub-interface, and the plug-in unit loading function is
LoadLibrary function.
With reference to first aspect the first or second or the third embodiment, in the 4th kind of embodiment party of first aspect
In formula, the method also includes:
If not there is no file under the plug-in unit absolute path title;Or, if the file signature is inserted with stored
Any plug-in unit signature in part configuration information file is all different;Or, if the card i/f discre value of the plug-in unit with deposited
The Universally Unique Identifier value of card i/f in the plug-in card configuration message file of storage is not identical, exits loading the stream of the plug-in unit
Journey.
Second aspect, the embodiment of the present invention provide a kind of device for loading plug-in unit, comprising: entry data read module, road
Diameter name acquiring module, file signature obtain module, card i/f discre value obtains module and plug-in unit loading module, wherein
Entry data read module, for reading the entry number of the plug-in unit after monitoring application program load plug-in unit
According to the entry data is configured according to pre-set plug-in card configuration message file;
Pathname obtains module, for extracting the plug-in unit relative path name in the entry data, answers according to described in
With the installation root pathname and the plug-in unit relative path name of program, plug-in unit absolute path title is obtained;
File signature obtains module, if there are files under the plug-in unit absolute path title, calls file acquisition function
Obtain the file signature of existing file under the plug-in unit absolute path title;
Card i/f discre value obtains module, if in the file signature and stored plug-in card configuration message file
Any plug-in unit signature is identical, calls plug-in unit to export function, obtains the card i/f discre value of the plug-in unit;
Plug-in unit loading module, if in the card i/f discre value of the plug-in unit and stored plug-in card configuration message file
Card i/f Universally Unique Identifier value it is identical, call plug-in unit loading function, utilize the plug-in unit card i/f load
The plug-in unit.
In conjunction with second aspect, in the first embodiment of second aspect, the plug-in card configuration message file uses can
Extending mark language editor, comprising: plug-in unit mark, plug-in unit relative path name, plug-in unit signature and card i/f it is general only
One identity value.
In conjunction with second aspect, in second of embodiment of second aspect, the plug-in unit export function is
DllGetClassObject function.
In conjunction with second aspect, in the third embodiment of second aspect, the card i/f includes: plug-in initialization
Sub-interface, plug-in unit are counter to be initialized sub-interface, starting plug-in unit sub-interface and stops plug-in unit sub-interface, and the plug-in unit loading function is
LoadLibrary function.
In conjunction with second aspect the first into the third any embodiment, in the 4th kind of embodiment party of second aspect
In formula, described device further include:
Module is exited in plug-in unit load, if not there is no file under the plug-in unit absolute path title;Or, if the file
It signs and is all different with any plug-in unit signature in stored plug-in card configuration message file;Or, if the plug-in unit of the plug-in unit
Interface discre value is not identical as the Universally Unique Identifier value of the card i/f in stored plug-in card configuration message file, exits
Load the process of the plug-in unit.
The third aspect, the embodiment of the present invention provide a kind of electronic equipment, and the electronic equipment includes: shell, processor, deposits
Reservoir, circuit board and power circuit, wherein circuit board is placed in the space interior that shell surrounds, processor and memory setting
On circuit boards;Power circuit, for each circuit or the device power supply for above-mentioned electronic equipment;Memory is for storing and can hold
Line program code;Processor is run and executable program code pair by reading the executable program code stored in memory
The program answered, the method for executing aforementioned any load plug-in unit.
A kind of method, apparatus and electronic equipment loading plug-in unit provided in an embodiment of the present invention, by monitoring using journey
Sequence loads plug-in unit, reads the entry data of the plug-in unit, the entry data is according to pre-set plug-in card configuration message file
It is configured;The plug-in unit relative path name in the entry data is extracted, the installation root road according to the application program
Diameter title and the plug-in unit relative path name, obtain plug-in unit absolute path title;If the plug-in unit absolute path title
Under there are file, call file acquisition function to obtain the file signature of existing file under the plug-in unit absolute path title;Such as
File signature described in fruit is identical as any plug-in unit signature in stored plug-in card configuration message file, and plug-in unit is called to export letter
Number, obtains the card i/f discre value of the plug-in unit;If the card i/f discre value of the plug-in unit is matched with stored plug-in unit
The Universally Unique Identifier value for setting the card i/f in message file is identical, calls plug-in unit loading function, utilizes the plug-in unit
Card i/f loads the plug-in unit, can/method that solves existing load plug-in unit cannot make the interface of different plug-in units using unified
Interface code section caused by expansion plugin application function higher cost, the lower problem of the loading efficiency of plug-in unit.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with
Other attached drawings are obtained according to these attached drawings.
Fig. 1 is one flow diagram of embodiment of the method for present invention load plug-in unit;
Fig. 2 is two flow diagram of embodiment of the method for present invention load plug-in unit;
Fig. 3 is the structural schematic diagram of the Installation practice one of present invention load plug-in unit;
Fig. 4 is the structural schematic diagram of electronic equipment one embodiment of the present invention.
Specific embodiment
The embodiment of the present invention is described in detail with reference to the accompanying drawing.
It will be appreciated that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.Base
Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts it is all its
Its embodiment, shall fall within the protection scope of the present invention.
Fig. 1 is one flow diagram of embodiment of the method for present invention load plug-in unit, as shown in Figure 1, the method for the present embodiment
May include:
Step 101, it monitors that application program loads plug-in unit, reads the entry data of the plug-in unit, the entry data is pressed
It is configured according to pre-set plug-in card configuration message file;
In the present embodiment, plug-in card configuration message file is used to store the configuration information of each plug-in unit, with corresponding to each plug-in unit
Interface carries out unification.In this way, all plug-in units correspond to identical interface generation when different plug-in units are extended or edited to plug-in unit
Code section reduces needed for writing distinct interface code segment without writing corresponding different interface code section for different plug-in units
Time, improve the update efficiency of plug-in unit.
As an alternative embodiment, plug-in card configuration message file uses extensible markup language (XML, Extensible
Mark Language) it is edited, comprising: plug-in unit identifies (item id), plug-in unit relative path name (name), plug-in unit signature
And Universally Unique Identifier (UUID, Universally Unique Identifier) value of card i/f.Wherein,
Plug-in unit identifies (item id), is used for identification plug;
Plug-in unit relative path name (name) installs root pathname with respect to owning application for plug-in unit to be arranged
Relative path;
Plug-in unit signature, the title of the signature company (operator) for identification plug;
The UUID value of card i/f, the UUID value for identification plug interface mappings.
As an alternative embodiment, the content that plug-in card configuration message file includes is as follows:
It include the configuration information of one or more plug-in units in plug-in card configuration message file in the present embodiment, write on <
Plugins>with</<plugins>between, the corresponding entry of each plug-in card configuration information<item>data.For example, for first
A plug-in unit, plug-in unit identify (item id) be 1, plug-in unit relative path name (name) are as follows: plugins
Kunionplugin.dll, plug-in unit are signed (sign) are as follows: kingsoft.com, the UUID value of card i/f
(Interfaceuuid) are as follows: { E02FE26A-76FA-4cda-9E61-FE37AD336206 }.
In the present embodiment, as an alternative embodiment, plug-in unit relative path name can be transported by the corresponding application program of plug-in unit
Battalion quotient presets, and card i/f uses pre-set unified interface, for example, IKBasePlugins card i/f, mapping
UUID value are as follows: { E02FE26A-76FA-4cda-9E61-FE37AD336206 }.
In the present embodiment, after plug-in card configuration message file is set, the plug-in card configuration message file of setting can be issued
To each electronic equipment, electronic equipment receives and stores plug-in card configuration message file, so as to subsequent according to the plug-in card configuration information text
The load of part progress plug-in unit.
In the present embodiment, application program starts<item>data for reading each plug-in unit after the completion of initialization.
In the present embodiment, the corresponding entry data of each plug-in unit.
Step 102, the plug-in unit relative path name in the entry data is extracted, the installation root according to the application program
Directory path title and the plug-in unit relative path name, obtain plug-in unit absolute path title;
In the present embodiment, the plug-in unit relative path name is linked into the installation root pathname of the application program
Under title, i.e., the installation root pathname of application program and the plug-in unit relative path name is spliced, obtain plug-in unit
Absolute path title.For example, plug-in unit relative path name are as follows: plugins kunionplugin.dll, the application program
Install root pathname are as follows: C: program files kingsoft, then by splicing, obtained plug-in unit absolute path
Title are as follows: C: program files kingsoft plugins kunionplugin.dll.
Step 103, if there are files under the plug-in unit absolute path title, file acquisition function is called to obtain described insert
The file signature of existing file under part absolute path title;
In the present embodiment, as an alternative embodiment, file acquisition function is windows function.
In the present embodiment, as an alternative embodiment, this method can also include:
If not there is no file under the plug-in unit absolute path title, the process of the plug-in unit is exited loading.
In the present embodiment, if not there is no file under the plug-in unit absolute path title, illustrate application program installation directory
There is no the plug-in unit, do not need to load.
Step 104, if the file signature and any plug-in unit signature phase in stored plug-in card configuration message file
Together, it calls plug-in unit to export function, obtains the card i/f discre value of the plug-in unit;
In the present embodiment, file signature and any sign field in stored plug-in card configuration message file that will acquire
It is matched.
In the present embodiment, it is DllGetClassObject function that plug-in unit, which exports function, exports function about calling plug-in unit,
The card i/f discre value for obtaining the plug-in unit is well-known technique, detailed description is omitted here.
In the present embodiment, as an alternative embodiment, this method can also include:
If the file signature is all different with any plug-in unit signature in stored plug-in card configuration message file, move back
The process of the plug-in unit is loaded out.
In the present embodiment, if any sign word in the file signature and stored plug-in card configuration message file that obtain
Section does not match that, shows without loading the plug-in unit.
Step 105, if inserting in the card i/f discre value of the plug-in unit and stored plug-in card configuration message file
The Universally Unique Identifier value of part interface is identical, calls plug-in unit loading function, described in the card i/f load using the plug-in unit
Plug-in unit.
In this implementation, as an alternative embodiment, if the card i/f obtained is IKBasePlugins, mapping
Card i/f discre value are as follows: { E02FE26A-76FA-4cda-9E61-FE37AD336206 }, then with plug-in card configuration message file
In card i/f Universally Unique Identifier value it is identical, the card i/f can be called.
In this implementation, as an alternative embodiment, plug-in unit loading function is LoadLibrary function.
In this implementation, as an alternative embodiment, card i/f includes: plug-in initialization sub-interface, plug-in unit is counter initializes
Sub-interface, starting plug-in unit sub-interface and stopping plug-in unit sub-interface.Wherein, the corresponding sub-interface function of each plug-in unit sub-interface,
Respectively plug-in initialization sub-interface function (Init function), plug-in unit are counter initializes sub-interface function (UnInit function), starting
Plug-in unit sub-interface function (RunPlugin function) and stopping plug-in unit sub-interface function (StopPlugin function), wherein
Init function is used to complete the initialization operation of plug-in unit;
RunPlugin function after completing initialization, calls the plug-in unit of operation for plug-in unit;
UnInit function is used to complete the anti-initialization operation of plug-in unit;
StopPlugin function after completing anti-initialization, stops the operation of plug-in unit for plug-in unit.
By filling corresponding application function information in sub-interface function, the respective application function of plug-in unit can be completed
(initialization plug-in unit instead initializes plug-in unit, starting plug-in unit and stops plug-in unit).
As an alternative embodiment, the sub-interface function that card i/f includes is as follows:
// > plug-in initialization
Virtual int_stdcall Init ()=0;
// > plug-in unit is counter to be initialized
Virtual int_stdcall UnInit ()=0;
// > starting plug-in unit
Virtual int_stdcall RunPlugin ()=0;
// > plug-in initialization
Virtual int_stdcall StopPlugin ()=0;
In the present embodiment, each plug-in unit is associated inlet using aforementioned four sub-interface function, can call plug-in unit and realize
The different function of plug-in unit.
In the present embodiment, as an alternative embodiment, this method can also include:
If the card i/f discre value of the plug-in unit and the card i/f in stored plug-in card configuration message file
Universally Unique Identifier value is not identical, exits loading the process of the plug-in unit.
In the present embodiment, if the Universally Unique Identifier of the card i/f discre value and stored card i/f that obtain
Be worth it is not identical, exit loading the process of plug-in unit, can may be to avoid the card i/f of acquisition it is invalid, so as to cause invalid
Card i/f executes the situation that plug-in unit load causes application crash, promotes the stability of plug-in unit load.
The method that the present invention loads plug-in unit monitors that application program loads plug-in unit, reads the entry data of the plug-in unit, institute
Entry data is stated to be configured according to pre-set plug-in card configuration message file;The plug-in unit extracted in the entry data is opposite
Pathname is inserted according to the installation root pathname and the plug-in unit relative path name of the application program
Part absolute path title;If there are files under the plug-in unit absolute path title, file acquisition function is called to obtain described insert
The file signature of existing file under part absolute path title;If the file signature and stored plug-in card configuration information text
Any plug-in unit signature in part is identical, calls plug-in unit to export function, obtains the card i/f discre value of the plug-in unit;If described
The Universally Unique Identifier value of card i/f in the card i/f discre value of plug-in unit and stored plug-in card configuration message file
It is identical, plug-in unit loading function is called, loads the plug-in unit using the card i/f of the plug-in unit.In this way, by being arranged for uniting
The plug-in card configuration message file of one card i/f avoids existing different plug-in units in load, needs to obtain different plug-in units
Interface calls and needs to write corresponding interface code section for different card i/fs in advance caused by corresponding interface function,
The time needed for writing interface code section is shortened, the cost of expansion plugin application function is reduced, improves the load of plug-in unit
Efficiency is conducive to the subsequent expansion and aggregate maintenance of plug-in unit;So that only portion is needed to connect according to plug-in card configuration message file
Mouth code segment can load all plug-in units, and realize the same card interface of different plug-in units, realize the diversification application function of plug-in unit
Can, facilitate the unified management of plug-in unit;And without changing application code.It only needs to configure relevant information in plug-in unit
It realizes plug-in unit load, is conducive to the extension of plug-in unit.
Fig. 2 is two flow diagram of embodiment of the method for present invention load plug-in unit, as shown in Fig. 2, the method for the present embodiment
May include:
Step 201, it monitors that application program loads plug-in unit, reads the entry data of the plug-in unit, the entry data is pressed
It is configured according to pre-set plug-in card configuration message file;
Step 202, the plug-in unit relative path name in the entry data is extracted, the installation root according to the application program
Directory path title and the plug-in unit relative path name, obtain plug-in unit absolute path title;
In the present embodiment, the process of step 201 to step 202 respectively with the step 101 of above method embodiment one to step
Rapid 102 is similar, and details are not described herein again.
Step 203, judge with the presence or absence of file under the plug-in unit absolute path title, if it does, executing step 204;
If it does not, executing step 209;
Step 204, file acquisition function is called to obtain the file label of existing file under the plug-in unit absolute path title
Name;
Step 205, any plug-in unit in the file signature and stored plug-in card configuration message file is signed, such as
Fruit is identical, executes step 206;If it is not the same, executing step 209;
Step 206, it calls plug-in unit to export function, obtains the card i/f discre value of the plug-in unit;
Step 207, inserting in the card i/f discre value of the plug-in unit and stored plug-in card configuration message file
The Universally Unique Identifier value of part interface executes step 208 if identical;If it is not the same, executing step 209;
Step 208, plug-in unit loading function is called, loads the plug-in unit using the card i/f of the plug-in unit;
In the present embodiment, if initialized to plug-in unit, Init function is called.
Step 209, the process of the plug-in unit is exited loading.
The method that the present invention loads plug-in unit, in the relevant configuration information of plug-in unit to be loaded and plug-in card configuration message file
Corresponding configuration information when not matching that, exit plug-in unit load process, cause application program when can load invalid to avoid plug-in unit
The situation of collapse promotes the resource utilization of electronic equipment.
Fig. 3 is the structural schematic diagram of the Installation practice one of present invention load plug-in unit, as shown in figure 3, the present embodiment adds
The device for carrying plug-in unit may include: entry data read module 31, pathname obtains module 32, file signature obtains module
33, card i/f discre value obtains module 34 and plug-in unit loading module 35, wherein
Entry data read module 31, for reading the entry of the plug-in unit after monitoring application program load plug-in unit
Data, the entry data are configured according to pre-set plug-in card configuration message file;
Pathname obtains module 32, for extracting the plug-in unit relative path name in the entry data, according to described in
The installation root pathname of application program and the plug-in unit relative path name, obtain plug-in unit absolute path title;
File signature obtains module 33, if there are files under the plug-in unit absolute path title, calls file acquisition letter
Number obtains the file signature of existing file under the plug-in unit absolute path title;
Card i/f discre value obtains module 34, if in the file signature and stored plug-in card configuration message file
Any plug-in unit signature it is identical, call plug-in unit export function, obtain the card i/f discre value of the plug-in unit;
Plug-in unit loading module 35, if the card i/f discre value of the plug-in unit and stored plug-in card configuration message file
In card i/f Universally Unique Identifier value it is identical, call plug-in unit loading function, the card i/f using the plug-in unit adds
Carry the plug-in unit.
In the present embodiment, as an alternative embodiment, the plug-in card configuration message file is compiled using extensible markup language
Volume, comprising: the Universally Unique Identifier value of plug-in unit mark, plug-in unit relative path name, plug-in unit signature and card i/f.Its
In,
Plug-in unit mark, is used for identification plug;
Plug-in unit relative path name is opposite with respect to owning application installation root pathname for plug-in unit to be arranged
Path;
Plug-in unit signature, the title of the signature company (operator) for identification plug;
The UUID value of card i/f, the UUID value for identification plug interface mappings.
It include the configuration information of one or more plug-in units, each plug-in unit in plug-in card configuration message file in the present embodiment
A corresponding entry data.
In the present embodiment, as an alternative embodiment, plug-in unit relative path name can be transported by the corresponding application program of plug-in unit
Battalion quotient presets, and card i/f uses pre-set unified interface.
In the present embodiment, as an alternative embodiment, file acquisition function is windows function.
In the present embodiment, as an alternative embodiment, the plug-in unit export function is DllGetClassObiect function.
In the present embodiment, as an alternative embodiment, the card i/f includes: that plug-in initialization sub-interface, plug-in unit are anti-
It initializes sub-interface, starting plug-in unit sub-interface and stops plug-in unit sub-interface, the plug-in unit loading function is LoadLibrary letter
Number.Wherein, the corresponding sub-interface function of each plug-in unit sub-interface, respectively Init function, UnInit function, RunPlugin letter
Several and StopPlugin function, wherein
Init function is used to complete the initialization operation of plug-in unit;
RunPlugin function after completing initialization, calls the plug-in unit of operation for plug-in unit;
UnInit function is used to complete the anti-initialization operation of plug-in unit;
StopPlugin function after completing anti-initialization, stops the operation of plug-in unit for plug-in unit.
By filling corresponding application function information in sub-interface function, the corresponding of plug-in unit can be completed and initialize, is anti-
Initialization, starting and stopping application function.
In the present embodiment, as an alternative embodiment, described device further include:
Module 36 is exited in plug-in unit load, if not there is no file under the plug-in unit absolute path title;Or, if the text
Part signature is all different with any plug-in unit signature in stored plug-in card configuration message file;Or, if the plug-in unit is inserted
Part interface discre value is not identical as the Universally Unique Identifier value of the card i/f in stored plug-in card configuration message file, moves back
The process of the plug-in unit is loaded out.
The device of the present embodiment can be used for executing the technical solution of embodiment of the method shown in Fig. 1, realization principle and skill
Art effect is similar, and details are not described herein again.
It should be noted that, in this document, relational terms such as first and second and the like are used merely to a reality
Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation
In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to
Non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those
Element, but also including other elements that are not explicitly listed, or further include for this process, method, article or equipment
Intrinsic element.In the absence of more restrictions, the element limited by sentence " including one ... ", it is not excluded that
There is also other identical elements in the process, method, article or apparatus that includes the element.
Each embodiment in this specification is all made of relevant mode and describes, same and similar portion between each embodiment
Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.
For Installation practice, since it is substantially similar to the method embodiment, so the comparison of description is simple
Single, the relevent part can refer to the partial explaination of embodiments of method.
Expression or logic and/or step described otherwise above herein in flow charts, for example, being considered use
In the order list for the executable instruction for realizing logic function, may be embodied in any computer-readable medium, for
Instruction execution system, device or equipment (such as computer based system, including the system of processor or other can be held from instruction
The instruction fetch of row system, device or equipment and the system executed instruction) it uses, or combine these instruction execution systems, device or set
It is standby and use.For the purpose of this specification, " computer-readable medium ", which can be, any may include, stores, communicates, propagates or pass
Defeated program is for instruction execution system, device or equipment or the dress used in conjunction with these instruction execution systems, device or equipment
It sets.The more specific example (non-exhaustive list) of computer-readable medium include the following: there is the electricity of one or more wirings
Interconnecting piece (electronic device), portable computer diskette box (magnetic device), random access memory (RAM), read-only memory
(ROM), erasable edit read-only storage (EPROM or flash memory), fiber device and portable optic disk is read-only deposits
Reservoir (CDROM).In addition, computer-readable medium can even is that the paper that can print described program on it or other are suitable
Medium, because can then be edited, be interpreted or when necessary with it for example by carrying out optical scanner to paper or other media
His suitable method is handled electronically to obtain described program, is then stored in computer storage.
It should be appreciated that each section of the invention can be realized with hardware, software, firmware or their combination.
In the above-described embodiment, multiple steps or method can be with storages in memory and by suitable instruction execution
The software or firmware that system executes are realized.For example, in another embodiment, can be used if realized with hardware
Any one of following technology well known in the art or their combination are realized: being had for realizing logic function to data-signal
The discrete logic of the logic gates of energy, the specific integrated circuit with suitable combinational logic gate circuit, programmable gate
Array (PGA), field programmable gate array (FPGA) etc..
The embodiment of the present invention also provides a kind of electronic equipment, and the electronic equipment includes dress described in aforementioned any embodiment
It sets.
Fig. 4 is the structural schematic diagram of electronic equipment one embodiment of the present invention, may be implemented to implement shown in Fig. 1-3 of the present invention
The process of example, as shown in figure 4, above-mentioned electronic equipment may include: shell 41, processor 42, memory 43, circuit board 44 and electricity
Source circuit 45, wherein circuit board 44 is placed in the space interior that shell 41 surrounds, and processor 42 and memory 43 are arranged in circuit
On plate 44;Power circuit 45, for each circuit or the device power supply for above-mentioned electronic equipment;Memory 43 is for storing and can hold
Line program code;Processor 42 is run and executable program generation by reading the executable program code stored in memory 43
The corresponding program of code, for executing the method for loading plug-in unit described in aforementioned any embodiment.
Processor 42 to the specific implementation procedures of above-mentioned steps and processor 42 by operation executable program code come
The step of further executing may refer to the description of Fig. 1-3 illustrated embodiment of the present invention, and details are not described herein.
The electronic equipment exists in a variety of forms, including but not limited to:
(1) mobile communication equipment: the characteristics of this kind of equipment is that have mobile communication function, and to provide speech, data
Communication is main target.This Terminal Type includes: smart phone (such as iPhone), multimedia handset, functional mobile phone and low
Hold mobile phone etc..
(2) super mobile personal computer equipment: this kind of equipment belongs to the scope of personal computer, there is calculating and processing function
Can, generally also have mobile Internet access characteristic.This Terminal Type includes: PDA, MID and UMPC equipment etc., such as iPad.
(3) portable entertainment device: this kind of equipment can show and play multimedia content.Such equipment include: audio,
Video player (such as iPod), handheld device, e-book and intelligent toy and portable car-mounted navigation equipment.
(4) server: providing the equipment of the service of calculating, and the composition of server includes that processor, hard disk, memory, system are total
Line etc., server is similar with general computer architecture, but due to needing to provide highly reliable service, in processing energy
Power, stability, reliability, safety, scalability, manageability etc. are more demanding.
(5) other electronic equipments with data interaction function.
Those skilled in the art are understood that realize all or part of step that above-described embodiment method carries
It suddenly is that relevant hardware can be instructed to complete by program, the program can store in a kind of computer-readable storage medium
In matter, which when being executed, includes the steps that one or a combination set of embodiment of the method.
For convenience of description, description apparatus above is to be divided into various units/modules with function to describe respectively.Certainly, exist
Implement to realize each unit/module function in the same or multiple software and or hardware when the present invention.
As seen through the above description of the embodiments, those skilled in the art can be understood that the present invention can
It realizes by means of software and necessary general hardware platform.Based on this understanding, technical solution of the present invention essence
On in other words the part that contributes to existing technology can be embodied in the form of software products, the computer software product
It can store in storage medium, such as read-only memory (Read-Only Memory, ROM), random access memory
(Random Access Memory, RAM), magnetic disk, CD etc., including some instructions are used so that a computer equipment (can
To be personal computer, server or the network equipment etc.) execute certain parts of each embodiment of the present invention or embodiment
The method.
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, any
In the technical scope disclosed by the present invention, any changes or substitutions that can be easily thought of by those familiar with the art, all answers
It is included within the scope of the present invention.Therefore, protection scope of the present invention should be subject to the protection scope in claims.
Claims (11)
1. a kind of method for loading plug-in unit characterized by comprising
It monitors that application program loads plug-in unit, reads the entry data of the plug-in unit, the entry data is according to pre-set
Plug-in card configuration message file is configured;
The plug-in unit relative path name in the entry data is extracted, the installation root pathname according to the application program
And the plug-in unit relative path name, obtain plug-in unit absolute path title;
If there are files under the plug-in unit absolute path title, file acquisition function is called to obtain the plug-in unit absolute path name
Claim the file signature of lower existing file;
If the file signature is identical as any plug-in unit signature in stored plug-in card configuration message file, plug-in unit is called to lead
Function out obtains the card i/f discre value of the plug-in unit;
If the card i/f discre value of the plug-in unit is general with the card i/f in stored plug-in card configuration message file
Unique identification code value is identical, calls plug-in unit loading function, loads the plug-in unit using the card i/f of the plug-in unit.
2. the method for load plug-in unit according to claim 1, which is characterized in that the plug-in card configuration message file uses can
Extending mark language editor, comprising: plug-in unit mark, plug-in unit relative path name, plug-in unit signature and card i/f it is general only
One identity value.
3. the method for load plug-in unit according to claim 1, which is characterized in that the plug-in unit exports function and is
DllGetClassObject function.
4. the method for load plug-in unit according to claim 1, which is characterized in that the card i/f includes: that plug-in unit is initial
Beggar's interface, plug-in unit are counter to be initialized sub-interface, starting plug-in unit sub-interface and stops plug-in unit sub-interface, the plug-in unit loading function
For LoadLibrary function.
5. the method for load plug-in unit according to any one of claims 1 to 4, which is characterized in that the method also includes:
If not there is no file under the plug-in unit absolute path title;Or, if the file signature is matched with stored plug-in unit
Any plug-in unit signature set in message file is all different;Or, if the card i/f discre value of the plug-in unit with it is stored
The Universally Unique Identifier value of card i/f in plug-in card configuration message file is not identical, exits loading the process of the plug-in unit.
6. a kind of device for loading plug-in unit characterized by comprising entry data read module, pathname obtain module, text
Part signature obtains module, card i/f discre value obtains module and plug-in unit loading module, wherein
Entry data read module, for reading the entry data of the plug-in unit, institute after monitoring application program load plug-in unit
Entry data is stated to be configured according to pre-set plug-in card configuration message file;
Pathname obtains module, for extracting the plug-in unit relative path name in the entry data, applies journey according to described
The installation root pathname of sequence and the plug-in unit relative path name, obtain plug-in unit absolute path title;
File signature obtains module, if there are files under the plug-in unit absolute path title, file acquisition function is called to obtain
The file signature of existing file under the plug-in unit absolute path title;
Card i/f discre value obtains module, if the file signature and any in stored plug-in card configuration message file
Plug-in unit signature is identical, calls plug-in unit to export function, obtains the card i/f discre value of the plug-in unit;
Plug-in unit loading module, if inserting in the card i/f discre value of the plug-in unit and stored plug-in card configuration message file
The Universally Unique Identifier value of part interface is identical, calls plug-in unit loading function, described in the card i/f load using the plug-in unit
Plug-in unit.
7. the device of load plug-in unit according to claim 6, which is characterized in that the plug-in card configuration message file uses can
Extending mark language editor, comprising: plug-in unit mark, plug-in unit relative path name, plug-in unit signature and card i/f it is general only
One identity value.
8. the device of load plug-in unit according to claim 6, which is characterized in that the plug-in unit exports function and is
DllGetClassObject function.
9. the device of load plug-in unit according to claim 6, which is characterized in that the card i/f includes: that plug-in unit is initial
Beggar's interface, plug-in unit are counter to be initialized sub-interface, starting plug-in unit sub-interface and stops plug-in unit sub-interface, the plug-in unit loading function
For LoadLibrary function.
10. according to the device of the described in any item load plug-in units of claim 6 to 9, which is characterized in that described device further include:
Module is exited in plug-in unit load, if not there is no file under the plug-in unit absolute path title;Or, if the file signature
It is all different with any plug-in unit signature in stored plug-in card configuration message file;Or, if the card i/f of the plug-in unit
Discre value is not identical as the Universally Unique Identifier value of the card i/f in stored plug-in card configuration message file, exits loading
The process of the plug-in unit.
11. a kind of electronic equipment, which is characterized in that the electronic equipment includes: shell, processor, memory, circuit board and electricity
Source circuit, wherein circuit board is placed in the space interior that shell surrounds, and processor and memory setting are on circuit boards;Power supply
Circuit, for each circuit or the device power supply for above-mentioned electronic equipment;Memory is for storing executable program code;Processing
Device runs program corresponding with executable program code by reading the executable program code stored in memory, for holding
The method of plug-in unit is loaded described in the aforementioned any claim 1-5 of row.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610219485.2A CN105912362B (en) | 2016-04-11 | 2016-04-11 | A kind of method, apparatus and electronic equipment loading plug-in unit |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610219485.2A CN105912362B (en) | 2016-04-11 | 2016-04-11 | A kind of method, apparatus and electronic equipment loading plug-in unit |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105912362A CN105912362A (en) | 2016-08-31 |
CN105912362B true CN105912362B (en) | 2019-02-26 |
Family
ID=56744854
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610219485.2A Active CN105912362B (en) | 2016-04-11 | 2016-04-11 | A kind of method, apparatus and electronic equipment loading plug-in unit |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105912362B (en) |
Families Citing this family (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109614158B (en) * | 2017-09-30 | 2021-11-26 | 北京国双科技有限公司 | Plug-in calling method, system, storage medium and processor |
CN110032400A (en) * | 2018-01-09 | 2019-07-19 | 武汉斗鱼网络科技有限公司 | A kind of method and electric terminal loading plug-in unit |
CN109491718A (en) * | 2018-09-13 | 2019-03-19 | 北京米文动力科技有限公司 | A kind of plug-in loading method and equipment |
CN112579191A (en) * | 2019-09-29 | 2021-03-30 | 华为终端有限公司 | Component loading method, device and system |
CN110855656B (en) * | 2019-11-06 | 2022-07-12 | 云深互联(北京)科技有限公司 | Plug-in flow proxy method, device and system capable of realizing application server protection |
CN111026466A (en) * | 2019-12-03 | 2020-04-17 | 成都卫士通信息产业股份有限公司 | File processing method and device, computer readable storage medium and electronic equipment |
CN112667246B (en) * | 2021-01-08 | 2024-03-01 | 深圳前海微众银行股份有限公司 | Application function expansion method and device and electronic equipment |
CN114296820A (en) * | 2021-12-23 | 2022-04-08 | 北京知道创宇信息技术股份有限公司 | Plug-in address adding method and device, server and storage medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102760068A (en) * | 2012-06-01 | 2012-10-31 | 奇智软件(北京)有限公司 | Loading method of Active X plugin and device |
CN102883324A (en) * | 2012-10-19 | 2013-01-16 | 广州市动景计算机科技有限公司 | Security verification method, security verification device and mobile terminal for plugin call in mobile terminal |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7434215B2 (en) * | 2003-09-11 | 2008-10-07 | International Business Machines Corporation | Mechanism for loading plugin classes at an appropriate location in the class loader hierarchy |
-
2016
- 2016-04-11 CN CN201610219485.2A patent/CN105912362B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102760068A (en) * | 2012-06-01 | 2012-10-31 | 奇智软件(北京)有限公司 | Loading method of Active X plugin and device |
CN102883324A (en) * | 2012-10-19 | 2013-01-16 | 广州市动景计算机科技有限公司 | Security verification method, security verification device and mobile terminal for plugin call in mobile terminal |
Also Published As
Publication number | Publication date |
---|---|
CN105912362A (en) | 2016-08-31 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105912362B (en) | A kind of method, apparatus and electronic equipment loading plug-in unit | |
CN106569869B (en) | Plug-in unit packaging method and device | |
CN109597661B (en) | Service function configuration method and device | |
CN106383786B (en) | Interface pressure performance testing method and device and electronic equipment | |
CN109358936A (en) | Information processing method, device, storage medium, electronic equipment and system | |
CN104881318B (en) | A kind of interface call method, device and terminal | |
CN103970563B (en) | The method of dynamic load Android class | |
CN109062617A (en) | A kind of application method, the mobile terminal of platform that supporting polymorphic type equipment | |
CN110489101A (en) | Interface analogy method, system, medium and electronic equipment | |
CN108829467B (en) | Third-party platform docking implementation method, device, equipment and storage medium | |
CN105718289A (en) | Component relationship establishing method and equipment | |
CN102946415B (en) | A kind of implementation method of mobile terminal this locality application and device | |
CN110531962A (en) | Development process method, equipment and the computer readable storage medium of small routine | |
CN111399840B (en) | Module development method and device | |
CN110442327A (en) | A kind of application builds method, apparatus, server | |
CN108282518A (en) | A kind of customer terminal webpage generation method and device | |
CN104238881A (en) | Terminal information display method and device and terminal | |
CN109710333A (en) | Processing method, equipment and the computer readable storage medium of boarding application | |
CN102262684A (en) | Method and device for generating webpage page of mobile terminal | |
CN109710265A (en) | Method and device for acquiring software installation package and electronic equipment | |
US10475298B1 (en) | Assisting cable use by locating connector ends of the cable | |
CN108170430A (en) | A kind of method and system of showing interface | |
CN106203069B (en) | A kind of hold-up interception method of dynamic link library file, device and terminal device | |
CN111090971A (en) | Method and device for exporting multi-source information as Excel file | |
CN109862399A (en) | It shows the method for rich media information, handle method, computer installation and the computer readable storage medium of rich media information |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
TA01 | Transfer of patent application right | ||
TA01 | Transfer of patent application right |
Effective date of registration: 20190109 Address after: Room 105-53811, No. 6 Baohua Road, Hengqin New District, Shenzhen City, Guangdong Province Applicant after: Zhuhai Leopard Technology Co.,Ltd. Address before: 100085 East District, Second Floor, 33 Xiaoying West Road, Haidian District, Beijing Applicant before: BEIJING KINGSOFT INTERNET SECURITY SOFTWARE Co.,Ltd. |
|
GR01 | Patent grant | ||
GR01 | Patent grant |