WO2011127863A2 - Method and device for calling open application programming interface (openapi) - Google Patents

Method and device for calling open application programming interface (openapi) Download PDF

Info

Publication number
WO2011127863A2
WO2011127863A2 PCT/CN2011/074424 CN2011074424W WO2011127863A2 WO 2011127863 A2 WO2011127863 A2 WO 2011127863A2 CN 2011074424 W CN2011074424 W CN 2011074424W WO 2011127863 A2 WO2011127863 A2 WO 2011127863A2
Authority
WO
WIPO (PCT)
Prior art keywords
openapi
calling
target
user
list
Prior art date
Application number
PCT/CN2011/074424
Other languages
French (fr)
Chinese (zh)
Other versions
WO2011127863A3 (en
Inventor
金洪波
颜友亮
齐泉
陈世展
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Priority to PCT/CN2011/074424 priority Critical patent/WO2011127863A2/en
Priority to CN201180000546.1A priority patent/CN102203736B/en
Publication of WO2011127863A2 publication Critical patent/WO2011127863A2/en
Publication of WO2011127863A3 publication Critical patent/WO2011127863A3/en

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
    • G06F9/541Interprogram communication via adapters, e.g. between incompatible applications

Definitions

  • the embodiments of the present invention relate to a programming interface technology, and in particular, to an open application programming interface (Open Application Programming Interface; Open API) calling method and device.
  • Open API Open Application Programming Interface
  • OpenAPIs OpenAPIs
  • users can call these OpenAPIs to implement the corresponding functions.
  • the embodiment of the invention provides an open application programming interface calling method and device, which are used to implement different calling OpenAPI in a unified manner, and improve the efficiency of calling OpenAPI.
  • An embodiment of the present invention provides an open application programming interface OpenAPI calling method, including: acquiring a target OpenAPI method corresponding to a user's calling request; Providing the user with a parameter list corresponding to the target OpenAPI method, to obtain parameter information of the target OpenAPI method;
  • the target OpenAPI method is called according to the parameter information and a calling rule adapted to the target OpenAPI method.
  • An embodiment of the present invention provides an open application programming interface OpenAPI calling device, including: a method obtaining unit, configured to acquire a target OpenAPI method corresponding to a user's calling request, and a parameter obtaining unit, configured to provide the user with the user Determining a parameter list corresponding to the target OpenAPI method, to obtain parameter information of the target OpenAPI method;
  • a calling unit configured to invoke the target OpenAPI method according to the parameter information and a calling rule adapted to the target OpenAPI method.
  • the method and device for calling an open application programming interface of the embodiment of the present invention obtain the parameter information corresponding to the target OpenAPI method and the target OpenAPI method, and then call the target OpenAPI method by using a calling rule adapted to the target OpenAPI method, which may be adopted.
  • the unified calling process implements calls to different OpenAPIs, which simplifies the calling process and improves the efficiency of calling OpenAPI.
  • FIG. 1 is a flowchart of a method for calling an OpenAPI according to an embodiment of the present invention
  • FIG. 2A is a flowchart of an embodiment of a step 101 according to an embodiment of the present invention
  • FIG. 2B is a schematic diagram of another embodiment of step 101 according to an embodiment of the present invention
  • a flowchart of still another embodiment of the step 101 is provided.
  • FIG. 2D is a flowchart of an embodiment of the step 10c3 according to an embodiment of the present invention
  • FIG. 2E is another embodiment of the step 10cl3 according to an embodiment of the present invention.
  • FIG. 3 is a flowchart of an implementation of step 103 according to an embodiment of the present invention;
  • FIG. 4 is a flowchart of a method for calling an OpenAPI according to another embodiment of the present invention.
  • FIG. 5 is a flowchart of a calling method when a target OpenAPI method adopts a Rest protocol according to an embodiment of the present invention
  • FIG. 6 is a flowchart of a calling method when a target OpenAPI method adopts a Soap protocol according to an embodiment of the present invention
  • FIG. 7 is a flowchart of a calling method when a target OpenAPI method adopts an Ajax protocol according to an embodiment of the present invention
  • FIG. 8 is a schematic structural diagram of an OpenAPI calling device according to an embodiment of the present invention.
  • FIG. 9 is a schematic structural diagram of an OpenAPI calling device according to another embodiment of the present invention. detailed description
  • FIG. 1 is a flowchart of a method for calling an OpenAPI according to an embodiment of the present invention. As shown in FIG. 1, the method in this embodiment includes:
  • Step 101 Obtain a target OpenAPI method corresponding to a user's call request.
  • the OpenAPI calling device provides an interface for obtaining a user call request for the user to input its call request. After the user inputs the call request, the OpenAPI calling device obtains the corresponding OpenAPI method by querying the OpenAIP information base according to the call request.
  • the OpenAPI information library stores a large amount of OpenAPI information, and these OpenAPI information can be obtained by manual pre-collection.
  • the OpenAPI method is included, and each OpenAPI method has corresponding parameter information, so in this embodiment, according to the layering of OpenAPI Point, OpenAPI information is stored as a list. That is, the OpenAPI repository, the method list, and the parameter list are included in the OpenAPI repository.
  • the OpenAPI list includes a large number of OpenAPI information, wherein each OpenAPI information mainly includes an OpenAPI identifier (ID), an OpenAPI function description information, an OpenAPI call address, a used communication protocol, and the like.
  • the method list includes information about the OpenAPI method corresponding to each OpenAPI in the OpenAPI list, and there is a mapping relationship between the OpenAPI list and the method list; the information of the OpenAPI method mainly includes the ID of the OpenAPI method, function description information, and the like.
  • the parameter list includes the parameter information corresponding to each OpenAPI method in the method list, that is, the information required to call an OpenAPI method, and there is a mapping relationship between the parameter list and the method list.
  • the OpenAPI calling device can search for a large API method in accordance with the user's call request in a large number of OpenAPI methods, thereby improving the success rate of the user calling the OpenAPI method.
  • the OpenAPI calling device can provide a calling interface to the user, so that the user inputs the calling request through the calling interface, and finally obtains the target OpenAPI method.
  • Step 102 Provide a user with a parameter list corresponding to the target OpenAPI method to obtain a target
  • the OpenAPI calling device searches the OpenAPI information base according to the target OpenAPI method to obtain a corresponding parameter list, and provides a parameter list to the user through a calling interface, so that the user inputs the corresponding parameter information.
  • the calling interface is the same calling interface as the calling interface of step 101.
  • the OpenAPI call device can obtain the parameter information.
  • the parameter list corresponding to different OpenAPI methods is not the same, and the parameter information obtained by the OpenAPI calling device is also different.
  • Step 103 Call the target OpenAPI method according to the parameter information and the calling rule that is adapted to the target OpenAPI method.
  • OpenAPIs use different communication protocols, for example, may use a representation state Representational State Transfer (referred to as: Rest) protocol, Simple Object Access Protocol (Sole) or Ajax (Asynchronous JavaScript and XML) protocol.
  • Rest representation state Representational State Transfer
  • Sole Simple Object Access Protocol
  • Ajax Asynchronous JavaScript and XML protocol.
  • the calling process for each protocol is different.
  • the OpenAPI calling device is pre-stored with various The calling protocol adapted to the communication protocol, when the OpenAPI calling device needs to call the OpenAPI method, selects an appropriate calling rule according to the communication protocol adopted by the OpenAPI method, and automatically completes the process of calling the OpenAPI method to the OpenAPI server according to the calling rule and the parameter information. , without the user having to learn the communication protocol.
  • the OpenAPI server refers to a server that stores a large number of OpenAPIs, which are usually deployed by the OpenAPI provider.
  • the OpenAPI calling device after obtaining the parameter information corresponding to the target OpenAPI method and the target OpenAPI method, invokes the target OpenAPI method by using a calling rule adapted to the target OpenAPI method, and implements the target OpenAPI method.
  • the use of a unified call flow to achieve calls to different OpenAPIs simplifies the calling process and improves the efficiency of calling OpenAPI.
  • FIG. 2A is a flowchart of an embodiment of a step 101 according to an embodiment of the present invention. As shown in FIG. 2A, the implementation of this embodiment includes:
  • Step 10al Receive a first call request sent by the user.
  • the OpenAPI calling tool can initiate a call request (ie, the first call request) to the OpenAPI calling device of this embodiment.
  • the user's invocation request may not include any information related to the OpenAPI, so that the user can generate and initiate a call request.
  • Step 10a2 Provide an OpenAPI list to the user according to the first call request, so that the user selects the target OpenAPI.
  • the OpenAPI calling device obtains the calling request of the user, the OpenAPI information base is queried according to the calling request, and the entire OpenAPI list in the OpenAPI information base is provided to the user.
  • the OpenAPI calling device provides the OpenAPI list to the user through the calling interface.
  • the OpenAPI list includes information of multiple OpenAPIs; after seeing the OpenAPI list, the user selects an OpenAPI (ie, target OpenAPI) according to his own needs. After the user selects OpenAPI, the OpenAPI call device gets the target OpenAPI.
  • Step 10a3 Obtain a method list corresponding to the target OpenAPI, and provide the method list to the user for selection by the user.
  • the OpenAPI calling device After the OpenAPI calling device obtains the target OpenAPI, it queries the OpenAPI information base according to the target OpenAPI to obtain a list of methods corresponding to the target OpenAPI. For example, by the ID of the target OpenAPI, get a list of methods indexed by that ID. The method list is then provided to the user via the call interface.
  • the method list includes information about multiple OpenAPI methods, and the user selects an OpenAPI method (ie, the target OpenAPI method) according to his or her own needs.
  • Step 10a4 Obtain a target OpenAPI method according to a result of the user selection.
  • the OpenAPI calling device obtains the target OpenAPI method. After that, step 102 and step 103 are performed to complete the call to the target OpenAPI method.
  • the user only needs to issue a call request to call OpenAPI, and does not need to indicate any information of the OpenAPI to be called.
  • the OpenAPI calling device provides the corresponding information to the user through the calling interface, and the user only needs to call the unified process of the device according to the OpenAPI.
  • the operation can be performed, and the user is enabled to call different OpenAPI methods through a unified process, thereby improving the calling efficiency.
  • FIG. 2B is a schematic diagram of another embodiment of step 101 according to an embodiment of the present invention. As shown in FIG. 2B, the embodiment of this embodiment includes:
  • Step 10b1 Receive a second call request sent by the user, where the second call request includes an OpenAPI keyword.
  • the OpenAPI calling tool may initiate a call request (ie, a second call request) to the OpenAPI calling device of the embodiment, where the second The call request contains the OpenAPI keyword.
  • the OpenAPI keyword is used to identify the OpenAPI that the user wants to call; the OpenAPI keyword may be one of the OpenAPI information stored in the OpenAPI list, so that the OpenAPI calling device can obtain the corresponding OpenAPI according to the OpenAPI keyword.
  • the OpenAPI keyword can be an OpenAPI ID or a call address.
  • Step 10b2 Query the OpenAPI list according to the OpenAPI keyword to obtain the target OpenAPI corresponding to the OpenAPI keyword.
  • the OpenAPI calling device searches in the OpenAPI list of the OpenAPI repository according to the OpenAPI keyword to obtain an OpenAPI that conforms to the OpenAPI keyword, that is, the target OpenAPI.
  • Step 10b3 Obtain a method list corresponding to the target OpenAPI, and provide the method list to the user for selection by the user.
  • the target OpenAPI corresponds to multiple OpenAPI methods, and all OpenAPI method related information is recorded in the method list under the target OpenAPI.
  • the OpenAPI calling device obtains the target OpenAPI, it searches in the OpenAPI repository to obtain a list of methods under the target OpenAPI. Then, the method list is provided to the user through the calling interface, so that the user can select an OpenAPI method, that is, the target OpenAPI method.
  • Step 10b4 Obtain a target OpenAPI method according to the result of the user selection.
  • the OpenAPI calling device obtains the target OpenAPI method. After that, step 102 and step 103 are performed to complete the call to the target OpenAPI method.
  • the user sends a call request carrying the OpenAPI keyword directly to the OpenAPI calling device through the OpenAPI calling tool, so that the OpenAPI directly obtains the target OpenAPI, which reduces the interaction between the subsequent OpenAPI calling device and the user, and the user and the OpenAPI call device.
  • the acquisition of the target OpenAPI method can be completed only once, and the efficiency of obtaining the target OpenAPI is improved.
  • the OpenAPI calling method implemented in conjunction with FIG. 2A or FIG. 2B can be implemented by a functional unit in the calling device of the OpenAPI, which is specifically encapsulating the original OpenAPI, and the OpenAPI is guaranteed during the development process.
  • Time interface consistency to provide users with a simple The easy-to-use call interface allows the user to specify the OpenAPI method to be called, and the OpenAPI method can automatically initiate a call to the OpenAPI method after the parameter information is filled in.
  • the functional unit is referred to as a directly selected calling unit.
  • the functions of the OpenAPI calling device can be divided into different functional levels.
  • the operation of selecting the target OpenAPI or selecting the target OpenAPI method is done by the user (User), and the operation of providing the user with an OpenAPI list, a method list or a parameter list can be considered as being done by the OpenAPI calling device's view layer.
  • Querying the OpenAPI repository the operation of obtaining an OpenAPI list, a method list, or a parameter list can be considered as being performed by the control layer of the device invoked by OpenAPI.
  • the OpenAPI list, method list, and parameter list in the OpenAPI repository can be thought of as being stored in the model layer of the OpenAPI calling device.
  • the operation of calling the target OpenAPI method according to the calling rules can also be considered as being done by the control layer of the OpenAPI calling device.
  • FIG. 2C is a flowchart of still another embodiment of step 101 according to an embodiment of the present invention. As shown in FIG. 2C, the embodiment of this embodiment includes:
  • Step 10cl Obtain an OpenAPI function parameter corresponding to the call request.
  • the function call request is sent to the OpenAPI calling device through its OpenAPI calling tool.
  • the function call request includes OpenAPI function parameters, which are used to identify the functions that the user needs to perform the OpenAPI method, but do not limit which OpenAPI method.
  • the OpenAPI calling device receives the function call request, and then parses the function call request to obtain the OpenAPI function parameters therein.
  • the OpenAPI calling device may parse the function call request according to the format of the function call request that is pre-agreed by the user, and obtain the OpenAPI function parameter from the corresponding location.
  • Step 10c2 Obtain an OpenAPI method set according to the OpenAPI function parameter.
  • the OpenAPI method set includes multiple OpenAPI methods corresponding to OpenAPI function parameters.
  • the OpenAPI information base is queried according to the obtained OpenAPI function parameters, mainly according to the OpenAPI function parameters. Look in the OpenAPI list and method list and get all OpenAPI methods that implement the functionality described by the OpenAPI function parameters. Among them, the obtained OpenAPI methods with the same function are stored in the OpenAPI method set.
  • the various OpenAPI methods in the OpenAPI method set can come from different OpenAPIs or can be written using different communication protocols, but with the same parameter list.
  • Step 10c3 According to the OpenAPI method, the Quality of Service (Qos) attribute value of each OpenAPI method is centralized, and the target OpenAPI method is obtained.
  • Qos Quality of Service
  • the OpenAPI information base also includes the Qos attribute value of each OpenAPI method.
  • the Qos attribute value can include a subjective Qos attribute and/or an objective Qos attribute.
  • the subjective Qos attribute mainly reflects the user's evaluation of OpenAPI.
  • the objective Qos attribute mainly reflects some performances in the OpenAPI call process.
  • the subjective Qos attribute can include any one or combination of the following: Usability, Correctness, Performance/Price, or Subjective Security. Among them, ease of use is used to reflect whether the process of calling OpenAPI is simple and whether the returned result is easy to understand. Correctness is used to evaluate whether the result obtained after calling OpenAPI is the result expected by the user.
  • the price-to-price ratio is the ratio of the actual application value of an OpenAPI to the cost of the user calling the OpenAPI.
  • Subjective security refers to the evaluation of whether the OpenAPI is safe after the user calls OpenAPI.
  • weighted averaging processing can be performed on the above various subjective Qos attributes to obtain a comprehensive subjective evaluation value.
  • the objective Qos attribute may include any one or a combination of the following: encryption security, response time (Response Time), availability (Availability), or stability (Stability).
  • encryption security refers to whether the transmission process of the OpenAPI call is encrypted.
  • Response time is the degree to which OpenAPI is called, that is, the time difference from the user-initiated call to the user's return.
  • Availability is used to evaluate whether the current OpenAPI is available and can be characterized by the ratio of users successfully calling OpenAPI. Stability can be expressed in Mean Time between Failures (MTBF), which is the average working time between failures of OpenAPI calls.
  • the above Qos attribute value of each OpenAPI method is obtained in advance.
  • the objective Qos attribute value can be obtained by monitoring the process of calling the OpenAPI method, for example:
  • the detection program can record the objective information including the response time and availability of the OpenAPI method.
  • the subjective Qos attribute value can be obtained by calling the user's evaluation after the OpenAPI method is finished. For example: After the call ends, the user is required to submit subjective evaluation information including correctness, ease of use, and cost performance. In other words, the value of the Qos property of the OpenAPI method is gradually collected during the called process.
  • the Qos attribute is called the incremental QoS attribute, and the value is called the incremental QoS attribute value.
  • the Qos attribute is called the decrement type Qos attribute, and its value is called the decrement type Qos attribute value.
  • the selection device normalizes various Qos attribute values, and generates a user applicability value, and evaluates the performance of the OpenAPI by using the user applicability value, and is based on each OpenAPI.
  • the user applicability value of the method is used to select the target OpenAPI method.
  • the OpenAPI calling device normalizes the incremental Qos attribute value according to the formula (1). : ⁇ 0
  • the OpenAPI calling device normalizes the decremented Qos attribute value according to formula (2) - maxg -eorial.
  • the OpenAPI calling device performs a weighted averaging process on the normalized Qos attribute value according to the formula (3) to generate a user applicability value.
  • represents the weight value of the ⁇ : normalized Qos attribute value of each OpenAPI method; in this embodiment, the weight value is preset, and for each OpenAPI method, the w k is the same, but is not limited to this; represents the user suitability value corresponding to the first OpenAPI method.
  • An implementation manner of the step 10c3 is as follows:
  • the OpenAPI calling device selects an OpenAPI method with the largest user applicability value from the multiple OpenAPI methods in the OpenAPI method set as the target OpenAPI method.
  • the implementation is simple and easy to implement, and the selected OpenAPI method is the best OpenAPI method, and the user can obtain a higher quality service after calling the target OpenAPI method.
  • step 10c3 includes:
  • Step 10c31 Assign a selection probability to each OpenAPI method according to the user suitability value corresponding to each OpenAPI method.
  • the OpenAPI calling device allocates different selection probabilities for each OpenAPI, and ensures that the selection probability of the OpenAPI method with good performance is large. That is, if the user value of the OpenAPI method is larger, the probability of the selection that the OpenAPI calling device assigns to it is greater.
  • the sum of all selection probabilities assigned by the OpenAPI calling device is 1.
  • apiidl a OpenAPI method
  • apiid2 apiidi
  • the n selection probabilities will be divided into n+1 probability intervals.
  • Step 10c32 generating a random number.
  • Step 10c33 Select a target OpenAPI method from a plurality of OpenAPI methods according to the random number and the selection probability.
  • the OpenAPI calling device sorts the selection probabilities in ascending order; then, compares the random numbers with the sorted selection probabilities, until the first selection probability greater than the random number is compared, and the first one is selected.
  • the OpenAPI method corresponding to the selection probability of the random number is used as the target OpenAPI method. That is to say, the OpenAPI calling device determines in which probability interval the random number appears, takes the OpenAPI method corresponding to the upper limit of the probability interval, and uses the OpenAPI method as the target OpenAPI method.
  • This embodiment can ensure that the OpenAPI method with higher probability is more likely to be selected by generating a random number between 0-1 and selecting the target OpenAPI method according to the random number and the selection probability assigned to the OpenAPI method. The higher the performance, the higher the probability that the OpenAPI method will be selected, and the possibility that each OpenAPI method will be selected.
  • the OpenAPI calling device After selecting the target OpenAPI method, the OpenAPI calling device performs steps 102 and 103 to call the target OpenAPI method to the OpenAPI server; and determines whether the OpenAPI server returns the calling result. If the judgment result is no, indicating that the target OpenAPI method fails, the target OpenAPI method is removed from the OpenAPI method set, and step 10c3 is re-executed to regain the target OpenAPI method. If the judgment result is yes, it indicates that the calling target OpenAPI method is successful, the call result is returned to the user, and the OpenAPI call operation is ended.
  • the implementation shown in FIG. 2C may be implemented by another functional unit of the OpenAPI calling device, which specifically provides an input parameter to the directly selected calling unit, and invokes the direct selection of the calling unit to implement the call to the OpenAPI method.
  • the functional unit allows the user to directly input the OpenAPI function parameters, and then automatically obtains multiple OpenAPI methods having the functions described by the OpenAPI function parameters according to the OpenAPI function parameters, and According to the Qos attribute, the OpenAPI method with better performance (that is, the service quality is better) is selected for the user to call, and if the selected target OpenAPI method is unavailable (that is, the call is not successfully succeeded), the user is selected from the OpenAPI method set and then re-selected for the user.
  • the above operation process is transparent to the user, and the user only needs to send a call request with the OpenAPI function parameter, no matter which OpenAPI method is finally called, the entire calling process is the same for the user, and the user does not need to care.
  • the communication protocol used by each OpenAPI method simplifies the user's calling process and improves the calling efficiency.
  • the functional unit is referred to as a one-key calling unit.
  • the one-click calling unit is implemented based on calling the directly selected calling unit.
  • the user only needs to send a call request once to call the device through OpenAPI to obtain a better OpenAPI method, and does not need to issue a call request to different devices multiple times, thereby improving the user's call to the OpenAPI method. effectiveness.
  • step l0cl includes:
  • Step 10cl Receive an application call request sent by the user, where the application call request includes application description information.
  • the application call request is sent to the OpenAPI calling device through its OpenAPI calling tool.
  • the users here mainly refer to the development users who develop new applications or new systems based on the OpenAPI method.
  • the application call request includes a description of the system or application that the user needs to complete through the OpenAPI method. For example: Take the combination application of the school introduction and the map as an example. The combined application needs to obtain a map centered on a certain coordinate (ie, a certain location), and then obtain the school information near the coordinate location, and the combination of the two is displayed together. .
  • Two functional information is involved in the combined application, one is to obtain a map centered on a certain location, and the other is to obtain a school-centered introduction.
  • the user needs to implement the combination application of the school introduction and the map through the OpenAPI method, the user only needs to send an application call request carrying the "school introduction and map combination and location A" information to the OpenAPI calling device, which specific OpenAPI method is used to implement the application.
  • the function is determined by the OpenAPI calling device according to the two function information obtained by the parsing.
  • the combination application of the school introduction and the map is only an example of the application description information.
  • Step 10cl2 Perform function parsing on the application description information to obtain OpenAPI function parameters.
  • the OpenAPI calling device parses the application call request. Take the application description information, and then perform function parsing on the application description information to obtain OpenAPI function parameters. For example: OpenAPI calls the device to perform functional analysis on "School introduction and map combination and location A", and obtains two OpenAPI function parameters such as "Get map centered on location A and get school introduction centered on location A”.
  • the OpenAPI invoking device executes step 10c32, performs a search in the OpenAPI information base according to the above OpenAPI function parameters, and finally finds an OpenAPI method set having a map function centered on the location A and an introduction to the school centered on the location A.
  • a set of OpenAPI methods for functionality Similarly, in these method sets, each OpenAPI method can be written using a different communication protocol, or it can belong to different OpenAPL.
  • the OpenAPI calling device performs step 10c33, respectively, from the above-mentioned OpenAPI method set with the map function centered on the location A and the OpenAPI method with the school introduction function centered on the location A, and the acquisition is obtained by the location A.
  • the process of obtaining the target OpenAPI method with the function of acquiring the map A-centered map and the process of obtaining the target OpenAPI method with the location introduction function centered on the location A are the same and independent.
  • the embodiment shown in FIG. 2E can be implemented by another functional unit of the OpenAPI calling device, which is mainly implemented by the application developer to invoke the target OpenAPI method on the basis of calling a key calling unit and directly selecting the calling unit.
  • the completed application is implemented by a variety of OpenAPI methods, and provides the user with a unit that calls the interface. Since the other functional unit combines the various OpenAPI methods to form a richer application, the functional unit is referred to as a mashup call unit.
  • the user only needs to input the application call request to implement the call of different OpenAPI methods, and the user does not need to care about the communication protocol used by each OpenAPI method, and has the advantages of simple call and high efficiency.
  • the OpenAPI calling device is also applied to the application developer (for example, the Web should Using the developer) provides an ability for application developers to invoke various OpenAPI methods to develop new mashup applications in a simple, efficient, and unified way to provide new business functionality. That is, the mashup calling unit for implementing the embodiment can be implemented as a platform on which application developers are allowed to share function codes (ie, various OpenAPI methods), and the platform can also provide retrieval and submission. , download and other functions to achieve maximum code reuse.
  • function codes ie, various OpenAPI methods
  • the Mashup call unit is the most granular, because a mashup application may incorporate several different OpenAPI methods. Due to this convergence, the OpenAPI calling device cannot directly evaluate the Mashup application by evaluating the QoS attribute of the OpenAPI method. Therefore, the OpenAPI calling device separately sets evaluation criteria and evaluates it in units of each Mashup application. In the evaluation criteria of the Mashup application, the main focus is on the user's evaluation.
  • the user invokes the Mashup application and returns subjective evaluation information of the Mashup application to the OpenAPI calling device.
  • the application developer can mark the price of the points he desires when publishing the Mashup application developed by himself; when the user downloads and uses the mashup application, he needs to pay the corresponding points score and submit it after use.
  • Evaluation information and in order to encourage the use of users to submit evaluation information, after using the user to submit the evaluation information, the OpenAPI calling device returns a certain amount of points to the user, thereby realizing the acquisition of the Mashup application evaluation information.
  • the OpenAPI method in each of the above embodiments or embodiments includes an OpenAPI method that cannot be independently operated by the Rest protocol. Based on this, the OpenAPI calling device pre-stores the calling rules that are compatible with various protocols.
  • FIG. 3 is a flow chart of an embodiment of step 103 according to an embodiment of the present invention.
  • the implementation may be implemented based on the foregoing embodiments or implementation manners. As shown in FIG. 3, the implementation manner includes:
  • Step 1031 Obtain a calling rule that is adapted to the target OpenAPI method according to the protocol type adopted by the target OpenAPI method. Specifically, the calling rules adapted to various communication protocols are pre-stored on the OpenAPI calling device. After the OpenAPI calling device determines the target OpenAPI method, the communication protocol used by the target OpenAPI method may be obtained from the OpenAPI list, and then the calling rule corresponding to the communication protocol is obtained.
  • Step 1032 Process the parameter information according to the calling rule to generate a third-party calling request.
  • the OpenAPI calling device After the OpenAPI calling device obtains the calling rule, it processes the parameter information of the target OpenAPI method to generate a third-party calling request, that is, a call request sent to a third-party OpenAPI server.
  • Step 1033 Send a third-party call request to the OpenAPI server to invoke the target OpenAPI method.
  • the OpenAPI invoking device After generating the invocation request, the OpenAPI invoking device sends a third-party invocation request to the third-party OpenAPI server to invoke the target OpenAPI method.
  • the OpenAPI calling device pre-stores the calling rules corresponding to various protocols, and obtains the corresponding calling rules according to the communication protocol used by the target OpenAPI method, and then invokes the target OpenAPI method, so that the user does not care about the target OpenAPI method.
  • the communication protocol does not need to be called after learning the communication protocol, and therefore has the advantages of simple implementation and high call efficiency.
  • FIG. 4 is a flowchart of a method for calling an OpenAPI according to another embodiment of the present invention. The embodiment is implemented based on the embodiment shown in FIG. 1 and FIG. 3. As shown in FIG. 4, the method in this embodiment includes before step 1033:
  • Step 103a Set the data format of the returned result.
  • the data format of the call result supported by the OpenAPI calling device, the data format of the call result supported by the user, and the data format supported by the OpenAPI server may be different, so in order to satisfy the user's ability to recognize the returned result, in this embodiment,
  • the OpenAPI calling device pre-sets the data format of the returned result before calling the target OpenAPI method. This is also done by the control layer of the OpenAPI calling device.
  • the method further includes:
  • Step 1034 receiving a call result returned by the OpenAPI server, and calling according to the data format The result is formatted and the processed call result is provided to the user.
  • the OpenAPI calling method of this embodiment sets a data format before calling the target OpenAPI method, and formats the returned result by using the set data format after receiving the returned result, so that the user can directly receive the identifiable return result. No need for users to perform format conversion, which improves the quality of service to users.
  • FIG. 5 is a flowchart of a calling method when a target OpenAPI method adopts a Rest protocol according to an embodiment of the present invention. As shown in FIG. 5, the method in this embodiment includes:
  • Step 501 The OpenAPI calling device acquires a target OpenAPI method according to the user's calling request.
  • the step 501 can obtain the target OpenAPI method by using the implementation manner shown in any of FIG. 2A and FIG. 2D, which is determined by the user's calling request, and the detailed process is not described herein again.
  • Step 502 The OpenAPI calling device provides a parameter list of the target OpenAPI method to the user. Specifically, after obtaining the target OpenAPI method, the OpenAPI calling device queries the OpenAPI information library to obtain a parameter list of the target OpenAPI method, and provides the user with the calling interface.
  • Step 503 The user inputs the parameter information required by the target OpenAPI method according to the parameter list, and simultaneously inputs the key value of the calling key, and sends the key value to the OpenAPI calling device.
  • the user inputs the parameter information on the calling interface, and at the same time inputs the encryption key required to invoke the target OpenAPI method, that is, the Key value is called, and is sent to the OpenAPI calling device by calling the submit function on the interface.
  • Step 504 The OpenAPI calling device receives the parameter information sent by the user and calls the Key value, queries the OpenAPI list according to the target OpenAPI method, and obtains the calling address of the target OpenAPI method.
  • Step 505 The OpenAPI calling device encrypts the parameter information and the called Key value to generate a third-party call request.
  • the OpenAPI calling device encrypts the parameter information by calling the Key value.
  • the third-party calling request under the Rest protocol is a request in a Hyper Text Mark-up Language (abbreviated as: HTML) format.
  • Step 506 The OpenAPI calling device sends a third-party calling request to the OpenAPI server according to the calling address to invoke the target OpenAPI method.
  • Step 507 The OpenAPI calling device receives the call result returned by the OpenAPI server, and formats the call result by using a preset data format, and then sends the result to the user.
  • the OpenAPI calling device formats the call result of the Extensible Markup Language (XML) format returned by the OpenAPI server to form a call result in a format recognizable by the user.
  • XML Extensible Markup Language
  • Step 504 and step 505 are corresponding execution rules when the target OpenAPI method adopts the Rest protocol, that is, the specific implementation manner of step 1032.
  • the calling API when the target OpenAPI method adopts the Rest protocol, the calling API directly acquires the calling rule corresponding to the Rest protocol, and automatically completes the calling of the target OpenAPI method according to the calling rule, and the user does not need to learn the Rest.
  • the communication mechanism of the protocol improves the efficiency of calling the OpenAPI method.
  • FIG. 6 is a flowchart of a calling method when a target OpenAPI method adopts a Soap protocol according to an embodiment of the present invention. As shown in FIG. 6, the method in this embodiment includes:
  • Step 601 The OpenAPI calling device acquires a target OpenAPI method according to the user's calling request.
  • Step 602 The OpenAPI calling device provides a parameter list of the target OpenAPI method to the user.
  • Step 603 The user inputs parameter information required by the target OpenAPI method according to the parameter list, and sends the parameter information to the OpenAPI calling device.
  • Step 604 The OpenAPI calling device receives the parameter information sent by the user, and queries the OpenAPI list according to the target OpenAPI method, and obtains the web service description language of the Soap protocol to convert to java. (WSDL2Java) toolkit.
  • Step 605 The OpenAPI calling device processes the parameter information and the target OpenAPI method by using the WSDL2 Java toolkit to generate a third-party call request.
  • the OpenAPI calling device uses the WSDL2 Java toolkit to make a Java interface code that is called to the Soap server (ie, the OpenAPI server), and then automatically generates a Soap client code that calls the target OpenAPI method by using the parameter information input by the user, the Soap client.
  • the terminal code generates a third-party call request at runtime.
  • Step 606 The OpenAPI calling device sends a third-party call request to the OpenAPI server to invoke the target OpenAPI method.
  • the OpenAPI calling device generates a call to the target OpenAPI method by running the Soap client code to generate and send a third-party call request to the OpenAPI server.
  • Step 607 The OpenAPI calling device receives the call result returned by the OpenAPI server, and formats the call result by using a preset data format, and then sends the result to the user.
  • the OpenAPI calling device formats the call result returned by the OpenAPI server to form a call result in a format recognizable by the user.
  • Step 604 and step 605 are the corresponding calling rules when the target OpenAPI method adopts the Soap protocol, which is the specific implementation manner of step 1032.
  • the OpenAPI calling device directly acquires the calling rule corresponding to the Soap protocol when the target OpenAPI method adopts the Soap protocol, and automatically completes the calling of the target OpenAPI method according to the calling rule, and the user is no longer required to learn the Soap.
  • the communication mechanism of the protocol improves the efficiency of calling the OpenAPI method.
  • FIG. 7 is a flowchart of a calling method when the target OpenAPI method adopts the Ajax protocol according to an embodiment of the present invention. As shown in FIG. 7, the method in this embodiment includes:
  • Step 701 The OpenAPI calling device acquires a target OpenAPI method according to a call request of the user.
  • Step 702 The OpenAPI calling device provides a parameter list of the target OpenAPI method to the user.
  • Step 703 The user inputs parameter information required by the target OpenAPI method according to the parameter list, and sends the parameter information to the OpenAPI calling device.
  • Step 704 The OpenAPI calling device receives the parameter information, and obtains the first function code stored locally, and then acquires the second function code from the OpenAPI server according to the first function code, and performs parameter information on the first function code and the second function code. Processing, generating a third-party call request.
  • the OpenAPI method written by using the Ajax protocol needs to write different function codes to be called when calling, the first function code corresponding to each OpenAPI method is generated and stored in advance in the embodiment.
  • calling the OpenAPI method implemented by the Ajax protocol also needs to download another part of the function code to the OpenAPI server.
  • the OpenAPI calling device is directly triggered to the OpenAPI server to obtain another part of the function code. , that is, the second function code (such as the required javascript code), and then combine the two parts of the function code to process the parameter information to generate a third-party call request.
  • the second function code such as the required javascript code
  • Step 705 The OpenAPI calling device sends a third-party call request to the OpenAPI server to invoke the target OpenAPI method.
  • the OpenAPI calling device generates and sends a third-party call request to the OpenAPI server by running the above function code.
  • Step 706 The OpenAPI calling device receives the call result returned by the OpenAPI server, and formats the call result by using a preset data format, and then sends the result to the user.
  • the OpenAPI calling device when the target OpenAPI method adopts the Ajax protocol, the OpenAPI calling device directly acquires the calling rule corresponding to the Ajax protocol, and automatically completes the calling of the target OpenAPI method according to the calling rule, and the user is no longer required to learn Ajax.
  • the communication mechanism of the protocol improves the efficiency of calling the OpenAPI method.
  • the embodiments of the present invention automatically set the calling rule under each communication protocol and input the calling request by providing a unified calling interface to the user, which is automatically adopted by the OpenAPI calling device.
  • the corresponding calling rule completes the call to each OpenAPI method, so that the user completes the call to various OpenAPI methods by using the same calling process, and does not need to learn various communication protocols, thereby improving the efficiency of calling the OpenAPI method and improving the user. Quality of service.
  • FIG. 8 is a schematic structural diagram of an OpenAPI calling device according to an embodiment of the present invention.
  • the calling device of this embodiment includes: a method obtaining unit 81, a parameter obtaining unit 82, and a calling unit 83.
  • the method obtaining unit 81 is configured to obtain a target OpenAPI method corresponding to the calling request of the user, and the parameter obtaining unit 82 is connected to the method acquiring unit 81, and configured to provide the user with a parameter list corresponding to the target OpenAPI method, to obtain The parameter information of the target OpenAPI method; the calling unit 83 is connected to the parameter obtaining unit 82, and is configured to invoke the target OpenAPI method according to the parameter information and the calling rule adapted to the target OpenAPI method.
  • the OpenAPI invoking device of this embodiment can be used to execute the process of the embodiment shown in FIG. 1.
  • the working principle is not described here. For details, refer to the description of the method embodiment.
  • the OpenAPI calling device After obtaining the parameter information corresponding to the target OpenAPI method and the target OpenAPI method, the OpenAPI calling device in this embodiment invokes the target OpenAPI method by using a calling rule adapted to the target OpenAPI method, and implements unified for the user.
  • the calling process implements calls to different OpenAPIs, which simplifies the calling process and improves the efficiency of calling OpenAPI.
  • FIG. 9 is a schematic structural diagram of an OpenAPI calling device according to another embodiment of the present invention.
  • the embodiment is implemented based on the embodiment shown in FIG. 8.
  • an implementation structure of the method obtaining unit 81 of the embodiment includes: a first receiving subunit 811, a first API acquiring subunit 812, and a first A subunit 813 and a first method acquisition subunit 814 are provided.
  • the first receiving subunit 811 is configured to receive a first call request sent by the user, where the first API obtaining subunit 812 is connected to the first receiving subunit 811, and configured to provide the OpenAPI list to the user according to the first calling request.
  • the OpenAPI list includes information of a plurality of OpenAPIs;
  • the first providing subunit 813 is connected to the first API obtaining subunit 812, configured to obtain a method list corresponding to the target OpenAPI, and provide the method list Give the user a choice for the user,
  • the method list includes information of a plurality of OpenAPI methods.
  • the first method obtaining subunit 814 is connected to the first providing subunit 813 for obtaining a target OpenAPI method according to a selection result of the user.
  • another implementation structure of the method obtaining unit 81 includes: a second receiving subunit 815, a second API obtaining subunit 816, a second providing subunit 817, and a second method obtaining subunit 818.
  • the second receiving subunit 815 is configured to receive a second calling request sent by the user, where the second calling request includes an OpenAPI keyword, and the second API obtaining subunit 816 is connected to the second receiving subunit 815, where The OpenAPI list is queried according to the OpenAPI keyword, and the target OpenAPI corresponding to the OpenAPI keyword is obtained.
  • the OpenAPI list includes information of multiple OpenAPIs.
  • the second providing subunit 817 is connected to the second API obtaining subunit 816 for obtaining the target OpenAPI.
  • the method list includes information of multiple OpenAPI methods; the second method obtaining subunit 818 is connected with the second providing subunit 817 for Select the result and get the target OpenAPI method.
  • another implementation structure of the method obtaining unit 81 includes: a parameter obtaining subunit 819, a method set obtaining subunit 820, and a third method acquiring subunit 821.
  • the parameter obtaining subunit 819 is configured to obtain an OpenAPI function parameter corresponding to the calling request
  • the method set obtaining subunit 820 is connected to the parameter obtaining subunit 819, and configured to obtain an OpenAPI method set according to the OpenAPI function parameter, the OpenAPI
  • the method set includes a plurality of OpenAPI methods corresponding to the OpenAPI function parameters
  • the third method obtaining subunit 821 is connected to the method set obtaining subunit 820, and is configured to collect the Qos attribute value of each OpenAPI method according to the OpenAPI method, and obtain the target OpenAPI method. .
  • An implementation structure of the parameter obtaining subunit 819 includes: a first receiving module and a first acquiring module.
  • the first receiving module is configured to receive a function call request sent by the user, where the function call request includes an OpenAPI function parameter;
  • the first acquiring module is connected to the first receiving module, configured to parse the function call request, and obtain the OpenAPI function parameter. .
  • Yet another implementation structure of the parameter acquisition subunit 819 includes: a second receiving module and a second obtaining module.
  • the second receiving module is configured to receive an application call request sent by the user, where the application invokes The request includes the application description information.
  • the second obtaining module is connected to the second receiving module, and is configured to perform function parsing processing on the application description information to obtain an OpenAPI function parameter.
  • the foregoing function sub-units or modules may be used to execute the processes of the foregoing embodiment shown in FIG. 2A to FIG. 2D, and the working principle thereof is not described again.
  • the OpenAPI calling device specifically allows the user to input various calling requests through the above function sub-units or modules, thereby providing a more convenient calling interface for the user, further improving the efficiency of calling the OpenAPI method and improving the quality of service to the user.
  • the calling unit 83 of the present embodiment includes a rule acquisition subunit 831, a generation subunit 832, and a calling subunit 833.
  • the rule obtaining sub-unit 831 is configured to obtain a calling rule that is adapted to the target OpenAPI method according to the protocol type adopted by the target OpenAPI method, and generate a sub-unit 832, which is connected to the rule obtaining sub-unit 831, according to the calling rule, The parameter information is processed to generate a third-party call request; the calling sub-unit 833 is connected to the generating sub-unit 832 for sending a third-party calling request to the OpenAPI server to invoke the target OpenAPI method.
  • the generating subunit 832 is specifically configured to receive the calling key Key value sent by the user, and query the OpenAPI list according to the target OpenAPI method to obtain the calling address; and the parameter information and the calling key.
  • the value is encrypted to generate a third-party call request.
  • the generating sub-unit 832 is specifically configured to query the OpenAPI list, obtain the WSDL2 Java toolkit of the Soa protocol, and process the parameter information and the target OpenAPI method by using the WSDL2 Java toolkit to generate a third-party calling request. .
  • the generating subunit 832 is specifically configured to obtain a locally stored first function code corresponding to the target OpenAPI method; and acquiring the second function code from the API database according to the first function code; The function code and the second function code process the parameter information to generate a third-party call request.
  • Each of the above functional subunits can be used to execute the process of the embodiment shown in FIG. 3 or FIG. 5 to FIG. The working principle is not repeated here, as described in the section on method embodiments.
  • the OpenAPI calling device of this embodiment further includes: a setting unit 84 and a receiving processing unit 85.
  • the setting unit 84 is configured to set a data format of the returned result.
  • the receiving processing unit 85 is connected to the setting unit 84, and is configured to receive a call result returned by the OpenAPI server, and format the call result according to the data format, and provide the processed call result to the user.
  • the OpenAPI calling device in this embodiment invokes the target OpenAPI method by using a calling rule adapted to the target OpenAPI method, and The implementation of the call process to achieve different calls to the OpenAPI, simplifying the calling process and improving the efficiency of calling OpenAPI.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Telephone Function (AREA)
  • Stored Programmes (AREA)
  • Devices For Executing Special Programs (AREA)

Abstract

A method and a device for calling an Open Application Programming Interface (OpenAPI) are provided. The method includes: obtaining a target OpenAPI method corresponding to a calling request of a user; providing a parameter list corresponding to the target OpenAPI method to the user so as to obtain the parameter information of the target OpenAPI method; processing the calling for the target OpenAPI method according to the parament information and the calling rule matching with the target OpenAPI method. By adopting this technical solution, calling different OpenAPIs using a uniform mode can be realized, and the calling efficiency is improved.

Description

开放应用程序编程接口调用方法及设备  Open application programming interface calling method and device
技术领域 Technical field
本发明实施例涉及编程接口技术, 尤其涉及一种开放应用程序编程接口 ( Open Application Programming Interface; 简称为: OpenAPI ) 调用方法及 设备。 背景技术  The embodiments of the present invention relate to a programming interface technology, and in particular, to an open application programming interface (Open Application Programming Interface; Open API) calling method and device. Background technique
目前, 互联网 (Internet ) 中存在着大量的开放 OpenAPI ( OpenAPI ) , 用户通过学习 OpenAPI的说明文档, 可以调用这些 OpenAPI 实现相应的功 At present, there are a large number of open OpenAPIs (OpenAPIs) in the Internet. By learning the documentation of OpenAPI, users can call these OpenAPIs to implement the corresponding functions.
Ah Ah
3匕。 3匕.
但是, 由于不同的 OpenAPI所采用的通信协议和调用方式都不尽相同。 对于直接调用 OpenAPI 中某项功能的用户, 以及对于利用已有 OpenAPI进 行二次开发的 Web应用开发者来说, 不仅需要学习 OpenAPI的说明文档从 整体上了解 OpenAPI的功能和结构, 还要需要对该 OpenAPI所采用的通信 机制进行学习, 以在基本掌握调用 OpenAPI的方法之后, 才能对该 OpenAPI 进行调用, 并得到该 OpenAPI所提供的开放能力。  However, the communication protocols and calling methods used by different OpenAPIs are different. For users who directly call a function in OpenAPI, and for Web application developers who use the existing OpenAPI for secondary development, not only need to learn the documentation of OpenAPI to understand the function and structure of OpenAPI as a whole, but also need to The communication mechanism adopted by the OpenAPI is learned to basically call the OpenAPI method before calling the OpenAPI and obtaining the open capability provided by the OpenAPI.
由上述可见, 由于不同 OpenAPI 所采用的通信机制不同, 使用者调用 OpenAPI实现开放能力的过程极为不方便、 不简洁, 调用 OpenAPI的效率较 低, 同时, 也无法采用统一的调用流程实现对不同 OpenAPI的调用。 发明内容  It can be seen from the above that due to the different communication mechanisms adopted by different OpenAPIs, the process of calling OpenAPI to implement openness is extremely inconvenient and inconvenient, and the efficiency of calling OpenAPI is low. At the same time, it is impossible to implement a different calling API by using a unified calling process. Call. Summary of the invention
本发明实施例提供一种开放应用程序编程接口调用方法及设备, 用以实现 采用统一方式调用不同 OpenAPI, 提高调用 OpenAPI的效率。  The embodiment of the invention provides an open application programming interface calling method and device, which are used to implement different calling OpenAPI in a unified manner, and improve the efficiency of calling OpenAPI.
本发明实施例提供一种开放应用程序编程接口 OpenAPI调用方法, 包括: 获取与用户的调用请求相对应的目标 OpenAPI方法; 向所述用户提供与所述目标 OpenAPI方法对应的参数列表, 以获取所述目 标 OpenAPI方法的参数信息; An embodiment of the present invention provides an open application programming interface OpenAPI calling method, including: acquiring a target OpenAPI method corresponding to a user's calling request; Providing the user with a parameter list corresponding to the target OpenAPI method, to obtain parameter information of the target OpenAPI method;
根据所述参数信息和与所述目标 OpenAPI方法相适应的调用规则, 对所述 目标 OpenAPI方法进行调用。  The target OpenAPI method is called according to the parameter information and a calling rule adapted to the target OpenAPI method.
本发明实施例提供一种开放应用程序编程接口 OpenAPI调用设备, 包括: 方法获取单元, 用于获取与用户的调用请求相对应的目标 OpenAPI方法; 参数获取单元, 用于向所述用户提供与所述目标 OpenAPI方法对应的参数 列表, 以获取所述目标 OpenAPI方法的参数信息;  An embodiment of the present invention provides an open application programming interface OpenAPI calling device, including: a method obtaining unit, configured to acquire a target OpenAPI method corresponding to a user's calling request, and a parameter obtaining unit, configured to provide the user with the user Determining a parameter list corresponding to the target OpenAPI method, to obtain parameter information of the target OpenAPI method;
调用单元, 用于根据所述参数信息和与所述目标 OpenAPI方法相适应的调 用规则, 对所述目标 OpenAPI方法进行调用。  And a calling unit, configured to invoke the target OpenAPI method according to the parameter information and a calling rule adapted to the target OpenAPI method.
本发明实施例的开放应用程序编程接口调用方法及设备,获取目标 OpenAPI 方法和目标 OpenAPI方法对应的参数信息后, 通过采用与目标 OpenAPI方法相 适应的调用规则, 对目标 OpenAPI方法进行调用, 可以采用统一的调用流程实 现对不同 OpenAPI的调用, 简化了调用过程, 提高了调用 OpenAPI的效率。 附图说明  The method and device for calling an open application programming interface of the embodiment of the present invention obtain the parameter information corresponding to the target OpenAPI method and the target OpenAPI method, and then call the target OpenAPI method by using a calling rule adapted to the target OpenAPI method, which may be adopted. The unified calling process implements calls to different OpenAPIs, which simplifies the calling process and improves the efficiency of calling OpenAPI. DRAWINGS
为了更清楚地说明本发明实施例或现有技术中的技术方案, 下面将对实施 例描述中所需要使用的附图作一简单地介绍, 显而易见地, 下面描述中的附图 是本发明的一些实施例, 对于本领域普通技术人员来讲, 在不付出创造性劳动 的前提下, 还可以根据这些附图获得其他的附图。  In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, a brief description of the drawings to be used in the description of the embodiments will be briefly made. It is obvious that the drawings in the following description are the present invention. For some embodiments, other drawings may be obtained from those of ordinary skill in the art without departing from the drawings.
图 1为本发明一实施例提供的 OpenAPI调用方法的流程图;  FIG. 1 is a flowchart of a method for calling an OpenAPI according to an embodiment of the present invention;
图 2A为本发明一实施例提供的步骤 101的一种实施方式的流程图; 图 2B为本发明一实施例提供的步骤 101的另一种实施方式的示意图; 图 2C为本发明一实施例提供的步骤 101的又一种实施方式的流程图; 图 2D为本发明一实施例提供的步骤 10c3的一种实施方式的流程图; 图 2E为本发明一实施例提供的步骤 10cl3的另一种实施方式的流程图; 图 3为本发明一实施例提供的步骤 103的实施方式的流程图; 2A is a flowchart of an embodiment of a step 101 according to an embodiment of the present invention; FIG. 2B is a schematic diagram of another embodiment of step 101 according to an embodiment of the present invention; A flowchart of still another embodiment of the step 101 is provided. FIG. 2D is a flowchart of an embodiment of the step 10c3 according to an embodiment of the present invention; FIG. 2E is another embodiment of the step 10cl3 according to an embodiment of the present invention. Flow chart of an embodiment; FIG. 3 is a flowchart of an implementation of step 103 according to an embodiment of the present invention;
图 4为本发明又一实施例提供的 OpenAPI调用方法的流程图;  4 is a flowchart of a method for calling an OpenAPI according to another embodiment of the present invention;
图 5为本发明一实施例提供的目标 OpenAPI方法采用 Rest协议时的调用方 法的流程图;  FIG. 5 is a flowchart of a calling method when a target OpenAPI method adopts a Rest protocol according to an embodiment of the present invention;
图 6为本发明一实施例提供的目标 OpenAPI方法采用 Soap协议时的调用方 法的流程图;  6 is a flowchart of a calling method when a target OpenAPI method adopts a Soap protocol according to an embodiment of the present invention;
图 7为本发明一实施例提供的目标 OpenAPI方法采用 Ajax协议时的调用方 法的流程图;  FIG. 7 is a flowchart of a calling method when a target OpenAPI method adopts an Ajax protocol according to an embodiment of the present invention;
图 8为本发明一实施例提供的 OpenAPI调用设备的结构示意图;  FIG. 8 is a schematic structural diagram of an OpenAPI calling device according to an embodiment of the present invention;
图 9为本发明又一实施例提供的 OpenAPI调用设备的结构示意图。 具体实施方式  FIG. 9 is a schematic structural diagram of an OpenAPI calling device according to another embodiment of the present invention. detailed description
为使本发明实施例的目的、 技术方案和优点更加清楚, 下面将结合本发明 实施例中的附图, 对本发明实施例中的技术方案进行清楚、 完整地描述, 显然, 所描述的实施例是本发明一部分实施例, 而不是全部的实施例。 基于本发明中 的实施例, 本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其 他实施例, 都属于本发明保护的范围。  The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is a partial embodiment of the invention, and not all of the embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
图 1为本发明一实施例提供的 OpenAPI调用方法的流程图。 如图 1所示, 本实施例的方法包括:  FIG. 1 is a flowchart of a method for calling an OpenAPI according to an embodiment of the present invention. As shown in FIG. 1, the method in this embodiment includes:
步骤 101、 获取与用户的调用请求相对应的目标 OpenAPI方法。  Step 101: Obtain a target OpenAPI method corresponding to a user's call request.
具体的, OpenAPI调用设备提供获取用户调用请求的接口, 以供用户输入 其调用请求。 待用户输入调用请求之后, OpenAPI调用设备根据调用请求通过 查询 OpenAIP信息库来获取相应的 OpenAPI方法。  Specifically, the OpenAPI calling device provides an interface for obtaining a user call request for the user to input its call request. After the user inputs the call request, the OpenAPI calling device obtains the corresponding OpenAPI method by querying the OpenAIP information base according to the call request.
其中, OpenAPI信息库存储有大量 OpenAPI的信息, 这些 OpenAPI的信息 可由人工预先搜集获取。 另外, 结合每个 OpenAPI又包括 OpenAPI方法、 每个 OpenAPI方法又有对应的参数信息, 故在本实施例中, 根据 OpenAPI的分层特 点, OpenAPI的信息以列表的形式存储。 即在 OpenAPI信息库中包括 OpenAPI 列表、 方法列表和参数列表。 OpenAPI列表包括有大量 OpenAPI的信息, 其中, 每个 OpenAPI的信息主要包括 OpenAPI的标识( ID ) 、 OpenAPI的功能描述信 息、 OpenAPI的调用地址、 采用的通信协议等等。 方法列表包括 OpenAPI列表 中每个 OpenAPI所对应的 OpenAPI方法的信息,且 OpenAPI列表与方法列表之 间存在着映射关系; OpenAPI方法的信息主要包括 OpenAPI方法的 ID、 功能描 述信息等。 参数列表包括方法列表中每个 OpenAPI方法所对应的参数信息, 即 要调用一个 OpenAPI方法所需的信息, 且参数列表与方法列表之间存在着映射 关系。 Among them, the OpenAPI information library stores a large amount of OpenAPI information, and these OpenAPI information can be obtained by manual pre-collection. In addition, in combination with each OpenAPI, the OpenAPI method is included, and each OpenAPI method has corresponding parameter information, so in this embodiment, according to the layering of OpenAPI Point, OpenAPI information is stored as a list. That is, the OpenAPI repository, the method list, and the parameter list are included in the OpenAPI repository. The OpenAPI list includes a large number of OpenAPI information, wherein each OpenAPI information mainly includes an OpenAPI identifier (ID), an OpenAPI function description information, an OpenAPI call address, a used communication protocol, and the like. The method list includes information about the OpenAPI method corresponding to each OpenAPI in the OpenAPI list, and there is a mapping relationship between the OpenAPI list and the method list; the information of the OpenAPI method mainly includes the ID of the OpenAPI method, function description information, and the like. The parameter list includes the parameter information corresponding to each OpenAPI method in the method list, that is, the information required to call an OpenAPI method, and there is a mapping relationship between the parameter list and the method list.
由上述可知, 由于预先存储了大量 OpenAPI的信息, OpenAPI调用设备可 以在大量 OpenAPI方法中搜索与用户的调用请求相适应的 OpenAPI方法, 提高 了用户调用 OpenAPI方法的成功率。  It can be seen from the above that since a large amount of OpenAPI information is stored in advance, the OpenAPI calling device can search for a large API method in accordance with the user's call request in a large number of OpenAPI methods, thereby improving the success rate of the user calling the OpenAPI method.
其中, OpenAPI调用设备可以向用户提供一调用界面, 以使用户通过调用 界面输入调用请求, 并最终获取目标 OpenAPI方法。  The OpenAPI calling device can provide a calling interface to the user, so that the user inputs the calling request through the calling interface, and finally obtains the target OpenAPI method.
步骤 102、 向用户提供与目标 OpenAPI方法对应的参数列表, 以获取目标 Step 102: Provide a user with a parameter list corresponding to the target OpenAPI method to obtain a target
OpenAPI方法的参数信息。 Parameter information of the OpenAPI method.
具体的, OpenAPI调用设备根据目标 OpenAPI方法查找 OpenAPI信息库获 取相应的参数列表, 并通过一调用界面将参数列表提供给用户, 以使用户输入 相应的参数信息。 其中, 较优选的, 该调用界面与步骤 101 的调用界面为同一 调用界面。  Specifically, the OpenAPI calling device searches the OpenAPI information base according to the target OpenAPI method to obtain a corresponding parameter list, and provides a parameter list to the user through a calling interface, so that the user inputs the corresponding parameter information. Preferably, the calling interface is the same calling interface as the calling interface of step 101.
当用户根据参数列表输入参数信息后, OpenAPI调用设备即可获得该参数 信息。 其中, 不同 OpenAPI方法对应的参数列表并不相同, OpenAPI调用设备 获取到的参数信息也会不同。  When the user inputs the parameter information according to the parameter list, the OpenAPI call device can obtain the parameter information. The parameter list corresponding to different OpenAPI methods is not the same, and the parameter information obtained by the OpenAPI calling device is also different.
步骤 103、 根据参数信息和与目标 OpenAPI方法相适应的调用规则, 对目 标 OpenAPI方法进行调用。  Step 103: Call the target OpenAPI method according to the parameter information and the calling rule that is adapted to the target OpenAPI method.
其中, 不同 OpenAPI采用的通信协议不同, 例如可能会采用表述性状态转 移( Representational State Transfer;简称为: Rest )协议、简单对象访问协议( Simple Object Access Protocol; 简称为: Soap )或者 Ajax ( Asynchronous JavaScript and XML )协议。 而每个协议对应的调用流程也不同。 为解决用户在调用不同协议 下的 OpenAPI方法时, 需要学习不同通信机制了解相应调用流程之后, 通过不 同的调用流程调用 OpenAPI方法的问题, 在本实施例中, OpenAPI调用设备预 先存储有与各种通信协议相适应的调用规则, 当 OpenAPI调用设备需要调用 OpenAPI方法时, 根据 OpenAPI方法采用的通信协议选择相适应的调用规则, 根据该调用规则和参数信息自动完成向 OpenAPI服务器中调用 OpenAPI方法的 过程, 而不需用户对通信协议进行学习。 Among them, different OpenAPIs use different communication protocols, for example, may use a representation state Representational State Transfer (referred to as: Rest) protocol, Simple Object Access Protocol (Sole) or Ajax (Asynchronous JavaScript and XML) protocol. The calling process for each protocol is different. In order to solve the problem that the user needs to learn the OpenAPI method under different protocols, it is necessary to learn different communication mechanisms to understand the corresponding calling process, and then call the OpenAPI method through different calling processes. In this embodiment, the OpenAPI calling device is pre-stored with various The calling protocol adapted to the communication protocol, when the OpenAPI calling device needs to call the OpenAPI method, selects an appropriate calling rule according to the communication protocol adopted by the OpenAPI method, and automatically completes the process of calling the OpenAPI method to the OpenAPI server according to the calling rule and the parameter information. , without the user having to learn the communication protocol.
其中, OpenAPI服务器是指存储有大量 OpenAPI的服务器, 该服务器通常 是由 OpenAPI提供者部署的。  Among them, the OpenAPI server refers to a server that stores a large number of OpenAPIs, which are usually deployed by the OpenAPI provider.
本实施例的 OpenAPI调用方法, OpenAPI调用设备在获取目标 OpenAPI方 法和目标 OpenAPI方法对应的参数信息后, 通过采用与目标 OpenAPI方法相适 应的调用规则, 对目标 OpenAPI方法进行调用, 对用户而言实现了采用统一的 调用流程实现对不同 OpenAPI的调用, 简化了调用过程, 提高了调用 OpenAPI 的效率。  In the OpenAPI calling method of the embodiment, after obtaining the parameter information corresponding to the target OpenAPI method and the target OpenAPI method, the OpenAPI calling device invokes the target OpenAPI method by using a calling rule adapted to the target OpenAPI method, and implements the target OpenAPI method. The use of a unified call flow to achieve calls to different OpenAPIs simplifies the calling process and improves the efficiency of calling OpenAPI.
本发明以下实施例提供了几种步骤 101的具体实施方式。图 2A为本发明一 实施例提供的步骤 101的一种实施方式的流程图。 如图 2A所示, 本实施例的实 施方式包括:  The following embodiments of the present invention provide specific implementations of several steps 101. FIG. 2A is a flowchart of an embodiment of a step 101 according to an embodiment of the present invention. As shown in FIG. 2A, the implementation of this embodiment includes:
步骤 10al、 接收用户发送的第一调用请求。  Step 10al: Receive a first call request sent by the user.
具体的, 当用户需要调用 OpenAPI方法时, 可以通过其 OpenAPI调用工具 向本实施例的 OpenAPI调用设备发起调用请求(即第一调用请求) 。 在该实施 例中, 用户的调用请求中可以不包括任何与 OpenAPI相关的信息, 便于用户生 成和发起调用请求。  Specifically, when the user needs to invoke the OpenAPI method, the OpenAPI calling tool can initiate a call request (ie, the first call request) to the OpenAPI calling device of this embodiment. In this embodiment, the user's invocation request may not include any information related to the OpenAPI, so that the user can generate and initiate a call request.
步骤 10a2、 根据第一调用请求向用户提供 OpenAPI列表, 以使用户选择目 标 OpenAPI„ OpenAPI调用设备获取到用户的调用请求之后,根据调用请求查询 OpenAPI 信息库,将 OpenAPI信息库中的整个 OpenAPI列表提供给用户。具体的, OpenAPI 调用设备通过调用界面将 OpenAPI列表提供给用户。 该 OpenAPI列表包括多个 OpenAPI的信息; 用户在看到 OpenAPI列表后, 根据自己的需求从中选择一个 OpenAPI (即目标 OpenAPI ) 。 在用户选择 OpenAPI之后, OpenAPI调用设备 就获取到目标 OpenAPI。 Step 10a2: Provide an OpenAPI list to the user according to the first call request, so that the user selects the target OpenAPI. After the OpenAPI calling device obtains the calling request of the user, the OpenAPI information base is queried according to the calling request, and the entire OpenAPI list in the OpenAPI information base is provided to the user. Specifically, the OpenAPI calling device provides the OpenAPI list to the user through the calling interface. The OpenAPI list includes information of multiple OpenAPIs; after seeing the OpenAPI list, the user selects an OpenAPI (ie, target OpenAPI) according to his own needs. After the user selects OpenAPI, the OpenAPI call device gets the target OpenAPI.
步骤 10a3、 获取目标 OpenAPI对应的方法列表, 并将方法列表提供给用户 以供用户选择。  Step 10a3: Obtain a method list corresponding to the target OpenAPI, and provide the method list to the user for selection by the user.
OpenAPI 调用设备获取到目标 OpenAPI之后, 根据目标 OpenAPI 查询 OpenAPI信息库,获取与目标 OpenAPI对应的方法列表。例如通过目标 OpenAPI 的 ID, 获取以该 ID为索引的方法列表。 然后, 通过调用界面将方法列表提供给 用户。 该方法列表包括多个 OpenAPI方法的信息, 用户根据自己的需求选择一 个 OpenAPI方法(即目标 OpenAPI方法) 。  After the OpenAPI calling device obtains the target OpenAPI, it queries the OpenAPI information base according to the target OpenAPI to obtain a list of methods corresponding to the target OpenAPI. For example, by the ID of the target OpenAPI, get a list of methods indexed by that ID. The method list is then provided to the user via the call interface. The method list includes information about multiple OpenAPI methods, and the user selects an OpenAPI method (ie, the target OpenAPI method) according to his or her own needs.
步骤 10a4、 根据用户的选择结果, 获取目标 OpenAPI方法。  Step 10a4: Obtain a target OpenAPI method according to a result of the user selection.
具体的, 在用户选择之后, OpenAPI调用设备就会获取到目标 OpenAPI方 法。 之后, 执行步骤 102和步骤 103, 完成对目标 OpenAPI方法的调用。  Specifically, after the user selects, the OpenAPI calling device obtains the target OpenAPI method. After that, step 102 and step 103 are performed to complete the call to the target OpenAPI method.
在本实施方式中, 用户只需发出调用 OpenAPI的调用请求, 而无须表明要 调用的 OpenAPI的任何信息, 由 OpenAPI调用设备通过调用界面向用户提供相 应信息, 用户只需根据 OpenAPI调用设备的统一流程进行操作即可, 对用户而 言实现了通过统一流程调用不同 OpenAPI方法, 提高了调用效率。  In this embodiment, the user only needs to issue a call request to call OpenAPI, and does not need to indicate any information of the OpenAPI to be called. The OpenAPI calling device provides the corresponding information to the user through the calling interface, and the user only needs to call the unified process of the device according to the OpenAPI. The operation can be performed, and the user is enabled to call different OpenAPI methods through a unified process, thereby improving the calling efficiency.
图 2B为本发明一实施例提供的步骤 101的另一种实施方式的示意图。如图 2B所示, 本实施例的实施方式包括:  FIG. 2B is a schematic diagram of another embodiment of step 101 according to an embodiment of the present invention. As shown in FIG. 2B, the embodiment of this embodiment includes:
步骤 10bl、 接收用户发送的第二调用请求, 该第二调用请求包括 OpenAPI 关键字。  Step 10b1: Receive a second call request sent by the user, where the second call request includes an OpenAPI keyword.
具体的, 当用户需要调用 OpenAPI方法时, 可以通过其 OpenAPI调用工具 向本实施例的 OpenAPI调用设备发起调用请求(即第二调用请求) , 在该第二 调用请求中携带有 OpenAPI关键字。 OpenAPI关键字用于标识用户所要调用的 OpenAPI; 该 OpenAPI关键字可以是与 OpenAPI列表中存储的 OpenAPI的信息 中的一种, 以便于 OpenAPI调用设备能够根据 OpenAPI 关键字获取到相应的 OpenAPI„ 例如: 该 OpenAPI关键字可以是 OpenAPI的 ID或调用地址等。 Specifically, when the user needs to invoke the OpenAPI method, the OpenAPI calling tool may initiate a call request (ie, a second call request) to the OpenAPI calling device of the embodiment, where the second The call request contains the OpenAPI keyword. The OpenAPI keyword is used to identify the OpenAPI that the user wants to call; the OpenAPI keyword may be one of the OpenAPI information stored in the OpenAPI list, so that the OpenAPI calling device can obtain the corresponding OpenAPI according to the OpenAPI keyword. For example: The OpenAPI keyword can be an OpenAPI ID or a call address.
步骤 10b2、 根据 OpenAPI关键字查询 OpenAPI列表, 获取与 OpenAPI关 键字对应的目标 OpenAPI。  Step 10b2: Query the OpenAPI list according to the OpenAPI keyword to obtain the target OpenAPI corresponding to the OpenAPI keyword.
OpenAPI调用设备根据 OpenAPI关键字在 OpenAPI信息库的 OpenAPI列表 中进行查找, 以获取符合 OpenAPI关键字的 OpenAPI , 即目标 OpenAPI。  The OpenAPI calling device searches in the OpenAPI list of the OpenAPI repository according to the OpenAPI keyword to obtain an OpenAPI that conforms to the OpenAPI keyword, that is, the target OpenAPI.
步骤 10b3、 获取目标 OpenAPI对应的方法列表, 并将方法列表提供给用户 以供用户选择。  Step 10b3: Obtain a method list corresponding to the target OpenAPI, and provide the method list to the user for selection by the user.
其中, 目标 OpenAPI对应有多个 OpenAPI方法, 所有 OpenAPI方法的相关 信息被记录在该目标 OpenAPI下的方法列表中。 当 OpenAPI调用设备获取目标 OpenAPI之后, 在 OpenAPI信息库中查找, 获取目标 OpenAPI下的方法列表。 然后, 通过调用界面将方法列表提供给用户, 以供用户从中选择一个 OpenAPI 方法, 即目标 OpenAPI方法。  The target OpenAPI corresponds to multiple OpenAPI methods, and all OpenAPI method related information is recorded in the method list under the target OpenAPI. After the OpenAPI calling device obtains the target OpenAPI, it searches in the OpenAPI repository to obtain a list of methods under the target OpenAPI. Then, the method list is provided to the user through the calling interface, so that the user can select an OpenAPI method, that is, the target OpenAPI method.
步骤 10b4、 根据用户的选择结果, 获取目标 OpenAPI方法。  Step 10b4: Obtain a target OpenAPI method according to the result of the user selection.
具体的, 在用户选择之后, OpenAPI调用设备就会获取到目标 OpenAPI方 法。 之后, 执行步骤 102和步骤 103, 完成对目标 OpenAPI方法的调用。  Specifically, after the user selects, the OpenAPI calling device obtains the target OpenAPI method. After that, step 102 and step 103 are performed to complete the call to the target OpenAPI method.
在本实施方式中, 用户通过其 OpenAPI调用工具直接向 OpenAPI调用设备 发送携带 OpenAPI关键字的调用请求, 使得 OpenAPI直接获取目标 OpenAPI , 减少了后续 OpenAPI调用设备与用户的交互操作, 用户与 OpenAPI调用设备只 需交互一次即可完成对目标 OpenAPI方法的获取操作,提高了获取目标 OpenAPI 的效率。  In this implementation manner, the user sends a call request carrying the OpenAPI keyword directly to the OpenAPI calling device through the OpenAPI calling tool, so that the OpenAPI directly obtains the target OpenAPI, which reduces the interaction between the subsequent OpenAPI calling device and the user, and the user and the OpenAPI call device. The acquisition of the target OpenAPI method can be completed only once, and the efficiency of obtaining the target OpenAPI is improved.
在此说明,在结合图 2A或图 2B实现的 OpenAPI调用方法,可以由 OpenAPI 调用设备中的一功能单元实现, 该功能单元具体是对原有 OpenAPI的进一步封 装, 在开发过程中保证了调用 OpenAPI时接口的一致性, 以向用户提供一种简 单易用的调用接口, 使得用户只需指定被调用的 OpenAPI方法, 并在填写参数 信息后即可由 OpenAPI调用设备自动发起对 OpenAPI方法的调用。 基于该功能 单元的具体功能, 将该功能单元称之为直接选定调用单元。 It is explained that the OpenAPI calling method implemented in conjunction with FIG. 2A or FIG. 2B can be implemented by a functional unit in the calling device of the OpenAPI, which is specifically encapsulating the original OpenAPI, and the OpenAPI is guaranteed during the development process. Time interface consistency to provide users with a simple The easy-to-use call interface allows the user to specify the OpenAPI method to be called, and the OpenAPI method can automatically initiate a call to the OpenAPI method after the parameter information is filled in. Based on the specific function of the functional unit, the functional unit is referred to as a directly selected calling unit.
另外, 在上述图 2A和图 2B中, 可以将 OpenAPI调用设备的功能划分为不 同的功能层次。 例如: 选择目标 OpenAPI或选择目标 OpenAPI方法的操作由用 户 (User ) 完成, 而向用户提供 OpenAPI列表、 方法列表或参数列表的操作可 视为由 OpenAPI调用设备的视图层完成。 查询 OpenAPI信息库, 获取 OpenAPI 列表、 方法列表或参数列表的操作可视为由 OpenAPI调用设备的控制层完成。 而 OpenAPI信息库中的 OpenAPI列表、 方法列表以及参数列表可视为存储在 OpenAPI调用设备的模型层。  In addition, in the above Figs. 2A and 2B, the functions of the OpenAPI calling device can be divided into different functional levels. For example: The operation of selecting the target OpenAPI or selecting the target OpenAPI method is done by the user (User), and the operation of providing the user with an OpenAPI list, a method list or a parameter list can be considered as being done by the OpenAPI calling device's view layer. Querying the OpenAPI repository, the operation of obtaining an OpenAPI list, a method list, or a parameter list can be considered as being performed by the control layer of the device invoked by OpenAPI. The OpenAPI list, method list, and parameter list in the OpenAPI repository can be thought of as being stored in the model layer of the OpenAPI calling device.
另外, 根据调用规则调用目标 OpenAPI方法的操作也可视为由 OpenAPI调 用设备的控制层来完成。  In addition, the operation of calling the target OpenAPI method according to the calling rules can also be considered as being done by the control layer of the OpenAPI calling device.
图 2C为本发明一实施例提供的步骤 101的又一种实施方式的流程图。如图 2C所示, 本实施例的实施方式包括:  FIG. 2C is a flowchart of still another embodiment of step 101 according to an embodiment of the present invention. As shown in FIG. 2C, the embodiment of this embodiment includes:
步骤 10cl、 获取与调用请求对应的 OpenAPI功能参数。  Step 10cl: Obtain an OpenAPI function parameter corresponding to the call request.
具体的, 当用户需要调用 OpenAPI方法时, 通过其 OpenAPI调用工具向 OpenAPI调用设备发送功能调用请求。该功能调用请求包括 OpenAPI功能参数, 用于标识用户需要 OpenAPI 方法所完成的功能, 但并不限制具体是哪一个 OpenAPI方法。 OpenAPI调用设备接收功能调用请求, 然后解析功能调用请求, 获取其中的 OpenAPI功能参数。 具体的, OpenAPI调用设备可以根据与用户预 先约定的功能调用请求的格式, 对功能调用请求进行解析, 从相应位置获取 OpenAPI功能参数。  Specifically, when the user needs to call the OpenAPI method, the function call request is sent to the OpenAPI calling device through its OpenAPI calling tool. The function call request includes OpenAPI function parameters, which are used to identify the functions that the user needs to perform the OpenAPI method, but do not limit which OpenAPI method. The OpenAPI calling device receives the function call request, and then parses the function call request to obtain the OpenAPI function parameters therein. Specifically, the OpenAPI calling device may parse the function call request according to the format of the function call request that is pre-agreed by the user, and obtain the OpenAPI function parameter from the corresponding location.
步骤 10c2、根据 OpenAPI功能参数,获取 OpenAPI方法集。其中, OpenAPI 方法集包括与 OpenAPI功能参数对应的多个 OpenAPI方法。  Step 10c2: Obtain an OpenAPI method set according to the OpenAPI function parameter. The OpenAPI method set includes multiple OpenAPI methods corresponding to OpenAPI function parameters.
当 OpenAPI调用设备获取 OpenAPI功能参数之后, 根据获取的 OpenAPI 功能参数在 OpenAPI信息库中进行查询, 主要是指根据 OpenAPI功能参数依次 在 OpenAPI列表和方法列表中进行查找, 并获取所有能够实现 OpenAPI功能参 数所描述的功能的 OpenAPI方法。 其中, 所获取的功能相同的 OpenAPI方法被 存储到 OpenAPI方法集中。 OpenAPI方法集中的各种 OpenAPI方法可以来自不 同的 OpenAPI, 也可以是采用不同的通信协议编写, 但却具有相同的参数列表。 After the OpenAPI calling device obtains the OpenAPI function parameters, the OpenAPI information base is queried according to the obtained OpenAPI function parameters, mainly according to the OpenAPI function parameters. Look in the OpenAPI list and method list and get all OpenAPI methods that implement the functionality described by the OpenAPI function parameters. Among them, the obtained OpenAPI methods with the same function are stored in the OpenAPI method set. The various OpenAPI methods in the OpenAPI method set can come from different OpenAPIs or can be written using different communication protocols, but with the same parameter list.
步骤 10c3、根据 OpenAPI方法集中每个 OpenAPI方法的服务质量( Quality of Service; 简称为: Qos )属性值, 获取目标 OpenAPI方法。  Step 10c3: According to the OpenAPI method, the Quality of Service (Qos) attribute value of each OpenAPI method is centralized, and the target OpenAPI method is obtained.
其中,在其中, OpenAPI信息库中还包括每个 OpenAPI方法的 Qos属性值。 该 Qos属性值可以包括主观 Qos属性和 /或客观 Qos属性。主观 Qos属性主要反 映用户对 OpenAPI的评价,客观 Qos属性主要反映 OpenAPI调用过程中的一些 性能。 主观 Qos属性可以包括以下任意一个或其组合: 易用性(Usability ) 、 正 确性 ( Correctness ) 、 性价比(Performance/Price )或主观安全性 ( Security ) 。 其中, 易用性用于反映调用 OpenAPI的过程是否简单, 返回的结果是否容易理 解。 正确性用于评价调用 OpenAPI后得到的结果是否是用户期望的结果。 性价 比是指一 OpenAPI 的实际应用价值与用户调用该 OpenAPI所花费的费用的比 值。 主观安全性是指用户在调用 OpenAPI后对 OpenAPI是否安全给出的评价。 另外, 还可以对上述各种主观 Qos属性进行加权平均处理, 获取综合主观评价 值。 客观 Qos 属性可以包括以下任意一种或其组合: 加密安全性、 响应时间 ( Response Time ) 、 可用性(Availability )或稳定性(Stability ) 。 其中, 加密 安全性是指 OpenAPI 调用的传输过程是否进行了加密。 响应时间是指调用 OpenAPI 的快慢程度, 即从用户发起调用到用户得到返回结果的时间差。 可用 性用于评价当前的 OpenAPI是否可用, 可以用用户成功调用 OpenAPI的比率来 表征。 稳定性可以用平均故障间隔时间 ( Mean Time between Failures; 简称为: MTBF )来表示, 是指 OpenAPI两次调用失败之间的平均工作时间。  Among them, the OpenAPI information base also includes the Qos attribute value of each OpenAPI method. The Qos attribute value can include a subjective Qos attribute and/or an objective Qos attribute. The subjective Qos attribute mainly reflects the user's evaluation of OpenAPI. The objective Qos attribute mainly reflects some performances in the OpenAPI call process. The subjective Qos attribute can include any one or combination of the following: Usability, Correctness, Performance/Price, or Subjective Security. Among them, ease of use is used to reflect whether the process of calling OpenAPI is simple and whether the returned result is easy to understand. Correctness is used to evaluate whether the result obtained after calling OpenAPI is the result expected by the user. The price-to-price ratio is the ratio of the actual application value of an OpenAPI to the cost of the user calling the OpenAPI. Subjective security refers to the evaluation of whether the OpenAPI is safe after the user calls OpenAPI. In addition, weighted averaging processing can be performed on the above various subjective Qos attributes to obtain a comprehensive subjective evaluation value. The objective Qos attribute may include any one or a combination of the following: encryption security, response time (Response Time), availability (Availability), or stability (Stability). Among them, encryption security refers to whether the transmission process of the OpenAPI call is encrypted. Response time is the degree to which OpenAPI is called, that is, the time difference from the user-initiated call to the user's return. Availability is used to evaluate whether the current OpenAPI is available and can be characterized by the ratio of users successfully calling OpenAPI. Stability can be expressed in Mean Time between Failures (MTBF), which is the average working time between failures of OpenAPI calls.
在本实施例中, 每个 OpenAPI方法的上述 Qos属性值是预先获取的。 具体 的, 客观 Qos属性值可以通过监测调用 OpenAPI方法的过程来获取, 例如: 可 以通过检测程序记录调用 OpenAPI方法的响应时间、 可用性等在内的客观信息 来获取 Qos属性值。 主观 Qos属性值可以通过调用 OpenAPI方法结束后用户的 评价来获取, 例如: 在调用结束后, 要求用户提交包括正确性、 易用性、 性价 比等在内的主观评价信息。 换句话说, OpenAPI方法的 Qos属性值是在被调用 的过程中逐渐搜集起来的。 In this embodiment, the above Qos attribute value of each OpenAPI method is obtained in advance. Specifically, the objective Qos attribute value can be obtained by monitoring the process of calling the OpenAPI method, for example: The detection program can record the objective information including the response time and availability of the OpenAPI method. To get the value of the Qos attribute. The subjective Qos attribute value can be obtained by calling the user's evaluation after the OpenAPI method is finished. For example: After the call ends, the user is required to submit subjective evaluation information including correctness, ease of use, and cost performance. In other words, the value of the Qos property of the OpenAPI method is gradually collected during the called process.
在各种 Qos属性值中, 一些 Qos属性的值越大, 表示 OpenAPI性能越高, 例如可用性; 一些 Qos属性的值越小, 表示 OpenAPI性能越高, 例如响应时间。 将 Qos属性值越大, 表示 OpenAPI性能越好的 Qos属性称为增量型 Qos属性, 相应的将其值称为增量型 Qos属性值; 将 Qos属性值越小, 表示 OpenAPI性能 越好的 Qos属性称为减量型 Qos属性, 相应的将其值称为减量型 Qos属性值。 为了计算方便, 在本实施例中, 选择设备对各种 Qos属性值进行归一化处理, 并生成用户适用度值, 以用户适用度值这一个指标来评价 OpenAPI的性能, 并 基于每个 OpenAPI方法的用户适用度值来选择目标 OpenAPI方法。  Among the various Qos attribute values, the larger the value of some Qos attributes, the higher the performance of OpenAPI, such as availability; the smaller the value of some Qos attributes, the higher the performance of OpenAPI, such as response time. The larger the value of the Qos attribute is, the better the performance of the OpenAPI is. The Qos attribute is called the incremental QoS attribute, and the value is called the incremental QoS attribute value. The smaller the QoS attribute value is, the better the OpenAPI performance is. The Qos attribute is called the decrement type Qos attribute, and its value is called the decrement type Qos attribute value. For the convenience of calculation, in the embodiment, the selection device normalizes various Qos attribute values, and generates a user applicability value, and evaluates the performance of the OpenAPI by using the user applicability value, and is based on each OpenAPI. The user applicability value of the method is used to select the target OpenAPI method.
具体的, OpenAPI调用设备根据公式( 1 )对增量型 Qos属性值进行归一化 处理。 :≠0 Specifically, the OpenAPI calling device normalizes the incremental Qos attribute value according to the formula (1). :≠0
Figure imgf000011_0001
k ―:„ k
Figure imgf000011_0001
k ―:„ k
v(2) = maxgr-ming" ( 1 ) maxg -ming =0  v(2) = maxgr-ming" ( 1 ) maxg -ming =0
i=l i=l  i=l i=l
OpenAPI调用设备根据公式(2)对减量型 Qos属性值进行归一化处理- maxg -e „ „ The OpenAPI calling device normalizes the decremented Qos attribute value according to formula (2) - maxg -e „ „
^ ^ ~ ,maxQ -mmQ ≠0  ^ ^ ~ , maxQ -mmQ ≠0
v(2) = maxe-mine i=l i=l (2) v(2) = maxe-mine i=li=l (2)
i=l i=l maxg -ming' 其中, 表示第 个 OpenAPI方法的第 k个 Qos属性值; v(g )表示第 个 OpenAPI方法的第 k个归一化的 Qos属性值; n表示 OpenAPI方法集中 OpenAPI方法的个数, i=\ ...n; k=l ...m , m表示每个 OpenAPI方法的 Qos属 性的个数。 例如: 当每个 OpenAPI方法对应的 Qos属性同时包括易用性、 正确 性、 性价比、 安全性、 响应时间、 可用性和稳定性时, 为 7。 i=li=l maxg -ming' where represents the kth Qos attribute value of the first OpenAPI method; v(g) represents the kth normalized Qos attribute value of the first OpenAPI method; n represents the OpenAPI method set The number of OpenAPI methods, i=\ ...n; k=l ...m , m represents the number of Qos attributes of each OpenAPI method. For example: When the QoS attribute corresponding to each OpenAPI method includes both ease of use, correctness, cost performance, security, response time, availability, and stability, it is 7.
进一步, 当进行归一化处理后, OpenAPI调用设备根据公式(3 )对归一化 处理后的 Qos属性值进行加权平均处理, 生成用户适用度值。
Figure imgf000012_0001
Further, after the normalization process, the OpenAPI calling device performs a weighted averaging process on the normalized Qos attribute value according to the formula (3) to generate a user applicability value.
Figure imgf000012_0001
其中, ^表示每个 OpenAPI方法的第^:个归一化的 Qos属性值的权重值; 在本实施例中, 该权重值是预先设定的, 且对于每个 OpenAPI方法而言, 该 wk 是相同的, 但并不限于此; 表示第 个 OpenAPI方法对应的用户适用度值。 Where ^ represents the weight value of the ^: normalized Qos attribute value of each OpenAPI method; in this embodiment, the weight value is preset, and for each OpenAPI method, the w k is the same, but is not limited to this; represents the user suitability value corresponding to the first OpenAPI method.
其中, 步骤 10c3的一种实施方式为: OpenAPI调用设备从 OpenAPI方法集 中多个 OpenAPI 方法中选择用户适用度值最大的 OpenAPI 方法作为目标 OpenAPI方法。 该实施方式简单易于实现, 且选择出的目标 OpenAPI方法为最 佳 OpenAPI方法,在调用该目标 OpenAPI方法后可使用户获得质量较高的服务。  An implementation manner of the step 10c3 is as follows: The OpenAPI calling device selects an OpenAPI method with the largest user applicability value from the multiple OpenAPI methods in the OpenAPI method set as the target OpenAPI method. The implementation is simple and easy to implement, and the selected OpenAPI method is the best OpenAPI method, and the user can obtain a higher quality service after calling the target OpenAPI method.
如图 2D所示, 步骤 10c3的另一种实施方式包括:  As shown in FIG. 2D, another embodiment of step 10c3 includes:
步骤 10c31、根据每个 OpenAPI方法对应的用户适用度值,为每个 OpenAPI 方法分配一选择概率。  Step 10c31: Assign a selection probability to each OpenAPI method according to the user suitability value corresponding to each OpenAPI method.
其中, OpenAPI调用设备为每个 OpenAPI分配不同的选择概率, 保证性能 好的 OpenAPI方法分配的选择概率较大。 也就是说, 如果 OpenAPI方法的用户 使用度值越大, OpenAPI调用设备为其分配的选择概率越大。 OpenAPI调用设 备所分配的所有选择概率之和为 1。 假设有 n个 OpenAPI方法, 按照从小到大 的顺序排列后分别为: apiidl , apiid2 , apiidi, apiidn, 相应的选择概率 分别为 pi , p2, pi, n, 其中, pl+p2+....+pi+...+pn=l。 n个选择概率将 划分出 n+1个概率区间。  Among them, the OpenAPI calling device allocates different selection probabilities for each OpenAPI, and ensures that the selection probability of the OpenAPI method with good performance is large. That is, if the user value of the OpenAPI method is larger, the probability of the selection that the OpenAPI calling device assigns to it is greater. The sum of all selection probabilities assigned by the OpenAPI calling device is 1. Suppose there are n OpenAPI methods, arranged in order from small to large: apiidl , apiid2 , apiidi , apiidn , the corresponding selection probabilities are pi , p2 , pi , n , where pl+p2+....+ Pi+...+pn=l. The n selection probabilities will be divided into n+1 probability intervals.
步骤 10c32、 产生随机数。  Step 10c32, generating a random number.
具体的, OpenAPI调用设备根据一定的算法产生 0-1之间的随机数。 步骤 10c33、 根据随机数和选择概率, 从多个 OpenAPI 方法中选择目标 OpenAPI方法。 Specifically, the OpenAPI calling device generates a random number between 0-1 according to a certain algorithm. Step 10c33: Select a target OpenAPI method from a plurality of OpenAPI methods according to the random number and the selection probability.
具体的, OpenAPI调用设备将选择概率按照从小到大的顺序排序; 然后, 将随机数依次与排序后的选择概率进行比较, 直到比较出第一个大于随机数的 选择概率为止, 选择第一个大于随机数的选择概率对应的 OpenAPI方法作为目 标 OpenAPI方法。 也就是说, OpenAPI调用设备判断该随机数出现在哪个概率 区间, 取该概率区间的上限对应的 OpenAPI方法, 将该 OpenAPI方法作为目标 OpenAPI方法。  Specifically, the OpenAPI calling device sorts the selection probabilities in ascending order; then, compares the random numbers with the sorted selection probabilities, until the first selection probability greater than the random number is compared, and the first one is selected. The OpenAPI method corresponding to the selection probability of the random number is used as the target OpenAPI method. That is to say, the OpenAPI calling device determines in which probability interval the random number appears, takes the OpenAPI method corresponding to the upper limit of the probability interval, and uses the OpenAPI method as the target OpenAPI method.
该实施方式通过产生 0-1之间的随机数, 并根据随机数和为 OpenAPI方法 分配的选择概率选择目标 OpenAPI方法, 可以保证概率较大的 OpenAPI方法被 选择的可能性较大, 也就是说可以保证性能越好的 OpenAPI方法被选择的概率 越高, 并且还能够保证每个 OpenAPI方法都有被选择的可能。  This embodiment can ensure that the OpenAPI method with higher probability is more likely to be selected by generating a random number between 0-1 and selecting the target OpenAPI method according to the random number and the selection probability assigned to the OpenAPI method. The higher the performance, the higher the probability that the OpenAPI method will be selected, and the possibility that each OpenAPI method will be selected.
进一步, 当选择出目标 OpenAPI方法之后, OpenAPI调用设备执行步骤 102 和步骤 103向 OpenAPI服务器调用目标 OpenAPI方法;并判断 OpenAPI服务器 是否返回调用结果。 如果判断结果为否, 说明调用目标 OpenAPI方法失败, 则 将目标 OpenAPI方法从 OpenAPI方法集中去除, 并重新执行步骤 10c3以重新 获取目标 OpenAPI方法。如果判断结果为是,说明调用目标 OpenAPI方法成功, 则向用户返回调用结果, 并结束此次 OpenAPI调用操作。  Further, after selecting the target OpenAPI method, the OpenAPI calling device performs steps 102 and 103 to call the target OpenAPI method to the OpenAPI server; and determines whether the OpenAPI server returns the calling result. If the judgment result is no, indicating that the target OpenAPI method fails, the target OpenAPI method is removed from the OpenAPI method set, and step 10c3 is re-executed to regain the target OpenAPI method. If the judgment result is yes, it indicates that the calling target OpenAPI method is successful, the call result is returned to the user, and the OpenAPI call operation is ended.
其中, 图 2C所示实施方式可由 OpenAPI调用设备的另一功能单元实现, 该功能单元具体向直接选定调用单元提供输入参数, 以调用直接选定调用单元 为基础实现对 OpenAPI方法的调用。 用户一旦确定了能够满足自己需求的抽象 功能 ( Abstract Function ) , 该功能单元允许用户直接输入 OpenAPI功能参数, 然后, 自动根据 OpenAPI功能参数获取具备该 OpenAPI功能参数所述功能的多 个 OpenAPI 方法, 并根据 Qos属性从中选择性能较佳(即服务质量较好) 的 OpenAPI方法供用户调用, 同时如果选择的目标 OpenAPI方法不可用 (即未被 调用成功) , 从 OpenAPI方法集中剔除后重新为用户选择, 直到使用户得到调 用结果为止。 上述操作过程对用户来说是透明的, 用户只需发送带有 OpenAPI 功能参数的调用请求即可, 无论最终调用的 OpenAPI方法是哪个, 对用户而言 整个调用流程是相同的,用户不需要关心每个 OpenAPI方法所使用的通信协议, 简化了用户的调用流程, 提高了调用效率。 基于该功能单元的具体功能, 将该 功能单元称之为一键调用单元。 该一键调用单元是以调用直接选定调用单元为 基础实现的。 The implementation shown in FIG. 2C may be implemented by another functional unit of the OpenAPI calling device, which specifically provides an input parameter to the directly selected calling unit, and invokes the direct selection of the calling unit to implement the call to the OpenAPI method. Once the user has determined an abstract function that can satisfy his own needs, the functional unit allows the user to directly input the OpenAPI function parameters, and then automatically obtains multiple OpenAPI methods having the functions described by the OpenAPI function parameters according to the OpenAPI function parameters, and According to the Qos attribute, the OpenAPI method with better performance (that is, the service quality is better) is selected for the user to call, and if the selected target OpenAPI method is unavailable (that is, the call is not successfully succeeded), the user is selected from the OpenAPI method set and then re-selected for the user. Until the user gets the tone Use the results so far. The above operation process is transparent to the user, and the user only needs to send a call request with the OpenAPI function parameter, no matter which OpenAPI method is finally called, the entire calling process is the same for the user, and the user does not need to care. The communication protocol used by each OpenAPI method simplifies the user's calling process and improves the calling efficiency. Based on the specific function of the functional unit, the functional unit is referred to as a one-key calling unit. The one-click calling unit is implemented based on calling the directly selected calling unit.
在图 2C 所示实施方式中, 用户只需发送一次调用请求即可通过 OpenAPI 调用设备得到性能较佳的 OpenAPI方法, 而不需要多次向不同的设备发出调用 请求, 提高了用户调用 OpenAPI方法的效率。  In the embodiment shown in FIG. 2C, the user only needs to send a call request once to call the device through OpenAPI to obtain a better OpenAPI method, and does not need to issue a call request to different devices multiple times, thereby improving the user's call to the OpenAPI method. effectiveness.
更进一步, 如图 2E所示, 步骤 lOcl的另一种实施方式包括:  Further, as shown in FIG. 2E, another implementation manner of the step l0cl includes:
步骤 10cl l、接收用户发送的应用调用请求, 该应用调用请求包括应用描述 信息。  Step 10cl: Receive an application call request sent by the user, where the application call request includes application description information.
具体的, 当用户需要调用 OpenAPI方法实现一种应用时, 通过其 OpenAPI 调用工具向 OpenAPI 调用设备发送应用调用请求。 此处的用户主要是指基于 OpenAPI 方法开发新应用或新系统的开发用户。 该应用调用请求包括开发用户 需要通过 OpenAPI方法所完成的系统或应用的描述信息。 例如: 以学校介绍与 地图的组合应用为例, 该组合应用需要获取以某个坐标为中心 (即某个地点) 的地图, 然后再获取该坐标地点附近的学校信息, 两者组合显示在一起。 在该 组合应用中涉及两个功能信息, 一个是获取以某地点为中心的地图, 另一个是 获取以某地点为中心的学校介绍。 当用户需要通过 OpenAPI方法实现学校介绍 与地图的组合应用时, 用户只需向 OpenAPI调用设备发送携带 "学校介绍与地 图组合以及地点 A" 信息的应用调用请求即可, 具体由哪些 OpenAPI方法实现 该功能, 由 OpenAPI调用设备根据解析获取到的两个功能信息进行确定。 其中, 学校介绍与地图的组合应用仅为应用描述信息的一种示例。  Specifically, when the user needs to call the OpenAPI method to implement an application, the application call request is sent to the OpenAPI calling device through its OpenAPI calling tool. The users here mainly refer to the development users who develop new applications or new systems based on the OpenAPI method. The application call request includes a description of the system or application that the user needs to complete through the OpenAPI method. For example: Take the combination application of the school introduction and the map as an example. The combined application needs to obtain a map centered on a certain coordinate (ie, a certain location), and then obtain the school information near the coordinate location, and the combination of the two is displayed together. . Two functional information is involved in the combined application, one is to obtain a map centered on a certain location, and the other is to obtain a school-centered introduction. When the user needs to implement the combination application of the school introduction and the map through the OpenAPI method, the user only needs to send an application call request carrying the "school introduction and map combination and location A" information to the OpenAPI calling device, which specific OpenAPI method is used to implement the application. The function is determined by the OpenAPI calling device according to the two function information obtained by the parsing. Among them, the combination application of the school introduction and the map is only an example of the application description information.
步骤 10cl2、 对应用描述信息进行功能解析处理, 获取 OpenAPI功能参数。  Step 10cl2: Perform function parsing on the application description information to obtain OpenAPI function parameters.
OpenAPI调用设备接收到应用调用请求之后, 对应用调用请求进行解析获 取其中的应用描述信息,然后对应用描述信息进行功能解析处理,获取 OpenAPI 功能参数。 例如: OpenAPI调用设备对 "学校介绍与地图组合以及地点 A" 进 行功能解析, 获取到 "获取以地点 A为中心的地图和获取以地点 A为中心的学 校介绍 " 这样两个 OpenAPI功能参数。 After receiving the application call request, the OpenAPI calling device parses the application call request. Take the application description information, and then perform function parsing on the application description information to obtain OpenAPI function parameters. For example: OpenAPI calls the device to perform functional analysis on "School introduction and map combination and location A", and obtains two OpenAPI function parameters such as "Get map centered on location A and get school introduction centered on location A".
之后, OpenAPI调用设备执行步骤 10c32, 根据上述 OpenAPI功能参数分 别在 OpenAPI信息库中进行查找, 最终找到具有获取以地点 A为中心的地图功 能的 OpenAPI方法集和具有获取以地点 A为中心的学校介绍功能的 OpenAPI 方法集。 同理, 在这些方法集中, 每个 OpenAPI方法可以使用不同的通信协议 编写, 也可以属于不同的 OpenAPL  Afterwards, the OpenAPI invoking device executes step 10c32, performs a search in the OpenAPI information base according to the above OpenAPI function parameters, and finally finds an OpenAPI method set having a map function centered on the location A and an introduction to the school centered on the location A. A set of OpenAPI methods for functionality. Similarly, in these method sets, each OpenAPI method can be written using a different communication protocol, or it can belong to different OpenAPL.
再接着, OpenAPI调用设备执行步骤 10c33 , 分别从上述具有获取以地点 A 为中心的地图功能的 OpenAPI方法集和具有获取以地点 A为中心的学校介绍功 能的 OpenAPI 方法集中获取具有获取以地点 A 为中心的地图功能的目标 OpenAPI方法和获取具有获取以地点 A为中心的学校介绍功能的目标 OpenAPI 方法。 其中, 获取具有获取以地点 A为中心的地图功能的目标 OpenAPI方法和 获取具有获取以地点 A为中心的学校介绍功能的目标 OpenAPI方法的过程是相 同且独立的。  Then, the OpenAPI calling device performs step 10c33, respectively, from the above-mentioned OpenAPI method set with the map function centered on the location A and the OpenAPI method with the school introduction function centered on the location A, and the acquisition is obtained by the location A. The central OpenMap method of the map function and the target OpenAPI method with the ability to acquire the school-introduction function centered on location A. Among them, the process of obtaining the target OpenAPI method with the function of acquiring the map A-centered map and the process of obtaining the target OpenAPI method with the location introduction function centered on the location A are the same and independent.
其中,如 2E所示实施方式可由 OpenAPI调用设备的另一功能单元实现,该 功能单元主要是由应用开发者以调用一键调用单元和直接选定调用单元为基础 实现对目标 OpenAPI方法的调用, 所完成的由多种 OpenAPI方法糅合在一起实 现的应用, 并向用户提供了统一调用接口的单元。 由于该另一功能单元将各 OpenAPI 方法糅合在一起形成了更加丰富的应用, 因此将该功能单元称之为糅 合 ( mashup )调用单元。  The embodiment shown in FIG. 2E can be implemented by another functional unit of the OpenAPI calling device, which is mainly implemented by the application developer to invoke the target OpenAPI method on the basis of calling a key calling unit and directly selecting the calling unit. The completed application is implemented by a variety of OpenAPI methods, and provides the user with a unit that calls the interface. Since the other functional unit combines the various OpenAPI methods to form a richer application, the functional unit is referred to as a mashup call unit.
在该实施方式下, 用户只需输入应用调用请求即可实现对不同 OpenAPI方 法的糅合调用, 且用户也不需关心每个 OpenAPI方法所采用的通信协议, 具有 调用简单、 效率高的优点。  In this embodiment, the user only needs to input the application call request to implement the call of different OpenAPI methods, and the user does not need to care about the communication protocol used by each OpenAPI method, and has the advantages of simple call and high efficiency.
另夕卜, 在该实施方式下, OpenAPI调用设备还向应用开发者(例如 Web应 用开发者)提供了一种能力, 使得应用开发者可以通过简单、 高效、 且统一的 调用方式调用各种 OpenAPI方法, 开发混搭应用, 以提供全新的业务功能。 即 用于实现该实施方式的 mashup调用单元可以作为一个平台来实现, 在该平台上 允许应用开发者相互之间共享功能代码(即各种 OpenAPI方法) , 同时, 该平 台还可以提供检索、 提交、 下载等功能, 从而实现最大限度的代码重用。 In addition, in this embodiment, the OpenAPI calling device is also applied to the application developer (for example, the Web should Using the developer) provides an ability for application developers to invoke various OpenAPI methods to develop new mashup applications in a simple, efficient, and unified way to provide new business functionality. That is, the mashup calling unit for implementing the embodiment can be implemented as a platform on which application developers are allowed to share function codes (ie, various OpenAPI methods), and the platform can also provide retrieval and submission. , download and other functions to achieve maximum code reuse.
在上所述的直接选定调用单元、 一键调用单元和 mashup 调用单元中, Mashup 调用单元的粒度最大, 因为一个混搭应用里可能融合了若干个不同的 OpenAPI方法。由于这种融合,使得 OpenAPI调用设备不能直接用评价 OpenAPI 方法的 QoS属性来评价 Mashup应用,故 OpenAPI调用设备单独制定评价标准, 以每个 Mashup应用为单位进行评价。 在 Mashup应用的评价标准中, 主要侧重 于用户的评价。 即在应用开发者通过调用一键调用单元和直接选定调用单元完 成 Mashup调用单元, 实现 Mashu 应用之后, 由用户对该 Mashup应用进行调 用并向 OpenAPI调用设备返回对该 Mashup应用的主观评价信息。 例如: 在实 际实现过程中, 应用开发者可以在发布自己开发的 Mashup应用时, 标注自己期 望的积分价格; 当使用用户在下载使用该 Mashup应用时需要支付相应的积分分 数, 并在使用后提交评价信息, 而为了鼓励使用用户提交评价信息, 在使用用 户提交评价信息之后, OpenAPI调用设备再返还一定的积分给该使用用户, 从 而实现对 Mashup应用评价信息的获取。  In the directly selected call unit, the one-click call unit, and the mashup call unit described above, the Mashup call unit is the most granular, because a mashup application may incorporate several different OpenAPI methods. Due to this convergence, the OpenAPI calling device cannot directly evaluate the Mashup application by evaluating the QoS attribute of the OpenAPI method. Therefore, the OpenAPI calling device separately sets evaluation criteria and evaluates it in units of each Mashup application. In the evaluation criteria of the Mashup application, the main focus is on the user's evaluation. That is, after the application developer completes the Mashup call unit by calling a one-click call unit and directly selecting the call unit, after the Mashu application is implemented, the user invokes the Mashup application and returns subjective evaluation information of the Mashup application to the OpenAPI calling device. For example: In the actual implementation process, the application developer can mark the price of the points he desires when publishing the Mashup application developed by himself; when the user downloads and uses the mashup application, he needs to pay the corresponding points score and submit it after use. Evaluation information, and in order to encourage the use of users to submit evaluation information, after using the user to submit the evaluation information, the OpenAPI calling device returns a certain amount of points to the user, thereby realizing the acquisition of the Mashup application evaluation information.
在此说明, 上述各实施例或实施方式中的 OpenAPI方法既包括由 Rest协议 无法独立运行的 OpenAPI方法。 基于此, OpenAPI调用设备上预先存储与各种 协议相适应的调用规则。  It is explained here that the OpenAPI method in each of the above embodiments or embodiments includes an OpenAPI method that cannot be independently operated by the Rest protocol. Based on this, the OpenAPI calling device pre-stores the calling rules that are compatible with various protocols.
图 3为本发明一实施例提供的步骤 103的实施方式的流程图。 该实施方式 可基于上述各实施例或实施方式实现, 如图 3所示, 该实施方式包括:  FIG. 3 is a flow chart of an embodiment of step 103 according to an embodiment of the present invention. The implementation may be implemented based on the foregoing embodiments or implementation manners. As shown in FIG. 3, the implementation manner includes:
步骤 1031、 根据目标 OpenAPI方法采用的协议类型, 获取与目标 OpenAPI 方法相适应的调用规则。 具体的, 在 OpenAPI调用设备上预先存储有与各种通信协议相适应的调用 规则。 当 OpenAPI调用设备确定出目标 OpenAPI方法之后, 可以从 OpenAPI 列表中获取该目标 OpenAPI方法所使用的通信协议, 进而获取与该通信协议对 应的调用规则。 Step 1031: Obtain a calling rule that is adapted to the target OpenAPI method according to the protocol type adopted by the target OpenAPI method. Specifically, the calling rules adapted to various communication protocols are pre-stored on the OpenAPI calling device. After the OpenAPI calling device determines the target OpenAPI method, the communication protocol used by the target OpenAPI method may be obtained from the OpenAPI list, and then the calling rule corresponding to the communication protocol is obtained.
步骤 1032、 根据调用规则, 对参数信息进行处理, 生成第三方调用请求。 Step 1032: Process the parameter information according to the calling rule to generate a third-party calling request.
OpenAPI调用设备获取调用规则之后, 对目标 OpenAPI方法的参数信息进 行处理, 生成第三方调用请求, 即发送给第三方的 OpenAPI服务器的调用请求。 After the OpenAPI calling device obtains the calling rule, it processes the parameter information of the target OpenAPI method to generate a third-party calling request, that is, a call request sent to a third-party OpenAPI server.
步骤 1033、 向 OpenAPI服务器发送第三方调用请求, 以对目标 OpenAPI 方法进行调用。  Step 1033: Send a third-party call request to the OpenAPI server to invoke the target OpenAPI method.
在生成调用请求之后, OpenAPI调用设备向第三方的 OpenAPI服务器发送 第三方调用请求, 以对目标 OpenAPI方法进行调用。  After generating the invocation request, the OpenAPI invoking device sends a third-party invocation request to the third-party OpenAPI server to invoke the target OpenAPI method.
在本实施方式中, OpenAPI调用设备上预先存储好各种协议对应的调用规 则, 并根据目标 OpenAPI方法使用的通信协议获取相应的调用规则, 进而调用 目标 OpenAPI方法, 使得用户不用关心目标 OpenAPI方法使用的通信协议, 不 用在学习通信协议之后进行调用, 因此, 具有实现简单、 调用效率较高的优势。  In this embodiment, the OpenAPI calling device pre-stores the calling rules corresponding to various protocols, and obtains the corresponding calling rules according to the communication protocol used by the target OpenAPI method, and then invokes the target OpenAPI method, so that the user does not care about the target OpenAPI method. The communication protocol does not need to be called after learning the communication protocol, and therefore has the advantages of simple implementation and high call efficiency.
图 4为本发明又一实施例提供的 OpenAPI调用方法的流程图。 本实施例基 于图 1和图 3所示实施例实现, 如图 4所示, 本实施例的方法在步骤 1033之前 包括:  FIG. 4 is a flowchart of a method for calling an OpenAPI according to another embodiment of the present invention. The embodiment is implemented based on the embodiment shown in FIG. 1 and FIG. 3. As shown in FIG. 4, the method in this embodiment includes before step 1033:
步骤 103a、 设定返回结果的数据格式。  Step 103a: Set the data format of the returned result.
具体的, 由于 OpenAPI调用设备所支持的调用结果的数据格式、 用户所支 持的调用结果的数据格式以及 OpenAPI服务器所支持的数据格式可以不同, 故 为了满足用户能够识别返回结果, 在本实施例中, OpenAPI调用设备在调用目 标 OpenAPI方法之前预先设定返回结果的数据格式。 该操作也是由 OpenAPI调 用设备的控制层来完成。  Specifically, the data format of the call result supported by the OpenAPI calling device, the data format of the call result supported by the user, and the data format supported by the OpenAPI server may be different, so in order to satisfy the user's ability to recognize the returned result, in this embodiment, The OpenAPI calling device pre-sets the data format of the returned result before calling the target OpenAPI method. This is also done by the control layer of the OpenAPI calling device.
如图 4所示, 在步骤 1033之后还包括:  As shown in FIG. 4, after step 1033, the method further includes:
步骤 1034、 接收 OpenAPI服务器返回的调用结果, 并根据数据格式对调用 结果进行格式化处理, 将处理后的调用结果提供给用户。 Step 1034, receiving a call result returned by the OpenAPI server, and calling according to the data format The result is formatted and the processed call result is provided to the user.
本实施例的 OpenAPI调用方法, 在调用目标 OpenAPI方法之前设定数据格 式, 在接收到返回结果之后采用设定的数据格式对返回结果进行格式化, 可以 保证用户直接接收到可识别的返回结果, 无须用户再进行格式转换, 提高了对 用户的服务质量。  The OpenAPI calling method of this embodiment sets a data format before calling the target OpenAPI method, and formats the returned result by using the set data format after receiving the returned result, so that the user can directly receive the identifiable return result. No need for users to perform format conversion, which improves the quality of service to users.
本发明以下实施例分别以目标 OpenAPI采用不同通信协议时, 对其进行调 用的流程进行详细说明。  The following embodiments of the present invention will be described in detail when the target OpenAPI adopts different communication protocols.
图 5为本发明一实施例提供的目标 OpenAPI方法采用 Rest协议时的调用方 法的流程图。 如图 5所示, 本实施例的方法包括:  FIG. 5 is a flowchart of a calling method when a target OpenAPI method adopts a Rest protocol according to an embodiment of the present invention. As shown in FIG. 5, the method in this embodiment includes:
步骤 501、 OpenAPI调用设备根据用户的调用请求, 获取目标 OpenAPI方 法。  Step 501: The OpenAPI calling device acquires a target OpenAPI method according to the user's calling request.
具体的, 该步骤 501可以采用图 2A-图 2D任一所示的实施方式获取目标 OpenAPI方法, 具体视用户的调用请求而定, 详细过程在此不再赘述。  Specifically, the step 501 can obtain the target OpenAPI method by using the implementation manner shown in any of FIG. 2A and FIG. 2D, which is determined by the user's calling request, and the detailed process is not described herein again.
步骤 502、 OpenAPI调用设备向用户提供目标 OpenAPI方法的参数列表。 具体的, 在获取目标 OpenAPI方法之后, OpenAPI调用设备查询 OpenAPI 信息库获取该目标 OpenAPI方法的参数列表, 并通过调用界面提供给用户。  Step 502: The OpenAPI calling device provides a parameter list of the target OpenAPI method to the user. Specifically, after obtaining the target OpenAPI method, the OpenAPI calling device queries the OpenAPI information library to obtain a parameter list of the target OpenAPI method, and provides the user with the calling interface.
步骤 503、 用户根据参数列表输入目标 OpenAPI方法所需的参数信息, 同 时输入调用密钥 Key值, 并发送给 OpenAPI调用设备。  Step 503: The user inputs the parameter information required by the target OpenAPI method according to the parameter list, and simultaneously inputs the key value of the calling key, and sends the key value to the OpenAPI calling device.
具体的, 用户在调用界面上输入参数信息, 同时输入调用目标 OpenAPI方 法时所需的加密密钥, 即调用 Key值, 并通过调用界面上的提交功能发送给 OpenAPI调用设备。  Specifically, the user inputs the parameter information on the calling interface, and at the same time inputs the encryption key required to invoke the target OpenAPI method, that is, the Key value is called, and is sent to the OpenAPI calling device by calling the submit function on the interface.
步骤 504、 OpenAPI调用设备接收用户发送的参数信息和调用 Key值, 根 据目标 OpenAPI方法查询 OpenAPI列表, 获取目标 OpenAPI方法的调用地址。  Step 504: The OpenAPI calling device receives the parameter information sent by the user and calls the Key value, queries the OpenAPI list according to the target OpenAPI method, and obtains the calling address of the target OpenAPI method.
步骤 505、 OpenAPI调用设备将参数信息和调用 Key值进行加密处理, 生 成第三方调用请求。  Step 505: The OpenAPI calling device encrypts the parameter information and the called Key value to generate a third-party call request.
具体的, OpenAPI调用设备用将调用 Key值对参数信息进行加密处理之后 生成第三方调用请求。 其中, 在 Rest协议下的第三方调用请求是超文本标记语 言 ( Hyper Text Mark-up Language; 简称为: HTML )格式的请求。 Specifically, the OpenAPI calling device encrypts the parameter information by calling the Key value. Generate a third-party call request. The third-party calling request under the Rest protocol is a request in a Hyper Text Mark-up Language (abbreviated as: HTML) format.
另外, 在该步骤中, OpenAPI调用设备还可以设定返回结果的数据格式。 步骤 506、 OpenAPI 调用设备根据调用地址, 将第三方调用请求发送给 OpenAPI服务器, 以对目标 OpenAPI方法进行调用。  In addition, in this step, the OpenAPI calling device can also set the data format of the returned result. Step 506: The OpenAPI calling device sends a third-party calling request to the OpenAPI server according to the calling address to invoke the target OpenAPI method.
步骤 507、 OpenAPI调用设备接收 OpenAPI服务器返回的调用结果, 并采 用预先设定的数据格式对调用结果进行格式化处理之后, 发送给用户。  Step 507: The OpenAPI calling device receives the call result returned by the OpenAPI server, and formats the call result by using a preset data format, and then sends the result to the user.
具体的, OpenAPI 调用设备将 OpenAPI 服务器返回的可扩展标记语言 ( Extensible Markup Language; 简称为: XML )格式的调用结果进行格式化处 理, 形成可被用户识别的格式的调用结果。  Specifically, the OpenAPI calling device formats the call result of the Extensible Markup Language (XML) format returned by the OpenAPI server to form a call result in a format recognizable by the user.
其中, 步骤 504和步骤 505即为目标 OpenAPI方法采用 Rest协议时, 对应 的调用规则, 亦即为步骤 1032的具体实施方式。  Step 504 and step 505 are corresponding execution rules when the target OpenAPI method adopts the Rest protocol, that is, the specific implementation manner of step 1032.
本实施例的 OpenAPI调用方法, OpenAPI调用设备在目标 OpenAPI方法采 用 Rest协议时, 直接获取该 Rest协议对应的调用规则, 并根据该调用规则自动 完成对目标 OpenAPI方法的调用, 不再需要用户学习 Rest协议的通信机制, 提 高了调用 OpenAPI方法的效率。  In the OpenAPI calling method of the embodiment, when the target OpenAPI method adopts the Rest protocol, the calling API directly acquires the calling rule corresponding to the Rest protocol, and automatically completes the calling of the target OpenAPI method according to the calling rule, and the user does not need to learn the Rest. The communication mechanism of the protocol improves the efficiency of calling the OpenAPI method.
图 6为本发明一实施例提供的目标 OpenAPI方法采用 Soap协议时的调用方 法的流程图。 如图 6所示, 本实施例的方法包括:  FIG. 6 is a flowchart of a calling method when a target OpenAPI method adopts a Soap protocol according to an embodiment of the present invention. As shown in FIG. 6, the method in this embodiment includes:
步骤 601、 OpenAPI调用设备根据用户的调用请求, 获取目标 OpenAPI方 法。  Step 601: The OpenAPI calling device acquires a target OpenAPI method according to the user's calling request.
步骤 602、 OpenAPI调用设备向用户提供目标 OpenAPI方法的参数列表。 步骤 603、 用户根据参数列表输入目标 OpenAPI方法所需的参数信息, 并 发送给 OpenAPI调用设备。  Step 602: The OpenAPI calling device provides a parameter list of the target OpenAPI method to the user. Step 603: The user inputs parameter information required by the target OpenAPI method according to the parameter list, and sends the parameter information to the OpenAPI calling device.
上述步骤 601-步骤 603详见步骤 501-步骤 503的描述, 在此不再赘述。 步骤 604、 OpenAPI调用设备接收用户发送的参数信息,并根据目标 OpenAPI 方法查询 OpenAPI 列表, 获取 Soap 协议的 web服务描述语言向 java转换 ( WSDL2Java ) 工具包。 The foregoing steps 601 to 603 are described in detail in steps 501 to 503, and details are not described herein again. Step 604: The OpenAPI calling device receives the parameter information sent by the user, and queries the OpenAPI list according to the target OpenAPI method, and obtains the web service description language of the Soap protocol to convert to java. (WSDL2Java) toolkit.
步骤 605、 OpenAPI调用设备使用 WSDL2Java工具包对参数信息和目标 OpenAPI方法进行处理, 生成第三方调用请求。  Step 605: The OpenAPI calling device processes the parameter information and the target OpenAPI method by using the WSDL2 Java toolkit to generate a third-party call request.
具体的, OpenAPI调用设备使用 WSDL2Java工具包先生成向 Soap服务器 (即 OpenAPI服务器)发起调用的 java接口代码,再利用用户输入的参数信息, 自动生成调用目标 OpenAPI方法的 Soap客户端代码, 该 Soap客户端代码在运 行时自行生成第三方调用请求。  Specifically, the OpenAPI calling device uses the WSDL2 Java toolkit to make a Java interface code that is called to the Soap server (ie, the OpenAPI server), and then automatically generates a Soap client code that calls the target OpenAPI method by using the parameter information input by the user, the Soap client. The terminal code generates a third-party call request at runtime.
另外, 在该步骤中, OpenAPI调用设备还可以设定返回结果的数据格式。 步骤 606、 OpenAPI调用设备将第三方调用请求发送给 OpenAPI服务器, 以对目标 OpenAPI方法进行调用。  In addition, in this step, the OpenAPI calling device can also set the data format of the returned result. Step 606: The OpenAPI calling device sends a third-party call request to the OpenAPI server to invoke the target OpenAPI method.
具体的, OpenAPI调用设备通过运行 Soap客户端代码生成并向 OpenAPI 服务器发送第三方调用请求, 从而完成对目标 OpenAPI方法的调用。  Specifically, the OpenAPI calling device generates a call to the target OpenAPI method by running the Soap client code to generate and send a third-party call request to the OpenAPI server.
步骤 607、 OpenAPI调用设备接收 OpenAPI服务器返回的调用结果, 并采 用预先设定的数据格式对调用结果进行格式化处理之后, 发送给用户。  Step 607: The OpenAPI calling device receives the call result returned by the OpenAPI server, and formats the call result by using a preset data format, and then sends the result to the user.
具体的, OpenAPI调用设备将 OpenAPI服务器返回的调用结果进行格式化 处理, 形成可被用户识别的格式的调用结果。  Specifically, the OpenAPI calling device formats the call result returned by the OpenAPI server to form a call result in a format recognizable by the user.
其中, 步骤 604和步骤 605即为目标 OpenAPI方法采用 Soap协议时,对应 的调用规则, 亦即为步骤 1032的具体实施方式。  Step 604 and step 605 are the corresponding calling rules when the target OpenAPI method adopts the Soap protocol, which is the specific implementation manner of step 1032.
本实施例的 OpenAPI调用方法, OpenAPI调用设备在目标 OpenAPI方法采 用 Soap协议时, 直接获取该 Soap协议对应的调用规则, 并根据该调用规则自 动完成对目标 OpenAPI方法的调用, 不再需要用户学习 Soap协议的通信机制, 提高了调用 OpenAPI方法的效率。  In the OpenAPI calling method of the embodiment, the OpenAPI calling device directly acquires the calling rule corresponding to the Soap protocol when the target OpenAPI method adopts the Soap protocol, and automatically completes the calling of the target OpenAPI method according to the calling rule, and the user is no longer required to learn the Soap. The communication mechanism of the protocol improves the efficiency of calling the OpenAPI method.
图 7为本发明一实施例提供的目标 OpenAPI方法采用 Ajax协议时的调用方 法的流程图。 如图 7所示, 本实施例的方法包括:  FIG. 7 is a flowchart of a calling method when the target OpenAPI method adopts the Ajax protocol according to an embodiment of the present invention. As shown in FIG. 7, the method in this embodiment includes:
步骤 701、 OpenAPI调用设备根据用户的调用请求, 获取目标 OpenAPI方 法。 步骤 702、 OpenAPI调用设备向用户提供目标 OpenAPI方法的参数列表。 步骤 703、 用户根据参数列表输入目标 OpenAPI方法所需的参数信息, 并 发送给 OpenAPI调用设备。 Step 701: The OpenAPI calling device acquires a target OpenAPI method according to a call request of the user. Step 702: The OpenAPI calling device provides a parameter list of the target OpenAPI method to the user. Step 703: The user inputs parameter information required by the target OpenAPI method according to the parameter list, and sends the parameter information to the OpenAPI calling device.
上述步骤 701-步骤 703详见步骤 501-步骤 503的描述, 在此不再赘述。 步骤 704、 OpenAPI调用设备接收参数信息, 并获取本地存储的第一功能代 码, 然后根据第一功能代码从 OpenAPI服务器获取第二功能代码, 并通过第一 功能代码和第二功能代码对参数信息进行处理, 生成第三方调用请求。  The foregoing step 701-step 703 is described in detail in step 501 - step 503, and details are not described herein again. Step 704: The OpenAPI calling device receives the parameter information, and obtains the first function code stored locally, and then acquires the second function code from the OpenAPI server according to the first function code, and performs parameter information on the first function code and the second function code. Processing, generating a third-party call request.
其中, 由于采用 Ajax协议编写的 OpenAPI方法在调用时, 需要编写不同的 功能代码来调用, 故在本实施例的中预先生成并存储了与各 OpenAPI方法相适 应的第一功能代码。 另外, 调用由 Ajax协议实现的 OpenAPI 方法还需要到 OpenAPI服务器上下载另一部分功能代码, 在本实施例中, 当获取到第一功能 代码时直接触发 OpenAPI调用设备到 OpenAPI服务器去获取另一部分功能代 码, 即第二功能代码(例如需要的 javascript代码) , 然后将两部分功能代码结 合起来对参数信息进行处理, 生成第三方调用请求。  Wherein, since the OpenAPI method written by using the Ajax protocol needs to write different function codes to be called when calling, the first function code corresponding to each OpenAPI method is generated and stored in advance in the embodiment. In addition, calling the OpenAPI method implemented by the Ajax protocol also needs to download another part of the function code to the OpenAPI server. In this embodiment, when the first function code is obtained, the OpenAPI calling device is directly triggered to the OpenAPI server to obtain another part of the function code. , that is, the second function code (such as the required javascript code), and then combine the two parts of the function code to process the parameter information to generate a third-party call request.
步骤 705、 OpenAPI调用设备将第三方调用请求发送给 OpenAPI服务器, 以对目标 OpenAPI方法进行调用。  Step 705: The OpenAPI calling device sends a third-party call request to the OpenAPI server to invoke the target OpenAPI method.
具体的, OpenAPI调用设备通过运行上述功能代码来生成并将第三方调用 请求发送给 OpenAPI服务器。  Specifically, the OpenAPI calling device generates and sends a third-party call request to the OpenAPI server by running the above function code.
步骤 706、 OpenAPI调用设备接收 OpenAPI服务器返回的调用结果, 并采 用预先设定的数据格式对调用结果进行格式化处理之后, 发送给用户。  Step 706: The OpenAPI calling device receives the call result returned by the OpenAPI server, and formats the call result by using a preset data format, and then sends the result to the user.
本实施例的 OpenAPI调用方法, OpenAPI调用设备在目标 OpenAPI方法采 用 Ajax协议时,直接获取该 Ajax协议对应的调用规则,并根据该调用规则自动 完成对目标 OpenAPI方法的调用, 不再需要用户学习 Ajax协议的通信机制, 提 高了调用 OpenAPI方法的效率。  In the OpenAPI calling method of the embodiment, when the target OpenAPI method adopts the Ajax protocol, the OpenAPI calling device directly acquires the calling rule corresponding to the Ajax protocol, and automatically completes the calling of the target OpenAPI method according to the calling rule, and the user is no longer required to learn Ajax. The communication mechanism of the protocol improves the efficiency of calling the OpenAPI method.
综上所述, 本发明各实施例通过预先设置各通信协议下的调用规则, 并通 过向用户提供统一的调用接口输入调用请求, 而由 OpenAPI调用设备自动采用 相应的调用规则完成对各 OpenAPI方法的调用, 使得用户采用相同的调用流程 完成对各种 OpenAPI方法的调用, 并无需对各种通信协议进行学习, 提高了调 用 OpenAPI方法的效率, 提高了对用户的服务质量。 In summary, the embodiments of the present invention automatically set the calling rule under each communication protocol and input the calling request by providing a unified calling interface to the user, which is automatically adopted by the OpenAPI calling device. The corresponding calling rule completes the call to each OpenAPI method, so that the user completes the call to various OpenAPI methods by using the same calling process, and does not need to learn various communication protocols, thereby improving the efficiency of calling the OpenAPI method and improving the user. Quality of service.
图 8为本发明一实施例提供的 OpenAPI调用设备的结构示意图。 如图 8所 示, 本实施例的调用设备包括: 方法获取单元 81、 参数获取单元 82和调用单元 83。  FIG. 8 is a schematic structural diagram of an OpenAPI calling device according to an embodiment of the present invention. As shown in FIG. 8, the calling device of this embodiment includes: a method obtaining unit 81, a parameter obtaining unit 82, and a calling unit 83.
其中,方法获取单元 81 ,用于获取与用户的调用请求相对应的目标 OpenAPI 方法; 参数获取单元 82, 与方法获取单元 81 连接, 用于向用户提供与目标 OpenAPI方法对应的参数列表, 以获取目标 OpenAPI方法的参数信息; 调用单 元 83 , 与参数获取单元 82连接, 用于根据参数信息和与目标 OpenAPI方法相 适应的调用规则, 对目标 OpenAPI方法进行调用。  The method obtaining unit 81 is configured to obtain a target OpenAPI method corresponding to the calling request of the user, and the parameter obtaining unit 82 is connected to the method acquiring unit 81, and configured to provide the user with a parameter list corresponding to the target OpenAPI method, to obtain The parameter information of the target OpenAPI method; the calling unit 83 is connected to the parameter obtaining unit 82, and is configured to invoke the target OpenAPI method according to the parameter information and the calling rule adapted to the target OpenAPI method.
本实施例的 OpenAPI调用设备可用于执行图 1所示实施例的流程, 其工作 原理不再赘述, 详见方法实施例的描述。  The OpenAPI invoking device of this embodiment can be used to execute the process of the embodiment shown in FIG. 1. The working principle is not described here. For details, refer to the description of the method embodiment.
本实施例的 OpenAPI调用设备, 在获取目标 OpenAPI方法和目标 OpenAPI 方法对应的参数信息后, 通过采用与目标 OpenAPI方法相适应的调用规则, 对 目标 OpenAPI方法进行调用, 对用户而言实现了采用统一的调用流程实现对不 同 OpenAPI的调用, 简化了调用过程, 提高了调用 OpenAPI的效率。  After obtaining the parameter information corresponding to the target OpenAPI method and the target OpenAPI method, the OpenAPI calling device in this embodiment invokes the target OpenAPI method by using a calling rule adapted to the target OpenAPI method, and implements unified for the user. The calling process implements calls to different OpenAPIs, which simplifies the calling process and improves the efficiency of calling OpenAPI.
图 9为本发明又一实施例提供的 OpenAPI调用设备的结构示意图。 本实施 例基于图 8所示实施例实现, 如图 9所示, 本实施例的方法获取单元 81的一种 实现结构包括: 第一接收子单元 811、 第一 API获取子单元 812、 第一提供子单 元 813和第一方法获取子单元 814。  FIG. 9 is a schematic structural diagram of an OpenAPI calling device according to another embodiment of the present invention. The embodiment is implemented based on the embodiment shown in FIG. 8. As shown in FIG. 9, an implementation structure of the method obtaining unit 81 of the embodiment includes: a first receiving subunit 811, a first API acquiring subunit 812, and a first A subunit 813 and a first method acquisition subunit 814 are provided.
具体的, 第一接收子单元 811 , 用于接收用户发送的第一调用请求; 第一 API获取子单元 812, 与第一接收子单元 811连接, 用于根据第一调用请求向用 户提供 OpenAPI列表, 以使用户选择目标 OpenAPI, 该 OpenAPI列表包括多个 OpenAPI的信息; 第一提供子单元 813 , 与第一 API获取子单元 812连接, 用于 获取目标 OpenAPI对应的方法列表, 并将方法列表提供给用户以供用户选择, 该方法列表包括多个 OpenAPI方法的信息; 第一方法获取子单元 814, 与第一 提供子单元 813连接, 用于根据用户的选择结果, 获取目标 OpenAPI方法。 Specifically, the first receiving subunit 811 is configured to receive a first call request sent by the user, where the first API obtaining subunit 812 is connected to the first receiving subunit 811, and configured to provide the OpenAPI list to the user according to the first calling request. In order to enable the user to select the target OpenAPI, the OpenAPI list includes information of a plurality of OpenAPIs; the first providing subunit 813 is connected to the first API obtaining subunit 812, configured to obtain a method list corresponding to the target OpenAPI, and provide the method list Give the user a choice for the user, The method list includes information of a plurality of OpenAPI methods. The first method obtaining subunit 814 is connected to the first providing subunit 813 for obtaining a target OpenAPI method according to a selection result of the user.
如图 9所示,方法获取单元 81的另一种实现结构包括:第二接收子单元 815、 第二 API获取子单元 816、 第二提供子单元 817和第二方法获取子单元 818。  As shown in FIG. 9, another implementation structure of the method obtaining unit 81 includes: a second receiving subunit 815, a second API obtaining subunit 816, a second providing subunit 817, and a second method obtaining subunit 818.
具体的, 第二接收子单元 815, 用于接收用户发送的第二调用请求, 该第二 调用请求包括 OpenAPI关键字; 第二 API获取子单元 816, 与第二接收子单元 815连接, 用于根据 OpenAPI关键字查询 OpenAPI列表, 获取与 OpenAPI关键 字对应的目标 OpenAPI, 该 OpenAPI列表包括多个 OpenAPI的信息; 第二提供 子单元 817, 与第二 API获取子单元 816连接, 用于获取目标 OpenAPI对应的 方法列表, 并将方法列表提供给用户以供用户选择, 该方法列表包括多个 OpenAPI方法的信息; 第二方法获取子单元 818, 与第二提供子单元 817连接, 用于根据用户的选择结果, 获取目标 OpenAPI方法。  Specifically, the second receiving subunit 815 is configured to receive a second calling request sent by the user, where the second calling request includes an OpenAPI keyword, and the second API obtaining subunit 816 is connected to the second receiving subunit 815, where The OpenAPI list is queried according to the OpenAPI keyword, and the target OpenAPI corresponding to the OpenAPI keyword is obtained. The OpenAPI list includes information of multiple OpenAPIs. The second providing subunit 817 is connected to the second API obtaining subunit 816 for obtaining the target OpenAPI. Corresponding method list, and providing the method list to the user for selection by the user, the method list includes information of multiple OpenAPI methods; the second method obtaining subunit 818 is connected with the second providing subunit 817 for Select the result and get the target OpenAPI method.
更进一步, 如图 9所示, 方法获取单元 81的又一种实现结构包括: 参数获 取子单元 819、 方法集获取子单元 820和第三方法获取子单元 821。  Further, as shown in FIG. 9, another implementation structure of the method obtaining unit 81 includes: a parameter obtaining subunit 819, a method set obtaining subunit 820, and a third method acquiring subunit 821.
具体的, 参数获取子单元 819, 用于获取与调用请求对应的 OpenAPI功能 参数; 方法集获取子单元 820, 与参数获取子单元 819连接, 用于根据 OpenAPI 功能参数, 获取 OpenAPI方法集, 该 OpenAPI方法集包括与 OpenAPI功能参数 对应的多个 OpenAPI方法; 第三方法获取子单元 821 , 与方法集获取子单元 820 连接, 用于根据 OpenAPI方法集中每个 OpenAPI方法的 Qos属性值, 获取目标 OpenAPI方法。  Specifically, the parameter obtaining subunit 819 is configured to obtain an OpenAPI function parameter corresponding to the calling request, and the method set obtaining subunit 820 is connected to the parameter obtaining subunit 819, and configured to obtain an OpenAPI method set according to the OpenAPI function parameter, the OpenAPI The method set includes a plurality of OpenAPI methods corresponding to the OpenAPI function parameters; the third method obtaining subunit 821 is connected to the method set obtaining subunit 820, and is configured to collect the Qos attribute value of each OpenAPI method according to the OpenAPI method, and obtain the target OpenAPI method. .
其中, 参数获取子单元 819 的一种实现结构包括: 第一接收模块和第一获 取模块。 具体的, 第一接收模块, 用于接收用户发送的功能调用请求, 该功能 调用请求包括 OpenAPI功能参数; 第一获取模块, 与第一接收模块连接, 用于 解析功能调用请求, 获取 OpenAPI功能参数。  An implementation structure of the parameter obtaining subunit 819 includes: a first receiving module and a first acquiring module. Specifically, the first receiving module is configured to receive a function call request sent by the user, where the function call request includes an OpenAPI function parameter; the first acquiring module is connected to the first receiving module, configured to parse the function call request, and obtain the OpenAPI function parameter. .
参数获取子单元 819 的又一种实现结构包括: 第二接收模块和第二获取模 块。 具体的, 第二接收模块, 用于接收用户发送的应用调用请求, 该应用调用 请求包括应用描述信息; 第二获取模块, 与第二接收模块连接, 用于对应用描 述信息进行功能解析处理, 获取 OpenAPI功能参数。 Yet another implementation structure of the parameter acquisition subunit 819 includes: a second receiving module and a second obtaining module. Specifically, the second receiving module is configured to receive an application call request sent by the user, where the application invokes The request includes the application description information. The second obtaining module is connected to the second receiving module, and is configured to perform function parsing processing on the application description information to obtain an OpenAPI function parameter.
其中, 上述各功能子单元或模块可用于执行上述图 2A-图 2D所示实施例的 流程, 其工作原理不再赘述, 详见方法实施例部分的描述。 OpenAPI调用设备 具体通过上述功能子单元或模块允许用户输入各种调用请求, 为用户提供了更 加方便的调用接口, 进一步提高了调用 OpenAPI方法的效率, 提高了对用户的 服务质量。  The foregoing function sub-units or modules may be used to execute the processes of the foregoing embodiment shown in FIG. 2A to FIG. 2D, and the working principle thereof is not described again. For details, refer to the description of the method embodiments. The OpenAPI calling device specifically allows the user to input various calling requests through the above function sub-units or modules, thereby providing a more convenient calling interface for the user, further improving the efficiency of calling the OpenAPI method and improving the quality of service to the user.
更进一步,如图 9所示,本实施例的调用单元 83包括:规则获取子单元 831、 生成子单元 832和调用子单元 833。  Further, as shown in FIG. 9, the calling unit 83 of the present embodiment includes a rule acquisition subunit 831, a generation subunit 832, and a calling subunit 833.
其中, 规则获取子单元 831 , 用于根据目标 OpenAPI方法采用的协议类型, 获取与目标 OpenAPI方法相适应的调用规则; 生成子单元 832, 与规则获取子 单元 831 连接, 用于根据调用规则, 对参数信息进行处理, 生成第三方调用请 求; 调用子单元 833 , 与生成子单元 832连接, 用于向 OpenAPI服务器发送第 三方调用请求, 以对目标 OpenAPI方法进行调用。  The rule obtaining sub-unit 831 is configured to obtain a calling rule that is adapted to the target OpenAPI method according to the protocol type adopted by the target OpenAPI method, and generate a sub-unit 832, which is connected to the rule obtaining sub-unit 831, according to the calling rule, The parameter information is processed to generate a third-party call request; the calling sub-unit 833 is connected to the generating sub-unit 832 for sending a third-party calling request to the OpenAPI server to invoke the target OpenAPI method.
具体的, 当目标 OpenAPI方法采用 Rest协议编写时, 生成子单元 832具体 用于接收用户发送的调用密钥 Key值, 并根据目标 OpenAPI方法查询 OpenAPI 列表, 获取调用地址; 并将参数信息和调用 Key值进行加密处理, 生成第三方 调用请求。  Specifically, when the target OpenAPI method is written by using the Rest protocol, the generating subunit 832 is specifically configured to receive the calling key Key value sent by the user, and query the OpenAPI list according to the target OpenAPI method to obtain the calling address; and the parameter information and the calling key. The value is encrypted to generate a third-party call request.
当目标 OpenAPI方法采用 Soap协议编写时,生成子单元 832具体用于查询 OpenAPI列表, 获取 Soa 协议的 WSDL2 Java工具包; 使用 WSDL2 Java工具包 对参数信息和目标 OpenAPI方法进行处理, 生成第三方调用请求。  When the target OpenAPI method is written by the Soap protocol, the generating sub-unit 832 is specifically configured to query the OpenAPI list, obtain the WSDL2 Java toolkit of the Soa protocol, and process the parameter information and the target OpenAPI method by using the WSDL2 Java toolkit to generate a third-party calling request. .
当目标 OpenAPI方法采用 Ajax协议编写时,生成子单元 832具体用于获取 本地存储的与目标 OpenAPI方法对应的第一功能代码; 根据第一功能代码, 从 API数据库获取第二功能代码;通过第一功能代码和第二功能代码对参数信息进 行处理, 生成第三方调用请求。  When the target OpenAPI method is written by using the Ajax protocol, the generating subunit 832 is specifically configured to obtain a locally stored first function code corresponding to the target OpenAPI method; and acquiring the second function code from the API database according to the first function code; The function code and the second function code process the parameter information to generate a third-party call request.
上述各功能子单元可用于执行图 3或图 5-图 7所示实施例的流程, 其具体 工作原理不再赘述, 详见方法实施例部分的描述。 Each of the above functional subunits can be used to execute the process of the embodiment shown in FIG. 3 or FIG. 5 to FIG. The working principle is not repeated here, as described in the section on method embodiments.
再进一步, 本实施例的 OpenAPI调用设备还包括: 设定单元 84和接收处理 单元 85。  Further, the OpenAPI calling device of this embodiment further includes: a setting unit 84 and a receiving processing unit 85.
具体的, 设定单元 84, 用于设定返回结果的数据格式。 接收处理单元 85, 与设定单元 84连接, 用于接收 OpenAPI服务器返回的调用结果, 并根据数据格 式对调用结果进行格式化处理, 将处理后的调用结果提供给用户。  Specifically, the setting unit 84 is configured to set a data format of the returned result. The receiving processing unit 85 is connected to the setting unit 84, and is configured to receive a call result returned by the OpenAPI server, and format the call result according to the data format, and provide the processed call result to the user.
综上所述, 本实施例的 OpenAPI调用设备, 在获取目标 OpenAPI方法和目 标 OpenAPI方法对应的参数信息后, 通过采用与目标 OpenAPI方法相适应的调 用规则, 对目标 OpenAPI方法进行调用, 对用户而言实现了采用统一的调用流 程实现对不同 OpenAPI的调用,简化了调用过程,提高了调用 OpenAPI的效率。  In summary, after obtaining the parameter information corresponding to the target OpenAPI method and the target OpenAPI method, the OpenAPI calling device in this embodiment invokes the target OpenAPI method by using a calling rule adapted to the target OpenAPI method, and The implementation of the call process to achieve different calls to the OpenAPI, simplifying the calling process and improving the efficiency of calling OpenAPI.
本领域普通技术人员可以理解: 实现上述方法实施例的全部或部分步骤可 以通过程序指令相关的硬件来完成, 前述的程序可以存储于一计算机可读取存 储介质中, 该程序在执行时, 执行包括上述方法实施例的步骤; 而前述的存储 介质包括: ROM、 RAM, 磁碟或者光盘等各种可以存储程序代码的介质。  A person skilled in the art can understand that all or part of the steps of implementing the above method embodiments may be completed by using hardware related to program instructions, and the foregoing program may be stored in a computer readable storage medium, and the program is executed when executed. The foregoing steps include the steps of the foregoing method embodiments; and the foregoing storage medium includes: a medium that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.
最后应说明的是: 以上实施例仅用以说明本发明的技术方案, 而非对其 限制; 尽管参照前述实施例对本发明进行了详细的说明, 本领域的普通技术 人员应当理解: 其依然可以对前述各实施例所记载的技术方案进行修改, 或 者对其中部分技术特征进行等同替换; 而这些修改或者替换, 并不使相应技 术方案的本质脱离本发明各实施例技术方案的精神和范围。  It should be noted that the above embodiments are only for explaining the technical solutions of the present invention, and are not intended to be limiting; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those skilled in the art that: The technical solutions described in the foregoing embodiments are modified, or some of the technical features are equivalently replaced. The modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

权 利 要 求 Rights request
1、 一种开放应用程序编程接口 OpenAPI调用方法, 其特征在于, 包括: 获取与用户的调用请求相对应的目标 OpenAPI方法;  An open application programming interface OpenAPI calling method, comprising: obtaining a target OpenAPI method corresponding to a user's calling request;
向所述用户提供与所述目标 OpenAPI方法对应的参数列表, 以获取所述目 标 OpenAPI方法的参数信息;  Providing the user with a parameter list corresponding to the target OpenAPI method to obtain parameter information of the target OpenAPI method;
根据所述参数信息和与所述目标 OpenAPI方法相适应的调用规则,对所述 目标 OpenAPI方法进行调用。  The target OpenAPI method is called according to the parameter information and a calling rule adapted to the target OpenAPI method.
2、 根据权利要求 1所述的 OpenAPI调用方法, 其特征在于, 所述获取与 用户的调用请求相对应的目标 OpenAPI方法包括:  2. The OpenAPI calling method according to claim 1, wherein the obtaining a target OpenAPI method corresponding to a user's calling request comprises:
接收所述用户发送的第一调用请求;  Receiving a first call request sent by the user;
根据所述第一调用请求向所述用户提供 OpenAPI列表, 以使所述用户选择 目标 OpenAPI , 所述 OpenAPI列表包括多个 OpenAPI的信息;  Providing the OpenAPI list to the user according to the first call request, so that the user selects a target OpenAPI, where the OpenAPI list includes information of multiple OpenAPIs;
获取所述目标 OpenAPI对应的方法列表, 并将所述方法列表提供给所述用 户以供所述用户选择, 所述方法列表包括多个 OpenAPI方法的信息;  Obtaining a method list corresponding to the target OpenAPI, and providing the method list to the user for selection by the user, where the method list includes information of multiple OpenAPI methods;
根据所述用户的选择结果, 获取所述目标 OpenAPI方法。  Obtaining the target OpenAPI method according to the selection result of the user.
3、 根据权利要求 1所述的 OpenAPI调用方法, 其特征在于, 所述获取与 用户的调用请求相对应的目标 OpenAPI方法包括:  The OpenAPI calling method according to claim 1, wherein the obtaining the target OpenAPI method corresponding to the user's calling request comprises:
接收所述用户发送的第二调用请求, 所述第二调用请求包括 OpenAPI关键 字;  Receiving a second call request sent by the user, where the second call request includes an OpenAPI keyword;
根据所述 OpenAPI关键字查询 OpenAPI列表, 获取与所述 OpenAPI关键 字对应的目标 OpenAPI, 所述 OpenAPI列表包括多个 OpenAPI的信息;  Querying the OpenAPI list according to the OpenAPI keyword, and acquiring a target OpenAPI corresponding to the OpenAPI keyword, where the OpenAPI list includes information of multiple OpenAPIs;
获取所述目标 OpenAPI对应的方法列表, 并将所述方法列表提供给所述用 户以供所述用户选择, 所述方法列表包括多个 OpenAPI方法的信息;  Obtaining a method list corresponding to the target OpenAPI, and providing the method list to the user for selection by the user, where the method list includes information of multiple OpenAPI methods;
根据所述用户的选择结果, 获取所述目标 OpenAPI方法。  Obtaining the target OpenAPI method according to the selection result of the user.
4、 根据权利要求 1所述的 OpenAPI调用方法, 其特征在于, 所述获取与 用户的调用请求相对应的目标 OpenAPI方法包括: 获取与所述调用请求对应的 OpenAPI功能参数; The OpenAPI calling method according to claim 1, wherein the obtaining the target OpenAPI method corresponding to the user's calling request comprises: Obtaining an OpenAPI function parameter corresponding to the call request;
根据所述 OpenAPI功能参数, 获取 OpenAPI方法集, 所述 OpenAPI方法 集包括与所述 OpenAPI功能参数对应的多个 OpenAPI方法;  Obtaining an OpenAPI method set according to the OpenAPI function parameter, where the OpenAPI method set includes multiple OpenAPI methods corresponding to the OpenAPI function parameter;
根据所述 OpenAPI方法集中每个所述 OpenAPI方法的服务质量 Qos属性 值, 获取所述目标 OpenAPI方法。  The target OpenAPI method is obtained by concentrating the quality of service Qos attribute value of each of the OpenAPI methods according to the OpenAPI method.
5、 根据权利要求 4所述的 OpenAPI调用方法, 其特征在于, 所述获取与 所述调用请求对应的 OpenAPI功能参数包括:  The OpenAPI calling method according to claim 4, wherein the obtaining the OpenAPI function parameters corresponding to the calling request includes:
接收所述用户发送的功能调用请求, 所述功能调用请求包括 OpenAPI功能 解析所述功能调用请求, 获取所述 OpenAPI功能参数。  Receiving a function call request sent by the user, where the function call request includes an OpenAPI function parsing the function call request, and acquiring the OpenAPI function parameter.
6、 根据权利要求 4所述的 OpenAPI调用方法, 其特征在于, 所述获取与 所述调用请求对应的 OpenAPI功能参数包括:  The OpenAPI calling method according to claim 4, wherein the obtaining the OpenAPI function parameters corresponding to the calling request includes:
接收所述用户发送的应用调用请求,所述应用调用请求包括应用描述信息; 对所述应用描述信息进行功能解析处理, 获取所述 OpenAPI功能参数。  Receiving an application call request sent by the user, where the application call request includes application description information; performing function parsing processing on the application description information to obtain the OpenAPI function parameter.
7、 根据权利要求 1-6任一项所述的 OpenAPI调用方法, 其特征在于, 所 述根据所述参数信息和与所述目标 OpenAPI方法相适应的调用规则,对所述目 标 OpenAPI方法进行调用包括: The OpenAPI calling method according to any one of claims 1 to 6, wherein the calling the target OpenAPI method according to the parameter information and a calling rule adapted to the target OpenAPI method Includes:
根据所述目标 OpenAPI 方法采用的协议类型, 获取与所述目标 OpenAPI 方法相适应的调用规则;  Obtaining a calling rule adapted to the target OpenAPI method according to a protocol type adopted by the target OpenAPI method;
根据所述调用规则, 对所述参数信息进行处理, 生成第三方调用请求; 向 OpenAPI服务器发送所述第三方调用请求,以对所述目标 OpenAPI方法 进行调用。  And processing, according to the calling rule, the parameter information to generate a third-party calling request; and sending the third-party calling request to the OpenAPI server to invoke the target OpenAPI method.
8、 根据权利要求 7所述的 OpenAPI调用方法, 其特征在于, 所述目标 OpenAPI方法采用表述性状态转移 Rest协议;  8. The OpenAPI calling method according to claim 7, wherein the target OpenAPI method uses a representational state transition Rest protocol;
所述根据所述调用规则, 对所述参数信息进行处理, 生成第三方调用请求 包括: 接收所述用户发送的调用密钥 Key值,并根据所述目标 OpenAPI方法查询 OpenAPI列表, 获取调用地址; 将所述参数信息和所述调用 Key值进行加密处 理, 生成所述第三方调用请求。 And processing the parameter information according to the calling rule, and generating a third-party calling request includes: Receiving a call key Key value sent by the user, and querying the OpenAPI list according to the target OpenAPI method to obtain a call address; and performing encryption processing on the parameter information and the call key value to generate the third party call request.
9、 根据权利要求 7 所述的 OpenAPI调用方法, 其特征在于, 所述目标 OpenAPI方法采用简单对象访问协议 Soa ;  The OpenAPI calling method according to claim 7, wherein the target OpenAPI method adopts a simple object access protocol Soa;
所述根据所述调用规则, 对所述参数信息进行处理, 生成第三方调用请求 包括:  And processing the parameter information according to the calling rule to generate a third-party calling request, including:
查询 OpenAPI列表, 获取所述 Soap协议的 WSDL2Java工具包; 使用所述 WSDL2Java工具包对所述参数信息和所述目标 OpenAPI方法进行处理, 生成 所述第三方调用请求。  Querying the OpenAPI list, obtaining the WSDL2Java toolkit of the Soap protocol; processing the parameter information and the target OpenAPI method using the WSDL2 Java toolkit to generate the third-party call request.
10、 根据权利要求 7所述的 OpenAPI调用方法, 其特征在于, 所述目标 OpenAPI方法采用 Ajax协议;  The OpenAPI calling method according to claim 7, wherein the target OpenAPI method adopts an Ajax protocol;
所述根据所述调用规则, 对所述参数信息进行处理, 生成第三方调用请求 包括:  And processing the parameter information according to the calling rule to generate a third-party calling request, including:
获取本地存储的与所述目标 OpenAPI方法对应的第一功能代码; 根据所述 第一功能代码, 从所述 API数据库获取第二功能代码; 通过所述第一功能代码 和所述第二功能代码对所述参数信息进行处理, 生成所述第三方调用请求。  Obtaining a first stored function code corresponding to the target OpenAPI method locally; acquiring, according to the first function code, a second function code from the API database; by using the first function code and the second function code Processing the parameter information to generate the third party call request.
11、 根据权利要求 7 所述的 OpenAPI 调用方法, 其特征在于, 向所述 OpenAPI服务器发送所述第三方调用请求, 以对所述目标 OpenAPI方法进行调 用之前包括:  The method of calling the OpenAPI according to claim 7, wherein the sending the third party call request to the OpenAPI server to invoke the target OpenAPI method comprises:
设定返回结果的数据格式。  Set the data format for the returned result.
12、 根据权利要求 11所述的 OpenAPI调用方法, 其特征在于, 还包括: 接收所述 OpenAPI服务器返回的调用结果, 并根据所述数据格式对所述调 用结果进行格式化处理, 将处理后的调用结果提供给所述用户。  The OpenAPI calling method according to claim 11, further comprising: receiving a call result returned by the OpenAPI server, and formatting the call result according to the data format, and processing the processed result The result of the call is provided to the user.
13、 一种开放应用程序编程接口 OpenAPI调用设备, 其特征在于, 包括: 方法获取单元, 用于获取与用户的调用请求相对应的目标 OpenAPI方法; 参数获取单元, 用于向所述用户提供与所述目标 OpenAPI方法对应的参数 列表, 以获取所述目标 OpenAPI方法的参数信息; 13. An open application programming interface OpenAPI calling device, comprising: a method obtaining unit, configured to acquire a target OpenAPI method corresponding to a user's calling request; a parameter obtaining unit, configured to provide the user with a parameter list corresponding to the target OpenAPI method, to obtain parameter information of the target OpenAPI method;
调用单元, 用于根据所述参数信息和与所述目标 OpenAPI方法相适应的调 用规则, 对所述目标 OpenAPI方法进行调用。  And a calling unit, configured to invoke the target OpenAPI method according to the parameter information and a calling rule adapted to the target OpenAPI method.
14、 根据权利要求 13所述的 OpenAPI调用设备, 其特征在于, 所述方法 获取单元包括:  The OpenAPI calling device according to claim 13, wherein the method obtaining unit comprises:
第一接收子单元, 用于接收所述用户发送的第一调用请求;  a first receiving subunit, configured to receive a first call request sent by the user;
第一 API 获取子单元, 用于根据所述第一调用请求向所述用户提供 a first API obtaining subunit, configured to provide the user according to the first call request
OpenAPI列表, 以使所述用户选择目标 OpenAPI , 所述 OpenAPI列表包括多个 OpenAPI的信息; a list of OpenAPIs to enable the user to select a target OpenAPI, the OpenAPI list including information of a plurality of OpenAPIs;
第一提供子单元, 用于获取所述目标 OpenAPI对应的方法列表, 并将所述 方法列表提供给所述用户以供所述用户选择, 所述方法列表包括多个 OpenAPI 方法的信息;  a first providing subunit, configured to obtain a method list corresponding to the target OpenAPI, and provide the method list to the user for selection by the user, where the method list includes information of multiple OpenAPI methods;
第一方法获取子单元, 用于根据所述用户的选择结果, 获取所述目标 OpenAPI方法。  The first method acquires a subunit, configured to obtain the target OpenAPI method according to the selection result of the user.
15、 根据权利要求 13所述的 OpenAPI调用设备, 其特征在于, 所述方法 获取单元包括:  The OpenAPI calling device according to claim 13, wherein the method obtaining unit comprises:
第二接收子单元, 用于接收所述用户发送的第二调用请求, 所述第二调用 请求包括 OpenAPI关键字;  a second receiving subunit, configured to receive a second calling request sent by the user, where the second calling request includes an OpenAPI keyword;
第二 API获取子单元, 用于根据所述 OpenAPI关键字查询 OpenAPI列表, 获取与所述 OpenAPI关键字对应的目标 OpenAPI,所述 OpenAPI列表包括多个 OpenAPI的信息;  a second API acquisition subunit, configured to query an OpenAPI list according to the OpenAPI keyword, and obtain a target OpenAPI corresponding to the OpenAPI keyword, where the OpenAPI list includes information of multiple OpenAPIs;
第二提供子单元, 用于获取所述目标 OpenAPI对应的方法列表, 并将所述 方法列表提供给所述用户以供所述用户选择, 所述方法列表包括多个 OpenAPI 方法的信息;  a second providing subunit, configured to obtain a method list corresponding to the target OpenAPI, and provide the method list to the user for selection by the user, where the method list includes information of multiple OpenAPI methods;
第二方法获取子单元, 用于根据所述用户的选择结果, 获取所述目标 OpenAPI方法。 a second method of acquiring a subunit, configured to acquire the target according to the selection result of the user OpenAPI method.
16、 根据权利要求 13所述的 OpenAPI调用设备, 其特征在于, 所述方法 获取单元包括:  The OpenAPI calling device according to claim 13, wherein the method obtaining unit comprises:
参数获取子单元, 用于获取与所述调用请求对应的 OpenAPI功能参数; 方法集获取子单元,用于根据所述 OpenAPI功能参数,获取 OpenAPI方法 集, 所述 OpenAPI方法集包括与所述 OpenAPI功能参数对应的多个 OpenAPI 方法;  a parameter obtaining subunit, configured to obtain an OpenAPI function parameter corresponding to the call request, and a method set obtaining subunit, configured to obtain an OpenAPI method set according to the OpenAPI function parameter, where the OpenAPI method set includes the OpenAPI function Multiple OpenAPI methods corresponding to the parameters;
第三方法获取子单元,用于根据所述 OpenAPI方法集中每个所述 OpenAPI 方法的服务质量 Qos属性值, 获取所述目标 OpenAPI方法。  The third method acquires a subunit, configured to obtain the target OpenAPI method according to the quality of service Qos attribute value of each of the OpenAPI methods according to the OpenAPI method.
17、 根据权利要求 16所述的 OpenAPI调用设备, 其特征在于, 所述参数 获取子单元包括:  The OpenAPI calling device according to claim 16, wherein the parameter obtaining subunit comprises:
第一接收模块, 用于接收所述用户发送的功能调用请求, 所述功能调用请 求包括 OpenAPI功能参数;  a first receiving module, configured to receive a function call request sent by the user, where the function call request includes an OpenAPI function parameter;
第一获取模块,用于解析所述功能调用请求,获取所述 OpenAPI功能参数。  The first obtaining module is configured to parse the function calling request, and obtain the OpenAPI function parameter.
18、 根据权利要求 16所述的 OpenAPI调用设备, 其特征在于, 所述参数 获取子单元包括: The OpenAPI calling device according to claim 16, wherein the parameter obtaining subunit comprises:
第二接收模块, 用于接收所述用户发送的应用调用请求, 所述应用调用请 求包括应用描述信息;  a second receiving module, configured to receive an application call request sent by the user, where the application call request includes application description information;
第二获取模块, 用于对所述应用描述信息进行功能解析处理, 获取所述  a second obtaining module, configured to perform function parsing processing on the application description information, to obtain the
19、 根据权利要求 13-18任一项所述的 OpenAPI调用设备, 其特征在于, 所述调用单元包括: The OpenAPI calling device according to any one of claims 13 to 18, wherein the calling unit comprises:
规则获取子单元, 用于根据所述目标 OpenAPI方法采用的协议类型, 获取 与所述目标 OpenAPI方法相适应的调用规则;  a rule obtaining subunit, configured to acquire a calling rule adapted to the target OpenAPI method according to a protocol type adopted by the target OpenAPI method;
生成子单元, 用于根据所述调用规则, 对所述参数信息进行处理, 生成第 三方调用请求; 调用子单元, 用于向 OpenAPI服务器发送所述第三方调用请求, 以对所述 目标 OpenAPI方法进行调用。 Generating a subunit, configured to process the parameter information according to the calling rule to generate a third party call request; The calling subunit is configured to send the third party invocation request to the OpenAPI server to invoke the target OpenAPI method.
20、 根据权利要求 19所述的 OpenAPI调用设备, 其特征在于, 所述目标 OpenAPI方法采用表述性状态转移 Rest协议;  The OpenAPI calling device according to claim 19, wherein the target OpenAPI method adopts a representational state transition Rest protocol;
所述生成子单元具体用于接收所述用户发送的调用密钥 Key值, 并根据所 述目标 OpenAPI方法查询 OpenAPI列表,获取调用地址; 并将所述参数信息和 所述调用 Key值进行加密处理, 生成所述第三方调用请求。  The generating sub-unit is specifically configured to receive a call key value sent by the user, and query an OpenAPI list according to the target OpenAPI method to obtain a call address, and encrypt the parameter information and the call key value. , generating the third party call request.
21、 根据权利要求 19所述的 OpenAPI调用设备, 其特征在于, 所述目标 OpenAPI方法采用简单对象访问协议 Soap;  The OpenAPI calling device according to claim 19, wherein the target OpenAPI method adopts a simple object access protocol Soap;
所述生成子单元具体用于查询 OpenAPI 列表, 获取所述 Soap 协议的 The generating subunit is specifically configured to query an OpenAPI list, and obtain the Soap protocol.
WSDL2Java工具包; 使用所述 WSDL2Java工具包对所述参数信息和所述目标 OpenAPI方法进行处理, 生成所述第三方调用请求。 a WSDL2 Java toolkit; processing the parameter information and the target OpenAPI method using the WSDL2 Java toolkit to generate the third party call request.
22、 根据权利要求 19所述的 OpenAPI调用设备, 其特征在于, 所述目标 OpenAPI方法采用 Ajax协议; 第一功能代码;根据所述第一功能代码,从所述 API数据库获取第二功能代码; 通过所述第一功能代码和所述第二功能代码对所述参数信息进行处理, 生成所 述第三方调用请求。  The OpenAPI calling device according to claim 19, wherein the target OpenAPI method adopts an Ajax protocol; a first function code; and acquiring a second function code from the API database according to the first function code; The parameter information is processed by the first function code and the second function code to generate the third party call request.
23、 根据权利要求 19所述的 OpenAPI调用设备, 其特征在于, 还包括: 设定单元, 用于设定返回结果的数据格式。  The OpenAPI calling device according to claim 19, further comprising: a setting unit, configured to set a data format of the returned result.
24、 根据权利要求 23所述的 OpenAPI调用设备, 其特征在于, 还包括: 接收处理单元, 用于接收所述 OpenAPI服务器返回的调用结果, 并根 据所述数据格式对所述调用结果进行格式化处理,将处理后的调用结果提供 给所述用户。  The OpenAPI calling device according to claim 23, further comprising: a receiving processing unit, configured to receive a call result returned by the OpenAPI server, and format the calling result according to the data format Processing, providing the processed call result to the user.
PCT/CN2011/074424 2011-05-20 2011-05-20 Method and device for calling open application programming interface (openapi) WO2011127863A2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2011/074424 WO2011127863A2 (en) 2011-05-20 2011-05-20 Method and device for calling open application programming interface (openapi)
CN201180000546.1A CN102203736B (en) 2011-05-20 2011-05-20 Method and device for calling open application programming interface (openapi)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2011/074424 WO2011127863A2 (en) 2011-05-20 2011-05-20 Method and device for calling open application programming interface (openapi)

Publications (2)

Publication Number Publication Date
WO2011127863A2 true WO2011127863A2 (en) 2011-10-20
WO2011127863A3 WO2011127863A3 (en) 2012-05-03

Family

ID=44662778

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2011/074424 WO2011127863A2 (en) 2011-05-20 2011-05-20 Method and device for calling open application programming interface (openapi)

Country Status (2)

Country Link
CN (1) CN102203736B (en)
WO (1) WO2011127863A2 (en)

Families Citing this family (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102609264A (en) * 2012-02-14 2012-07-25 深圳市同洲视讯传媒有限公司 Method and device for generating calling codes by calling application programming interfaces
WO2013146047A1 (en) * 2012-03-29 2013-10-03 ソニー株式会社 Information processing device, information processing method, server device, retrieval method, and information processing system
CN102707958B (en) * 2012-06-08 2017-07-14 北京奇虎科技有限公司 A kind of interface generation method of calibration and equipment based on open platform
CN103546806B (en) * 2013-10-16 2017-04-05 小米科技有限责任公司 A kind of generation method and device of feature list
CN105335131B (en) * 2014-06-03 2018-12-25 广州市动景计算机科技有限公司 Sensor interface processing method and processing device
CN105607895B (en) * 2014-11-21 2021-03-02 阿里巴巴集团控股有限公司 Application program operation method and device based on application program programming interface
CN105740057A (en) * 2014-12-09 2016-07-06 阿里巴巴集团控股有限公司 Information processing method and device
CN104636132B (en) * 2014-12-23 2018-07-24 用友网络科技股份有限公司 Method for operating application program, utility program operating system and application program
CN104572095B (en) * 2014-12-29 2017-12-22 天津大学 A kind of adaptive approach that Ajax applications are built towards end user
CN104750810A (en) * 2015-03-30 2015-07-01 浪潮集团有限公司 Data querying and processing method based on configuration
CN106648557B (en) * 2015-10-28 2020-04-03 华为技术有限公司 Sharing method and device of Application Programming Interface (API)
CN105634743B (en) * 2015-12-30 2019-10-25 中国银联股份有限公司 The authentication method called for open interface
CN106445562B (en) * 2016-11-14 2019-11-15 用友网络科技股份有限公司 OpenAPI implementation method and OpenAPI realization device based on metadata
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
CN107977198A (en) * 2017-12-21 2018-05-01 中科点击(北京)科技有限公司 Method and device based on crawler technology generation application programming interface API
CN109347942B (en) * 2018-10-09 2019-08-23 浙江明度智控科技有限公司 A kind of industrial gateway data repay method and industrial gateway
CN111984713A (en) * 2020-06-29 2020-11-24 五八到家有限公司 Data processing method, device, equipment and storage medium
CN113392388B (en) * 2021-05-19 2023-05-09 杭州宇泛智能科技有限公司 Terminal, cloud verification autonomous customization service method and system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101620536A (en) * 2009-08-17 2010-01-06 用友软件股份有限公司 Method and device for invoking performance function
CN101667139A (en) * 2009-10-13 2010-03-10 金蝶软件(中国)有限公司 Service program invocation method based on aggregate type object, device and system therefor
CN101976188A (en) * 2010-05-26 2011-02-16 天津大学 OpenApi data automatic loading system oriented to AJAX protocol

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101620536A (en) * 2009-08-17 2010-01-06 用友软件股份有限公司 Method and device for invoking performance function
CN101667139A (en) * 2009-10-13 2010-03-10 金蝶软件(中国)有限公司 Service program invocation method based on aggregate type object, device and system therefor
CN101976188A (en) * 2010-05-26 2011-02-16 天津大学 OpenApi data automatic loading system oriented to AJAX protocol

Also Published As

Publication number Publication date
CN102203736A (en) 2011-09-28
CN102203736B (en) 2014-04-02
WO2011127863A3 (en) 2012-05-03

Similar Documents

Publication Publication Date Title
WO2011127863A2 (en) Method and device for calling open application programming interface (openapi)
US20220035600A1 (en) API Specification Generation
US11265378B2 (en) Cloud storage methods and systems
US10957326B2 (en) Device identifier dependent operation processing of packet based data communication
CN108521858B (en) Device identifier dependent handling of operations for packet-based data communication
US10585683B2 (en) Defining application programming interfaces (APIs) using object schemas
KR101880456B1 (en) Enabling resource semantics
KR102048653B1 (en) Enriching database query responses using data from external data sources
CN103038788B (en) Providing multiple network resources
US8656417B2 (en) Interface for telecommunication services using uniform resource identifiers
US8452925B2 (en) System, method and computer program product for automatically updating content in a cache
JP4902671B2 (en) Strategies for sending content to target devices
US10331504B2 (en) Method and system for extending application programming interfaces
WO2017117509A1 (en) Universal interaction platform for people, services, and devices
JP7038113B2 (en) Permitting Semantic Mashups on the Internet of Things
EP3465436B1 (en) Extending object-schema-based application programming interfaces (apis)
US8838679B2 (en) Providing state service for online application users
US20150081798A1 (en) Process-based inter-thing collaboration apparatus and method in web of things environment
WO2011157099A1 (en) Method and related device for enabling context aware service application
WO2010043175A1 (en) Method and device for terminal management based on right control
WO2008049348A1 (en) Method and system, client, server of managing xml document
CN110334103A (en) The update method of recommendation service provides device, access mechanism and recommender system
CN112262371A (en) Invoking functionality of a proxy via a digital assistant application using an address template
TW200538950A (en) Defining nodes in device management system
Fang et al. Exposing UDDI service descriptions and their metadata annotations as WS-resources

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 201180000546.1

Country of ref document: CN

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 11768474

Country of ref document: EP

Kind code of ref document: A2

NENP Non-entry into the national phase in:

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 11768474

Country of ref document: EP

Kind code of ref document: A2