CN103177040A - Method and device for calling functions of webpage application - Google Patents

Method and device for calling functions of webpage application Download PDF

Info

Publication number
CN103177040A
CN103177040A CN2011104417123A CN201110441712A CN103177040A CN 103177040 A CN103177040 A CN 103177040A CN 2011104417123 A CN2011104417123 A CN 2011104417123A CN 201110441712 A CN201110441712 A CN 201110441712A CN 103177040 A CN103177040 A CN 103177040A
Authority
CN
China
Prior art keywords
script
local
web
service
interface
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN2011104417123A
Other languages
Chinese (zh)
Inventor
黄奎
屈超
李临
孟昭俊
常平
谢昕虬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN2011104417123A priority Critical patent/CN103177040A/en
Publication of CN103177040A publication Critical patent/CN103177040A/en
Pending legal-status Critical Current

Links

Abstract

The invention discloses a method and a device for calling functions of webpage application and belongs to the field of computers. The method for calling the functions of the webpage application comprises the following steps: extracting a Web script of a local service called by a rendering engine of a browser, wherein the Web script at least comprises the parameter of the local service called by the rendering engine of the browser; and sending the Web script to a local assembly, and calling a corresponding local service by the local assembly according to the parameter included in the Web script. The device for calling the functions of the webpage application comprises an extracting module, a sending module and a calling module. Through sending the Web script of the local service called by the rendering engine of the browser to the local assembly, the corresponding local service is called by the local assembly, and thus the linkage between the rendering engine of the browser and the local assembly is achieved, functions that a WebApp does not have are offered by the local service, and thus the functions of the WebApp are enlarged, and the expansibility of calling the functions of the WebApp is improved.

Description

Funcall method and the device of web application
Technical field
The present invention relates to computer realm, particularly a kind of funcall method and device of web application.
Background technology
Along with the development of network technology, the kind of WebApp (web application) is more and more.Wherein, WebApp provides Web (webpage) page running environment by browser kernel, and with respect to the Web page, WebApp more emphasizes functional.
Prior art utilizes the advantage of Web to build colourful application interface when realizing the funcall of WebApp, by the Web script in browser kernel, completes corresponding function take the Web page as the basis.
In realizing process of the present invention, the inventor finds that there is following shortcoming at least in prior art:
Even WebApp can utilize the advantage of Web to build colourful application interface, but the funcall of WebApp only is confined to the own funcall of WebApp itself, and its available function is limited, causes the extendability of funcall not high.
Summary of the invention
In order to improve the function of web application, and improve the extendability of its funcall, the embodiment of the present invention provides a kind of funcall method and device of web application.Described technical scheme is as follows:
On the one hand, provide a kind of funcall method of web application, described method comprises:
Extract the Web script that browser kernel calls local service, described Web script comprises the parameter of the local service that described browser kernel calls at least;
Described Web script is sent to local component, by described local component according to local service corresponding to parameter call that comprises in described Web script.
On the other hand, provide a kind of funcall device of web application, described device comprises:
Extraction module be used for to extract the Web script that browser kernel calls local service, and described Web script comprises the parameter of the local service that described browser kernel calls at least;
Sending module is used for the Web script that described extraction module extracts is sent to local component;
Calling module is used for local service corresponding to parameter call that is comprised by the Web script that described local component sends according to described sending module.
The beneficial effect of the technical scheme that the embodiment of the present invention provides is:
Send to local component by the Web script that browser kernel is called local service, call corresponding local service by local component, realization couples together browser kernel and local component, the function that provides WebApp not possess by local service, thereby enlarged the function of WebApp, improved the extendability of its funcall.
Description of drawings
In order to be illustrated more clearly in the technical scheme in the embodiment of the present invention, during the below will describe embodiment, the accompanying drawing of required use is done to introduce simply, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skills, under the prerequisite of not paying creative work, can also obtain according to these accompanying drawings other accompanying drawing.
Fig. 1 is the funcall method flow diagram of a kind of web application of providing of the embodiment of the present invention one;
Fig. 2 is the funcall method flow diagram of a kind of web application of providing of the embodiment of the present invention two;
Fig. 3 is the structural representation of the Web script that provides of the embodiment of the present invention two;
Fig. 4 is the structural representation of the local component that provides of the embodiment of the present invention two;
Fig. 5 is the funcall process schematic diagram of the web application that provides of the embodiment of the present invention two;
Fig. 6 is the funcall method flow diagram of the web application that provides of the embodiment of the present invention three;
Fig. 7 is the structural representation of the Web script that provides of the embodiment of the present invention three;
Fig. 8 is the structural representation of the local component that provides of the embodiment of the present invention three;
Fig. 9 is the funcall process schematic diagram of the web application that provides of the embodiment of the present invention three;
Figure 10 is the funcall apparatus structure schematic diagram of the first web application of providing of the embodiment of the present invention four;
Figure 11 is the funcall apparatus structure schematic diagram of the second web application of providing of the embodiment of the present invention four;
Figure 12 is the funcall apparatus structure schematic diagram of the third web application of providing of the embodiment of the present invention four;
Figure 13 is the funcall apparatus structure schematic diagram of the 4th kind of web application providing of the embodiment of the present invention four;
Figure 14 is the funcall apparatus structure schematic diagram of the 5th kind of web application providing of the embodiment of the present invention four;
Figure 15 is the funcall apparatus structure schematic diagram of the 6th kind of web application providing of the embodiment of the present invention four.
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 one
The present embodiment provides a kind of funcall method of web application, and referring to Fig. 1, the method flow that the present embodiment provides is specific as follows:
101: extract the Web script that browser kernel calls local service, this Web script comprises the parameter of the local service that browser kernel calls at least;
102: the Web script is sent to local component, by the local component local service corresponding according to the parameter call that comprises in the Web script.
Further, can call corresponding local service by the Web script in order to make browser kernel, the form of the local service that can in advance local component be provided by interface is registered in Web script space, calls for the Web script.Therefore, the method that the present embodiment provides also comprised before the extraction browser kernel calls the Web script of local service:
The registration script calling interface corresponding with each local service in the Web of browser kernel script space, each script calling interface comprises the parameter of the local service corresponding with it;
Extract the Web script that browser kernel calls local service, specifically comprise:
Extract by the script calling interface Web script that browser kernel calls local service, the script calling interface is corresponding with the local service that browser kernel calls.
For be the mode of the corresponding script calling interface of each local service registration in the Web of browser kernel script space, form man-to-man relation between script calling interface and local service, by different script calling interfaces, can call different local services, and corresponding different Web scripts.
Further, in order to make local component can receive the Web script that browser kernel calls local service, can be provided for receiving in advance the interface of Web script in local component, and for the mode for the corresponding script calling interface of each local service registration, can determine in order to make local component the different local services that different Web scripts call, the script receiving interface corresponding with each local service can be set in local component in advance, therefore, the method that the present embodiment provides also comprised before the Web script is sent to local component:
The script receiving interface corresponding with each local service is set in local component, and this Web script comprises parameter corresponding to local service that browser kernel calls, and this script receiving interface is used for receiving the Web script;
The Web script is sent to local component, specifically comprises:
By the script receiving interface, the Web script is sent to local component, the script receiving interface is corresponding with the local service that browser kernel calls, and makes local component according to local service corresponding to parameter call script receiving interface that comprises in the Web script.
For the mode of the script receiving interface corresponding with each local service is set in local component, form man-to-man relation between script receiving interface and local service, by different script receiving interfaces, can receive different Web scripts, and corresponding different local services.
Alternatively, in order to make browser kernel call corresponding local service by the Web script, except adopting said method registration script calling interface corresponding with each local service in the Web of browser kernel script space, outside calling for the Web script, can also a general-purpose interface be set for all local services, and call corresponding local service according to the service name of each local service, therefore, the method that the present embodiment provides also comprised before the extraction browser kernel calls the Web script of local service:
Registered in advance is called the general-purpose interface of local service in the Web of browser kernel script space, and general-purpose interface comprises service name parameter and Transfer Parameters;
Wherein, when browser kernel calls local service, the service name parameter modification that general-purpose interface is comprised is the service name of the local service called of browser kernel, and the Transfer Parameters that general-purpose interface is comprised is revised as the parameter of the local service that browser kernel calls;
Extract the Web script that browser kernel calls local service, specifically comprise:
Extract by general-purpose interface the Web script that browser kernel calls local service, this Web script comprises service name and the parameter of the local service that browser kernel calls.
Call the mode of the general-purpose interface of local service for registered in advance in the Web of browser kernel script space, general-purpose interface and a plurality of local service form the relation of one-to-many, be the corresponding general-purpose interfaces of a plurality of local services, call different local services by this general-purpose interface, corresponding different Web scripts, and in order to distinguish the local service of calling by this general-purpose interface, this general-purpose interface also comprises the service name of the local service of calling except comprising the parameter of the local service of calling.
Alternatively, in order to make local component can receive the Web script that browser kernel calls local service, except adopting said method that the mode of the script receiving interface corresponding with each local service is set in local component, can also an interface that be used for receiving the Web script be set for all local services, therefore, the method that the present embodiment provides also comprised before the Web script is sent to local component:
A distribution interface is set in local component, and distribution interface is used for receiving the Web script that browser kernel calls local service;
The Web script is sent to local component, specifically comprises:
By distribution interface, the Web script is sent to local component, make local component according to local service corresponding to parameter call service name that comprises in the Web script.
For the above-mentioned mode that a distribution interface is set in local component, this distribution interface and a plurality of local service form the relation of one-to-many, be the corresponding distribution interface of a plurality of local services, receive the Web script that calls different local services by this distribution interface.
Further, can't Direct Recognition Web script due to local component, the method that the present embodiment provides also comprised before the Web script is sent to local component:
The service name of the local service that the browser kernel that comprises in the Web script is called and the form that parameter converts local component recognition to.
Need to prove, the present embodiment does not limit concrete local service, the function based on webpage that the WebApp self that can directly call with respect to browser kernel provides, local service can be used as the Function Extension of WebApp, it includes but not limited to the operation of local file, based on data, services of TCP (Transmission Control Protocol, transmission control protocol) or UDP (User Datagram Protocol, User Datagram Protocol) etc.In addition, the local component that the present embodiment and subsequent embodiment relate to is the assembly that local service is provided, and this local component can be the part of WebApp, also can be separate with WebApp, for example, be arranged in operating system, the present embodiment is not done concrete restriction to this.
The method that the present embodiment provides, send to local component by the Web script that browser kernel is called local service, call corresponding local service by local component, realization couples together browser kernel and local component, the function that provides WebApp not possess by local service, thereby enlarged the function of WebApp, improved the extendability of its funcall; In addition, by using a general-purpose interface and a distribution interface, call corresponding local service according to the title of local service, thereby when local component increases local service, need not increases extra interface, thereby has reached the ability that local component API independently expands; And Web script and local component can continue expansion, thereby have the dirigibility of height.
In order more clearly to set forth the funcall method of the web application that above-described embodiment one provides, content in conjunction with above-described embodiment one, take the content of following embodiment two and embodiment three as example, funcall method to web application at length illustrates, and sees following embodiment two and embodiment three for details:
Embodiment two
The present embodiment provides a kind of funcall method of web application, for convenience of explanation, in conjunction with the content of above-described embodiment one, the present embodiment is to register the script calling interface corresponding with each local service as example in Web script space, and the method that the present embodiment is provided is illustrated.Referring to Fig. 2, the method flow that the present embodiment provides is specific as follows:
201: the registration script calling interface corresponding with each local service in the Web of browser kernel script space, each script calling interface comprises the parameter of the local service corresponding with it;
wherein, the present embodiment does not limit the mode of the script calling interface corresponding with each local service of registration in the Web of browser kernel script space, in addition, concrete form and the content of the script calling interface that the present embodiment does not obtain registration equally limit, because each script calling interface is corresponding with each local service, if thereby a plurality of local services are arranged, need registration to obtain a plurality of script calling interfaces, in order to distinguish different script calling interfaces, the service name of local service that can the script calling interface is corresponding is as the title of this script calling interface, and in order by this script calling interface, the parameter of the local service called to be passed to local component, this script calling interface includes but not limited to: the parameter of local service.The service name of a local service that provides take local component is as E, and registers script calling interface corresponding to this local service be example under the window.external object, and the form of this script calling interface can be as follows:
window.external.E(F);
Wherein, E is the title of script calling interface, this title can be service name corresponding to local service, for example, for the local service that opens file, its corresponding service name is openFile, for the local service that sends data, its corresponding service name is sendData, can also be service names corresponding to other local services, the present embodiment does not limit specific service title corresponding to local service, and local service corresponding to this service name gets final product for the local service that local component can provide.
F is the parameter of local service, and this parameter approximately is decided to be string format, and content wherein is the parameter that passes to local component, and the present embodiment does not limit the particular content in parameter F.Why parameter F approximately is decided to be string format herein, because character string can be used as the container of a parameter, its can pack numeral, date, scripting object or be exactly simple character string itself, the parameter of different local services can be packaged into different contents.
to sum up, because each script calling interface is corresponding with each local service, and this script calling interface comprises the parameter of local service, therefore, the script calling interface just becomes the outlet that the Web script calls corresponding local service, take the structure of Web script shown in Figure 3 as example, Fig. 3 shows and calls service name with browser kernel is script calling interfaces corresponding to two local services of openFile and connect, the name of one of them script calling interface is called openFile, it comprises parameter f ileName, the name of another one script calling interface is called connect, it comprises parameter d estination, the concrete invoked procedure that calls local service by the script calling interface sees the subsequent step description for details.
202: the script receiving interface corresponding with each local service is set in local component, and this script receiving interface is used for receiving the Web script;
For this step, in order to make local component can receive the Web script that browser kernel calls local service, local component need to provide the script receiving interface corresponding with each local service, and this script receiving interface be used for to receive the parameter of the local service that the browser kernel of Web scripts pass calls.the present embodiment does not limit the mode that the script receiving interface is set, concrete form and the content of the script receiving interface that arranges do not limited equally, because each script receiving interface is corresponding with each local service, if thereby a plurality of local services are arranged, a plurality of script receiving interfaces need to be set, in order to distinguish different script receiving interfaces, the service name of local service that can the script receiving interface is corresponding is as the title of this script receiving interface, and in order to receive the parameter that comprises in the Web script by this script receiving interface, this script receiving interface includes but not limited to receive parameter, take arrange in local component one with service name as the corresponding script receiving interface of the local service of E as example, this script receiving interface is that form as follows is example:
E(F);
Wherein, E is the title of script receiving interface, it can be the service name of local service, for example, the service name openFile of the local service that opens file, the service name that sends the local service of data is sendData, can also be the service name of other local services, and the present embodiment does not limit specific service title corresponding to local service herein.F is for receiving parameter, content in this reception parameter F can be the parameter of the local service that receives, it can be string format, why parameter F approximately being decided to be string format herein, is because character string can be used as the container of a parameter, its can pack numeral, date, scripting object or be exactly simple character string itself, different local services has different parameters, therefore, the reception parameter that different local services is corresponding different, the present embodiment is not done concrete restriction to this.
To sum up, by setting in advance the script receiving interface, local component can receive the parameter of the local service that browser kernel calls.Take the structure of local component shown in Figure 4 as example, in Fig. 4, local component can receive by script receiving interface openFile (fileName) the Web script that comprises parameter f ileName, call thus the local service that service name is openFile, can receive by script receiving interface connect (destination) the Web script that comprises parameter d estination, call thus the local service that service name is connect, concrete invoked procedure sees subsequent step for details to be described.
203: extract by the script calling interface Web script that browser kernel calls local service, this Web script comprises the parameter of the local service that browser kernel calls, and this script calling interface is corresponding with the local service that browser kernel calls;
particularly, the local service of calling take browser kernel is for opening file as example, its corresponding service name is openFile, parameter is fileName, browser kernel can call the local service that this opens file by the script calling interface openFile (fileName) of registered in advance, can extract by this script calling interface the Web script that browser kernel calls local service, and this Web script comprises the parameter of the local service that browser kernel calls, and send it to local component by subsequent step, called the local service that opens file by local component, see the description of subsequent step for details.
204: by the script receiving interface, the Web script is sent to local component, this script receiving interface is corresponding with the local service that browser kernel calls, and makes local component according to local service corresponding to parameter call script receiving interface that comprises in the Web script.
For this step, because local component can't Direct Recognition Web script, therefore, before the script receiving interface that this step sets in advance in by local component sends to local component with the Web script, comprise that also the parameter of the local service that the browser kernel that will comprise in the Web script calls converts the preferred steps of the form of local component recognition to, again it is sent to local component by the script receiving interface that sets in advance in local component afterwards, call corresponding local service by local component.
Wherein, the present embodiment does not limit the specific implementation that the parameter that will comprise in the Web script converts the form of local component recognition to.Identify the service parameter of the local service that browser kernel calls when local component after, can determine call which local service by the script receiving interface that receives the Web script, and call corresponding local service according to the parameter that identifies.Local component calls local service can pass through existing techniques in realizing equally, and the present embodiment repeats no more this.
So far, the whole flow process of the funcall of web application finishes, and in conjunction with the operation of Web script and local component, the funcall process of this web application can be as shown in Figure 5.
the method that the present embodiment provides, parameter registration by each local service that local component is provided is in the Web script space of browser kernel, obtain script calling interface corresponding to each local service, and set in advance the script receiving interface in local component, thereby only need call by extracting browser kernel the Web script of local service, and send to local component after converting thereof into the form that to identify for local component, can call corresponding local service by local component, realization couples together browser kernel and local component, the function that provides WebApp not possess by local service, thereby enlarged the function of WebApp, improved the extendability of its funcall.
Embodiment three
The present embodiment provides a kind of method of calling local service, for convenience of explanation, in conjunction with the content of above-described embodiment one, the present embodiment take register in the Web of browser kernel script space call local service general-purpose interface as example, the method that the present embodiment is provided is illustrated.Referring to Fig. 6, the method flow that the present embodiment provides is specific as follows:
601: the general-purpose interface of local service is called in registration in the Web of browser kernel script space, and this general-purpose interface comprises service name parameter and Transfer Parameters;
Wherein, the present embodiment does not limit the mode that the general-purpose interface of local service is called in registration in the Web of browser kernel script space, in addition, the present embodiment does not limit concrete form and the content of general-purpose interface of registration equally, because this general-purpose interface can be used for calling all local services, in order to pass through this general-purpose interface, call corresponding local service with the title of local service, the parameter of this general-purpose interface includes but not limited to: service name parameter and Transfer Parameters.To register general-purpose interface as example under the window.external object, the form of this general-purpose interface can be as follows:
window.external.X(A,B);
Wherein, A is the service name parameter, for example, for the local service that opens file, its corresponding service name is openFile, for the local service that sends data, its corresponding service name is sendData, can also be service names corresponding to other local services, the present embodiment limit specific service title corresponding to service name parameter, and local service corresponding to this service name gets final product for the local service that local component can provide.
B is Transfer Parameters, and this Transfer Parameters approximately is decided to be string format, and content wherein is the parameter that passes to local component, and the present embodiment does not limit the particular content in B parameter.Why B parameter approximately being decided to be string format herein, is because character string can be used as the container of a parameter, its can pack numeral, date, scripting object or be exactly simple character string itself.Like this, all to the call parameters of local service can be unified B parameter of use, B parameter specifically can be packaged into according to the difference of each local service different contents.
to sum up, service name parameter and Transfer Parameters that general-purpose interface by registered in advance comprises, can realize calling of local service united, thereby general-purpose interface X just becomes the outlet that other Web scripts call local service, take the structure of Web script shown in Figure 7 as example, in Fig. 7, the Web script comprises that browser kernel passes through X (A, B) service name that can call of this general-purpose interface is openFile, parameter is the local service of fileName, and service name is connect, parameter is the local service of destination, concrete invoked procedure sees subsequent step for details to be described.
602: a distribution interface is set in local component, and this distribution interface is used for receiving the Web script that browser kernel calls local service;
For this step, in order to make local component can receive the Web script that browser kernel calls local service, local component need to provide a distribution interface, and this distribution interface be used for to receive service name and the parameter of the local service that the browser kernel of Web scripts pass calls.The present embodiment does not limit the mode that distribution interface is set, concrete form and the content of the distribution interface that arranges do not limited equally, take the distribution interface that arranges in local component as form as follows as example:
Y(A,B);
Wherein, A is the service name parameter, the service name of the local service that it can call for browser kernel, for example, service name is the local service that opens file of openFile, service name is the local service of the transmission data of sendData, can also be local services corresponding to other service names, and the present embodiment does not limit specific service title corresponding to service name parameter herein.B parameter is the call parameters that local component need to use when calling local service corresponding to A, B parameter is string format, all to the call parameters of local service can be unified B parameter of use, B parameter can be packaged into according to the difference of each local service different contents, and the present embodiment is not done concrete restriction to this.
To sum up, by distribution interface Y (A, B) is set, local component can receive service name and the parameter of the local service that browser kernel calls.Take the structure of local component shown in Figure 8 as example, in Fig. 8, local component is by distribution interface Y (A, B) can receive service name is openFile, parameter is the Web script of fileName, call thus corresponding local service openFile (fileName), by distribution interface Y (A, B) can receive service name is connect, parameter is the Web script of destination, call thus corresponding local service Connect (destination), concrete invoked procedure sees subsequent step for details to be described.
603: extract by general-purpose interface the Web script that browser kernel calls local service, this Web script comprises service name and the parameter of the local service that browser kernel calls;
Particularly, because the general-purpose interface of registering comprises service name parameter and Transfer Parameters, thereby browser kernel is when calling local service, the service name parameter modification that browser kernel can comprise general-purpose interface is the service name of the local service called of browser kernel, the Transfer Parameters that general-purpose interface is comprised is revised as the parameter of the local service that browser kernel calls, and obtains calling the Web script of local service.
The local service of calling take browser kernel is for opening file as example, its corresponding service name is openFile, parameter is fileName, use the general-purpose interface X (A of registration when browser kernel, when B) calling the local service that this opens file, browser kernel can be revised as openFile with the service name parameter A in general-purpose interface X (A, B), Transfer Parameters B is revised as fileName, obtains comprising the Web script of openFile and fileName.In order to realize calling the local service that opens file, can extract openFile and fileName by general-purpose interface, and send it to local component by subsequent step, called the local service that opens file by local component, see the description of subsequent step for details.
604: by distribution interface, the Web script is sent to local component, make local component according to local service corresponding to parameter call service name that comprises in the Web script.
For this step, because local component can't Direct Recognition Web script, therefore, before the Web script that the distribution interface that this step sets in advance in by local component will comprise the service name of the local service that browser kernel calls and parameter sends to local component, also comprise the service name of the local service that the browser kernel that will comprise in the Web script calls and the preferred steps of the form that parameter converts local component recognition to, again it is sent to local component by the distribution interface that sets in advance in local component afterwards.
Wherein, the present embodiment does not limit the service name of local service that browser kernel is called and the specific implementation of the form that parameter converts local component recognition to.Identify the service name of the local service that browser kernel calls when local component after, can determine call which local service, and call local service corresponding to service name according to the parameter that identifies.Local component calls local service can pass through existing techniques in realizing, and the present embodiment repeats no more this.
So far, the whole flow process of the funcall of web application finishes, and in conjunction with the operation of Web script and local component, this process of calling local service can be as shown in Figure 9.
the method that the present embodiment provides, general-purpose interface by registered in advance local service in Web script space, and set in advance a distribution interface in local component, thereby only need to extract by general-purpose interface the Web script that browser kernel calls local service, and convert thereof into the form that to identify for local component, distribution interface by local component sends it to local component more afterwards, by local component calling local service, realization couples together browser kernel and local component, the function that provides WebApp not possess by local service, thereby enlarged the function of WebApp, improved the extendability of its funcall, in addition, when local component provides new service, directly transmit new local service name by the Web script in general-purpose interface and can realize calling of new local service, need not increases extra interface, has reached the ability that local API independently expands, because Web script and local component can continue expansion, make the funcall mode of the web application that the present embodiment provides have the dirigibility of height.
Embodiment four
The present embodiment provides a kind of funcall device of web application, and this device is used for carrying out the funcall method of above-mentioned web application, and referring to Figure 10, this device comprises:
Extraction module 1001 be used for to extract the Web script that browser kernel calls local service, and this Web script comprises the parameter of the local service that browser kernel calls at least;
Sending module 1002 is used for the Web script that extraction module 1001 extracts is sent to local component;
Calling module 1003 is used for local service corresponding to parameter call that is comprised by the Web script that local component sends according to sending module 1002.
Further, referring to Figure 11, this device also comprises:
The first Registering modules 1004 is used at the Web of the browser kernel script space registration script calling interface corresponding with each local service, and each script calling interface comprises the parameter of the local service corresponding with it;
Extraction module 1001, concrete being used for extracts by the script calling interface of the first Registering modules 1004 registrations the Web script that browser kernel calls local service, this Web script comprises the parameter of the local service that browser kernel calls, and this script calling interface is corresponding with the local service that browser kernel calls.
Further, referring to Figure 12, this device also comprises:
First arranges module 1005, is used at local component, the script receiving interface corresponding with each local service being set, and this script receiving interface is used for receiving the Web script;
Sending module 1002, concrete being used for sends to local component by the first script receiving interface that module 1005 settings are set with the Web script, this script receiving interface is corresponding with the local service that browser kernel calls, and makes local component according to local service corresponding to parameter call script receiving interface that comprises in the Web script.
Alternatively, referring to Figure 13, this device also comprises:
The second Registering modules 1006 is used for calling in the Web of browser kernel script space registered in advance the general-purpose interface of local service, and this general-purpose interface comprises service name parameter and Transfer Parameters;
Wherein, when browser kernel calls local service, the service name parameter modification that general-purpose interface is comprised is the service name of the local service called of browser kernel, and the Transfer Parameters that general-purpose interface is comprised is revised as the parameter of the local service that browser kernel calls;
Extraction module 1001, concrete being used for extracts by the general-purpose interface of the second Registering modules 1006 registrations the Web script that browser kernel calls local service, and the Web script comprises service name and the parameter of the local service that browser kernel calls.
Alternatively, referring to Figure 14, this device also comprises:
Second arranges module 1007, is used at local component, a distribution interface being set, and this distribution interface is used for receiving the Web script that browser kernel calls local service;
Sending module 1003, concrete being used for sends to local component by the second distribution interface that module 1007 settings are set with the Web script, makes local component according to local service corresponding to parameter call service name that comprises in the Web script.
Further, no matter adopt above-mentioned which kind of mode to extract or send the Web script, due to local component None-identified Web script, therefore, before sending it to local component, also need to convert the Web script to form that local assembly can be identified, referring to Figure 15, this device also comprises:
Modular converter 1008, the service name of the local service that the browser kernel that is used for that the Web script is comprised calls and the form that parameter converts local component recognition to.
Need to prove, device shown in Figure 15 has only comprised extraction module 1001, modular converter 1008, sending module 1002 and calling module 1003, in practical application, this device can also comprise simultaneously that the first Registering modules 1004 and first arranges module 1005, comprise simultaneously that perhaps the second Registering modules 1006 and second arranges module 1007, the present embodiment is not done concrete restriction to this.
The device that the present embodiment provides, send to local component by the Web script that browser kernel is called local service, call corresponding local service by local component, realization couples together browser kernel and local component, the function that provides WebApp not possess by local service, thereby enlarged the function of WebApp, improved the extendability of its funcall; In addition, by using a general-purpose interface and a distribution interface, call corresponding local service according to the title of local service, thereby when local component increases local service, need not increases extra interface, thereby has reached the ability that local component API independently expands; And Web script and local component can continue expansion, thereby have the dirigibility of height.
Need to prove: the funcall device of the web application that above-described embodiment provides is when realizing the funcall of web application, 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, the funcall device of the web application that above-described embodiment provides and the funcall embodiment of the method for web application 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 (12)

1. the funcall method of a web application, is characterized in that, described method comprises:
Extract the Web script that browser kernel calls local service, described Web script comprises the parameter of the local service that described browser kernel calls at least;
Described Web script is sent to local component, by described local component according to local service corresponding to parameter call that comprises in described Web script.
2. method according to claim 1, is characterized in that, described extraction browser kernel also comprises before calling the Web script of local service:
The registration script calling interface corresponding with each local service in the Web of described browser kernel script space, each script calling interface comprises the parameter of the local service corresponding with it;
Described extraction browser kernel calls the Web script of local service, specifically comprises:
Extract by the script calling interface Web script that described browser kernel calls local service, described Web script comprises the parameter of the local service that described browser kernel calls, and described script calling interface is corresponding with the local service that described browser kernel calls.
3. method according to claim 1, is characterized in that, described described Web script is sent to local component before, also comprise:
The script receiving interface corresponding with each local service is set in described local component, and described script receiving interface is used for receiving the Web script;
Described described Web script is sent to local component, specifically comprises:
By the script receiving interface, described Web script is sent to described local component, described script receiving interface is corresponding with the local service that described browser kernel calls, and makes local service corresponding to described local component script receiving interface according to the parameter call that comprises in described Web script.
4. method according to claim 1, is characterized in that, described extraction browser kernel also comprises before calling the Web script of local service:
The general-purpose interface of local service is called in registration in the Web of described browser kernel script space, and described general-purpose interface comprises service name parameter and Transfer Parameters;
Wherein, when described browser kernel calls local service, the service name parameter modification that described general-purpose interface is comprised is the service name of the local service called of described browser kernel, and the Transfer Parameters that described general-purpose interface is comprised is revised as the parameter of the local service that described browser kernel calls;
Described extraction browser kernel calls the Web script of local service, specifically comprises:
Extract by described general-purpose interface the Web script that described browser kernel calls local service, described Web script comprises service name and the parameter of the local service that described browser kernel calls.
5. method according to claim 1, is characterized in that, described described Web script is sent to local component before, also comprise:
A distribution interface is set in described local component, and described distribution interface is used for receiving the Web script that described browser kernel calls local service;
Described described Web script is sent to local component, specifically comprises:
By described distribution interface, described Web script is sent to described local component, make described local component according to local service corresponding to the described service name of parameter call that comprises in described Web script.
6. the described method of arbitrary claim according to claim 1 to 5, is characterized in that, described described Web script is sent to local component before, also comprise:
The service name of the local service that the described browser kernel that comprises in described Web script is called and parameter convert the form of described local component identification to.
7. the funcall device of a web application, is characterized in that, described device comprises:
Extraction module be used for to extract the Web script that browser kernel calls local service, and described Web script comprises the parameter of the local service that described browser kernel calls at least;
Sending module is used for the Web script that described extraction module extracts is sent to local component;
Calling module is used for local service corresponding to parameter call that is comprised by the Web script that described local component sends according to described sending module.
8. device according to claim 7, is characterized in that, described device also comprises:
The first Registering modules is used at the Web of the described browser kernel script space registration script calling interface corresponding with each local service, and each script calling interface comprises the parameter of the local service corresponding with it;
Described extraction module, concrete being used for extracts by the script calling interface of described the first Registering modules registration the Web script that described browser kernel calls local service, described Web script comprises the parameter of the local service that described browser kernel calls, and described script calling interface is corresponding with the local service that described browser kernel calls.
9. device according to claim 7, is characterized in that, described device also comprises:
First arranges module, is used at described local component, the script receiving interface corresponding with each local service being set, and described script receiving interface is used for receiving the Web script;
Described sending module, concrete being used for sends to described local component by the described first script receiving interface that the module setting is set with described Web script, described script receiving interface is corresponding with the local service that described browser kernel calls, and makes local service corresponding to described local component script receiving interface according to the parameter call that comprises in described Web script.
10. device according to claim 9, is characterized in that, described device also comprises:
The second Registering modules is used for calling in the Web of described browser kernel script space registered in advance the general-purpose interface of local service, and described general-purpose interface comprises service name parameter and Transfer Parameters;
Wherein, when described browser kernel calls local service, the service name parameter modification that described general-purpose interface is comprised is the service name of the local service called of described browser kernel, and the Transfer Parameters that described general-purpose interface is comprised is revised as the parameter of the local service that described browser kernel calls;
Described extraction module, concrete being used for extracts by the general-purpose interface of described the second Registering modules registration the Web script that described browser kernel calls local service, and described Web script comprises service name and the parameter of the local service that described browser kernel calls.
11. device according to claim 7 is characterized in that, described device also comprises:
Second arranges module, is used at described local component, a distribution interface being set, and described distribution interface is used for receiving the Web script that described browser kernel calls local service;
Described sending module, concrete being used for sends to described local component by the described second distribution interface that the module setting is set with described Web script, makes described local component according to local service corresponding to the described service name of parameter call that comprises in described Web script.
12. according to claim 7 to 11, the described device of arbitrary claim, is characterized in that, described device also comprises:
Modular converter, the service name of the local service that the described browser kernel that is used for that described Web script is comprised calls and parameter convert the form of described local component identification to.
CN2011104417123A 2011-12-26 2011-12-26 Method and device for calling functions of webpage application Pending CN103177040A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2011104417123A CN103177040A (en) 2011-12-26 2011-12-26 Method and device for calling functions of webpage application

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2011104417123A CN103177040A (en) 2011-12-26 2011-12-26 Method and device for calling functions of webpage application

Publications (1)

Publication Number Publication Date
CN103177040A true CN103177040A (en) 2013-06-26

Family

ID=48636921

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2011104417123A Pending CN103177040A (en) 2011-12-26 2011-12-26 Method and device for calling functions of webpage application

Country Status (1)

Country Link
CN (1) CN103177040A (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104158856A (en) * 2014-07-23 2014-11-19 武汉理工大学 Local API calling method dispense with preset of secure session
CN104932910A (en) * 2014-03-20 2015-09-23 中国移动通信集团公司 Method and system for application program interface extension
WO2016192556A1 (en) * 2015-05-29 2016-12-08 北京金山安全软件有限公司 Interface invoking method, device and terminal
CN106815037A (en) * 2015-11-30 2017-06-09 腾讯科技(深圳)有限公司 The execution method and device of application function
CN106980550A (en) * 2017-03-23 2017-07-25 青岛海信电器股份有限公司 Expansion interface call method and device
CN103886029B (en) * 2014-03-03 2017-10-27 百度在线网络技术(北京)有限公司 Implementation method, device, server and the system of web application
CN108134834A (en) * 2017-12-22 2018-06-08 福建榕基软件股份有限公司 A kind of WEB terminal calls the method and system of local service
CN109656466A (en) * 2019-03-14 2019-04-19 北京小米移动软件有限公司 System information transmission method, device and computer readable storage medium
CN109902257A (en) * 2019-02-28 2019-06-18 广州达安临床检验中心有限公司 Resource access method, device, computer equipment and storage medium
CN110554968A (en) * 2019-09-10 2019-12-10 联想(北京)有限公司 interface calling method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080244514A1 (en) * 2007-03-29 2008-10-02 Microsoft Corporation Scriptable object model for network based services
CN101634947A (en) * 2009-08-31 2010-01-27 腾讯科技(深圳)有限公司 IE control using local resources of client and application method thereof
CN101840415A (en) * 2010-03-15 2010-09-22 福建鑫诺通讯技术有限公司 Method for controlling local resources through LUA scripts under B/S structure
CN102207866A (en) * 2011-05-25 2011-10-05 盛乐信息技术(上海)有限公司 Systems and methods for developing, publishing, installing and operating application programs based on Web operating system (WebOS)

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080244514A1 (en) * 2007-03-29 2008-10-02 Microsoft Corporation Scriptable object model for network based services
CN101634947A (en) * 2009-08-31 2010-01-27 腾讯科技(深圳)有限公司 IE control using local resources of client and application method thereof
CN101840415A (en) * 2010-03-15 2010-09-22 福建鑫诺通讯技术有限公司 Method for controlling local resources through LUA scripts under B/S structure
CN102207866A (en) * 2011-05-25 2011-10-05 盛乐信息技术(上海)有限公司 Systems and methods for developing, publishing, installing and operating application programs based on Web operating system (WebOS)

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103886029B (en) * 2014-03-03 2017-10-27 百度在线网络技术(北京)有限公司 Implementation method, device, server and the system of web application
CN104932910A (en) * 2014-03-20 2015-09-23 中国移动通信集团公司 Method and system for application program interface extension
CN104158856B (en) * 2014-07-23 2017-05-24 武汉理工大学 Local API calling method dispense with preset of secure session
CN104158856A (en) * 2014-07-23 2014-11-19 武汉理工大学 Local API calling method dispense with preset of secure session
WO2016192556A1 (en) * 2015-05-29 2016-12-08 北京金山安全软件有限公司 Interface invoking method, device and terminal
CN106815037A (en) * 2015-11-30 2017-06-09 腾讯科技(深圳)有限公司 The execution method and device of application function
CN106980550A (en) * 2017-03-23 2017-07-25 青岛海信电器股份有限公司 Expansion interface call method and device
CN108134834A (en) * 2017-12-22 2018-06-08 福建榕基软件股份有限公司 A kind of WEB terminal calls the method and system of local service
CN109902257A (en) * 2019-02-28 2019-06-18 广州达安临床检验中心有限公司 Resource access method, device, computer equipment and storage medium
CN109902257B (en) * 2019-02-28 2021-06-29 广州达安临床检验中心有限公司 Resource access method, device, computer equipment and storage medium
CN109656466A (en) * 2019-03-14 2019-04-19 北京小米移动软件有限公司 System information transmission method, device and computer readable storage medium
CN109656466B (en) * 2019-03-14 2019-05-24 北京小米移动软件有限公司 System information transmission method, device and computer readable storage medium
CN110554968A (en) * 2019-09-10 2019-12-10 联想(北京)有限公司 interface calling method and device

Similar Documents

Publication Publication Date Title
CN103177040A (en) Method and device for calling functions of webpage application
CN106022483B (en) The method and apparatus converted between machine learning model
CN101923485B (en) JACA remote invocation method in CORBA (Common Object Request Breaker Architecture) system
CN103974111B (en) By the method, apparatus of the data transfer on intelligent terminal to television terminal
EP2854348B1 (en) Interface display method and system of home gateway applicable to multiple display types
CN110049012B (en) Operation method of routing equipment, routing equipment and terminal equipment
CN103176834B (en) A kind of method of invoke extensions interface and device
CN106372250A (en) Parameter passing method and device capable of starting local application through URL protocol
CN102866925B (en) Communication method and system for middleware and user interface
CN102799477A (en) Resource access method and apparatus
CN108696523A (en) A kind of response method and equipment of session services
CN104836831A (en) Object service method used for Internet of Things
CN104156211A (en) Universal data interface used for sensor and data calling method
CN101609427B (en) Programmable network service automation test system and programmable network service automation method
CN103279382A (en) Method, Java terminal, native terminal and system for native resource access
CN105138399A (en) Cross-platform mobile Web application runtime engine
CN103002047A (en) RPC (Remote Procedure Call) type WEB SOA (Service-Oriented Architecture) method
CN101964742B (en) Method, system and device for using network open ability
Cha et al. Standardization strategy for the Internet of wearable things
CN102957585B (en) The data transmission method of a kind of Ethernet and data transmission device
CN105204824A (en) Method and device for communication between application and mobile terminal
CN107517247A (en) A kind of socket interfaces applied to financial industry turn the system and method for http interfaces
CN101533409A (en) Network browser system and control method
CN107544920A (en) A kind of design method of the simulation computer peripheral hardware platform based on Android intelligent
CN105847328B (en) Carry out data transmission interactive method to Http agreement based on QTP

Legal Events

Date Code Title Description
PB01 Publication
C06 Publication
SE01 Entry into force of request for substantive examination
C10 Entry into substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20130626

RJ01 Rejection of invention patent application after publication