CN104866383A - Interface calling method and device and terminal - Google Patents

Interface calling method and device and terminal Download PDF

Info

Publication number
CN104866383A
CN104866383A CN201510289070.8A CN201510289070A CN104866383A CN 104866383 A CN104866383 A CN 104866383A CN 201510289070 A CN201510289070 A CN 201510289070A CN 104866383 A CN104866383 A CN 104866383A
Authority
CN
China
Prior art keywords
interface
parameter
calling
request
call
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201510289070.8A
Other languages
Chinese (zh)
Other versions
CN104866383B (en
Inventor
刘争辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhuhai Baoqu Technology Co Ltd
Original Assignee
Beijing Kingsoft Internet Security Software 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 Beijing Kingsoft Internet Security Software Co Ltd filed Critical Beijing Kingsoft Internet Security Software Co Ltd
Priority to CN201510289070.8A priority Critical patent/CN104866383B/en
Publication of CN104866383A publication Critical patent/CN104866383A/en
Priority to PCT/CN2016/083359 priority patent/WO2016192556A1/en
Application granted granted Critical
Publication of CN104866383B publication Critical patent/CN104866383B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer And Data Communications (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The embodiment of the invention discloses an interface calling method and a terminal, comprising the following steps: receiving an interface calling request, wherein the interface calling request carries an interface identifier and an interface parameter corresponding to a target interface to be called by a client script; determining a calling mode of the target interface according to the interface identifier; determining a first parameter in input parameters of a target interface function corresponding to the target interface according to the calling mode and the interface parameters; taking the request identifier of the interface calling request and the first parameter as input parameters of the target interface function, and calling the target interface function; acquiring output parameters returned after the target interface function is called, wherein the output parameters comprise the request identification and second parameters; and returning the calling result of the interface calling request corresponding to the request identifier to the client script based on the second parameter. By adopting the embodiment of the invention, the development efficiency of the expansion interface can be improved.

Description

A kind of interface interchange method, device and terminal
Technical field
The present invention relates to field of computer technology, particularly relate to a kind of interface interchange method, device and terminal.
Background technology
Along with the development of Internet technology, browser has become one of application software of indispensability on mobile terminal, and when browsing webpage by the browser on mobile terminal, browser kernel makes an explanation to webpage grammer and plays up.Usually, browser kernel provides some standard interfaces for client script or calls, therefore, by loading client script in webpage, perform this client script by browser-interpreted, the Dynamic Display effect of webpage can be realized, strengthen the interactivity of webpage.Such as: realize the Special Effect Show of page elements, respond to users action, proof list forms data etc.
But the standard interface that browser kernel itself provides is limited, therefore, for meeting the development requirement of Web page, developer need develop more expansion interface as required, and the client script for Web page calls.At present, owing to developing the standard disunity of expansion interface, a kind of unification does not process the interface interchange method that client script calls arbitrary extension interface, therefore, developer is when developing expansion interface, the Functional Design interface function provided for this expansion interface is not only provided, but also needs to design for this expansion interface the disposal route that client script calls this interface.Such as: existing interface exploitation method as shown in Figure 1a, during development interface A and interface B, except the interface function of the interface function and interface B of developing interface A, call method when also need develop a set of script calling interface A for interface A and call method when developing a set of script calling interface B for interface B, cause development efficiency low.
Summary of the invention
The embodiment of the present invention provides a kind of interface interchange method, device and terminal, can improve the development efficiency of expansion interface.
First aspect, the embodiment of the present invention provides a kind of interface interchange method, comprising:
Receiving interface call request, described interface interchange request carries interface identifier corresponding to target interface that client script needs to call and interface parameters, one of expansion interface that described target interface provides for browser;
According to described interface identifier, determine the method for calling of described target interface;
According to described method of calling and described interface parameters, determine the first parameter in the input parameter of the target interface function that described interface identifier is corresponding;
Using the request of described interface interchange request mark and described first parameter as the input parameter of described target interface function, call described target interface function;
Obtain the output parameter returned after calling described target interface function, described output parameter comprises described request mark and the second parameter;
Based on described second parameter, the result of calling of interface interchange request corresponding for described request mark is returned to described client script.
In the first possible implementation of first aspect, the data type of described output parameter is the first default data type;
Described according to described method of calling and described interface parameters, after determining the first parameter in the input parameter of the target interface function that described target interface is corresponding, described method also comprises:
Described first parameter is carried out format conversion, and the data type of the first parameter after changing is the second default data type;
The output parameter that described acquisition returns after calling described target interface function, after described output parameter comprises described request mark and the second parameter, described method also comprises:
Described second parameter is carried out format conversion, and the data type of the second parameter after changing is the 3rd default data type.
In conjunction with the first possible implementation of first aspect or first aspect, in the implementation that the second of first aspect is possible, described according to described method of calling and described interface parameters, determine that the first parameter in the input parameter of the target interface function that described target interface is corresponding comprises:
If described method of calling is synchronization call, described interface parameters is defined as the first parameter in the input parameter of described target interface function;
If described method of calling is asynchronous call, other parameter in described interface parameters except parameter preset is defined as the first parameter in the input parameter of described target interface function, described parameter preset is for identifying call back function.
In conjunction with the first possible implementation of first aspect or first aspect, in the third possible implementation of first aspect, described based on described second parameter, the result of calling of interface interchange request corresponding for described request mark is returned to described client script and comprises:
If described method of calling is synchronization call, the result of calling that described second parameter identifies corresponding interface interchange request as described request is returned to described client script;
If described method of calling is asynchronous call, determine the target call back function that described request mark is corresponding, and using the input parameter of described second parameter as described target call back function, run described target call back function and obtain Output rusults, and then described Output rusults is returned to described client script as the result of calling of described interface interchange request.
In conjunction with the third possible implementation of first aspect, in the 4th kind of possible implementation of first aspect, described according to described interface identifier, after determining the method for calling of described target interface, described method also comprises:
If described method of calling is asynchronous call, be saved to by callback information in callback data storehouse, described callback information comprises the call back function that described request identifies and described parameter preset identifies;
The described target call back function determining described request mark correspondence, comprising:
If described method of calling is asynchronous call, from described callback data storehouse, inquire about callback information corresponding to described request mark according to described request mark;
The call back function that described callback information is specified is defined as target call back function.
In conjunction with the 4th kind of possible implementation of first aspect, in the 5th kind of possible implementation of first aspect, describedly call after result returns to described client script using described second parameter as interface interchange request corresponding to described request mark, described method also comprises:
Delete the callback information that the mark of request described in described callback data storehouse is corresponding.
In conjunction with the first possible implementation of first aspect or first aspect, in the 6th kind of possible implementation of first aspect, described according to described interface identifier, determine that the method for calling of described target interface comprises:
According to described interface identifier, from the interface database preset, inquire about interface message corresponding to described interface identifier, described interface message comprises interface identifier and method of calling;
Method of calling corresponding for this interface identifier in described interface database is defined as the method for calling of described target interface.
Second aspect, the embodiment of the present invention provides a kind of interface interchange device, comprising:
Receiver module, for receiving interface call request, described interface interchange request carries interface identifier corresponding to target interface that client script needs to call and interface parameters, one of expansion interface that described target interface provides for browser;
Mode determination module, for according to described interface identifier, determines the method for calling of described target interface;
Parameter determination module, for according to described method of calling and described interface parameters, determines the first parameter in the input parameter of the target interface function that described interface identifier is corresponding;
Calling module, for using the request of described interface interchange request mark and described first parameter as the input parameter of described target interface function, call described target interface function;
Acquisition module, for obtain call described target interface function after the output parameter that returns, described output parameter comprises described request mark and the second parameter;
Return module, for based on described second parameter, the result of calling of interface interchange request corresponding for described request mark is returned to described client script.
In the first possible implementation of second aspect, the data type of described output parameter is the first default data type, and described device also comprises:
First modular converter, for described first parameter is carried out format conversion, the data type of the first parameter after changing is the second default data type;
Second modular converter, for described second parameter is carried out format conversion, the data type of the second parameter after changing is the 3rd default data type.
In conjunction with the first possible implementation of second aspect or second aspect, in the implementation that the second of second aspect is possible, described parameter determination module specifically for:
If described method of calling is synchronization call, described interface parameters is defined as the first parameter in the input parameter of described target interface function;
If described method of calling is asynchronous call, other parameter in described interface parameters except parameter preset is defined as the first parameter in the input parameter of described target interface function, described parameter preset is for identifying call back function.
In conjunction with the first possible implementation of second aspect or second aspect, in the third possible implementation of second aspect, described in return module and comprise:
Synchronously return unit, if described method of calling is synchronization call, the result of calling that described second parameter identifies corresponding interface interchange request as described request is returned to described client script;
Asynchronously return unit, if described method of calling is asynchronous call, determine the target call back function that described request mark is corresponding, and using the input parameter of described second parameter as described target call back function, run described target call back function and obtain Output rusults, and then described Output rusults is returned to described client script as the result of calling of described interface interchange request.
In conjunction with the third possible implementation of second aspect, in the 4th kind of possible implementation of second aspect, described device also comprises:
Preserve module, if be asynchronous call for described method of calling, be saved to by callback information in callback data storehouse, described callback information comprises the call back function that described request identifies and described parameter preset identifies;
Described synchronously return unit specifically for:
If described method of calling is asynchronous call, from described callback data storehouse, inquire about callback information corresponding to described request mark according to described request mark;
The call back function that described callback information is specified is defined as target call back function.
In conjunction with the 4th kind of possible implementation of second aspect, in the 5th kind of possible implementation of second aspect, described device also comprises:
Removing module, for deleting callback information corresponding to the mark of request described in described callback data storehouse.
In conjunction with the 5th kind of possible implementation of second aspect or second aspect, in the 6th kind of possible implementation of second aspect, described mode determination module specifically for:
According to described interface identifier, from the interface database preset, inquire about interface message corresponding to described interface identifier, described interface message comprises interface identifier and method of calling;
Method of calling corresponding for this interface identifier in described interface database is defined as the method for calling of described target interface.
The third aspect, the embodiment of the present invention provides a kind of terminal, it is characterized in that, comprises interface interchange device as above.
In the embodiment of the present invention, receiving interface call request, described interface interchange request carries interface identifier corresponding to target interface that client script needs to call and interface parameters, one of expansion interface that described target interface provides for browser; According to described interface identifier, determine the method for calling of described target interface; According to described method of calling and described interface parameters, determine the first parameter in the input parameter of the target interface function that described interface identifier is corresponding; Using the request of described interface interchange request mark and described first parameter as the input parameter of described target interface function, call described target interface function; Obtain the output parameter returned after calling described target interface function, described output parameter comprises described request mark and the second parameter; Based on described second parameter, the result of calling of interface interchange request corresponding for described request mark is returned to described client script.Adopt the embodiment of the present invention, by design and the interface interchange of normalized interface function, browser can adopt unified interface interchange method to realize client script calling arbitrary expansion interface.Thus, when developer develops expansion interface, only need develop interface function corresponding to this expansion interface, the development efficiency of expansion interface can be improved.
Accompanying drawing explanation
In order to be illustrated more clearly in the technical scheme in the embodiment of the present invention, below the accompanying drawing used required in describing embodiment is briefly described, apparently, accompanying drawing in the following describes is some embodiments of the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
Fig. 1 a is the schematic diagram of a kind of interface interchange that existing method provides;
Fig. 1 is the schematic flow sheet of a kind of interface interchange method that the embodiment of the present invention provides;
Fig. 1 b is the schematic diagram of a kind of interface interchange that Fig. 1 provides;
Fig. 2 is another schematic flow sheet of a kind of interface interchange method that the embodiment of the present invention provides;
Fig. 3 is the structural representation of a kind of interface interchange device that the embodiment of the present invention provides;
Fig. 4 is another structural representation of a kind of interface interchange device that the embodiment of the present invention provides;
Fig. 4 a is wherein a kind of structural representation returning module that Fig. 4 provides;
Fig. 5 is the another structural representation of a kind of interface interchange device that the embodiment of the present invention provides;
Fig. 6 is the structural representation of a kind of terminal that the embodiment of the present invention provides;
Fig. 7 is a structural representation again of a kind of interface interchange device that the embodiment of the present invention provides.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only a part of embodiment of the present invention, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
Embodiments provide a kind of interface interchange method, device and terminal, a kind of interface interchange method, device and the terminal that provide below in conjunction with accompanying drawing 1-accompanying drawing 7 pairs of embodiment of the present invention describe in detail respectively.
Refer to Fig. 1, Fig. 1 is the schematic flow sheet of a kind of interface interchange method that the embodiment of the present invention provides, and in embodiments of the present invention, the method can comprise the following steps.
S101: receiving interface call request, described interface interchange request carries interface identifier corresponding to target interface that client script needs to call and interface parameters, one of expansion interface that described target interface provides for browser.
Method described in embodiments of the present invention may be used for the browser in terminal or is similar in the product of browser, described terminal can be the terminals such as computing machine, IPAD, mobile phone, also can be other smart machine, concrete, the embodiment of the present invention impose any restrictions.
Usually, the Dynamic Display effect of horn of plenty webpage, strengthen the interactivity of webpage and user, browser provides a large amount of interface to webpage, calls for the client script loaded in webpage, browser-interpreted, performs this client script.Such as: when browser receives the interface interchange request of client script, the information of carrying according to this interface interchange request runs interface function corresponding to target interface specified by this information, thus realizes corresponding function.Therefore, browser is in the process of Web page loading, if the client script in webpage needs to call the expansion interface that browser provides, then and receiving interface call request.
S102: according to described interface identifier, determines the method for calling of described target interface.
The method of calling of interface comprises synchronization call and asynchronous call, and wherein, synchronization call is that a kind of block type calls, and called side will wait for that called side just returns after being finished, and belongs to unidirectional and calls; Asynchronous call is a kind of two-wayly to call, be similar to the treatment mechanism of message or event, only there is operation requests in called side, not etc. called side is not finished and returns immediately, the call back function (callback) that called side provides initiatively calls after being finished in called side, execution result is returned to called side, and therefore, asynchronous call can promote the efficiency that browser performs webpage.Usually, after developer develops the interface function of expansion interface, the function that can realize according to expansion interface pre-sets the method for calling of this interface.Such as, when supposing client script calling interface A, subsequent operation can be performed without the need to returning results of interface A, then for improving the operational efficiency of webpage, the method of calling of interface A can be set to asynchronous call, thus, there is the parameter that represents call back function in the interface parameters of interface A, this parameter and interface need the concrete function realized to have nothing to do, for returning the operation result of interface.Again such as, when supposing client script calling interface B, the prerequisite returned results as subsequent operation of interface B, then can be set to synchronization call by the method for calling of interface B.
As a kind of example, it can be the interface message recording expansion interface in default interface database, described interface message comprises interface identifier and method of calling, described interface identifier can be the interface name of interface function, also can be and interface name other identifier one to one, concrete, the embodiment of the present invention is not restricted; Method of calling comprises synchronization call and asynchronous call.For convenience of description, suppose that interface identifier is interface name, the expansion interface provided has 3, then the file layout of interface database can be as shown in table 1, and table 1 is that the embodiment of the present invention provides a kind of storage of interface database to illustrate.
Table 1
Interface identifier Method of calling
recordHistory Asynchronous call
downloadUrl Asynchronous call
playAudio Synchronization call
As known from Table 1, in the expansion interface that browser provides, interface identifier is respectively " recordHistory " and the method for calling corresponding to interface of " downloadUrl " is asynchronous call, and the method for calling of interface identifier corresponding to the interface of " playAudio " is synchronization call.Therefore, in the embodiment of the present invention, according to interface identifier entrained in interface interchange request, the method for calling of target interface corresponding to described interface identifier can be inquired from interface database.
As another kind of example, it also can be the parameter of the method for calling including mark target interface in the interface parameters entrained by interface interchange request.Such as: first parameter can supposing in interface parameters is used for representing the method for calling of target interface, synchronization call is represented with " 1 ", asynchronous call is represented with " 0 ", certainly, the parameter of the method for calling of expression target interface also can be the parameter being positioned at other position in interface parameters, the concrete numerical value of expression method of calling can be also other character, and the embodiment of the present invention is not restricted.But based on this hypothesis, according to the method for calling of the concrete numerical value determination target interface of first parameter in interface parameters, if get this parameter for " 1 ", then can determine that the method for calling of the target interface that interface identifier is corresponding is synchronization call; " if 0 ", then can determine that the method for calling of the target interface that interface identifier is corresponding is asynchronous call.What deserves to be explained is, the concrete form of the embodiment of the present invention to the parameter of the method for calling of spotting interface is not restricted, and makes an appointment and demarcates rule.In the embodiment of the present invention, according to interface parameters entrained in interface interchange request, the method for calling of the target interface that described interface identifier is corresponding can be determined.For convenience of the explanation of subsequent step, the embodiment of the present invention is for the first example.
S103: according to described method of calling and described interface parameters, determines the first parameter in the input parameter of the target interface function that described interface identifier is corresponding.
Because browser there are differences when the interface interchange request processing asynchronous call and synchronization call respectively, asynchronous call needs called side to provide a parameter identifying call back function, and called side returns the execution result of target interface function after being finished by this call back function; Synchronization call is the execution result that called side directly returns target interface function after being finished.Therefore, if method of calling is asynchronous call, there is the parameter preset of mark call back function (callback) in interface parameters then entrained by interface interchange request, this parameter preset is provided by called side, and called side is responsible for the call back function calling this parameter preset mark.
In the embodiment of the present invention, the mode of standardization client script calling interface, such as, represents that the script of synchronization call and asynchronous call can as shown in code 1.
Code 1
// synchronization call, operating result is obtained by rreturn value
function syncInterface(arg1,arg2,......);
// asynchronous call, operating result is obtained by call back function callback
function asyncInterface(arg1,arg2,......,callback);
// call back function specification
function asyncCallback(Object);
As can be seen from code 1, the embodiment of the present invention has been standardized the specification of script calling interface, and wherein, number and the data type of interface parameters (arg1, arg2 etc.) set according to the actual requirements.In asynchronous call, last parameter in interface parameters can be used for representing the parameter of call back function, certainly, also can be the parameter being positioned at other position in interface parameters, concrete, the embodiment of the present invention be restricted, and reaches in advance and arranges.Call back function in asynchronous call is used for calling result and informs to client script, wherein, the specification of call back function is also listed in code 1, and it accepts an input parameter, the type of input parameter can be the conventional data type that script is supported, such as: Object object.
In the embodiment of the present invention, if method of calling is synchronization call, then according to the interface parameters that interface interchange request is carried, directly can determine that this interface parameters is the first parameter in the input parameter of the target interface function that target interface is corresponding.If method of calling is asynchronous call, then according to the interface parameters that interface interchange request is carried, other parameter determining in this interface parameters except parameter preset is the first parameter in the input parameter of the target interface function that target interface is corresponding, wherein, parameter preset for identifying call back function, the corresponding call back function of each parameter preset.
S104: using the request of described interface interchange request mark and described first parameter as the input parameter of described target interface function, call described target interface function.
In specific implementation, using the request of described interface interchange request mark and described first parameter as the input parameter of described target interface function, before calling described target interface function, can determine that the request of described interface interchange request identifies.Further, consider that browser is in the process of Web page loading, the situation simultaneously processing multinomial interface interchange request can be there is, therefore, the request mark of employing demarcates every interface interchange request of client script calling interface, all information association of the interface interchange request that this request mark is corresponding with it, described information comprise this interface interchange request interface identifier, interface parameters, call result etc., thus, follow the tracks of every interface interchange request by request mark and call result.In the embodiment of the present invention, after receiving interface interchange request, determine the request mark of this interface interchange request, wherein, request mark can be that browser kernel distributes when receiving interface interchange request automatically.Known, a request mark unique demarcation interface interchange request, and request mark associates with interface parameters with the interface identifier entrained by this interface interchange request.
In the embodiment of the present invention, the design of interface function standardized, namely each interface function receives a request mark one of them parameter as input parameter, and using this request mark also as one of them parameter of output parameter.Such as: using request mark one of them parameter as the input parameter of interface function, namely input parameter comprises request mark and the first parameter; Using this request mark one of them parameter as the output parameter of interface function, namely output parameter comprises request mark and the second parameter, request mark and the second parameter association.Thus, after interface function is finished, obtain the output parameter of this interface function, output parameter comprise request mark and the second parameter, by request mark distinguish this request mark associate the second parameter be which interface interchange request call result.
In specific implementation, using request mark and the first parameter as the input parameter of target interface function corresponding to target interface, call this target interface function, namely run this target interface function.
S105: obtain the output parameter returned after calling described target interface function, described output parameter comprises described request mark and the second parameter.
In the embodiment of the present invention, the output parameter of interface function comprises request mark and the second parameter, wherein, second parameter is the parameter being used for returning to client script after this interface function realizes interface function, request mark be used for identifying this second parameter be which interface interchange request of client script call result.
In specific implementation, after target interface function operation, obtain the output parameter returned after calling described target interface function, described output parameter comprises described request mark and the second parameter.
S106: based on described second parameter, returns to described client script by the result of calling of interface interchange request corresponding for described request mark.
As a kind of example, if method of calling is synchronization call, due to called side need wait for called side return call result after just perform subsequent operation, therefore, the result of calling that second parameter identifies corresponding interface interchange request as request is directly returned to called side, wherein, request mark and this second parameter association.
As another kind of example, if method of calling is asynchronous call, due to called side without the need to wait for called side return call result after can continue to perform subsequent operation, call result and return to called side by call back function.Therefore, called side is using the input parameter of the second parameter as call back function, what returned the interface interchange request of request mark correspondence by the mode calling this call back function calls result to called side, wherein, request mark and this second parameter association, call back function is for asking the parameter preset demarcated in the interface parameters entrained by interface interchange request corresponding to mark.Understandable, called side is client script, and called side is browser.Thus, the result of calling of interface interchange request is returned to client script, completes calling of interface.
For convenience of description, the inventive method can be interpreted as interface middle layer, as shown in Figure 1 b, Fig. 1 b is the schematic diagram of a kind of interface interchange that Fig. 1 provides.Browser is in the process performing webpage, if the client script in webpage needs to call the expansion interface that browser provides, then interface middle layer receiving interface call request, interface identifier corresponding to target interface that client script needs to call and interface parameters is carried in this interface interchange request, wherein, the arbitrary expansion interface in the expansion interface that provides for browser of target interface; Adopt the target interface function that said method invocation target interface is corresponding, and using the operation result of this target interface function as this interface interchange request result of calling return to client script.Thus, the call flow of Processing Interface is unified by this interface middle layer, developer is when developing expansion interface, only need develop corresponding interface function for expansion interface, without the need to designing the call method of this interface a set of for each expansion interface, reduce workload, improve development efficiency.
In the interface interchange method that the embodiment of the present invention describes, receiving interface call request, described interface interchange request carries interface identifier corresponding to target interface that client script needs to call and interface parameters, one of expansion interface that described target interface provides for browser; According to described interface identifier, determine the method for calling of target interface; According to described method of calling and described interface parameters, determine the first parameter in the input parameter of the target interface function that described target interface is corresponding; Using the request of described interface interchange request mark and described first parameter as the input parameter of described target interface function, call described target interface function; Obtain the output parameter returned after calling described target interface function, described output parameter comprises described request mark and the second parameter; Based on described second parameter, the result of calling of interface interchange request corresponding for described request mark is returned to described client script.Adopt the embodiment of the present invention, by design and the interface interchange of normalized interface function, browser can adopt unified interface interchange method to realize client script calling arbitrary expansion interface.Thus, when developer develops expansion interface, only need develop interface function corresponding to this expansion interface, improve development efficiency.
Refer to Fig. 2, Fig. 2 is another schematic flow sheet of a kind of interface interchange method that the embodiment of the present invention provides, and in embodiments of the present invention, the method can comprise the following steps.
S201: receiving interface call request, described interface interchange request carries interface identifier corresponding to target interface that client script needs to call and interface parameters.
S202: according to described interface identifier, determines the method for calling of described target interface.
In specific implementation, according to the target interface that interface interchange request will be called, determine the method for calling of this target interface, described method of calling comprises synchronization call and asynchronous call.Usually, the interface message of each interface is stored in advance in interface database, and described interface message comprises interface identifier and method of calling.When browser receives this interface interchange request, according to the interface identifier carried in this interface interchange request, inquire about the interface message that this interface identifier is corresponding from interface database, interface message comprises interface identifier and method of calling; Thus, method of calling corresponding for this interface identifier in interface database is defined as the method for calling of target interface.Certainly, the method for calling of target interface also can be client script when calling this target interface, and demarcate in the interface parameters of interface interchange request, concrete, the embodiment of the present invention is not restricted.
But as one preferred embodiment, determine that the method for calling of target interface can be according to interface identifier, inquire about interface message corresponding to this interface identifier from the interface database preset, described interface message comprises interface identifier and method of calling; Method of calling corresponding for this interface identifier inquired from interface database is defined as the method for calling of described target interface.
S203: according to described method of calling and described interface parameters, determines the first parameter in the input parameter of the target interface function that described interface identifier is corresponding.
In the embodiment of the present invention, asynchronous call needs client script in interface parameters, carry the parameter of a mark call back function, for convenience of describing, the parameter of mark call back function is called parameter preset.Such as, last parameter in the interface parameters of asynchronous call can be used for depositing parameter preset, certainly, also can arrange parameter preset other position in interface parameters according to making an appointment, concrete, the embodiment of the present invention is not restricted.In one implementation, if determine, method of calling is asynchronous call, obtain the parameter preset identifying call back function in interface parameters, callback information is saved in default callback data storehouse, described callback information comprises the call back function that described request identifies and described parameter preset identifies, and certainly, callback information can also comprise the out of Memory such as environmental variance required when running this call back function, concrete, the embodiment of the present invention is not restricted.Thus, facilitate subsequent step (such as, step S208) return asynchronous call call result time, according to the request mark in the output parameter returned after invocation target interface function, from this callback data storehouse, inquire about the target call back function that this request mark is corresponding.
As a kind of example, represent that the script of synchronization call and asynchronous call can as shown in the code 1 in above-described embodiment.Known, the interface parameters of synchronization call is the parameter required for target interface function corresponding to target interface, be used in the interface parameters of asynchronous interface representing that the parameter preset (callback) of call back function does not need in the target interface function that target interface is corresponding, but after target interface function operation, need to call the call back function represented by this parameter preset, return and call result.In the embodiment of the present invention, determine the first parameter in the input parameter of the target interface function that target interface is corresponding according to the method for calling of target interface and interface parameters.In specific implementation, if method of calling is synchronization call, the interface parameters of carrying in interface interchange request is defined as the first parameter in the input parameter of target interface function corresponding to target interface; If method of calling is asynchronous call, other parameter in the interface parameters of carry interface interchange request except parameter preset is defined as the first parameter in the input parameter of target interface function, wherein, parameter preset for identifying call back function, the corresponding call back function of each parameter preset.
S204: described first parameter is carried out format conversion, the data type of the first parameter after changing is the second default data type.
Because current browser is mostly multi-core browser, namely browser comprises two or more browser kernel, existing method is when for multi-core browser exploitation expansion interface, an interface function identical with the function that this expansion interface will realize need be all designed for each browser kernel, not only cost of development is high, and due to the design specifications of different browser kernel docking port functions different, the interface function that different browser kernels calls for identical interface identifier is different, cause interface interchange flow process complicated, thus, the efficiency of calling interface is low.
In the embodiment of the present invention, by the design specifications of interface function, no matter for which type of browser kernel, identical specification is all adopted to carry out design interface function.Such as, the design specifications of interface function can as shown in code 2, and when adding interface function, developer only need realize corresponding function according to this specification.What deserves to be explained is, code 2 is only example, and the present invention is not limited to this example.
// interface function specification, id represents that the request corresponding with interface interchange request identifies, and kv_map preserves the parameter that script imports into
Value InterfaceFunction(int id,KeyValueMap kv_map);
In this specification, id is request mark, for following the tracks of this interface interchange request and calling result; The data type of the first parameter kv_map of interface function is the second default data type, described second data type can be predefined for receiving the type of data structure of any categorical data, also can be the conventional data type in the database that carries of programming language, this data type can receive the data of any data type.Such as: KeyValueMap type or Value type, concrete, the embodiment of the present invention is not restricted.For convenience of description, the embodiment of the present invention for KeyValueMap type, but it should be noted that not limiting the second data type is KeyValueMap type for the second data type.Wherein, KeyValueMap or Value is a kind of data type, and the type, as storage tank, can be used for preserving the data of number of different types, such as: integer, floating number, character string etc.Concrete, KeyValueMap is a kind of key-value (Key-Value) mapping table, the one-to-one relationship of key (Key) and value (Value) is saved in this mapping table, key (Key) can be numeral (order of parameter) or character string (title of parameter), and value (Value) is the occurrence of certain key corresponding in parameter.
In the embodiment of the present invention, determined first parameter is carried out format conversion, the data type of the first parameter after changing is the second default data type.Namely before the target interface function that invocation target interface is corresponding, need the first parameter scripts pass is come in change, as the first Parameter Switch is become a KeyValueMap object etc.
For convenience of description, suppose that client script is for calling the interface that is added web-page histories record, and the method for calling of this interface is asynchronous call, the interface specification that then client script provides can be: functionrecordHistory (url, date, callback), first Parametric Representation needs the network address (url importing webpage into, be assumed to http: www.liebao.cn), second parameter represents the time (time needing to import into access, be assumed to 2014-07-2020:00:00), last parameter is script function object, this parameter is not as the parameter of calling interface function, and for notifying script after interface function successful operation, therefore, step S103 does not comprise this parameter according to determined first parameter of interface parameters.After determined first parameter is carried out format conversion, the first parameter obtaining the KeyValueMap type after changing can be as shown in table 2, and table 2 is the signals of a kind of second data type that the embodiment of the present invention provides.
Table 2
Thus, after ensureing that different browser kernels receives the interface interchange request of client script, can be all the parameter that data type is identical by the first Parameter Switch by this step, the data type of the input parameter of docking port function achieves unification, therefore, an interface function need only be designed when developer develops a socket for multi-core browser.
S205: using the request of described interface interchange request mark and described first parameter as the input parameter of described target interface function, call described target interface function.
In specific implementation, using the request of described interface interchange request mark and described first parameter as the input parameter of described target interface function, before calling described target interface function, can determine that the request of described interface interchange request identifies.Consider that browser is in the process of Web page loading, the situation simultaneously processing multinomial interface interchange request can be there is, therefore, the request mark of employing demarcates every interface interchange request of client script calling interface, all information association of the interface interchange request that this request mark is corresponding with it, described information comprise this interface interchange request interface identifier, interface parameters, call result etc., thus, by request mark follow the tracks of every interface interchange request and call result.In the embodiment of the present invention, after receiving interface interchange request, determine the request mark of this interface interchange request, wherein, request mark can be that browser kernel distributes when receiving interface interchange request automatically.Known, a request mark unique demarcation interface interchange request, and request mark associates with interface parameters with the interface identifier entrained by this interface interchange request.
Usually, after developer develops a set of expansion interface, the relevant information of this interface be kept in default interface database, wherein, the relevant information of interface comprises interface identifier and interface function, and described interface identifier can be interface name.If developer has provided the target interface specified by interface interchange request, then can find a unique interface function mated with this interface identifier in the information bank preset by the interface identifier carried in interface interchange request.In the embodiment of the present invention, according to the interface identifier carried in interface interchange request, in query interface database, whether there is the interface function mated with described interface identifier.If exist, illustrate that browser provides the target interface specified by this interface identifier, the request mark corresponding according to interface interchange request and the first parameter after changing run the target interface function found; If do not exist, illustrate that browser does not provide this target interface, then return default error message.
If inquire the target interface function that in interface database, existence is mated with interface identifier, then the first parameter after request being identified and changing in step S204, as the input parameter of found target interface function, calls this target interface function.In other words, the first parameter after request mark and conversion is substituted in the target interface function found, run or perform the target interface function found.Thus for different browser kernels, after adopting the embodiment of the present invention, can adopt unified specification calling interface function, the mode of different browser kernel calling interfaces is identical, and the efficiency of calling interface is high, and the execution efficiency of webpage is also improved.
S206: obtain the output parameter returned after calling described target interface function, described output parameter comprises described request mark and the second parameter, and the data type of described output parameter is the first default data type.
After the target interface function that invocation target interface is corresponding, obtain the output parameter returned after calling described target interface function, described output parameter comprises described request mark and the second parameter, the data type of described output parameter is the first default data type, wherein, the second parameter is used for representing the operation result of target interface function.In specific implementation, described first data type can be predefined for receiving the data type of any categorical data, and also can be the conventional data type in the database that carries of programming language, this data type can receive the data of any data type.Such as: KeyValueMap type or Value type, concrete, the embodiment of the present invention is not restricted.For convenience of description, in code 2 or the embodiment of the present invention for the first data type for Value type, but the embodiment of the present invention does not limit the first data type is Value type.Thus, when developer is for different browser kernels exploitation expansion interface, only need according to Specification Design interface function, without the need to designing an interface function respectively for different browser kernels, and without the need to designing the call method of interface corresponding to this interface function, not only can reduce cost of development, and improve development efficiency.
What deserves to be explained is, in specific implementation, also can be that the data type of the second parameter is the first default data type, the data type of the output parameter of interface function be structure, and this structure comprises request mark and the second parameter.Such as, for the first data type for Value type, the specification of structure can as shown in code 3.
Code 3
struct InterfaceResult
{
Value val;
int id;
};
S207: described second parameter is carried out format conversion, the data type of the second parameter after changing is the 3rd default data type.
As one preferred embodiment, the second parameter in the output parameter returned after accessed invocation target interface function is carried out format conversion, the data type of the second parameter after changing is the 3rd default data type.Wherein, the 3rd data type can be predefined for receiving the type of data structure of any categorical data, also can be the conventional data type in client-side scripting language, and such as, Object object, concrete, the embodiment of the present invention is not restricted.Thus, standardization processing is carried out to the result of calling returning to client script, improves the execution efficiency of script.What deserves to be explained is, also can not carry out format conversion for the second parameter, skip this step and perform step S208.
S208: based on described second parameter, returns to described client script by the result of calling of interface interchange request corresponding for described request mark.
According to the method for calling of target interface, the result of calling that the second parameter identifies corresponding interface interchange request as the request in this output parameter is returned to described client script.In specific implementation, if the method for calling of target interface is synchronization call, the result of calling that the second parameter or the second parameter after format conversion identify corresponding interface interchange request as described request is returned to described client script; If described method of calling is asynchronous call, identify according to described request, determine the target call back function that this request mark is corresponding, using the second parameter or the second parameter after the format conversion input parameter as described target call back function, run described target call back function and obtain Output rusults, and then described Output rusults is returned to client script as the result of calling of described interface interchange request.
In one embodiment, if method of calling is asynchronous call, then determine that the mode of the target call back function that described request mark is corresponding can be: according to described request mark, from described callback data storehouse, inquire about the callback information that described request mark is corresponding; The call back function that described callback information is specified is defined as target call back function.Meanwhile, store the out of Memory running this target call back function if get in this callback information, then current environmental variance is set according to these information, ensure normal this target call back function of operation, result will be called and inform to client script.
As a kind of feasible embodiment, will call after result returns to client script, delete the callback information that the mark of request described in described callback data storehouse is corresponding.Thus, reduce data volume, improve the search efficiency of target call back function.
In the interface interchange method that the embodiment of the present invention describes, receiving interface call request, described interface interchange request carries interface identifier corresponding to target interface that client script needs to call and interface parameters, one of expansion interface that described target interface provides for browser; According to described interface identifier, determine the method for calling of target interface; According to described method of calling and described interface parameters, determine the first parameter in the input parameter of the target interface function that described target interface is corresponding; Using the request of described interface interchange request mark and described first parameter as the input parameter of described target interface function, call described target interface function; Obtain the output parameter returned after calling described target interface function, described output parameter comprises described request mark and the second parameter; Based on described second parameter, the result of calling of interface interchange request corresponding for described request mark is returned to described client script.Adopt the embodiment of the present invention, by design and the interface interchange of normalized interface function, browser can adopt unified interface interchange method to realize client script calling arbitrary expansion interface.Thus, when developer develops expansion interface, only need develop interface function corresponding to this expansion interface, improve development efficiency.
Be apparatus of the present invention embodiment below, apparatus of the present invention embodiment and the inventive method embodiment belong to same design, for performing the method described in the inventive method embodiment.For convenience of explanation, apparatus of the present invention embodiment only illustrates the part relevant to apparatus of the present invention embodiment, and concrete ins and outs do not disclose, and please refer to the description of the inventive method embodiment, repeats no longer one by one herein.
Refer to Fig. 3, Fig. 3 is the structural representation of a kind of interface interchange device that the embodiment of the present invention provides, in embodiments of the present invention, this device can comprise: receiver module 101, mode determination module 102, parameter determination module 103, calling module 104, acquisition module 105 and return module 106.
Receiver module 101, for receiving interface call request, described interface interchange request carries interface identifier corresponding to target interface that client script needs to call and interface parameters, the arbitrary expansion interface in the expansion interface that described target interface provides for browser.
Mode determination module 102, for according to described interface identifier, determines the method for calling of described target interface.
Parameter determination module 103, for according to described method of calling and described interface parameters, determines the first parameter in the input parameter of the target interface function that described target interface is corresponding.
Calling module 104, for using the request of described interface interchange request mark and described first parameter as the input parameter of described target interface function, call described target interface function.
Acquisition module 105, for obtain call described target interface function after the output parameter that returns, described output parameter comprises described request mark and the second parameter.
Return module 106, for based on described second parameter, the result of calling of interface interchange request corresponding for described request mark is returned to described client script.
In the interface interchange device that the embodiment of the present invention describes, receiving interface call request, described interface interchange request carries interface identifier corresponding to target interface that client script needs to call and interface parameters, one of expansion interface that described target interface provides for browser; According to described interface identifier, determine the method for calling of target interface; According to described method of calling and described interface parameters, determine the first parameter in the input parameter of the target interface function that described target interface is corresponding; Using the request of described interface interchange request mark and described first parameter as the input parameter of described target interface function, call described target interface function; Obtain the output parameter returned after calling described target interface function, described output parameter comprises described request mark and the second parameter; Based on described second parameter, the result of calling of interface interchange request corresponding for described request mark is returned to described client script.Adopt the embodiment of the present invention, by design and the interface interchange of normalized interface function, browser can adopt unified interface interchange method to realize client script calling arbitrary expansion interface.Thus, when developer develops expansion interface, only need develop interface function corresponding to this expansion interface, improve development efficiency.
Refer to Fig. 4, Fig. 4 is another structural representation of a kind of interface interchange device that the embodiment of the present invention provides, in embodiments of the present invention, this device can comprise: receiver module 201, mode determination module 202, parameter determination module 203, calling module 204, acquisition module 205, return module 206, first modular converter 207, second modular converter 208, preserve module 301 and removing module 302.
Receiver module 201, for receiving interface call request, described interface interchange request carries interface identifier corresponding to target interface that client script needs to call and interface parameters, one of expansion interface that described target interface provides for browser.
Mode determination module 202, for according to described interface identifier, determines the method for calling of described target interface.
Parameter determination module 203, for according to described method of calling and described interface parameters, determines the first parameter in the input parameter of the target interface function that described target interface is corresponding.
Calling module 204, for using the request of described interface interchange request mark and described first parameter as the input parameter of described target interface function, call described target interface function.
Acquisition module 205, for obtain call described target interface function after the output parameter that returns, described output parameter comprises described request mark and the second parameter.
Return module 206, for based on described second parameter, the result of calling of interface interchange request corresponding for described request mark is returned to described client script.
In one embodiment, the data type of described output parameter is the first default data type.
First modular converter 207, for described first parameter is carried out format conversion, the data type of the first parameter after changing is the second default data type.
Second modular converter 208, for described second parameter is carried out format conversion, the data type of the second parameter after changing is the 3rd default data type.
Preserve module 301, if be asynchronous call for described method of calling, be saved to by callback information in callback data storehouse, described callback information comprises the call back function that described request identifies and described parameter preset identifies.
Removing module 302, for deleting callback information corresponding to the mark of request described in described callback data storehouse.
In another kind of embodiment, parameter determination module 203 specifically for:
If described method of calling is synchronization call, described interface parameters is defined as the first parameter in the input parameter of described target interface function;
If described method of calling is asynchronous call, other parameter in described interface parameters except parameter preset is defined as the first parameter in the input parameter of described target interface function, described parameter preset is for identifying call back function.
In another kind of embodiment, return module 206 and comprise: synchronously return unit 2061 and asynchronously return unit 2062, as shown in fig. 4 a, Fig. 4 a is wherein a kind of structural representation returning module that Fig. 4 provides.
Synchronously return unit 2061, if described method of calling is synchronization call, the result of calling that described second parameter identifies corresponding interface interchange request as described request is returned to described client script;
Asynchronously return unit 2062, if described method of calling is asynchronous call, determine the target call back function that described request mark is corresponding, and using the input parameter of described second parameter as described target call back function, run described target call back function and obtain Output rusults, and then described Output rusults is returned to client script as the result of calling of described interface interchange request.
In another kind of embodiment, synchronously return unit 2061 specifically for:
According to described request mark, from described callback data storehouse, inquire about the callback information that described request mark is corresponding;
The call back function that described callback information is specified is defined as target call back function.
In another kind of embodiment, mode determination module 202 specifically for:
According to described interface identifier, from the interface database preset, inquire about interface message corresponding to described interface identifier, described interface message comprises interface identifier and method of calling;
Method of calling corresponding for this interface identifier in described interface database is defined as the method for calling of described target interface.
In the interface interchange device that the embodiment of the present invention describes, receiving interface call request, described interface interchange request carries interface identifier corresponding to target interface that client script needs to call and interface parameters, one of expansion interface that described target interface provides for browser; According to described interface identifier, determine the method for calling of target interface; According to described method of calling and described interface parameters, determine the first parameter in the input parameter of the target interface function that described target interface is corresponding; Using the request of described interface interchange request mark and described first parameter as the input parameter of described target interface function, call described target interface function; Obtain the output parameter returned after calling described target interface function, described output parameter comprises described request mark and the second parameter; Based on described second parameter, the result of calling of interface interchange request corresponding for described request mark is returned to described client script.Adopt the embodiment of the present invention, by design and the interface interchange of normalized interface function, browser can adopt unified interface interchange method to realize client script calling arbitrary expansion interface.Thus, when developer develops expansion interface, only need develop interface function corresponding to this expansion interface, improve development efficiency.
Refer to Fig. 5, Fig. 5 is the another structural representation of a kind of interface interchange device that the embodiment of the present invention provides, in embodiments of the present invention, this device can comprise: parameter converter 301, interface proxy 302, interface transponder 303, interface notification device 304, interface Register 305, interface database 306 and call request database 307.
In specific implementation, if the method for calling of the target interface specified by interface interchange instruction is asynchronous call, then this interface interchange device can also comprise callback data storehouse 308 and readjustment device 309.Developer is when adding interface, and need to provide the log-on messages such as the interface identifier of interface and method of calling to interface Register 305, for convenience of description, assuming that interface identifier is interface name, wherein, being embodied in host process of interface function provides.Interface Register 305 records these log-on messages, and after process is played up in browser establishment, these log-on messages are sent to by the mode of interprocess communication the process of playing up, process of playing up is buffered in these log-on messages in interface database 306, thus, record the interface message of each interface in interface database 306, such as, the file layout of interface database can be as shown in table 1.When callback data storehouse 308 is asynchronous call for method of calling, store the call back function carried in the interface interchange request that request identifies and this request is demarcated of this asynchronous call, thus, readjustment device 309 can remove to inquire about in callback data storehouse 308 target call back function corresponding to this request mark according to request mark, to be returned call result by the mode of calling this target call back function to script.Call request database 307 is for storing the request mark and method of calling called, thus, after interface notification device 304 gets the output parameter after target interface function operation, go in call request database 307, to inquire about method of calling corresponding to this request mark according to the request mark in this output parameter, if synchronization call, then direct output parameter is sent to interface proxy 302; If asynchronous call, then output parameter is sent to readjustment device 309.What deserves to be explained is, this interface interchange device may be used for, in the browser of one process, also may be used in the browser of multi-process, but for convenience of description, for the browser of multi-process.
Usually, browser mostly shows as multi-process in operational process, and described multi-process at least comprises the process of playing up and host process, wherein, plays up process playing up for the treatment of web page contents, and host process is for the treatment of user interface and management other processes etc. all.Can only perform webpage owing to playing up process, and can not perform other operation, therefore, the specific implementation (i.e. the realization of interface function) of expansion interface must provide in host process.For convenience of description, browser, assumed starts the process of playing up and host process in operational process, then in the interface interchange flow process realizing client script, play up the interface interchange request that process receives client script, described interface interchange request carries interface identifier corresponding to target interface that client script needs to call and interface parameters, the arbitrary expansion interface in the expansion interface that described target interface provides for browser.Cannot target interface function corresponding to operational objective interface owing to playing up process itself, therefore, the interface identifier imported into according to client script and interface parameters, re-construct interface interchange request, this interface interchange request is sent to host process, thus, run the target interface function specified by this interface interchange request by host process, and operation result is returned to the process of playing up and/or client script, realize calling of script.
In the embodiment of the present invention, parameter converter 301 receives the interface interchange request of client script 201, described interface interchange request carries interface identifier corresponding to target interface that client script 201 needs to call and interface parameters, and the expansion that described target interface provides for browser one of connects.Whether there is interface message corresponding to this interface identifier in parameter converter 301 query interface database 306, if do not exist, then specification interface call error, directly returns default error message; If exist, then determine the method for calling of interface name that this interface identifier is corresponding and target interface corresponding to this interface identifier.Further, according to the first parameter in the input parameter of this method of calling and target interface function corresponding to described interface parameters determination target interface.Parameter converter 301 carries out format conversion to the first parameter, and the data type of the first parameter after changing is the second default data type, such as, and KeyValueMap type or Value type.
Interface proxy 302 (Interface Proxy) obtains the recalls information needed for interface interchange request from parameter converter 301, or recalls information is sent to interface proxy 302 by parameter converter 301, described recalls information comprises the request mark of interface interchange request, interface name, the first parameter and method of calling, if method of calling is asynchronous call, described recalls information also comprises call back function.Certainly, described request mark also can be that interface proxy 302 is determined or generate, and concrete, the embodiment of the present invention is not restricted.If method of calling is asynchronous call, then interface proxy 302 is according to accessed recalls information, request is identified and identify corresponding call back function with this request to be added in callback data storehouse 308.To adjust back after device 309 receives the output parameter of the target interface function that the interface notification device 304 in host process returns, from callback data storehouse 308, inquire about target call back function corresponding to this request mark according to the request mark in this output parameter.Meanwhile, interface proxy 302 is to the interface transponder 303 transmission interface call request being arranged in host process, and described interface interchange request can as shown in code 4.
Such as, the method of calling of the target interface if desired called is asynchronous call, the interface name of hypothetical target interface is recordHistory, then client script calls the code of this target interface and can be: recordHistory (' http: www.liebao.cn', ' 2014-07-2020:00:00', onRecordHistoryDone), known, the function name of the first parameter comprises " http: www.liebao.cn, " " 2014-07-2020:00:00, " call back function is onRecordHistoryDone.Therefore, parameter converter 301 receives the interface interchange request of client script invocation target interface recordHistory, determines the request mark of described interface interchange request and the method for calling of described target interface; According to described method of calling and described interface parameters, determine the first parameter in the input parameter of the target interface function that described target interface is corresponding.Parameter converter 303 carries out format conversion to the first parameter, and the first parameter after format conversion can be as shown in table 2.The information such as the environmental variance needed for request mark (request_id), call back function object (being onRecordHistoryDone function here) of this interface interchange request of mark and normal this call back function of execution can be added in callback data storehouse 308 by interface proxy 302, ensure that readjustment device can will call result according to the information of preserving in callback data storehouse 308 and successfully return to script.Simultaneously, interface proxy 302 re-constructs interface interchange request according to accessed recalls information, and by the mode of interprocess communication this interface interchange request sent to the interface transponder 303 in browser host process, the call request of interface can as shown in code 4, the call request of this interface can carry request mark request_id, interface name interface, the first parameter arguments and method of calling sync, wherein, the data type of the first parameter is the second default data type.
In code 4, citing describes the call request of asynchronous interface, wherein, request_id is used for identifying interface interchange request, interface represents the interface identifier wanting invocation target interface corresponding, arguments is through the first parameter that the data type that obtains after parameter converter 301 is changed is the first default data type, and sync is used for representing the method for calling of target interface.
Code 4
If desired the target interface called is sync cap, parameter s ync then in interface interchange request is true, in like manner, interface proxy 302 sends to the call request of constructed interface by the mode of interprocess communication the interface transponder 303 in browser host process.If method of calling is synchronization call, then, after interface proxy 302 sends call request to interface transponder 303, interface proxy 302 can suspend execution, until browser host process complete and after transmitting rreturn value just continue.If method of calling is asynchronous call, then, after interface proxy 302 sends call request to interface transponder 303, interface proxy 302 can return immediately, thus the process of playing up can continue to perform other operation, and the execution efficiency of webpage is high.
After interface transponder 303 receives the call request of interface proxy transmission, according to recalls information entrained in this call request, the request mark of this call request of mark and method of calling are added in call request database 307, thus the call request database 307 in host process preserves the corresponding relation between each request mark and the method for calling of the target interface specified by call request.Interface transponder 303 removes according to interface identifier the target interface function that in interface Register 305, inquiry is corresponding with this interface name, obtain the position of target interface function 401 corresponding to target interface, using the input parameter of request mark request_id and the first parameter arguments as inquired target interface function 401, call this target interface function, wherein, the implementation of target interface function can be asynchronous implement mode also can be synchronous implementation.
Usually, interface function needs to return operation result after running, as whether operation is successful, require data read etc., these data are the output parameter of interface function, the data type of this output parameter is the first default data type, as KeyValueMap type or Value type etc.So, target interface function is after being finished, output parameter can be passed to interface notification device 304, wherein, output parameter comprises request mark and the second parameter, second parameter be interface interchange request corresponding to described request mark call result, thus interface notification device 304 is identified in call request database 307 according to request and searches corresponding call request and method of calling.
If method of calling is synchronization call, then request mark and the second parameter are sent to interface proxy 302 by interface notification device 304, thus, after interface proxy 302 receives the output parameter of the target interface function that interface notification device 304 returns, continue to perform other operation.The second parameter in parameter converter 301 pairs of output parameters carries out format conversion, and the data type of the second parameter after changing is the 3rd default data type, such as, the Object object of script inside, and then what return this request mark correspondence calls result to script, and synchronization call completes.After synchronization call completes, delete the respective items in call request database 307 according to request mark, thus reduce data volume, improve search efficiency.
If method of calling is synchronization call, can return immediately after interface proxy 302 gives the call request of interface transponder 303 transmission interface, continue the other parts performing script.And returning results of calling interface needs to be returned by the call back function specified by call request.Therefore, interface notification device 304 according to the request mark in output parameter inquire about from call request database 307 after target interface corresponding to this request mark be asynchronous call, request mark and the second parameter are sent to the readjustment device 309 in the process of playing up, readjustment device 309 adopts this request to identify from callback data storehouse 308, inquires about target call back function corresponding to this request mark, simultaneously, second parameter is carried out format conversion by call parameters converter 301, the data type of the second parameter after changing is the 3rd default data type, such as, the Object object of script, using the input parameter of the second parameter after conversion as target call back function, the target call back function that Run Script provides, thus, return and call result, asynchronous interface has called.After asynchronous call completes, delete the respective items in call request database 307 and callback data storehouse 308 according to request mark, thus reduce data volume, improve search efficiency.
In the interface interchange device that the embodiment of the present invention describes, receiving interface call request, described interface interchange request carries interface identifier corresponding to target interface that client script needs to call and interface parameters, one of expansion interface that described target interface provides for browser; According to described interface identifier, determine the method for calling of target interface; According to described method of calling and described interface parameters, determine the first parameter in the input parameter of the target interface function that described target interface is corresponding; Using the request of described interface interchange request mark and described first parameter as the input parameter of described target interface function, call described target interface function; Obtain the output parameter returned after calling described target interface function, described output parameter comprises described request mark and the second parameter; Based on described second parameter, the result of calling of interface interchange request corresponding for described request mark is returned to described client script.Adopt the embodiment of the present invention, by design and the interface interchange of normalized interface function, browser can adopt unified interface interchange method to realize client script calling arbitrary expansion interface.Thus, when developer develops expansion interface, only need develop interface function corresponding to this expansion interface, improve development efficiency.
Refer to Fig. 6, Fig. 6 is the structural representation of a kind of terminal that the embodiment of the present invention provides, and in embodiments of the present invention, terminal 10 comprises interface interchange device as above.In embodiments of the present invention, described terminal can comprise: the terminal devices such as smart mobile phone, computer, panel computer, notebook computer, palm PC and mobile internet device (MID), PAD.Concrete, the embodiment of the present invention is not restricted.
What deserves to be explained is, terminal 10 comprises any one interface interchange device as above, this terminal receiving interface call request, described interface interchange request carries interface identifier corresponding to target interface that client script needs to call and interface parameters, one of expansion interface that described target interface provides for browser; According to described interface identifier, determine the method for calling of target interface; According to described method of calling and described interface parameters, determine the first parameter in the input parameter of the target interface function that described target interface is corresponding; Using the request of described interface interchange request mark and described first parameter as the input parameter of described target interface function, call described target interface function; Obtain the output parameter returned after calling described target interface function, described output parameter comprises described request mark and the second parameter; Based on described second parameter, the result of calling of interface interchange request corresponding for described request mark is returned to described client script.Adopt the embodiment of the present invention, by design and the interface interchange of normalized interface function, browser can adopt unified interface interchange method to realize client script calling arbitrary expansion interface.Thus, when developer develops expansion interface, only need develop interface function corresponding to this expansion interface, improve development efficiency.
Refer to Fig. 7, Fig. 7 is a structural representation again of a kind of interface interchange device that the embodiment of the present invention provides, for performing interface interchange method disclosed in the embodiment of the present invention, this device can comprise: at least one processor 401, such as CPU, at least one network interface 404 or other user interfaces 403, storer 405, at least one communication bus 402.Communication bus 402 is for realizing the connection communication between these assemblies.Wherein, user interface 403 optionally can comprise USB interface and other standards interface, wireline interface.Network interface 404 optionally can comprise Wi-Fi interface and other wave points.Storer 405 may comprise high-speed RAM storer, still may comprise non-labile storer (non-volatile memory), such as at least one magnetic disk memory.Storer 405 optionally can comprise at least one and be positioned at memory storage away from aforementioned processor 401.As shown in Figure 7, operating system 4051 and application program 4052 can be comprised as in a kind of storer 405 of computer-readable storage medium.
In some embodiments, storer 405 stores following element, executable module or data structure, or their subset, or their superset:
Operating system 4051, comprises various system program, for realizing various basic business and processing hardware based task;
Application program 4052, comprise the various application program such as the comparison program of data block and the delete program of target data block in the setting program of the deblocking parameter of objective network data, the partition program of target data block, target data block and database, for realizing various applied business.
Particularly, processor 401, for calling the program stored in storer 405, performs following operation:
Receiving interface call request, described interface interchange request carries interface identifier corresponding to target interface that client script needs to call and interface parameters, one of expansion interface that described target interface provides for browser;
According to described interface identifier, determine the method for calling of described target interface;
According to described method of calling and described interface parameters, determine the first parameter in the input parameter of the target interface function that described target interface is corresponding;
Using the request of described interface interchange request mark and described first parameter as the input parameter of described target interface function, call described target interface function;
Obtain the output parameter returned after calling described target interface function, described output parameter comprises described request mark and the second parameter;
Based on described second parameter, the result of calling of interface interchange request corresponding for described request mark is returned to described client script.
In one embodiment, the data type of described output parameter is the first default data type;
Processor 401 performs described according to described method of calling and described interface parameters, after determining the operation of the first parameter in the input parameter of the target interface function that described target interface is corresponding, also comprises and performs following operation:
Described first parameter is carried out format conversion, and the data type of the first parameter after changing is the second default data type;
Processor 401 performs the output parameter returned after described target interface function is called in described acquisition, after described output parameter comprises the operation of described request mark and the second parameter, also comprises and performs following operation:
Described second parameter is carried out format conversion, and the data type of the second parameter after changing is the 3rd default data type.
In one embodiment, processor 401 performs described according to described method of calling and described interface parameters, determines the operation of the first parameter in the input parameter of described target interface function, comprises and performs following operation:
If described method of calling is synchronization call, described interface parameters is defined as the first parameter in the input parameter of described target interface function;
If described method of calling is asynchronous call, other parameter in described interface parameters except parameter preset is defined as the first parameter in the input parameter of described target interface function, described parameter preset is for identifying call back function.
In one embodiment, processor 401 performs described based on described second parameter, and the result of calling of interface interchange request corresponding for described request mark is returned to described client script, comprises and performs following operation:
If described method of calling is synchronization call, the result of calling that described second parameter identifies corresponding interface interchange request as described request is returned to described client script;
If described method of calling is asynchronous call, determine the target call back function that described request mark is corresponding, and using the input parameter of described second parameter as described target call back function, run described target call back function and obtain Output rusults, and then described Output rusults is returned to client script as the result of calling of described interface interchange request.
In one embodiment, processor 401 performs described according to described interface identifier, after determining the operation of the method for calling of described target interface, also comprises and performs following operation:
If described method of calling is asynchronous call, be saved to by callback information in callback data storehouse, described callback information comprises the call back function that described request identifies and described parameter preset identifies;
Wherein, processor 401 performs the described operation determining the target call back function that described request mark is corresponding, comprises and performs following operation:
If described method of calling is asynchronous call, from described callback data storehouse, inquire about callback information corresponding to described request mark according to described request mark;
The call back function that described callback information is specified is defined as target call back function.
In one embodiment, processor 401 performs and describedly calls after result returns to the operation of described client script using described second parameter as interface interchange request corresponding to described request mark, also comprises and performs following operation:
Delete the callback information that the mark of request described in described callback data storehouse is corresponding.
In one embodiment, processor 401 performs according to described interface identifier, determines the operation of the method for calling of described target interface, comprises and performs following operation:
According to described interface identifier, from the interface database preset, inquire about interface message corresponding to described interface identifier, described interface message comprises interface identifier and method of calling;
Method of calling corresponding for this interface identifier in described interface database is defined as the method for calling of described target interface.
In the technical scheme that the embodiment of the present invention describes, receiving interface call request, described interface interchange request carries interface identifier corresponding to target interface that client script needs to call and interface parameters, one of expansion interface that described target interface provides for browser; According to described interface identifier, determine the method for calling of target interface; According to described method of calling and described interface parameters, determine the first parameter in the input parameter of the target interface function that described target interface is corresponding; Using the request of described interface interchange request mark and described first parameter as the input parameter of described target interface function, call described target interface function; Obtain the output parameter returned after calling described target interface function, described output parameter comprises described request mark and the second parameter; Based on described second parameter, the result of calling of interface interchange request corresponding for described request mark is returned to described client script.Adopt the embodiment of the present invention, by design and the interface interchange of normalized interface function, browser can adopt unified interface interchange method to realize client script calling arbitrary expansion interface.Thus, when developer develops expansion interface, only need develop interface function corresponding to this expansion interface, improve development efficiency.
In the description of this instructions, specific features, structure, material or feature that the description of reference term " embodiment ", " some embodiments ", " example ", " concrete example " or " some examples " etc. means to describe in conjunction with this embodiment or example are contained at least one embodiment of the present invention or example.In this manual, not necessarily must for identical embodiment or example to the schematic representation of above-mentioned term.And the specific features of description, structure, material or feature can combine in one or more embodiment in office or example in an appropriate manner.In addition, when not conflicting, the feature of the different embodiment described in this instructions or example and different embodiment or example can carry out combining and combining by those skilled in the art.
The feature of the different embodiment described in this instructions and different embodiment can carry out combining and combining by those skilled in the art.Module in all embodiments of the present invention or unit, universal integrated circuit can be passed through, such as CPU (Central Processing Unit, central processing unit), or realized by ASIC (ApplicationSpecific Integrated Circuit, special IC).
Step in all embodiment methods of the present invention can be carried out order according to actual needs and be adjusted, merges and delete; Module in all embodiment device of the present invention or unit can carry out merging, divide and deleting according to actual needs.
Describe and can be understood in process flow diagram or in this any process otherwise described or method, represent and comprise one or more for realizing the module of the code of the executable instruction of the step of specific logical function or process, fragment or part, and the scope of the preferred embodiment of the present invention comprises other realization, wherein can not according to order that is shown or that discuss, comprise according to involved function by the mode while of basic or by contrary order, carry out n-back test, this should understand by embodiments of the invention person of ordinary skill in the field.
In flow charts represent or in this logic otherwise described and/or step, such as, the sequencing list of the executable instruction for realizing logic function can be considered to, may be embodied in any computer-readable medium, for instruction execution system, device or equipment (as computer based system, comprise the system of processor or other can from instruction execution system, device or equipment instruction fetch and perform the system of instruction) use, or to use in conjunction with these instruction execution systems, device or equipment.With regard to this instructions, " computer-readable medium " can be anyly can to comprise, store, communicate, propagate or transmission procedure for instruction execution system, device or equipment or the device that uses in conjunction with these instruction execution systems, device or equipment.The example more specifically (non-exhaustive list) of computer-readable medium comprises following: the electrical connection section (electronic installation) with one or more wiring, portable computer diskette box (magnetic device), random access memory (RAM), ROM (read-only memory) (ROM), erasablely edit ROM (read-only memory) (EPROM or flash memory), fiber device, and portable optic disk ROM (read-only memory) (CDROM).In addition, computer-readable medium can be even paper or other suitable media that can print described program thereon, because can such as by carrying out optical scanning to paper or other media, then carry out editing, decipher or carry out process with other suitable methods if desired and electronically obtain described program, be then stored in computer memory.
Those skilled in the art are appreciated that realizing all or part of step that above-described embodiment method carries is that the hardware that can carry out instruction relevant by program completes, described program can be stored in a kind of computer-readable recording medium, this program perform time, step comprising embodiment of the method one or a combination set of.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing module, also can be that the independent physics of unit exists, also can be integrated in a module by two or more unit.Above-mentioned integrated module both can adopt the form of hardware to realize, and the form of software function module also can be adopted to realize.If described integrated module using the form of software function module realize and as independently production marketing or use time, also can be stored in a computer read/write memory medium.
The above-mentioned storage medium mentioned can be ROM (read-only memory), disk or CD etc.Although illustrate and describe embodiments of the invention above, be understandable that, above-described embodiment is exemplary, can not be interpreted as limitation of the present invention, and those of ordinary skill in the art can change above-described embodiment within the scope of the invention, revises, replace and modification.
Above disclosedly be only preferred embodiment of the present invention, certainly the interest field of the present invention can not be limited with this, one of ordinary skill in the art will appreciate that all or part of flow process realizing above-described embodiment, and according to the equivalent variations that the claims in the present invention are done, still belong to the scope that invention is contained.

Claims (10)

1. an interface interchange method, is characterized in that, comprising:
Receiving interface call request, described interface interchange request carries interface identifier corresponding to target interface that client script needs to call and interface parameters, one of expansion interface that described target interface provides for browser;
According to described interface identifier, determine the method for calling of described target interface;
According to described method of calling and described interface parameters, determine the first parameter in the input parameter of the target interface function that described interface identifier is corresponding;
Using the request of described interface interchange request mark and described first parameter as the input parameter of described target interface function, call described target interface function;
Obtain the output parameter returned after calling described target interface function, described output parameter comprises described request mark and the second parameter;
Based on described second parameter, the result of calling of interface interchange request corresponding for described request mark is returned to described client script.
2. the method for claim 1, is characterized in that, the data type of described output parameter is the first default data type;
Described according to described method of calling and described interface parameters, after determining the first parameter in the input parameter of the target interface function that described target interface is corresponding, described method also comprises:
Described first parameter is carried out format conversion, and the data type of the first parameter after changing is the second default data type;
The output parameter that described acquisition returns after calling described target interface function, after described output parameter comprises described request mark and the second parameter, described method also comprises:
Described second parameter is carried out format conversion, and the data type of the second parameter after changing is the 3rd default data type.
3. method as claimed in claim 1 or 2, is characterized in that, described according to described method of calling and described interface parameters, determines that the first parameter in the input parameter of the target interface function that described target interface is corresponding comprises:
If described method of calling is synchronization call, described interface parameters is defined as the first parameter in the input parameter of described target interface function;
If described method of calling is asynchronous call, other parameter in described interface parameters except parameter preset is defined as the first parameter in the input parameter of described target interface function, described parameter preset is for identifying call back function.
4. method as claimed in claim 1 or 2, is characterized in that, described based on described second parameter, and the result of calling of interface interchange request corresponding for described request mark is returned to described client script and comprises:
If described method of calling is synchronization call, the result of calling that described second parameter identifies corresponding interface interchange request as described request is returned to described client script;
If described method of calling is asynchronous call, determine the target call back function that described request mark is corresponding, and using the input parameter of described second parameter as described target call back function, run described target call back function and obtain Output rusults, and then described Output rusults is returned to described client script as the result of calling of described interface interchange request.
5. method as claimed in claim 4, it is characterized in that, described according to described interface identifier, after determining the method for calling of described target interface, described method also comprises:
If described method of calling is asynchronous call, be saved to by callback information in callback data storehouse, described callback information comprises the call back function that described request identifies and described parameter preset identifies;
The described target call back function determining described request mark correspondence, comprising:
If described method of calling is asynchronous call, from described callback data storehouse, inquire about callback information corresponding to described request mark according to described request mark;
The call back function that described callback information is specified is defined as target call back function.
6. method as claimed in claim 5, is characterized in that, describedly calls after result returns to described client script using described second parameter as interface interchange request corresponding to described request mark, and described method also comprises:
Delete the callback information that the mark of request described in described callback data storehouse is corresponding.
7. method as claimed in claim 1 or 2, is characterized in that, described according to described interface identifier, determines that the method for calling of described target interface comprises:
According to described interface identifier, from the interface database preset, inquire about interface message corresponding to described interface identifier, described interface message comprises interface identifier and method of calling;
Method of calling corresponding for this interface identifier in described interface database is defined as the method for calling of described target interface.
8. an interface interchange device, is characterized in that, comprising:
Receiver module, for receiving interface call request, described interface interchange request carries interface identifier corresponding to target interface that client script needs to call and interface parameters, one of expansion interface that described target interface provides for browser;
Mode determination module, for according to described interface identifier, determines the method for calling of described target interface;
Parameter determination module, for according to described method of calling and described interface parameters, determines the first parameter in the input parameter of the target interface function that described interface identifier is corresponding;
Calling module, for using the request of described interface interchange request mark and described first parameter as the input parameter of described target interface function, call described target interface function;
Acquisition module, for obtain call described target interface function after the output parameter that returns, described output parameter comprises described request mark and the second parameter;
Return module, for based on described second parameter, the result of calling of interface interchange request corresponding for described request mark is returned to described client script.
9. device as claimed in claim 8, it is characterized in that, the data type of described output parameter is the first default data type, and described device also comprises:
First modular converter, for described first parameter is carried out format conversion, the data type of the first parameter after changing is the second default data type;
Second modular converter, for described second parameter is carried out format conversion, the data type of the second parameter after changing is the 3rd default data type.
10. a terminal, is characterized in that, comprises the interface interchange device as described in any one of claim 8-14.
CN201510289070.8A 2015-05-29 2015-05-29 Interface calling method and device and terminal Active CN104866383B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201510289070.8A CN104866383B (en) 2015-05-29 2015-05-29 Interface calling method and device and terminal
PCT/CN2016/083359 WO2016192556A1 (en) 2015-05-29 2016-05-25 Interface invoking method, device and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510289070.8A CN104866383B (en) 2015-05-29 2015-05-29 Interface calling method and device and terminal

Publications (2)

Publication Number Publication Date
CN104866383A true CN104866383A (en) 2015-08-26
CN104866383B CN104866383B (en) 2018-11-23

Family

ID=53912231

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510289070.8A Active CN104866383B (en) 2015-05-29 2015-05-29 Interface calling method and device and terminal

Country Status (2)

Country Link
CN (1) CN104866383B (en)
WO (1) WO2016192556A1 (en)

Cited By (32)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016192556A1 (en) * 2015-05-29 2016-12-08 北京金山安全软件有限公司 Interface invoking method, device and terminal
CN106412009A (en) * 2016-08-29 2017-02-15 郑州悉知信息科技股份有限公司 Interface calling method and device
CN106649078A (en) * 2015-11-02 2017-05-10 阿里巴巴集团控股有限公司 Application interface testing method and device
CN107135073A (en) * 2016-02-26 2017-09-05 北京京东尚科信息技术有限公司 Interface interchange method and apparatus
CN107194014A (en) * 2017-07-04 2017-09-22 贵州数据宝网络科技有限公司 Data source call method and device
CN107809332A (en) * 2017-11-10 2018-03-16 中国民生银行股份有限公司 Compound interface configures and compound interface call method, device
CN108009026A (en) * 2017-10-27 2018-05-08 深圳市买买提乐购金融服务有限公司 Interface call method, third party's data access platform and computer-readable medium
CN108650093A (en) * 2018-03-30 2018-10-12 深圳市富途网络科技有限公司 A kind of interface realizing method based on idempotence
CN108874557A (en) * 2018-05-24 2018-11-23 广东睿江云计算股份有限公司 A kind of front end interface processing method and system
CN109218841A (en) * 2018-08-17 2019-01-15 武汉斗鱼网络科技有限公司 Barrage method for message transmission, device, equipment and storage medium
CN109426570A (en) * 2017-08-29 2019-03-05 阿里巴巴集团控股有限公司 A kind of acquisition methods of data, device and equipment
CN109446261A (en) * 2018-10-31 2019-03-08 北京酷我科技有限公司 It is a kind of to mix the method and its system for calling data based on multiple interfaces
CN109445960A (en) * 2018-10-18 2019-03-08 腾讯科技(深圳)有限公司 Method for routing, device and the storage medium of application
CN109710426A (en) * 2018-12-24 2019-05-03 珠海豹趣科技有限公司 A kind of inter-process communication methods and relevant device
CN109871285A (en) * 2017-12-05 2019-06-11 北京嘀嘀无限科技发展有限公司 Dynamic adjusting method, device, server, mobile terminal and readable storage medium storing program for executing
CN110413423A (en) * 2019-07-23 2019-11-05 腾讯科技(深圳)有限公司 Data processing method, relevant apparatus, equipment and storage medium
CN110618875A (en) * 2018-06-20 2019-12-27 北京三快在线科技有限公司 Communication method, distributed system, electronic device, and storage medium
CN110737428A (en) * 2019-10-21 2020-01-31 Oppo广东移动通信有限公司 Hidl-based universal interface design method, device, terminal and readable storage medium
CN111030111A (en) * 2019-12-30 2020-04-17 广东电网有限责任公司电力调度控制中心 Method, device, system and medium for configuring stable control section parameters of power system
CN111142960A (en) * 2018-11-02 2020-05-12 中国电信股份有限公司 Interface providing method, device and system
CN111158794A (en) * 2019-12-19 2020-05-15 苏州浪潮智能科技有限公司 OpenStack-oriented API (application program interface) combination optimization method and device
CN111190950A (en) * 2019-10-31 2020-05-22 腾讯科技(深圳)有限公司 Asset retrieval method and device
CN111274453A (en) * 2020-01-14 2020-06-12 北京市商汤科技开发有限公司 Data operation method, system, electronic device and computer readable storage medium
CN111428171A (en) * 2020-03-23 2020-07-17 郑州悉知信息科技股份有限公司 Interface call processing method and system
CN111581578A (en) * 2020-05-09 2020-08-25 郑州悉知信息科技股份有限公司 Interface request processing method and device
CN112395024A (en) * 2020-12-09 2021-02-23 上海益世界信息技术集团有限公司 Interface calling method and related device
CN112667371A (en) * 2020-12-07 2021-04-16 深圳市远行科技股份有限公司 Asynchronous task processing method, device, equipment and storage medium
CN112925589A (en) * 2019-12-06 2021-06-08 腾讯科技(深圳)有限公司 Calling method and device of expansion interface
CN113448742A (en) * 2020-03-25 2021-09-28 北京京东振世信息技术有限公司 Interface data acquisition method and device
CN113452721A (en) * 2021-08-30 2021-09-28 湖南高至科技有限公司 Network interaction function optimization system, method, computer equipment and medium
CN113934476A (en) * 2021-10-15 2022-01-14 中电金信软件有限公司 Logic calling method and device and electronic equipment
CN114443019A (en) * 2020-11-03 2022-05-06 福建天泉教育科技有限公司 Asynchronous calling method and terminal for graphical programming multi-language interaction thread

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109274656B (en) * 2018-09-04 2022-04-22 平安普惠企业管理有限公司 Interface parameter decryption method and device, computer equipment and storage medium
CN111124873A (en) * 2018-10-31 2020-05-08 北京国双科技有限公司 Method and device for returning Mock data
CN110333914B (en) * 2019-04-12 2023-09-15 上海连尚网络科技有限公司 Method and device for executing target operation
CN110780929B (en) * 2019-09-18 2024-05-03 华为技术有限公司 Method for calling hardware interface and electronic equipment
CN110968296B (en) * 2019-12-03 2023-07-25 政采云有限公司 Data acquisition method, device, equipment and readable storage medium
CN111310007B (en) * 2020-02-11 2023-07-07 北京达佳互联信息技术有限公司 Webpage interface query method and device, electronic equipment and storage medium
CN111552578B (en) * 2020-04-30 2023-08-04 成都新潮传媒集团有限公司 Third party interface calling method and device
CN115080006A (en) * 2021-03-15 2022-09-20 武汉斗鱼网络科技有限公司 Data calling method and related equipment
CN114840276A (en) * 2022-04-15 2022-08-02 北京百度网讯科技有限公司 Object calling method, device, equipment, storage medium and program product
CN115208936A (en) * 2022-05-26 2022-10-18 锐凌无线有限责任公司 Remote calling method, system, device, electronic equipment and storage medium
CN115225812B (en) * 2022-06-01 2024-04-09 合肥移瑞通信技术有限公司 Camera control method and device, electronic equipment and storage medium
CN115499291B (en) * 2022-09-14 2024-04-02 平安壹钱包电子商务有限公司 Processing method and device for service zero-drop alarm information and storage medium
CN115865886B (en) * 2022-11-28 2023-07-18 灵犀科技有限公司 HTTP-based cross-network data interaction method and device
CN117270831B (en) * 2023-11-17 2024-02-23 天津华来科技股份有限公司 Protocol class synchronization and cooperative program call compatible implementation method

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080016498A1 (en) * 2001-03-23 2008-01-17 S2 Technologies, Inc. System and method for generating data sets for testing embedded systems
US20130013751A1 (en) * 2009-05-11 2013-01-10 Accenture Global Services Limited Enhanced network adapter framework
CN103226474A (en) * 2013-05-10 2013-07-31 北京奇虎科技有限公司 Method, device and system for interaction between webpage script and browser program
CN103309728A (en) * 2012-03-12 2013-09-18 腾讯科技(深圳)有限公司 Asynchronous request processing method and equipment
CN104281455A (en) * 2014-10-11 2015-01-14 北京金山安全软件有限公司 Interface calling method and device and terminal

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103177040A (en) * 2011-12-26 2013-06-26 腾讯科技(深圳)有限公司 Method and device for calling functions of webpage application
CN104866383B (en) * 2015-05-29 2018-11-23 北京金山安全软件有限公司 Interface calling method and device and terminal

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080016498A1 (en) * 2001-03-23 2008-01-17 S2 Technologies, Inc. System and method for generating data sets for testing embedded systems
US20130013751A1 (en) * 2009-05-11 2013-01-10 Accenture Global Services Limited Enhanced network adapter framework
CN103309728A (en) * 2012-03-12 2013-09-18 腾讯科技(深圳)有限公司 Asynchronous request processing method and equipment
CN103226474A (en) * 2013-05-10 2013-07-31 北京奇虎科技有限公司 Method, device and system for interaction between webpage script and browser program
CN104281455A (en) * 2014-10-11 2015-01-14 北京金山安全软件有限公司 Interface calling method and device and terminal

Cited By (45)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016192556A1 (en) * 2015-05-29 2016-12-08 北京金山安全软件有限公司 Interface invoking method, device and terminal
CN106649078B (en) * 2015-11-02 2019-06-25 阿里巴巴集团控股有限公司 Application interface test method and device
CN106649078A (en) * 2015-11-02 2017-05-10 阿里巴巴集团控股有限公司 Application interface testing method and device
CN107135073A (en) * 2016-02-26 2017-09-05 北京京东尚科信息技术有限公司 Interface interchange method and apparatus
CN107135073B (en) * 2016-02-26 2021-05-25 北京京东尚科信息技术有限公司 Interface calling method and device
CN106412009A (en) * 2016-08-29 2017-02-15 郑州悉知信息科技股份有限公司 Interface calling method and device
CN107194014A (en) * 2017-07-04 2017-09-22 贵州数据宝网络科技有限公司 Data source call method and device
CN107194014B (en) * 2017-07-04 2021-05-28 贵州数据宝网络科技有限公司 Data source calling method and device
CN109426570A (en) * 2017-08-29 2019-03-05 阿里巴巴集团控股有限公司 A kind of acquisition methods of data, device and equipment
CN108009026A (en) * 2017-10-27 2018-05-08 深圳市买买提乐购金融服务有限公司 Interface call method, third party's data access platform and computer-readable medium
CN107809332A (en) * 2017-11-10 2018-03-16 中国民生银行股份有限公司 Compound interface configures and compound interface call method, device
CN109871285A (en) * 2017-12-05 2019-06-11 北京嘀嘀无限科技发展有限公司 Dynamic adjusting method, device, server, mobile terminal and readable storage medium storing program for executing
CN108650093A (en) * 2018-03-30 2018-10-12 深圳市富途网络科技有限公司 A kind of interface realizing method based on idempotence
CN108874557A (en) * 2018-05-24 2018-11-23 广东睿江云计算股份有限公司 A kind of front end interface processing method and system
CN110618875A (en) * 2018-06-20 2019-12-27 北京三快在线科技有限公司 Communication method, distributed system, electronic device, and storage medium
CN109218841B (en) * 2018-08-17 2021-01-01 武汉斗鱼网络科技有限公司 Barrage message transmission method, device, equipment and storage medium
CN109218841A (en) * 2018-08-17 2019-01-15 武汉斗鱼网络科技有限公司 Barrage method for message transmission, device, equipment and storage medium
CN109445960A (en) * 2018-10-18 2019-03-08 腾讯科技(深圳)有限公司 Method for routing, device and the storage medium of application
CN109445960B (en) * 2018-10-18 2021-03-02 腾讯科技(深圳)有限公司 Application routing method, device and storage medium
CN109446261A (en) * 2018-10-31 2019-03-08 北京酷我科技有限公司 It is a kind of to mix the method and its system for calling data based on multiple interfaces
CN111142960B (en) * 2018-11-02 2023-11-14 中国电信股份有限公司 Interface providing method, device and system
CN111142960A (en) * 2018-11-02 2020-05-12 中国电信股份有限公司 Interface providing method, device and system
CN109710426A (en) * 2018-12-24 2019-05-03 珠海豹趣科技有限公司 A kind of inter-process communication methods and relevant device
CN110413423A (en) * 2019-07-23 2019-11-05 腾讯科技(深圳)有限公司 Data processing method, relevant apparatus, equipment and storage medium
CN110737428A (en) * 2019-10-21 2020-01-31 Oppo广东移动通信有限公司 Hidl-based universal interface design method, device, terminal and readable storage medium
CN110737428B (en) * 2019-10-21 2023-08-15 Oppo广东移动通信有限公司 Hidl-based universal interface design method, device, terminal and readable storage medium
CN111190950A (en) * 2019-10-31 2020-05-22 腾讯科技(深圳)有限公司 Asset retrieval method and device
CN112925589A (en) * 2019-12-06 2021-06-08 腾讯科技(深圳)有限公司 Calling method and device of expansion interface
CN112925589B (en) * 2019-12-06 2023-10-17 深圳市雅阅科技有限公司 Calling method and device of expansion interface
CN111158794B (en) * 2019-12-19 2023-03-31 苏州浪潮智能科技有限公司 OpenStack-oriented API (application program interface) combination optimization method and device
CN111158794A (en) * 2019-12-19 2020-05-15 苏州浪潮智能科技有限公司 OpenStack-oriented API (application program interface) combination optimization method and device
CN111030111A (en) * 2019-12-30 2020-04-17 广东电网有限责任公司电力调度控制中心 Method, device, system and medium for configuring stable control section parameters of power system
CN111274453A (en) * 2020-01-14 2020-06-12 北京市商汤科技开发有限公司 Data operation method, system, electronic device and computer readable storage medium
CN111428171A (en) * 2020-03-23 2020-07-17 郑州悉知信息科技股份有限公司 Interface call processing method and system
CN113448742B (en) * 2020-03-25 2023-11-03 北京京东振世信息技术有限公司 Interface data acquisition method and device
CN113448742A (en) * 2020-03-25 2021-09-28 北京京东振世信息技术有限公司 Interface data acquisition method and device
CN111581578B (en) * 2020-05-09 2022-11-29 郑州悉知信息科技股份有限公司 Interface request processing method and device
CN111581578A (en) * 2020-05-09 2020-08-25 郑州悉知信息科技股份有限公司 Interface request processing method and device
CN114443019A (en) * 2020-11-03 2022-05-06 福建天泉教育科技有限公司 Asynchronous calling method and terminal for graphical programming multi-language interaction thread
CN112667371A (en) * 2020-12-07 2021-04-16 深圳市远行科技股份有限公司 Asynchronous task processing method, device, equipment and storage medium
CN112395024A (en) * 2020-12-09 2021-02-23 上海益世界信息技术集团有限公司 Interface calling method and related device
CN112395024B (en) * 2020-12-09 2021-12-24 上海益世界信息技术集团有限公司 Interface calling method and related device
CN113452721A (en) * 2021-08-30 2021-09-28 湖南高至科技有限公司 Network interaction function optimization system, method, computer equipment and medium
CN113934476B (en) * 2021-10-15 2022-08-19 中电金信软件有限公司 Logic calling method and device and electronic equipment
CN113934476A (en) * 2021-10-15 2022-01-14 中电金信软件有限公司 Logic calling method and device and electronic equipment

Also Published As

Publication number Publication date
WO2016192556A1 (en) 2016-12-08
CN104866383B (en) 2018-11-23

Similar Documents

Publication Publication Date Title
CN104866383A (en) Interface calling method and device and terminal
CN109325195B (en) Rendering method and system for browser, computer device and computer storage medium
CN104281455A (en) Interface calling method and device and terminal
CN108156022B (en) Service calling method and device and electronic equipment
US9942307B2 (en) Web application script migration
CN104881318A (en) Interface calling method and device and terminal
CN108287708B (en) Data processing method and device, server and computer readable storage medium
US10789111B2 (en) Message oriented middleware with integrated rules engine
USRE48851E1 (en) Thin client for mapping system
CN111143446A (en) Data structure conversion processing method and device of data object and electronic equipment
CN104657435A (en) Storage management method for application data and network management system
CN111818194A (en) Domain name based access system and method
CN105320662A (en) Method and device for webpage generation
CN109739487B (en) Business logic processing method and device and computer readable storage medium
CN112131230B (en) Application software as a service (SaaS) realization method, device, equipment and storage medium
CN111800511B (en) Synchronous login state processing method, system, equipment and readable storage medium
US7856344B2 (en) Method for transforming overlapping paths in a logical model to their physical equivalent based on transformation rules and limited traceability
CN114726905A (en) Method, device, equipment and storage medium for accessing Tbox network to Android system
CN114564241A (en) Hardware device access method and device, computer device and storage medium
CN109977317B (en) Data query method and device
CN111464429A (en) WeChat applet multi-item compatible sharing method, system, storage medium and equipment
CN111314493A (en) Data processing method of heterogeneous cloud storage system and readable medium and system thereof
CN115858013B (en) Multi-research and development project parallel resource allocation method, system, device and medium
CN112084003B (en) Method, device, medium and electronic equipment for isolating data
CN111046430B (en) Data processing method and device, storage medium and electronic equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
EXSB Decision made by sipo to initiate substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20181203

Address after: Room 105-53811, No. 6 Baohua Road, Hengqin New District, Zhuhai City, Guangdong Province

Patentee after: Zhuhai Leopard Technology Co.,Ltd.

Address before: 100085 East District, Second Floor, 33 Xiaoying West Road, Haidian District, Beijing

Patentee before: BEIJING KINGSOFT INTERNET SECURITY SOFTWARE Co.,Ltd.

TR01 Transfer of patent right