CN103176834A - Method and device for calling expansion interface - Google Patents

Method and device for calling expansion interface Download PDF

Info

Publication number
CN103176834A
CN103176834A CN2011104417157A CN201110441715A CN103176834A CN 103176834 A CN103176834 A CN 103176834A CN 2011104417157 A CN2011104417157 A CN 2011104417157A CN 201110441715 A CN201110441715 A CN 201110441715A CN 103176834 A CN103176834 A CN 103176834A
Authority
CN
China
Prior art keywords
expansion interface
data structure
interface
parameter
browser kernel
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
CN2011104417157A
Other languages
Chinese (zh)
Other versions
CN103176834B (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201110441715.7A priority Critical patent/CN103176834B/en
Publication of CN103176834A publication Critical patent/CN103176834A/en
Application granted granted Critical
Publication of CN103176834B publication Critical patent/CN103176834B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • User Interface Of Digital Computer (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention discloses a method and a device for calling an expansion interface, and belongs to the field of computers. The method for calling the expansion interface comprises the following steps of receiving an identifier of the expansion interface needing to calling by a browser kernel and corresponding parameters of the expansion interface; parsing the corresponding parameters of the expansion interface, and converting the corresponding parameters of the expansion interface into parameters of universal data structure, wherein the universal data structure can be identified by the expansion interface; calling an expansion interface corresponding to the identifier of the expansion interface to enable the expansion interface to operate according to the parameters of the universal data structure, and obtaining operation results; and encapsulating the operation results through a data structure supported by the browser kernel, and sending the encapsulated operation results to the browser kernel. The device for calling the expansion interface comprises a receiving module, a parsing module, a calling module, and a first encapsulating module. According to the method and the device for calling the expansion interface, development cost of a multi-kernel browser can be reduced.

Description

A kind of method of invoke extensions interface and device
Technical field
The present invention relates to computer realm, particularly a kind of method of invoke extensions interface and device.
Background technology
When exploitation Web (webpage) used, the application interface that browser often occurring provides can not satisfy the demand that Web uses, and so need to expand the ability of browser kernel; The technician can develop expansion interface at present, and browser kernel can satisfy the demand that Web uses by the invoke extensions interface, thereby realizes the ability of browser kernel is expanded.
Wherein, present expansion interface all is based on specific browser kernel exploitation, make the corresponding cover expansion interface of every kind of browser kernel, and every kind of browser kernel can only call its corresponding expansion interface, for example, IE (Internet Explorer, internet browser) kernel and WebKit kernel are present two kinds of common browser kernels, overlap for the IE kernel development goes out one of its correspondence the ability that expansion interface is expanded the IE kernel; And for going out one of correspondence, the WebKit kernel development overlaps the ability that expansion interface is expanded the WebKit kernel.
In realizing process of the present invention, the inventor finds that there is following problem at least in prior art:
The multinuclear browser occurs at present, in order to expand the ability of the browser kernel in browser, need to develop a cover expansion interface of its correspondence for each browser kernel in the multinuclear browser, so increased the cost of development of multinuclear browser.
Summary of the invention
In order to reduce the cost of development of multinuclear browser, the invention provides a kind of method and device of invoke extensions interface.Described technical scheme is as follows:
A kind of method of invoke extensions interface, described method comprises:
Sign and the parameter corresponding to described expansion interface of the expansion interface that the reception browser kernel need to call;
The parameter that described expansion interface is corresponding is resolved, and the parameter that described expansion interface is corresponding converts the parameter of common data structure to, and described common data structure is the data structure that described expansion interface can be identified;
Call the expansion interface of the sign correspondence of described expansion interface, described expansion interface is moved according to the parameter of described common data structure, obtain operation result;
Adopt the data structure that described browser kernel is supported that described operation result is encapsulated, the operation result of described encapsulation is sent to described browser kernel.
Described parameter corresponding to described expansion interface resolved, the parameter that described expansion interface is corresponding converts the parameter of common data structure to, comprising:
Obtain parsing interface corresponding to described browser kernel;
Parse by described parsing interface the data structure that parameter corresponding to the described browser kernel described expansion interface of encapsulation adopts, obtain the data structure that described browser kernel is supported;
According to the data structure that described browser kernel is supported, parameter corresponding to described expansion interface carried out decapsulation, obtain the parameter of common data structure.
Described parsing interface corresponding to described browser kernel that obtains comprises:
Obtain the type of described browser kernel, determine the sign of corresponding parsing interface according to the type of described browser kernel;
From the corresponding relation of the sign of the parsing receiving port stored and index, obtain index corresponding to described parsing interface;
The index corresponding according to described parsing interface obtains described parsing interface from terminal this locality.
The described expansion interface that calls the sign correspondence of described expansion interface makes described expansion interface move according to the parameter of described common data structure, obtains operation result, comprising:
From the corresponding relation of the sign of the expansion interface stored and index, obtain index corresponding to described expansion interface according to the sign of described expansion interface;
Obtain described expansion interface according to the described index that obtains from terminal this locality, the parameter of the corresponding common data structure of described expansion interface is transferred to described expansion interface, described expansion interface is moved according to the parameter of the corresponding common data structure of described expansion interface, obtain operation result.
Described described expansion interface is moved according to the parameter of described common data structure, obtains operation result, also comprise:
In the process that described expansion interface moves according to the parameter of described common data structure, if described expansion interface produces event, adopt the data structure that described browser kernel is supported that described event is encapsulated, and the event of described encapsulation is submitted to described browser kernel, by described browser kernel, described event is processed.
A kind of device of invoke extensions interface, described device comprises:
Receiver module be used for to receive sign and the parameter corresponding to described expansion interface of the expansion interface that browser kernel need to call;
Parsing module is used for parameter corresponding to described expansion interface resolved, and the parameter that described expansion interface is corresponding converts the parameter of common data structure to, and described common data structure is the data structure that described expansion interface can be identified;
Calling module, the expansion interface for the sign correspondence of calling described expansion interface makes described expansion interface move according to the parameter of described common data structure, obtains operation result;
The first package module is used for adopting the data structure that described browser kernel is supported that described operation result is encapsulated, and the operation result of described encapsulation is sent to described browser kernel.
Described parsing module comprises:
The first acquiring unit is used for obtaining parsing interface corresponding to described browser kernel;
Resolution unit is used for parsing by described parsing interface the data structure that parameter corresponding to the described browser kernel described expansion interface of encapsulation adopts, and obtains the data structure that described browser kernel is supported;
Decapsulation unit is used for according to the data structure that described browser kernel is supported, parameter corresponding to described expansion interface being carried out decapsulation, obtains the parameter of common data structure.
Described the first acquiring unit comprises:
First obtains subelement, is used for obtaining the type of described browser kernel, determines the sign of corresponding parsing interface according to the type of described browser kernel;
Second obtains subelement, is used for obtaining index corresponding to described parsing interface from the sign of the parsing interface stored and the corresponding relation of index;
The 3rd obtains subelement, is used for the index corresponding according to described parsing interface and obtains described parsing interface from terminal this locality.
Described calling module comprises:
Second acquisition unit is used for according to the sign of described expansion interface obtaining index corresponding to described expansion interface from the sign of the expansion interface stored and the corresponding relation of index;
The operation unit, be used for obtaining described expansion interface according to the described index that obtains from terminal this locality, the parameter of the corresponding common data structure of described expansion interface is transferred to described expansion interface, described expansion interface is moved according to the parameter of the corresponding common data structure of described expansion interface, obtain operation result.
Described device also comprises:
The second package module, be used for working as the process that described expansion interface moves according to the parameter of described common data structure, if described expansion interface produces event, adopt the data structure that described browser kernel is supported that described event is encapsulated, and the event of described encapsulation is submitted to described browser kernel, by described browser kernel, described event is processed.
in the present invention, sign and the parameter corresponding to this expansion interface of the expansion interface that the reception browser kernel need to call, the parameter that this expansion interface is corresponding is resolved, the parameter that this expansion interface is corresponding is changed the parameter of the common data structure that this expansion interface can identify, call the expansion interface of the sign correspondence of this expansion interface, this expansion interface is moved according to the parameter of common data structure obtain operation result, the data structure that adopts this browser kernel to support encapsulates operation result, operation result after encapsulation is sent to this browser kernel, so only need to go out a cover expansion interface for the multinuclear Development of Web Browser, each browser kernel in this multinuclear browser can be shared this cover expansion interface, thereby reduce the cost of development of multinuclear browser, in addition, the exploitation of expansion interface need to be based on concrete browser kernel, and browser kernel and expansion interface are fully independent, has higher extendability from making the multinuclear browser.
Description of drawings
Fig. 1 is the method flow diagram of a kind of invoke extensions interface of providing of the embodiment of the present invention 1;
Fig. 2 is the method flow diagram of a kind of invoke extensions interface of providing of the embodiment of the present invention 2;
Fig. 3 is a kind of multinuclear browser structure schematic diagram that the embodiment of the present invention 2 provides;
Fig. 4 is the configuration diagram of a kind of WebKit kernel of providing of the embodiment of the present invention 2;
Fig. 5 is the configuration diagram of a kind of IE kernel of providing of the embodiment of the present invention 2;
Fig. 6 is the apparatus structure schematic diagram of a kind of invoke extensions interface of providing of the embodiment of the present invention 3.
Embodiment
For making the purpose, technical solutions and advantages of the present invention clearer, embodiment of the present invention is described further in detail below in conjunction with accompanying drawing.
Embodiment 1
As shown in Figure 1, the embodiment of the present invention provides a kind of method of invoke extensions interface, comprising:
Step 101: sign and the parameter corresponding to this expansion interface of the expansion interface that the reception browser kernel need to call;
Step 102: the parameter that this expansion interface is corresponding is resolved, and the parameter that this expansion interface is corresponding converts the parameter of common data structure form to, the data structure that common data structure can be identified for this expansion interface;
Step 103: call the expansion interface of the sign correspondence of this expansion interface, this expansion interface is moved according to the parameter of common data structure, obtain operation result;
Step 104: the data structure that adopts browser kernel to support encapsulates operation result, and the operation result that encapsulates is sent to browser kernel.
Wherein, above-mentioned steps 102 can comprise:
1021: obtain parsing interface corresponding to browser kernel;
1022: parse browser kernel by this parsing interface and encapsulate the data structure that parameter corresponding to this expansion interface adopts, obtain the data structure that browser kernel is supported;
1023: according to the data structure that browser kernel is supported, parameter corresponding to this expansion interface carried out decapsulation, obtain the parameter of common data structure.
Wherein, above-mentioned steps 1021 can comprise:
(1): obtain the type of browser kernel, determine the sign of corresponding parsing interface according to the type of browser kernel;
(2): from the corresponding relation of the sign of the parsing interface stored and index, obtain index corresponding to this parsing interface;
(3): the index corresponding according to this parsing interface obtains this parsing interface from terminal this locality.
Wherein, above-mentioned steps 103 can comprise:
1031: from the corresponding relation of the sign of expansion interface and index, obtain index corresponding to this expansion interface according to the sign of this expansion interface;
1032: obtain this expansion interface according to the index that obtains from terminal this locality, the parameter of the corresponding common data structure of this expansion interface is transferred to this expansion interface, and this expansion interface is moved according to the parameter of the corresponding common data structure of this expansion interface, obtain operation result.
Further, the method also comprises:
In the process that this expansion interface moves according to the parameter of common data structure, if this expansion interface produces event, adopt the data structure that browser kernel is supported that the event that produces is encapsulated, and the event of encapsulation is submitted to browser kernel, by browser kernel, the event of encapsulation is processed.
Wherein, in the present invention, terminal comprises client, Web terminal or wireless terminal, and is identical therewith in the implication of other local terminals that occur of the present invention, explanation no longer one by one.
in embodiments of the present invention, the sign of the expansion interface that the reception browser kernel need to call and the parameter of this expansion interface, obtain the data structure that this browser kernel is supported, the parameter of this expansion interface is converted to the parameter of the common data structure that this expansion interface can identify, call the expansion interface of the sign correspondence of this expansion interface, the parameter of common data structure is transferred to this expansion interface, this expansion interface is moved according to the parameter of common data structure, obtain operation result, the data structure that adopts this browser kernel to support encapsulates operation result, operation result after encapsulation is sent to this browser kernel, so only need to go out a cover expansion interface for the multinuclear Development of Web Browser, each browser kernel in this multinuclear browser can be shared this cover expansion interface, thereby reduce the cost of exploitation multinuclear browser.
Embodiment 2
The embodiment of the present invention provides a kind of method of invoke extensions interface.Wherein, in the present embodiment, for multinuclear Development of Web Browser one overlaps expansion interface and a calling device is set in the multinuclear browser, when the browser kernel in this multinuclear browser needs the invoke extensions interface, the expansion interface that calling device can need to call by this browser kernel of method call that this enforcement provides, referring to Fig. 2, the method comprises:
Step 201: the sign and parameter corresponding to this expansion interface that receive the expansion interface that needs that this browser kernel sends call;
Wherein, the code that the text that browser kernel is used Web comprises is resolved, use when needing the invoke extensions interface when parsing this Web, obtain the sign of the expansion interface that need to call and the parameter of this expansion interface from the body of an instrument spare that this Web uses, then this browser kernel adopts the data structure himself supported that the parameter of this expansion interface is encapsulated, then sends the sign of this expansion interface and parameter corresponding to this expansion interface after encapsulation to calling device.Wherein, the sign of expansion interface can be the title of this expansion interface.
Wherein, defined the browser kernel that uses during this Web is applied in the multinuclear browser in the file file that Web uses, comprise also in the file file that Web uses that Web is applied in the displaying contents that shows in browser, the layout information of each displaying contents and the script that is used for realizing action, the displaying contents that Web uses can be picture, word and/or button etc., the layout information of displaying contents can comprise the position of displaying contents, color and/or size etc.
Wherein, referring to Fig. 3, browser kernel provides running environment for the code that the file file of resolving the Web application comprises, browser kernel comprises typesetting engine and script engine at least, typesetting engine makes an explanation, arranges and play up for Web is used the layout information of realizing displaying contents and each displaying contents, and script engine is used for Web is used for the script of realizing action resolves.
Wherein, when certain Web of operation uses in the multinuclear browser, calling device is determined this Web and is used the browser kernel that uses, each displaying contents that the file file that this Web is used comprises and the layout information of each displaying contents are submitted to the typesetting engine of this browser kernel, and the text that this Web uses is comprised the script engine of submitting to this browser kernel for the script of realizing action; Then the typesetting engine of this browser kernel makes an explanation, arranges and play up the layout information of each displaying contents and each displaying contents, when needing the invoke extensions interface in the process of explaining, arrange and playing up, obtain sign and the parameter corresponding to this expansion interface of this expansion interface from the layout information of each displaying contents and each displaying contents, and adopt the data structure that this browser kernel is supported that parameter corresponding to this expansion interface encapsulated, and the sign of this expansion interface and the parameter after encapsulation are sent to calling device; And, the text that the script engine of this browser kernel is used this Web comprises for the script of realizing action resolves, when needing the invoke extensions interface in the process of resolving, from being used for realizing that the script of action obtains sign and the parameter corresponding to this expansion interface of this expansion interface, and adopt the data structure that this browser kernel is supported that parameter corresponding to this expansion interface encapsulated, and the sign of this expansion interface and the parameter after encapsulation are sent to calling device.
wherein, WebKit kernel and IE kernel are present two kinds of common browser kernels, the framework of WebKit kernel shown in Figure 4, the WebKit kernel is except comprising typesetting engine and script engine, also comprise binding interface and port, the typesetting engine of WebKit kernel can be WebCore, script engine can be JavaScript, at least comprise in typesetting engine for the content interpret unit of explaining displaying contents, for the layout Interpretation unit of the layout information of explaining displaying contents and for the layout rendering unit of displaying contents being arranged and play up according to the layout information of displaying contents, typesetting engine and script engine are undertaken alternately by the binding interface, typesetting engine and script engine are undertaken by the outside of port and WebKit kernel alternately.
The framework of IE kernel shown in Figure 5, the IE kernel is except comprising typesetting engine and script engine, also comprise network communication interface and port, the typesetting engine of IE kernel can be Trident, script engine can be MS Jscript engine (Microsoft Jscript engine, Microsoft's script engine), the IE kernel can communicate by network communication interface and network, and is undertaken alternately by the outside of port and IE kernel.
Step 202: the parameter that this expansion interface is corresponding is resolved, obtain the data structure that this browser kernel is supported, and the parameter that this expansion interface is corresponding converts the parameter of common data structure to, the data structure that common data structure can be identified for this expansion interface;
Particularly, obtain parsing interface corresponding to this browser kernel, parse this browser kernel by this parsing interface and encapsulate the data structure that parameter corresponding to this expansion interface adopts, obtain the data structure that this browser kernel is supported, and according to the data structure that this browser kernel is supported, parameter corresponding to this expansion interface carried out decapsulation, obtain the parameter of common data structure.
Wherein, be parsing interface corresponding to each browser kernel configuration in the multinuclear browser in advance, and the installation kit of this multinuclear browser comprise the parsing interface that each browser kernel is corresponding; Terminal can each browser kernel is corresponding when the installation kit of multinuclear browser is installed the parsing interface be stored in terminal this locality, and terminal can form the sign of parsing interface and the corresponding relation of index when the installation kit of this multinuclear browser is installed, and the index of each parsing interface of storing in the sign of parsing interface and the corresponding relation of index points to respectively each parsing interface of the local storage of terminal.
Wherein, obtain the operation of parsing interface corresponding to this browser kernel, can be specially:
Obtain the type of this browser kernel, determine the sign of corresponding parsing interface according to the type of this browser kernel, and from the corresponding relation of the sign of the parsing interface stored and index, obtain index corresponding to this parsing interface, obtain corresponding parsing interface according to the index of this parsing interface from terminal this locality.
Wherein, the type of present common browser kernel comprises IE kernel and WebKit kernel etc.
Wherein, in the present embodiment, can be with the defined data structure of certain programming language as common data structure, such as can be with data structures such as the defined shaping of C++ programming language, character string types as common data structure; In addition, the technician can adopt common data structure to develop a cover expansion interface corresponding to multinuclear browser, so each expansion interface corresponding to this multinuclear browser can be identified the data of common data structure.
Step 203: call corresponding expansion interface according to the sign of this expansion interface, this expansion interface is moved according to the parameter of this common data structure, obtain operation result;
Wherein, the embedded browser object of multinuclear browser (for example, widndow (window) object and document (document) object etc.), in advance each browser object expanded and developed expansion interface, obtain a cover expansion interface corresponding to this multinuclear browser configuration, and the installation kit of this multinuclear browser comprises the cover expansion interface that this multinuclear browser is corresponding; Terminal can the cover expansion interface that this multinuclear browser is corresponding when the installation kit of multinuclear browser is installed be stored in terminal this locality, and terminal can form the sign of expansion interface and the corresponding relation of index when installation kit is installed, and the index of each expansion interface in the sign of expansion interface and the corresponding relation of index points to respectively each expansion interface of the local storage of terminal.
Particularly, according to the sign of this expansion interface from the corresponding relation of the sign of the expansion interface stored and index, obtain index corresponding to this expansion interface, obtain this expansion interface according to the index that obtains from terminal this locality, the parameter of the common data structure that this expansion interface is corresponding is transferred to this expansion interface, the parameter of this expansion interface common data structure corresponding according to this expansion interface is moved, obtained operation result.
Wherein, need to prove: in the present embodiment, can adopt tree form data structure at the local storing and resolving interface of terminal and expansion interface, node in tree form data structure is used for storing and resolving interface or expansion interface, and the node that is used for this parsing interface of storage in the sign of the resolving interface index point tree form data structure corresponding with parsing interface in the corresponding relation of index, and, be used for the node of this expansion interface of storage in the sign of the expansion interface index point tree form data structure corresponding with expansion interface in the corresponding relation of index.
Step 204: adopt the data structure that this browser kernel is supported that the operation result that obtains is encapsulated, and the operation result after encapsulating sends to this browser kernel.
Wherein, every kind of browser kernel can only be identified the data of its data structure of supporting, in the present embodiment, the data-switching that the data structure that every kind of browser kernel is adopted encapsulates becomes the data of common data structure, and a cover expansion interface of exploitation can be identified the data of common data structure; In addition, the data structure that adopts browser kernel to support encapsulates operation result, makes the operation result after browser kernel can be identified encapsulation, thereby operation result is processed.
Further, in the process that this expansion interface moves according to the parameter of the corresponding common data structure of this expansion interface, if this expansion interface produces event, the data structure that can adopt this browser kernel to support encapsulates this event, and the event after encapsulating submits to this browser kernel, by this browser kernel, this event processed.
in embodiments of the present invention, the sign of the expansion interface that the reception browser kernel need to call and the parameter of this expansion interface, obtain the data structure that this browser kernel is supported, the parameter of this expansion interface is converted to the parameter of the common data structure that this expansion interface can identify, call the expansion interface of the sign correspondence of this expansion interface, this expansion interface is moved according to the parameter of common data structure obtain operation result, the data structure that adopts this browser kernel to support encapsulates operation result, operation result after encapsulation is sent to this browser kernel, so only need to go out a cover expansion interface for the multinuclear Development of Web Browser, each browser kernel in this multinuclear browser can be shared this cover expansion interface, thereby reduce the cost of exploitation multinuclear browser.
Embodiment 3
As shown in Figure 4, the embodiment of the present invention provides a kind of device of invoke extensions interface, comprising:
Receiver module 301 be used for to receive sign and the parameter corresponding to this expansion interface of the expansion interface that browser kernel need to call;
Parsing module 302 is used for parameter corresponding to this expansion interface resolved, and the parameter that this expansion interface is corresponding converts the parameter of common data structure to, the data structure that common data structure can be identified for this expansion interface;
Calling module 303, the expansion interface for the sign correspondence of calling this expansion interface makes this expansion interface move according to the parameter of common data structure, obtains operation result;
The first package module 304, the data structure that is used for adopting this browser kernel to support encapsulates operation result, and the operation result that encapsulates is sent to this browser kernel.
Wherein, parsing module 302 comprises:
The first acquiring unit is used for obtaining parsing interface corresponding to this browser kernel;
Resolution unit is used for parsing this browser kernel by this parsing interface and encapsulates the data structure that parameter corresponding to this expansion interface adopts, and obtains the data structure that this browser kernel is supported;
Decapsulation unit is used for according to the data structure that this browser kernel is supported, parameter corresponding to this expansion interface being carried out decapsulation, obtains the parameter of common data structure.
Wherein, the first acquiring unit comprises:
First obtains subelement, is used for obtaining the type of this browser kernel, determines the sign of corresponding parsing interface according to the type of this browser kernel;
Second obtains subelement, is used for obtaining index corresponding to this parsing interface from the sign of the parsing interface stored and the corresponding relation of index;
The 3rd obtains subelement, is used for the index corresponding according to this parsing interface and obtains this parsing interface from terminal this locality.
Wherein, calling module 303 comprises:
Second acquisition unit is used for according to the sign of this expansion interface obtaining index corresponding to this expansion interface from the sign of the expansion interface stored and the corresponding relation of index;
The operation unit, be used for obtaining this expansion interface according to the index that obtains from terminal this locality, the parameter of the corresponding common data structure of this expansion interface is transferred to this expansion interface, this expansion interface is moved according to the parameter of the corresponding common data structure of this expansion interface, obtain operation result.
Further, this device also comprises:
The second package module, be used for working as the process that this expansion interface moves according to the parameter of common data structure, if this expansion interface produces event, adopt the data structure that this browser kernel is supported that the event that produces is encapsulated, and the event of encapsulation is submitted to this browser kernel, by this browser kernel, the event of encapsulation is processed.
in embodiments of the present invention, the sign of the expansion interface that the reception browser kernel need to call and the parameter of this expansion interface, obtain the data structure that this browser kernel is supported, the parameter of this expansion interface is converted to the parameter of the common data structure that this expansion interface can identify, call the expansion interface of the sign correspondence of this expansion interface, this expansion interface is moved according to the parameter of common data structure, obtain operation result, the data structure that adopts this browser kernel to support encapsulates operation result, operation result after encapsulation is sent to this browser kernel, so only need to go out a cover expansion interface for the multinuclear Development of Web Browser, each browser kernel in this multinuclear browser can be shared this cover expansion interface, thereby reduce the cost of exploitation multinuclear browser.
Need to prove: the device of a kind of invoke extensions interface that above-described embodiment provides is when the invoke extensions interface, only the division with above-mentioned each functional module is illustrated, in practical application, can as required above-mentioned functions be distributed and be completed by different functional modules, the inner structure that is about to device is divided into different functional modules, to complete all or part of function described above.In addition, above-described embodiment provides the device of invoke extensions interface and the embodiment of the method for invoke extensions interface to belong to same design, and its specific implementation process sees embodiment of the method for details, repeats no more here.
One of ordinary skill in the art will appreciate that all or part of step that realizes above-described embodiment can complete by hardware, also can come the relevant hardware of instruction to complete by program, described program can be stored in a kind of computer-readable recording medium, the above-mentioned storage medium of mentioning can be ROM (read-only memory), disk or CD etc.
The above is only preferred embodiment of the present invention, and is in order to limit the present invention, within the spirit and principles in the present invention not all, any modification of doing, is equal to replacement, improvement etc., within all should being included in protection scope of the present invention.

Claims (10)

1. the method for an invoke extensions interface, is characterized in that, described method comprises:
Sign and the parameter corresponding to described expansion interface of the expansion interface that the reception browser kernel need to call;
The parameter that described expansion interface is corresponding is resolved, and the parameter that described expansion interface is corresponding converts the parameter of common data structure to, and described common data structure is the data structure that described expansion interface can be identified;
Call the expansion interface of the sign correspondence of described expansion interface, described expansion interface is moved according to the parameter of described common data structure, obtain operation result;
Adopt the data structure that described browser kernel is supported that described operation result is encapsulated, the operation result of described encapsulation is sent to described browser kernel.
2. the method for claim 1, is characterized in that, described parameter corresponding to described expansion interface resolved, and the parameter that described expansion interface is corresponding converts the parameter of common data structure to, comprising:
Obtain parsing interface corresponding to described browser kernel;
Parse by described parsing interface the data structure that parameter corresponding to the described browser kernel described expansion interface of encapsulation adopts, obtain the data structure that described browser kernel is supported;
According to the data structure that described browser kernel is supported, parameter corresponding to described expansion interface carried out decapsulation, obtain the parameter of common data structure.
3. method as claimed in claim 2, is characterized in that, described parsing interface corresponding to described browser kernel that obtains comprises:
Obtain the type of described browser kernel, determine the sign of corresponding parsing interface according to the type of described browser kernel;
From the corresponding relation of the sign of the parsing interface stored and index, obtain index corresponding to described parsing interface;
The index corresponding according to described parsing interface obtains described parsing interface from terminal this locality.
4. the method for claim 1, is characterized in that, the described expansion interface that calls the sign correspondence of described expansion interface makes described expansion interface move according to the parameter of described common data structure, obtains operation result, comprising:
From the corresponding relation of the sign of the expansion interface stored and index, obtain index corresponding to described expansion interface according to the sign of described expansion interface;
Obtain described expansion interface according to the described index that obtains from terminal this locality, the parameter of the corresponding common data structure of described expansion interface is transferred to described expansion interface, described expansion interface is moved according to the parameter of the corresponding common data structure of described expansion interface, obtain operation result.
5. as the described method of claim 1-4 any one claim, it is characterized in that, described described expansion interface moved according to the parameter of described common data structure, obtain operation result, also comprise:
In the process that described expansion interface moves according to the parameter of described common data structure, if described expansion interface produces event, adopt the data structure that described browser kernel is supported that described event is encapsulated, and the event of described encapsulation is submitted to described browser kernel, by described browser kernel, described event is processed.
6. the device of an invoke extensions interface, is characterized in that, described device comprises:
Receiver module be used for to receive sign and the parameter corresponding to described expansion interface of the expansion interface that browser kernel need to call;
Parsing module is used for parameter corresponding to described expansion interface resolved, and the parameter that described expansion interface is corresponding converts the parameter of common data structure to, and described common data structure is the data structure that described expansion interface can be identified;
Calling module, the expansion interface for the sign correspondence of calling described expansion interface makes described expansion interface move according to the parameter of described common data structure, obtains operation result;
The first package module is used for adopting the data structure that described browser kernel is supported that described operation result is encapsulated, and the operation result of described encapsulation is sent to described browser kernel.
7. device as claimed in claim 6, is characterized in that, described parsing module comprises:
The first acquiring unit is used for obtaining parsing interface corresponding to described browser kernel;
Resolution unit is used for parsing by described parsing interface the data structure that parameter corresponding to the described browser kernel described expansion interface of encapsulation adopts, and obtains the data structure that described browser kernel is supported;
Decapsulation unit is used for according to the data structure that described browser kernel is supported, parameter corresponding to described expansion interface being carried out decapsulation, obtains the parameter of common data structure.
8. device as claimed in claim 7, is characterized in that, described the first acquiring unit comprises:
First obtains subelement, is used for obtaining the type of described browser kernel, determines the sign of corresponding parsing interface according to the type of described browser kernel;
Second obtains subelement, is used for obtaining index corresponding to described parsing interface from the sign of the parsing interface stored and the corresponding relation of index;
The 3rd obtains subelement, is used for the index corresponding according to described parsing interface and obtains described parsing interface from terminal this locality.
9. device as claimed in claim 6, is characterized in that, described calling module comprises:
Second acquisition unit is used for according to the sign of described expansion interface obtaining index corresponding to described expansion interface from the sign of the expansion interface stored and the corresponding relation of index;
The operation unit, be used for obtaining described expansion interface according to the described index that obtains from terminal this locality, the parameter of the corresponding common data structure of described expansion interface is transferred to described expansion interface, described expansion interface is moved according to the parameter of the corresponding common data structure of described expansion interface, obtain operation result.
10. as the described device of claim 6-9 any one claim, it is characterized in that, described device also comprises:
The second package module, be used for working as the process that described expansion interface moves according to the parameter of described common data structure, if described expansion interface produces event, adopt the data structure that described browser kernel is supported that described event is encapsulated, and the event of described encapsulation is submitted to described browser kernel, by described browser kernel, described event is processed.
CN201110441715.7A 2011-12-26 2011-12-26 A kind of method of invoke extensions interface and device Active CN103176834B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110441715.7A CN103176834B (en) 2011-12-26 2011-12-26 A kind of method of invoke extensions interface and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110441715.7A CN103176834B (en) 2011-12-26 2011-12-26 A kind of method of invoke extensions interface and device

Publications (2)

Publication Number Publication Date
CN103176834A true CN103176834A (en) 2013-06-26
CN103176834B CN103176834B (en) 2016-02-17

Family

ID=48636737

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110441715.7A Active CN103176834B (en) 2011-12-26 2011-12-26 A kind of method of invoke extensions interface and device

Country Status (1)

Country Link
CN (1) CN103176834B (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103955515A (en) * 2014-05-05 2014-07-30 百度在线网络技术(北京)有限公司 Processing method and device for dual-core browser
CN104281455A (en) * 2014-10-11 2015-01-14 北京金山安全软件有限公司 Interface calling method and device and terminal
CN104881318A (en) * 2015-05-07 2015-09-02 北京金山安全软件有限公司 Interface calling method and device and terminal
CN105389222A (en) * 2015-12-15 2016-03-09 中国科学院声学研究所 Method, apparatus and system for dynamically calling native interface
CN106980550A (en) * 2017-03-23 2017-07-25 青岛海信电器股份有限公司 Expansion interface call method and device
CN108334382A (en) * 2018-01-30 2018-07-27 美通云动(北京)科技有限公司 Control method, device, electronic equipment and the computer-readable medium of browser
CN110008035A (en) * 2018-12-27 2019-07-12 阿里巴巴集团控股有限公司 Data-interface extended method, data processing method, device and equipment
CN111352360A (en) * 2018-12-24 2020-06-30 深圳市优必选科技有限公司 Robot control method, robot control device, robot, and computer storage medium
CN112925589A (en) * 2019-12-06 2021-06-08 腾讯科技(深圳)有限公司 Calling method and device of expansion interface
CN112988410A (en) * 2019-12-17 2021-06-18 腾讯科技(深圳)有限公司 Calling method and device of browser extension interface, terminal and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101039320A (en) * 2005-12-29 2007-09-19 国际商业机器公司 Method and apparatus for providing an interface between a client application and a web service
CN102075800A (en) * 2011-01-11 2011-05-25 中兴通讯股份有限公司 File play control method and system based on interactive personnel television set top box

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101039320A (en) * 2005-12-29 2007-09-19 国际商业机器公司 Method and apparatus for providing an interface between a client application and a web service
CN102075800A (en) * 2011-01-11 2011-05-25 中兴通讯股份有限公司 File play control method and system based on interactive personnel television set top box

Cited By (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103955515B (en) * 2014-05-05 2018-03-30 百度在线网络技术(北京)有限公司 The processing method and processing device of double-core browser
CN103955515A (en) * 2014-05-05 2014-07-30 百度在线网络技术(北京)有限公司 Processing method and device for dual-core browser
CN104281455A (en) * 2014-10-11 2015-01-14 北京金山安全软件有限公司 Interface calling method and device and terminal
CN104881318A (en) * 2015-05-07 2015-09-02 北京金山安全软件有限公司 Interface calling method and device and terminal
CN104881318B (en) * 2015-05-07 2019-06-25 珠海豹趣科技有限公司 A kind of interface call method, device and terminal
WO2016177341A1 (en) * 2015-05-07 2016-11-10 北京金山安全软件有限公司 Interface calling method and device, and terminal
CN105389222B (en) * 2015-12-15 2018-12-21 中国科学院声学研究所 A kind of methods, devices and systems of dynamic call native interface
CN105389222A (en) * 2015-12-15 2016-03-09 中国科学院声学研究所 Method, apparatus and system for dynamically calling native interface
CN106980550A (en) * 2017-03-23 2017-07-25 青岛海信电器股份有限公司 Expansion interface call method and device
CN108334382A (en) * 2018-01-30 2018-07-27 美通云动(北京)科技有限公司 Control method, device, electronic equipment and the computer-readable medium of browser
CN111352360A (en) * 2018-12-24 2020-06-30 深圳市优必选科技有限公司 Robot control method, robot control device, robot, and computer storage medium
CN110008035A (en) * 2018-12-27 2019-07-12 阿里巴巴集团控股有限公司 Data-interface extended method, data processing method, device and equipment
CN110008035B (en) * 2018-12-27 2022-11-18 阿里巴巴集团控股有限公司 Data interface extension method, data processing method, device and equipment
CN112925589A (en) * 2019-12-06 2021-06-08 腾讯科技(深圳)有限公司 Calling method and device of expansion interface
CN112925589B (en) * 2019-12-06 2023-10-17 深圳市雅阅科技有限公司 Calling method and device of expansion interface
CN112988410A (en) * 2019-12-17 2021-06-18 腾讯科技(深圳)有限公司 Calling method and device of browser extension interface, terminal and storage medium

Also Published As

Publication number Publication date
CN103176834B (en) 2016-02-17

Similar Documents

Publication Publication Date Title
CN103176834A (en) Method and device for calling expansion interface
CN107861713B (en) Data calling method and device and computer readable storage medium
CN102929638B (en) Method and system for expanding Web application (App) functions
CN102057654B (en) Mobile device application framework
US8131753B2 (en) Apparatus and method for accessing and indexing dynamic web pages
EP2854348B1 (en) Interface display method and system of home gateway applicable to multiple display types
CN103873918A (en) Picture processing method, device and terminal
CN101465866B (en) Method for accessing WAP network based on Web terminal and transition module
CN102129364A (en) Method for embedding widget toolbar in application program and rapid widget accessing method
CN101815093A (en) Method for adapting webpage to mobile terminal and mobile terminal page adaptation device
CN103517385A (en) AP connecting method and system of Wi-Fi of Android
CN104038510A (en) IOS system transparent agent realization method and system
CN110221848A (en) APP method for updating pages, device, electronic equipment and storage medium
EP4198773A1 (en) Image processing method and apparatus, and computer readable storage medium
CN109828815A (en) Screen adaptation method, device, equipment and storage medium based on mixed mode
CN104978183A (en) Icon construction method, and terminal equipment
CN106331055A (en) Identifier generation device and method
CN104615670A (en) Method for supporting multiple rendering engines in android browser and browser
CN104850498A (en) Filling information testing method and filling information testing system
US8266514B2 (en) Map service
CN104965832A (en) Method and apparatus for accessing browser
CN104702299A (en) GNSS receiver accessed and configured by use of webpages
CN104679489A (en) System and method for internally setting web browser in online game client side
CN101533409B (en) Network browser system and control method
CN102957585B (en) The data transmission method of a kind of Ethernet and data transmission device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant