The call method and device of a kind of application programming interfaces
Technical field
The application is related to Internet technical field, more particularly to the call method and device of a kind of application programming interfaces.
Background technology
Mixed type application (Hybrid app) is one kind between web application (Web app) and native applications (Native
App the application between), the good user-interaction experiences of Native app and the advantage of Web app Cross-border congestion managements are had concurrently.
Hybrid app, which need to download in terminal device, to be installed and could run, and H5 containers are embedded in Hybrid app (for example, network video
Figure component web view or other browser kernel components), H5 containers provide the environment of H5 pages operation so that Hybrid
App can carry out web page access., can also should by call that H5 containers provide in addition, Hybrid app are when accessing webpage
Carry out sheet corresponding with the Api in using terminal equipment with routine interface (Api, Application program interface)
Ground resource (for example, bluetooth, camera).But in actual applications, H5 containers can provide in different editions Hybrid app
Api may be different, as the Api for calling highest version Hybrid app H5 containers to provide in lowest version Hybrid app
When, can due to may be not present the Api in lowest version Hybrid app in H5 containers and can not in using terminal equipment with the Api
Corresponding local resource.
The content of the invention
The embodiment of the present application provides a kind of call method of application programming interfaces, can effectively improve Hybrid app clients
The calling efficiency to Api parameters is held, and then improves the user experience of Hybrid app clients.
The embodiment of the present application provides a kind of call method of application programming interfaces, including:
Determine that mixed type application Hybrid app need the application programming interfaces Api parameters called;
Determine the Release parameter of the Hybrid app;
According to the Api parameters and the Release parameter of the Hybrid app, determine the Hybrid app to the Api
The call-by mechanism of parameter.
Alternatively, according to the Api parameters and the Release parameter of the Hybrid app, the Hybrid app couple are determined
The call-by mechanism of the Api parameters, including:
Determine invocation protocol corresponding to the Api parameters;
According to the Release parameter of the Hybrid app and the invocation protocol, determine the Hybrid app to described
The call-by mechanism of Api parameters.
Alternatively, according to the Release parameter of the Hybrid app and the invocation protocol, the Hybrid app are determined
To the call-by mechanism of the Api parameters, including:
If the Release parameter of the Hybrid app is less than the first parameter preset in the invocation protocol, and the calling
Agreement includes the second parameter preset, to Hybrid app progress edition upgradings, the Hybrid app after being upgraded, its
In, the Release parameter of the Hybrid app after the upgrading is not less than first parameter preset;
Hybrid app after upgrading are called to the Api parameters.
Alternatively, the Hybrid app are upgraded, including:
The first prompted dialog frame is ejected, wherein, the first prompted dialog frame is used to prompt to enter the Hybrid app
Row edition upgrading;
According to the first prompted dialog frame, the Hybrid app are upgraded.
Alternatively, according to the Release parameter of the Hybrid app and the invocation protocol, the Hybrid app are determined
To the call-by mechanism of the Api parameters, including:
If the Release parameter of the Hybrid app is less than the first parameter preset in the invocation protocol, and the calling
Agreement includes the 3rd parameter preset, ejects the second prompted dialog frame, wherein, the second prompted dialog frame is described for prompting
Hybrid app can not realize the calling to the Api parameters.
Alternatively, methods described also includes:
If the Release parameter of the Hybrid app is not less than first parameter preset, the Hybrid app are to described
Api parameters are called.
The embodiment of the present application also provides a kind of calling device of application programming interfaces, including:Determining unit and processing unit,
Wherein:
The determining unit, determine that mixed type application Hybrid app need the application programming interfaces Api parameters called;
The determining unit, determine the Release parameter of the Hybrid app;
The processing unit, according to the Api parameters and the Release parameter of the Hybrid app, determine the Hybrid
Call-by mechanisms of the app to the Api parameters.
Alternatively, the processing unit is according to the Api parameters and the Release parameter of the Hybrid app, it is determined that described
Hybrid app to the call-by mechanisms of the Api parameters, including:
Determine invocation protocol corresponding to the Api parameters;
According to the Release parameter of the Hybrid app and the invocation protocol, determine the Hybrid app to described
The call-by mechanism of Api parameters.
Alternatively, Release parameter and the invocation protocol of the processing unit according to the Hybrid app, determines institute
Call-by mechanisms of the Hybrid app to the Api parameters is stated, including:
If the Release parameter of the Hybrid app is less than the first parameter preset in the invocation protocol, and the calling
Agreement includes the second parameter preset, to Hybrid app progress edition upgradings, the Hybrid app after being upgraded, its
In, the Release parameter of the Hybrid app after the upgrading is not less than first parameter preset;
Hybrid app after the upgrading are called to the Api parameters.
Alternatively, the processing unit upgrades to the Hybrid app, including:
The first prompted dialog frame is ejected, wherein, the first prompted dialog frame is used to prompt to enter the Hybrid app
Row edition upgrading;
According to the first prompted dialog frame, the Hybrid app are upgraded.
Alternatively, Release parameter and the invocation protocol of the processing unit according to the Hybrid app, determines institute
Call-by mechanisms of the Hybrid app to the Api parameters is stated, including:
If the Release parameter of the Hybrid app is less than the first parameter preset in the invocation protocol, and the calling
Agreement includes the 3rd parameter preset, ejects the second prompted dialog frame, wherein, the second prompted dialog frame is described for prompting
Hybrid app can not realize the calling to the Api parameters.
Alternatively, if the Release parameter of the Hybrid app is not less than first parameter preset, the processing unit
The Hybrid app are controlled to be called the Api parameters.
The embodiment of the present application also provides a kind of calling device of application programming interfaces, including:Memory and processor, its
In:
The memory, deposit program;
The processor, performs the program of the memory storage, and specifically performs:
Determine that mixed type application Hybrid app need the application programming interfaces Api parameters called;
Determine the Release parameter of the Hybrid app;
According to the Api parameters and the Release parameter of the Hybrid app, determine the Hybrid app to the Api
The call-by mechanism of parameter.
The embodiment of the present application also provides a kind of computer-readable recording medium, the computer-readable recording medium storage one
Individual or multiple programs, one or more of programs are when the electronic equipment for being included multiple application programs performs so that described
Electronic equipment performs following methods:
Determine that mixed type application Hybrid app need the application programming interfaces Api parameters called;
Determine the Release parameter of the Hybrid app;
According to the Api parameters and the Release parameter of the Hybrid app, determine the Hybrid app to the Api
The call-by mechanism of parameter.
Above-mentioned at least one technical scheme that the embodiment of the present application uses can reach following beneficial effect:
The Api parameters called and Hybrid app Release parameter are needed by determining Hybrid app, and then according to
Api parameters and Hybrid app Release parameter determine that Hybrid app to the call-by mechanism of Api parameters, effectively improve Hybrid
App improves Hybrid app user experience to the calling efficiency of Api parameters.
Brief description of the drawings
Accompanying drawing described herein is used for providing further understanding of the present application, forms the part of the application, this Shen
Schematic description and description please is used to explain the application, does not form the improper restriction to the application.In the accompanying drawings:
Fig. 1 is a kind of schematic flow sheet of the call method for application programming interfaces that the embodiment of the present application provides;
Fig. 2 is a kind of schematic flow sheet of the call method for application programming interfaces that the embodiment of the present application provides;
Fig. 3 is the structural representation for a kind of electronic equipment that the embodiment of the present application provides;
Fig. 4 is a kind of structural representation of the calling device for application programming interfaces that the embodiment of the present application provides.
Embodiment
Hybrid app clients (being arranged on the Hybrid app in terminal device) are good due to having had Native app concurrently
Good user-interaction experience and the advantage of Web app Cross-border congestion managements and be widely used.In actual applications, Hybrid
Although app clients appear to be one is needed to download the Native app that installation could be run in terminal device, but it is carried
Web app are actually similar to for the process of service, access is a webpage.
The process that Hybrid app clients provide service can be with as follows:First, Hybrid app clients according to
URL (URL) set in advance, the accessing page request for carrying the URL is sent to server, for accessing this
The page corresponding to URL;Second, server returns to HTML code corresponding to the page to Hybrid app clients, wherein, should
The Api parameters for needing to call are included in HTML code;3rd, Hybrid app clients parse the HTML code, it is determined that should
The Api parameters to be called of HTML code;4th, Hybrid app clients are by calling H5 in Hybrid app clients to hold
The Api parameters in device, start function corresponding with the Api parameters in terminal device.
For example, Hybrid app clients send accessing page request, server according to URL set in advance to server
HTML code corresponding to the page is returned to Hybrid app clients, Hybrid app clients parse the HTML code, really
The fixed Api parameters to be called of the HTML code are photo.js, and Hybrid app clients are adjusted by Api parameters photo.js
With the Api parameter photo.jar in Hybrid app clients in H5 containers, start the camera function in terminal device.
In actual applications, server may upgrade to Hybrid app service ends, and terminal device is needed from clothes
Business device could complete upgrading of the Hybrid app clients from lowest version to highest version, highest version after downloading upgrade installation package
Hybrid app clients are relative to lowest version Hybrid app clients it is possible that the increase of function, that is to say, that high
H5 containers may increase newly relative to H5 containers in lowest version Hybrid app clients in version Hybrid app clients
Api parameters.
When H5 containers could provide in lowest version Hybrid app client call highest version Hybrid app clients
During Api parameters, terminal can not be completed due to the Api parameters are not present in H5 containers in lowest version Hybrid app clients
The startup of corresponding function in equipment so that lowest version Hybrid app clients report an error for this Api parameter call, cause
Hybrid app customer terminal webpages, which access, to be there is sudden strain of a muscle and moves back or phenomena such as access errors, and user may need to re-start the above-mentioned page
Access process, operate repeatedly, whole efficiency step-down, more have a strong impact on Hybrid app user experience.
For example, server upgrades to Hybrid app service ends so that Hybrid app service ends are from Hybrid
App1.0 service ends have been upgraded to Hybrid app2.0 service ends.Hybrid app2.0 service ends are relative to Hybrid
App1.0 service ends add bluetooth calling function, i.e., Hybrid app2.0 service ends are relative to Hybrid app1.0 service ends
H5 containers are added in Api parameters bluetooth.js, Hybrid app2.0 clients relative to Hybrid app1.0 clients
Container adds Api parameters bluetooth.jar in end.If Hybrid app clients are Hybrid in terminal device
App1.0 clients, user in Hybrid app1.0 clients to server send accessing page request, server to
Hybrid app1.0 clients return to HTML code corresponding to the page, and Hybrid app1.0 clients parse HTML generations
Code, it is bluetooth.js to determine the Api parameters to be called of the HTML code, due to H5 in Hybrid app1.0 clients
Bluetooth.jar is not present in container so that Hybrid app1.0 clients can not be by calling bluetooth.jar to open
Bluetooth function in dynamic terminal device, causes page access to fail.
In order to realize the purpose of the application, the embodiment of the present application provides the call method and dress of a kind of application programming interfaces
Put, this method includes:By determining that Hybrid app need the Api parameters and Hybrid app called Release parameter, enter
And call-by mechanisms of the Hybrid app to Api parameters is determined according to the Release parameter of Api parameters and Hybrid app, effectively improve
Hybrid app improve Hybrid app user experience to the calling efficiency of Api parameters.
Technical scheme is clearly and completely retouched with reference to the application specific embodiment and corresponding accompanying drawing
State.Obviously, described embodiment is only some embodiments of the present application, rather than whole embodiments.Based in the application
Embodiment, the every other embodiment that those of ordinary skill in the art are obtained under the premise of creative work is not made,
Belong to the scope of the application protection.
Below in conjunction with accompanying drawing, the technical scheme that each embodiment of the application provides is described in detail.
Embodiment 1
Fig. 1 is a kind of schematic flow sheet of the call method for application programming interfaces that the embodiment of the present application provides.The side
Method can be with as follows.
Step 102:Determine that mixed type application Hybrid app need the application programming interfaces Api parameters called.
User opens a terminal the Hybrid app clients in equipment, is sent and taken to server according to URL set in advance
Accessing page request with the URL.Server determines that Hybrid app client users need to visit according to the accessing page request
HTML code corresponding to the page asked, and return to the HTML code to Hybrid app clients.
Wherein, the Api parameters that the needs included in the HTML code call, wherein, the Api parameters represent Hybrid app
The page that client user needs to access is needed by calling the Api parameters start which kind of function in terminal device.
Hybrid app clients for example, user opens a terminal in equipment, sent out according to URL set in advance to server
The accessing page request for carrying the URL is sent, server returns to user according to the accessing page request to Hybrid app clients
HTML code corresponding to the page that accesses is needed, the Api parameters that the needs included in the HTML code call are gps.js, i.e.,
The page that Hybrid app client users need to access is needed by calling the Api in Hybrid app clients in H5 containers
Parameter is the gps positioning functions in gps.jar startup terminal devices.
Step 104:Determine Hybrid app Release parameter.
Hybrid app clients for sending accessing page request, determine the version ginseng of the Hybrid app clients
Number, with according to its Release parameter, it is determined that corresponding Api parameter calls mechanism.
It should be noted that the Release parameter for determining Hybrid app clients can be that server determines, can also
It is that Hybrid app clients itself determine.
It should be noted that the accessing page request that server can be sent according to Hybrid app clients, it is determined that
The Release parameter of Hybrid app clients, request determination can be obtained by sending Release parameter to Hybrid app clients
The Release parameter of Hybrid app clients, the Release parameter of Hybrid app clients can also be determined by other means,
Here it is not specifically limited.
Step 106:According to Api parameters and Hybrid app Release parameter, tune of the Hybrid app to Api parameters is determined
Use mechanism.
It is determined that what is included in HTML code corresponding to the page that Hybrid app client users need to access needs to adjust
, can be according to the version of Hybrid app clients after the Release parameter of Api parameters and Hybrid app clients
Parameter, the call-by mechanism of the Api parameters is called for its determination, to meet user's request.
In the embodiment of the present application, according to Api parameters and Hybrid app Release parameter, determine Hybrid app to Api
Call-by mechanism, including:
Determine invocation protocol corresponding to Api parameters;
According to Hybrid app Release parameter and invocation protocol, call-by mechanisms of the Hybrid app to Api parameters is determined.
Server is upgraded to Hybrid app service ends, and the Hybrid app service ends after upgrading add newly
Calling function, that is, the Hybrid app service ends after upgrading add new Api parameters, and server is joined to newly-increased Api
Number sets invocation protocol, can include the first parameter preset, the second parameter preset or the 3rd parameter preset in invocation protocol, its
In, the first parameter preset represents that the minimum version of the Hybrid app clients of the Api parameters can be called, default according to first
Parameter, it may be determined that whether current version Hybrid app clients can call the Api parameters in terminal device;Second is default
Parameter or the 3rd parameter preset represent that current version Hybrid app clients can not call the Api parameters in terminal device
When, provide the user corresponding call and feed back.
In the embodiment of the present application, according to Hybrid app Release parameter and invocation protocol, determine Hybrid app to Api
The call-by mechanism of parameter, including two kinds of situations:
The first situation:If Hybrid app Release parameter is less than the first parameter preset in invocation protocol, and calls
Agreement includes the second parameter preset, to Hybrid app progress edition upgradings, the Hybrid app after being upgraded, wherein,
The Release parameter of Hybrid app after upgrading is not less than the first parameter preset;
Hybrid app after upgrading are called to Api parameters.
Still by taking above-mentioned calling Api parameters gps.js as an example, invocation protocol corresponding to Api parameters gps.js is:Hybrid://
gps/getIos_version=5.0&android_version=6.0&upgrade=true.
Wherein, the first parameter preset is ios_version=5.0 or android_version=6.0, ios_version
The Hybrid app clients of=5.0 minimum versions for representing to support gps positioning functions to call in ios systems are ios_
Hybrid app5.0, android_version=6.0 represent that support gps positioning functions are called most in Android system
The Hybrid app clients of lowest version are android_Hybrid app6.0;Second parameter preset is upgrade=true,
Represent when current version Hybrid app clients can not call gps positioning functions, to current version Hybrid app clients
End carries out edition upgrading.
If the Release parameter of Hybrid app clients is ios_Hybrid app3.0, due to ios_Hybrid app3.0
Less than the first parameter preset ios_Hybrid app5.0 in invocation protocol, i.e. the Hybrid app clients in current 3.0 version
Api parameters gps.jar is not present in H5 containers in end, the Hybrid app clients of current 3.0 version can not be according to Api parameters
Gps.js calls Api parameters gps.jar to start the gps positioning functions in terminal device.
After it is determined that the Hybrid app clients of current 3.0 version can not call gps positioning functions, assisted due to calling
View includes the second parameter preset upgrade=true, and therefore, the Hybrid app clients of current 3.0 version are risen
Level, to cause the Release parameter of the Hybrid app clients after upgrading not less than the first parameter preset (for example, after upgrading
The Release parameters of Hybrid app clients be ios_Hybrid app6.0), that is, the Hybrid app clients after upgrading
Include Api parameter gps.jar in middle H5 containers, the Hybrid app clients after upgrading can be according to Api parameters gps.js
Api parameters gps.jar is called to start the gps positioning functions in terminal device.
In the embodiment of the present application, the mode upgraded to Hybrid app clients can include:Pass through server pair
Hybrid app clients carry out mandatory upgrade, without prompting user;Or, Hybrid app clients are carried out by server
Mandatory upgrade, and upgrade tip is carried out to user;Or, by ejecting update dialogs, user is to Hybrid app clients for guiding
End is upgraded, but is whether selection of the upgrading depending on user.
By ejecting update dialogs, guiding user upgrades to Hybrid app clients, specifically included:
The first prompted dialog frame is ejected, wherein, the first prompted dialog frame is used to prompt to carry out version liter to Hybrid app
Level;
According to the first prompted dialog frame, Hybrid app are upgraded.
Server is it is determined that the Hybrid app clients of current 3.0 version can not call gps positioning functions, and calling
After agreement includes the second parameter preset upgrade=true, ejected in the Hybrid app clients of current 3.0 version
First prompted dialog frame, the first prompted dialog frame are used to prompt user to carry out the Hybrid app clients of current 3.0 version
Upgrading, and the upgrading to the Hybrid app clients of current 3.0 version is completed by the first prompted dialog frame, guiding user,
Or the not upgrade command that user sends is received, terminate current page and access operation.
Second case:If Hybrid app Release parameter is less than the first parameter preset in invocation protocol, and calls
Agreement includes the 3rd parameter preset, ejects the second prompted dialog frame, wherein, the second prompted dialog frame is used to prompt Hybrid
App can not realize the calling to Api.
Still by taking above-mentioned call request gps.js as an example, invocation protocol corresponding to Api parameters gps.js is:Hybrid://
gps/getIos_version=5.0&android_version=6.0&upgrade=false.
Wherein, the first parameter preset is ios_version=5.0 or android_version=6.0, ios_version
The Hybrid app clients of=5.0 minimum versions for representing to support gps positioning functions to call in ios systems are ios_
Hybrid app5.0, android_version=6.0 represent that support gps positioning functions are called most in Android system
The Hybrid app of lowest version are android_Hybrid app6.0;3rd parameter preset is upgrade=false, is represented
When current version Hybrid app clients can not call gps positioning functions, user is carried out not call prompting.
If the Release parameter of Hybrid app clients is android_Hybrid app5.0, due to android_
Hybrid app5.0 are less than the first parameter preset android_Hybrid app6.0 in invocation protocol, i.e., at current 5.0 editions
Api parameters gps.jar, the Hybrid app visitors of current 5.0 version is not present in this Hybrid app clients in H5 containers
Family end can not call Api parameters gps.jar to start the gps positioning functions in terminal device according to Api parameters gps.js.
After it is determined that the Hybrid app clients of current 5.0 version can not call gps positioning functions, assisted due to calling
View includes the 3rd parameter preset upgrade=true, therefore, is ejected in the Hybrid app clients of current 5.0 version
Second prompted dialog frame, the second prompted dialog frame are used to prompt the Hybrid app clients of current 5.0 version of user not adjust
With gps positioning functions.
Server is by pre-setting invocation protocol corresponding to Api parameters so that carries out Api in Hybrid app clients
, can be according to the invocation protocol pre-set, it is determined that current version Hybrid app clients can not be called during parameter call
During Api parameters, provide the user corresponding call and feed back:Guiding user upgrades to current version Hybrid app clients
Or prompting user's current version Hybrid app clients can not realize Api parameter calls, effectively improve Hybrid app clients
The calling efficiency to Api parameters is held, and then improves the user experience of Hybrid app clients.
In the embodiment of the present application, in addition to:
If Hybrid app Release parameter is not less than the first parameter preset, Hybrid app are called to Api parameters.
Still by taking above-mentioned Api parameters gps.js as an example, invocation protocol corresponding to Api parameters gps.js is:Hybrid://gps/
getIos_version=5.0&android_version=6.0&upgrade=true.
Wherein, the first parameter preset is ios_version=5.0 or android_version=6.0, ios_version
The Hybrid app clients of=5.0 minimum versions for representing to support gps positioning functions to call in ios systems are ios_
Hybrid app5.0, android_version=6.0 represent that support gps positioning functions are called most in Android system
The Hybrid app clients of lowest version are android_Hybrid app6.0.
If the Release parameter of Hybrid app clients is ios_Hybrid app5.0, due to ios_Hybrid app5.0
Not less than the first parameter preset ios_Hybrid app5.0 in invocation protocol, i.e. the Hybrid app visitors in current 5.0 version
Include Api parameters gps.jar in H5 containers in the end of family, the Hybrid app clients of current 5.0 version can be according to Api parameters
Gps.js calls Api parameters gps.jar to start the gps positioning functions in terminal device.
In actual applications, can be in server end according to the Release parameters of Hybrid app clients and Api parameters
Invocation protocol, determine call-by mechanism of the Hybrid app clients to Api parameters;The user that server can also be determined needs
Invocation protocol corresponding to the Api parameters that the needs included in HTML code corresponding to the page of access and the HTML code call
It is sent to Hybrid app clients so that HTML code is parsed in Hybrid app clients and determines Api parameters, according to
The Release parameter of Hybrid app clients and the invocation protocol of Api parameters, determine Hybrid app clients to Api parameters
Call-by mechanism, it is not specifically limited here.
The technical scheme that the embodiment of the present application is recorded, by determine Hybrid app need the Api parameters called and
Hybrid app Release parameter, and then determine Hybrid app to Api according to the Release parameter of Api parameters and Hybrid app
The call-by mechanism of parameter, calling efficiency of the Hybrid app to Api parameters is effectively improved, and then improve Hybrid app user
Usage experience.
Embodiment 2
Present invention design is described based on previous embodiment 1 in detail, for the ease of being better understood from the application's
Technical characteristic, means and effect, the call method of the application programming interfaces of the application is described further below, so as to be formed
Another embodiment of the application.
The calling of application programming interfaces in the invoked procedure of application programming interfaces and embodiment 1 in the embodiment of the present application 2
Journey is similar, and some other step not made referrals in embodiment 2 may refer to the associated description in embodiment 1, herein no longer
Repeat.
Fig. 2 is a kind of schematic flow sheet of the call method for application programming interfaces that the embodiment of the present application provides.The side
Method can be with as follows.
Step 202:User opens Hybrid app clients in terminal device;
Step 204:Hybrid app clients send the page for carrying the URL according to URL set in advance to server
Access request, server determine HTML code corresponding to the page that user's needs access, and determine according to the accessing page request
The Api parameters to be called of the HTML code, and then determine invocation protocol corresponding to the Api parameters that pre-set;
Step 206:Server determines the Release parameter of Hybrid app clients, and judges Hybrid app clients
Whether Release parameter is less than the first parameter preset in invocation protocol corresponding to Api parameters;If so, performing step 208, otherwise hold
Row step 214;
It should be noted that the accessing page request that server can be sent according to Hybrid app clients, it is determined that
The Release parameter of Hybrid app clients, request determination can be obtained by sending Release parameter to Hybrid app clients
The Release parameter of Hybrid app clients, the Release parameter of Hybrid app clients can also be determined by other means,
Here it is not specifically limited.
Step 208:Determine that invocation protocol includes is the second parameter preset or the 3rd parameter preset, if including be
Second parameter preset, perform step 210;If including be the 3rd parameter preset, perform step 212;
Step 210:The first prompted dialog frame is ejected, guiding user completes to enter the Hybrid app clients of current version
Row upgrading so that the Release parameter of the Hybrid app clients after upgrading is not less than the first parameter preset so that upgrades it
Hybrid app clients afterwards complete the calling to Api parameters;
Step 212:The second prompted dialog frame is ejected, prompting the Hybrid app clients of user's current version can not realize
To Api calling;
Step 214:Hybrid app clients are called to Api parameters.
The technical scheme that the embodiment of the present application is recorded, by determine Hybrid app need the Api parameters called and
Hybrid app Release parameter, and then determine Hybrid app to Api according to the Release parameter of Api parameters and Hybrid app
The call-by mechanism of parameter, calling efficiency of the Hybrid app to Api parameters is effectively improved, and then improve Hybrid app user
Usage experience.
Embodiment 3
Fig. 3 is the structural representation for a kind of electronic equipment that the embodiment of the present application provides.As shown in figure 3, in hardware view,
The electronic equipment includes processor, alternatively also includes internal bus, network interface, memory.Wherein, memory may include
Internal memory, such as high-speed random access memory (Random-Access Memory, RAM), it is also possible to also deposited including non-volatile
Reservoir (non-volatile memory), for example, at least 1 magnetic disk storage etc..Certainly, the electronic equipment is also possible that it
Hardware required for his business.
Processor, network interface and memory can be connected with each other by internal bus, and the internal bus can be ISA
(Industry Standard Architecture, industry standard architecture) bus, PCI (Peripheral
Component Interconnect, Peripheral Component Interconnect standard) bus or EISA (Extended Industry Standard
Architecture, EISA) bus etc..The bus can be divided into address bus, data/address bus, control always
Line etc..For ease of representing, only represented in Fig. 3 with a four-headed arrow, it is not intended that an only bus or a type of
Bus.
Memory, for depositing program.Specifically, program can include program code, and described program code includes calculating
Machine operational order.Memory can include internal memory and nonvolatile memory, and provide instruction and data to processor.
Processor read from nonvolatile memory corresponding to computer program into internal memory then run, in logical layer
The calling device of application programming interfaces is formed on face.Processor, performs the program deposited of memory, and specifically for perform with
Lower operation:
Determine that mixed type application Hybrid app need the application programming interfaces Api parameters called;
Determine Hybrid app Release parameter;
According to Api parameters and Hybrid app Release parameter, call-by mechanisms of the Hybrid app to Api parameters is determined.
The above-mentioned method performed such as the embodiment of the present application 1 and/or embodiment 2 can apply in processor, or by
Device is managed to realize.Processor is probably a kind of IC chip, has the disposal ability of signal.In implementation process, above-mentioned side
Each step of method can be completed by the integrated logic circuit of the hardware in processor or the instruction of software form.Above-mentioned place
Reason device can be general processor, including central processing unit (Central Processing Unit, CPU), network processing unit
(Network Processor, NP) etc.;Can also be digital signal processor (Digital Signal Processor,
DSP), application specific integrated circuit (Application Specific Integrated Circuit, ASIC), field programmable gate
Array (Field-Programmable Gate Array, FPGA) either other PLDs, discrete gate or crystalline substance
Body pipe logical device, discrete hardware components.Can realize or perform disclosed each method in the embodiment of the present application, step and
Logic diagram.General processor can be microprocessor or the processor can also be any conventional processor etc..With reference to
The step of method disclosed in the embodiment of the present application, can be embodied directly in hardware decoding processor and perform completion, or with decoding
Hardware and software module combination in processor perform completion.Software module can be located at random access memory, flash memory, read-only storage
In the ripe storage medium in this area such as device, programmable read only memory or electrically erasable programmable memory, register.Should
Storage medium is located at memory, and processor reads the information in memory, with reference to the step of its hardware completion above method.
The electronic equipment can also carry out the method that Fig. 1 and/or Fig. 2 is performed, and realize above-described embodiment 1 and/or embodiment 2
Function, the embodiment of the present application will not be repeated here.
The embodiment of the present application also proposed a kind of computer-readable recording medium, the computer-readable recording medium storage one
Individual or multiple programs, one or more programs include instruction, and the instruction is held when the electronic equipment for being included multiple application programs
During row, the electronic equipment can be made to perform the call method of the application programming interfaces in Fig. 1 and/or embodiment illustrated in fig. 2, and have
Body is used to perform:
Determine that mixed type application Hybrid app need the application programming interfaces Api parameters called;
Determine Hybrid app Release parameter;
According to Api parameters and Hybrid app Release parameter, call-by mechanisms of the Hybrid app to Api parameters is determined.
Fig. 4 is a kind of structural representation of the calling device for application programming interfaces that the embodiment of the present application provides.Device 400
Including:Determining unit 401 and processing unit 402, wherein:
Determining unit 401, determine that mixed type application Hybrid app need the application programming interfaces Api parameters called;
Determining unit 401, determine Hybrid app Release parameter;
Processing unit 402, according to Api parameters and Hybrid app Release parameter, determine Hybrid app to Api parameters
Call-by mechanism.
Alternatively, processing unit 402 determines Hybrid app couple according to Api parameters and Hybrid app Release parameter
The call-by mechanism of Api parameters, including:
Determine invocation protocol corresponding to Api parameters;
According to Hybrid app Release parameter and invocation protocol, call-by mechanisms of the Hybrid app to Api parameters is determined.
Alternatively, processing unit 402 determines Hybrid app couple according to Hybrid app Release parameter and invocation protocol
The call-by mechanism of Api parameters, including:
If Hybrid app Release parameter is less than the first parameter preset in invocation protocol, and invocation protocol includes the
Two parameter presets, to Hybrid app progress edition upgradings, the Hybrid app after being upgraded, wherein, after upgrading
Hybrid app Release parameter is not less than the first parameter preset;
Hybrid app after upgrading are called to Api parameters.
Alternatively, processing unit 402 upgrades to Hybrid app, including:
The first prompted dialog frame is ejected, wherein, the first prompted dialog frame is used to prompt to carry out version liter to Hybrid app
Level;
According to the first prompted dialog frame, Hybrid app are upgraded.
Alternatively, processing unit 402 determines Hybrid app couple according to Hybrid app Release parameter and invocation protocol
The call-by mechanism of Api parameters, including:
If Hybrid app Release parameter is less than the first parameter preset in invocation protocol, and invocation protocol includes the
Three parameter presets, the second prompted dialog frame is ejected, wherein, the second prompted dialog frame is used to prompt Hybrid app can not realize pair
The calling of Api parameters.
Alternatively, if Hybrid app Release parameter is not less than the first parameter preset, processing unit 402 controls Hybrid
App is called to Api parameters.
According to the calling device of application programming interfaces, determining unit determines that Hybrid app need the Api parameters called;Really
Order member determines Hybrid app Release parameter;Processing unit according to Api parameters and Hybrid app Release parameter, it is determined that
Hybrid app effectively improve calling efficiency of the Hybrid app to Api parameters, and then improve to the call-by mechanism of Api parameters
Hybrid app user experience.
In the 1990s, the improvement for a technology can clearly distinguish be on hardware improvement (for example,
Improvement to circuit structures such as diode, transistor, switches) or software on improvement (improvement for method flow).So
And as the development of technology, the improvement of current many method flows can be considered as directly improving for hardware circuit.
Designer nearly all obtains corresponding hardware circuit by the way that improved method flow is programmed into hardware circuit.Cause
This, it cannot be said that the improvement of a method flow cannot be realized with hardware entities module.For example, PLD
(Programmable Logic Device, PLD) (such as field programmable gate array (Field Programmable Gate
Array, FPGA)) it is exactly such a integrated circuit, its logic function is determined by user to device programming.By designer
Voluntarily programming comes a digital display circuit " integrated " on a piece of PLD, without asking chip maker to design and make
Special IC chip.Moreover, nowadays, substitution manually makes IC chip, this programming is also used instead mostly " patrols
Volume compiler (logic compiler) " software realizes that software compiler used is similar when it writes with program development,
And the source code before compiling also write by handy specific programming language, this is referred to as hardware description language
(Hardware Description Language, HDL), and HDL is also not only a kind of, but have many kinds, such as ABEL
(Advanced Boolean Expression Language)、AHDL(Altera Hardware Description
Language)、Confluence、CUPL(Cornell University Programming Language)、HDCal、JHDL
(Java Hardware Description Language)、Lava、Lola、MyHDL、PALASM、RHDL(Ruby
Hardware Description Language) etc., VHDL (Very-High-Speed are most generally used at present
Integrated Circuit Hardware Description Language) and Verilog.Those skilled in the art also should
This understands, it is only necessary to method flow slightly programming in logic and is programmed into integrated circuit with above-mentioned several hardware description languages,
Can is readily available the hardware circuit for realizing the logical method flow.
Controller can be implemented in any suitable manner, for example, controller can take such as microprocessor or processing
Device and storage can by the computer of the computer readable program code (such as software or firmware) of (micro-) computing device
Read medium, gate, switch, application specific integrated circuit (Application Specific Integrated Circuit,
ASIC), the form of programmable logic controller (PLC) and embedded microcontroller, the example of controller include but is not limited to following microcontroller
Device:ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20 and Silicone Labs C8051F320, are deposited
Memory controller is also implemented as a part for the control logic of memory.It is also known in the art that except with
Pure computer readable program code mode realized beyond controller, completely can be by the way that method and step is carried out into programming in logic to make
Controller is obtained in the form of gate, switch, application specific integrated circuit, programmable logic controller (PLC) and embedded microcontroller etc. to come in fact
Existing identical function.Therefore this controller is considered a kind of hardware component, and various for realizing to including in it
The device of function can also be considered as the structure in hardware component.Or even, can be by for realizing that the device of various functions regards
For that not only can be the software module of implementation method but also can be the structure in hardware component.
System, device, module or the unit that above-described embodiment illustrates, it can specifically be realized by computer chip or entity,
Or realized by the product with certain function.One kind typically realizes that equipment is computer.Specifically, computer for example may be used
Think personal computer, laptop computer, cell phone, camera phone, smart phone, personal digital assistant, media play
It is any in device, navigation equipment, electronic mail equipment, game console, tablet PC, wearable device or these equipment
The combination of equipment.
For convenience of description, it is divided into various units during description apparatus above with function to describe respectively.Certainly, this is being implemented
The function of each unit can be realized in same or multiple softwares and/or hardware during application.
It should be understood by those skilled in the art that, embodiments of the invention can be provided as method, system or computer program
Product.Therefore, the present invention can use the reality in terms of complete hardware embodiment, complete software embodiment or combination software and hardware
Apply the form of example.Moreover, the present invention can use the computer for wherein including computer usable program code in one or more
The computer program production that usable storage medium is implemented on (including but is not limited to magnetic disk storage, CD-ROM, optical memory etc.)
The form of product.
The present invention is the flow with reference to method according to embodiments of the present invention, equipment (system) and computer program product
Figure and/or block diagram describe.It should be understood that can be by every first-class in computer program instructions implementation process figure and/or block diagram
Journey and/or the flow in square frame and flow chart and/or block diagram and/or the combination of square frame.These computer programs can be provided
The processors of all-purpose computer, special-purpose computer, Embedded Processor or other programmable data processing devices is instructed to produce
A raw machine so that produced by the instruction of computer or the computing device of other programmable data processing devices for real
The device for the function of being specified in present one flow of flow chart or one square frame of multiple flows and/or block diagram or multiple square frames.
These computer program instructions, which may be alternatively stored in, can guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works so that the instruction being stored in the computer-readable memory, which produces, to be included referring to
Make the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one square frame of block diagram or
The function of being specified in multiple square frames.
These computer program instructions can be also loaded into computer or other programmable data processing devices so that counted
Series of operation steps is performed on calculation machine or other programmable devices to produce computer implemented processing, so as in computer or
The instruction performed on other programmable devices is provided for realizing in one flow of flow chart or multiple flows and/or block diagram one
The step of function of being specified in individual square frame or multiple square frames.
In a typical configuration, computing device includes one or more processors (CPU), input/output interface, net
Network interface and internal memory.
Internal memory may include computer-readable medium in volatile memory, random access memory (RAM) and/or
The forms such as Nonvolatile memory, such as read-only storage (ROM) or flash memory (flash RAM).Internal memory is computer-readable medium
Example.
Computer-readable medium includes permanent and non-permanent, removable and non-removable media can be by any method
Or technology come realize information store.Information can be computer-readable instruction, data structure, the module of program or other data.
The example of the storage medium of computer includes, but are not limited to phase transition internal memory (PRAM), static RAM (SRAM), moved
State random access memory (DRAM), other kinds of random access memory (RAM), read-only storage (ROM), electric erasable
Programmable read only memory (EEPROM), fast flash memory bank or other memory techniques, read-only optical disc read-only storage (CD-ROM),
Digital versatile disc (DVD) or other optical storages, magnetic cassette tape, the storage of tape magnetic rigid disk or other magnetic storage apparatus
Or any other non-transmission medium, the information that can be accessed by a computing device available for storage.Define, calculate according to herein
Machine computer-readable recording medium does not include temporary computer readable media (transitory media), such as data-signal and carrier wave of modulation.
It should also be noted that, term " comprising ", "comprising" or its any other variant are intended to nonexcludability
Comprising so that process, method, commodity or equipment including a series of elements not only include those key elements, but also wrapping
Include the other element being not expressly set out, or also include for this process, method, commodity or equipment intrinsic want
Element.In the absence of more restrictions, the key element limited by sentence "including a ...", it is not excluded that wanted including described
Other identical element also be present in the process of element, method, commodity or equipment.
The application can be described in the general context of computer executable instructions, such as program
Module.Usually, program module includes performing particular task or realizes routine, program, object, the group of particular abstract data type
Part, data structure etc..The application can also be put into practice in a distributed computing environment, in these DCEs, by
Task is performed and connected remote processing devices by communication network.In a distributed computing environment, program module can be with
In the local and remote computer-readable storage medium including storage device.
Each embodiment in this specification is described by the way of progressive, identical similar portion between each embodiment
Divide mutually referring to what each embodiment stressed is the difference with other embodiment.It is real especially for system
For applying example, because it is substantially similar to embodiment of the method, so description is fairly simple, related part is referring to embodiment of the method
Part explanation.
Embodiments herein is the foregoing is only, is not limited to the application.For those skilled in the art
For, the application can have various modifications and variations.All any modifications made within spirit herein and principle, it is equal
Replace, improve etc., it should be included within the scope of claims hereof.