Disclosure of Invention
In view of this, embodiments of the present invention provide a method, a system, and a device for using a network openability, so as to enable a Widget user to use a plurality of openabilities without knowing service logic of an openability provider.
The embodiment of the invention is realized as follows:
the embodiment of the invention provides a method for using network open capacity, which comprises the following steps:
receiving a calling request for the opening capability of an opening capability provider, which is sent by a Widget client, wherein the calling request is generated by the Widget client by encapsulating the downloaded opening capability of the opening capability provider and developing a Widget file including a specific identifier to analyze and construct, and the calling request carries the specific identifier;
acquiring corresponding data information or service from the open capability provider according to the call request carrying the specific identifier;
and performing adaptation conversion on the received data information or service and returning the data information or service to the Widget client.
And carrying out protocol conversion and/or data conversion on the received data information or service.
The embodiment of the invention provides a network open capability using system, which comprises: a Widget server, a Widget client and an open capability provider, wherein,
the Widget server is used for packaging the opening capability of the opening capability provider and developing and generating a Widget file comprising a specific identifier for downloading by the Widget client; the method specifically comprises the following steps:
a receiving unit, configured to receive a call request for the opening capability of the opening capability provider, where the call request is generated by the Widget client parsing and constructing the Widget file, and the call request carries the specific identifier;
the acquiring unit is used for acquiring corresponding data information or service from the open capability provider according to the calling request carrying the specific identifier;
the adaptation conversion unit is used for carrying out adaptation conversion on the data information or the service;
the sending unit is used for sending the data information or service subjected to the adaptation conversion to the Widget client;
the Widget client is used for downloading the Widget file comprising the specific identifier, analyzing and constructing the Widget file to generate a call request for the opening capability of the opening capability provider, wherein the call request carries the specific identifier.
The embodiment of the invention also provides a Widget server, which encapsulates and develops the opening capability of an opening capability provider to generate a Widget file including a specific identifier for a Widget client to download, and the method comprises the following steps:
a receiving unit, configured to receive a call request for the opening capability of the opening capability provider, where the call request is generated by the Widget client parsing and constructing the Widget file, and the call request carries the specific identifier;
the acquiring unit is used for acquiring corresponding data information or service from the open capability provider according to the calling request carrying the specific identifier;
the adaptation conversion unit is used for carrying out adaptation conversion on the data information or the service;
and the sending unit is used for sending the data information or the service after the adaptation conversion to the Widget client.
The embodiment of the invention encapsulates and develops the opening capability of the opening capability provider through the Widget server to generate the Widget file comprising the specific identifier, when the Widget client downloads the file for use, the Widget client only needs to analyze the Widget file and sends the calling request comprising the specific identifier to the Widget server, so that the Widget server can request corresponding data or service for the Widget client to the opening capability provider according to the calling request comprising the specific identifier. According to the technical scheme provided by the embodiment of the invention, the opening capacity of the opening capacity provider is encapsulated, so that a Widget user can use a plurality of opening capacities without knowing the service logic of the opening capacity provider.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The embodiment of the invention provides a method for using network open capability, which comprises the following steps: after the opening capability of the opening capability provider is encapsulated, developed and generated to a Widget file including a specific identifier, and downloaded by a Widget client, a specific use method is as shown in fig. 1, and includes:
s101: receiving a calling request for the opening capability of an opening capability provider, which is sent by the Widget client, wherein the calling request is generated by the Widget client by encapsulating the downloaded opening capability of the opening capability provider and developing a Widget file including a specific identifier to analyze and construct the Widget file, and the calling request carries the specific identifier;
s102: analyzing the calling request to obtain calling parameters including the specific identification;
s103: acquiring corresponding data information or service from a corresponding open capacity provider according to the calling parameter; in this embodiment, this step can be understood as: sending data information or service request information to a corresponding open capability provider according to the calling parameter; and receiving data information or service sent by the corresponding open capability provider.
S104: and performing adaptation conversion on the received data information or service and returning the data information or service to the Widget client.
The method for using the network open capability provided by the embodiment of the invention has the advantages that the Widget server encapsulates and develops the open capability of the open capability provider to generate the Widget file comprising the specific identifier, when the Widget client downloads the file for use, the Widget client only needs to analyze the Widget file, and sends the calling request comprising the specific identifier to the Widget server, so that the Widget server can request corresponding data or service from the open capability provider for the Widget client according to the calling request. According to the technical scheme provided by the embodiment of the invention, the opening capacity of the opening capacity provider is encapsulated, so that a Widget user can use a plurality of opening capacities without knowing the service logic of the opening capacity provider.
Before using the opening capacity, a Widget server firstly encapsulates the opening capacity of an opening capacity provider, and develops and generates a Widget file including a specific identifier for the encapsulated opening capacity provider, so as to publish the Widget file to a Widget client.
It should be noted that, before the Widget server encapsulates the opening capability of the opening capability provider, it needs to acquire the opening capability information first, and here, the information may be acquired in two ways: firstly, a Widget server is obtained by actively grabbing on a network; second, the openability provider actively registers on the Widget server. In the subsequent operation process, the same packaging development method can be adopted for the opening capacity acquired by the two modes.
For example, the following method can be used to develop the package of the openness provider:
and (3) encapsulation of a URL/access code mode, wherein the mode is mainly applied to Mashup, telecom value-added services and other open capability providers. For example: during a show-selecting game, a service provider develops a short message value-added service on the existing mobile value-added service platform, and the short message is sent by television audiences to support favorite match players. And if the service provider opens the service capability of the service provider at the moment, the Widget developer is allowed to carry out secondary development on the basis, so that the value added service provides a unique access code externally, and the access code is provided for the Widget client, therefore, when the service is operated, the telecom value added service platform can identify the corresponding service logic through the access code. After the above encapsulation development process, the Widget file describing the voting service includes the following codes:
and (3) packaging a label mode, wherein the mode is mainly applied to an opening capability provider which is actively grabbed by the Widget server on the network to obtain the opening capability or actively registered on the Widget server. By adopting the method, the services of the opening capability provider are packaged and developed, usually, after packaging, the Widget server provides some extended HTML tags for the developer, and the developer can develop HTML pages according to the HTML tags.
The JavaScript object mode has basically the same application range as the label mode, and is also an opening capability provider which is applied to the Widget server to actively capture the opening capability on the network or actively register the opening capability on the Widget server. By adopting the method, the service of the opening capability provider is encapsulated and developed, generally, after encapsulation, the Widget server provides some extended JavaScript objects for the developer, and the developer can develop according to the JavaScript objects.
It should be noted that, with the method for using network openability provided by the embodiment of the present invention, when encapsulating openability of openability providers, it may not be considered whether the openability providers are in the same network. For example: the interfaces, logics and data formats related to the message service capabilities provided by different operators in the telecommunication network may be different, but when the opening capabilities of the opening capability providers are encapsulated, only different specific identifiers are provided for different opening capability providers, and uniform simplified encapsulation and uniform adaptation management are performed to the outside. The above is now exemplified as follows: assuming that the open capabilities of the data television under the telecom operator 1, the telecom operator 2, the internet service provider, and the home network are encapsulated uniformly, in the encapsulating process, a specific identifier needs to be set for each open capability provider, and here, the method for encapsulating the open capability providers by using the JavaScript object method can be represented as: message (Tosomebody, content). The business logic after encapsulation can be represented as follows:
if(Tosomebody.mobilePhone1=online)
message class service logic for telecommunications carrier 1
elseif(Tosomebody.mobilePhone2=online)
Message class service logic for telecom operator 2
elseif(Tosomebody.IM=online)
Message class service logic for internet service providers
elseif(Tosomebody.TV=online)
Message service logic of digital television under home network
After the above-mentioned packaging and development, the related file is packaged into a compressed file, and then the compressed file is changed into a specific file type that the Widget can recognize, for example, a file in the format of a.
After packaging the opening capability of the opening capability provider and generating a Widget file including a specific identifier, executing the steps shown in fig. 2:
step 201: and the Widget client downloads the Widget file which is subjected to encapsulation development to the local so as to perform Widget related service.
In step 201, the client downloads the package-developed Widget file from the network, runs the file, and proceeds to step 202.
Step 202: and the Widget client analyzes the downloaded Widget file to construct and generate a call request for the opening capability of the opening capability provider.
In step 202, according to the three aforementioned package development methods, when the Widget client parses the Widget file, different situations may also be encountered:
if the URL/access code mode is adopted in the stage of encapsulation development, when the Widget client analyzes the Widget file, the client encounters the URL/access code involved in the process of encapsulation development in the process of analysis, and at the moment, the Widget client needs to add the URL/access code into a request for calling the opening capability of the opening capability provider to be constructed, so as to indicate what opening capability the user needs to call. Meanwhile, the constructed invocation request of the openness capability also includes identification information of the Widget service and other related parameters, which are used for indicating what data or service the user needs to obtain from the openness capability provider. In further detail, specific parameters included in the call request of the open capability may refer to table 1.
TABLE 1
Besides, it should be noted that, in general, the open capability call request is a call request of a unified capability encapsulation interface, and the request is generally based on HTTP.
Step 203: and the Widget client sends the calling request for the opening capability to the Widget server.
Step 204: and the Widget server analyzes the call request of the opening capability and acquires the call parameters in the call request.
In step 204, after receiving the request for opening capability invocation sent by the Widget client, the Widget server parses the request to obtain relevant parameters included in the request, for example, the parameters shown in table 1.
Step 205: and the Widget server sends data or service request information to the corresponding open capability provider according to the acquired calling parameters.
In step 205, after obtaining the invocation parameter, the Widget server may determine what opening capability the Widget client needs to invoke according to the invocation parameter including the parameter content, and select a suitable opening capability provider for the Widget client. In this regard, further specific may be:
since numerous openness providers may be registered on the Widget server, the Widget server can know what openness needs to be called by the Widget client according to the content included in the calling parameter, and thus the Widget server can select the openness provider meeting the openness calling requirement from the numerous openness providers.
Preferably, the Widget server may further perform real-time monitoring on the registered openness providers to obtain the operating states of the respective openness providers, and select a suitable openness provider for the Widget client from the openness providers with good operating states. As exemplified above, if the monitoring result indicates that the operation status of the telecommunications carrier 1 is good in the telecommunications carrier 1, the telecommunications carrier 2, the internet service provider and the home network, the telecommunications carrier 1 is selected for data or service acquisition.
Then, the Widget server determines what data or service the Widget client wants to obtain according to the Widget service identification information included in the invocation parameter, and the Widget server needs to send a specific request message including the message to the selected openness capability provider.
Step 206: and the opening capability provider provides corresponding data or service to the Widget server according to the request message sent by the Widget server.
Step 207: the Widget server receives data or service provided by the open capability provider and performs adaptation conversion on the data.
In step 207, since the communication protocols and data frame formats used by the Widget client and the openness provider may be different, the data or services acquired from the openness provider may not be directly used by the Widget, and the Widget server is further required to perform corresponding conversion on the data or services, so that the data or services can be normally received and displayed by the Widget client.
In addition, if the Widget client further specifies a result format expected to be returned in the call parameter, the Widget server also needs to perform corresponding conversion on the received data or service according to a format specified in advance.
Step 208: and the Widget server sends the data or service subjected to the adaptation conversion to the Widget terminal.
The data sent by the Widget server to the Widget terminal is subjected to adaptation conversion and conforms to various standards of the Widget client, so that the Widget client can directly use and display the result after receiving the data or service.
The method for using the network open capability provided by the embodiment of the invention has the advantages that the Widget server encapsulates and develops the open capability of the open capability provider to generate the Widget file comprising the specific identifier, when the Widget client downloads the file for use, the Widget client only needs to analyze the specific identifier contained in the file, and sends the calling request comprising the specific identifier to the Widget server, so that the Widget server can request corresponding data or service from the open capability provider for the Widget client according to the calling request. According to the technical scheme provided by the embodiment of the invention, the opening capacity of the opening capacity provider is encapsulated, so that a Widget user can use a plurality of opening capacities without knowing the service logic of the opening capacity provider.
Correspondingly, an embodiment of the present invention further provides a system for using network openness capability, where the system structure is shown in fig. 3, and includes: a Widget server 301, a Widget client 302, and an open capability provider 303, wherein,
the Widget server 301 is configured to encapsulate the opening capability of the opening capability provider 303 and develop and generate a Widget file including the specific identifier.
The Widget client 302 is configured to download the Widget file including the specific identifier from the Widget server 301; and analyzing and constructing the Widget file to generate a call request for the opening capability of the opening capability provider 303, wherein the call request carries the specific identifier, and sending the call request to the Widget server 301.
In this embodiment, the Widget server 301 is further configured to receive a call request for the opening capability of the opening capability provider 303, where the call request is sent by the Widget client 302.
In this embodiment, the Widget server 301 is further configured to parse the invocation request to obtain an invocation parameter including the specific identifier, and obtain corresponding data information or service from the corresponding open capability provider 303 according to the invocation parameter;
in this embodiment, the Widget server 301 is further configured to perform adaptation conversion on the received data information or service and return the data information or service to the Widget client 302.
The network open capability using system provided by the embodiment of the invention encapsulates and develops the open capability of the open capability provider through the Widget server to generate the Widget file comprising the specific identifier, when the Widget client downloads the file for use, the Widget client only needs to analyze the Widget file, and sends the calling request comprising the specific identifier to the Widget server, so that the Widget server can request corresponding data or service from the open capability provider for the Widget client according to the calling request. According to the technical scheme provided by the embodiment of the invention, the opening capacity of the opening capacity provider is encapsulated, so that a Widget user can use a plurality of opening capacities without knowing the service logic of the opening capacity provider.
Further, an embodiment of the present invention further provides a Widget server, where a specific structure of the server is shown in fig. 4, and the server mainly includes:
a package development unit 401, configured to package the opening capability of the opening capability provider and develop and generate a Widget file including a specific identifier;
a receiving unit 402, configured to receive a call request for the opening capability of the opening capability provider, where the call request is generated by the Widget client parsing and constructing the Widget file, and the call request carries the specific identifier;
an obtaining unit 403, configured to obtain corresponding data information or service from the openness provider according to the call request carrying the specific identifier;
an adaptation conversion unit 404, configured to perform adaptation conversion on the data information or service received by the obtaining unit 403;
a sending unit 405, configured to send the data information or service subjected to the adaptation conversion to the Widget client.
The obtaining unit 403 is further configured to parse the invocation request to obtain an invocation parameter including the specific identifier, and obtain corresponding data information or service from the open capability provider according to the invocation parameter including the specific identifier, and may further include a structure as shown in fig. 5:
an analyzing subunit 501, configured to analyze the call request to obtain a call parameter including the specific identifier;
a sending subunit 502, configured to send data information or a service request message to a corresponding openness capability provider according to the call parameter including the specific identifier;
a receiving subunit 503, configured to receive the data information or the service sent by the corresponding openability provider.
The Widget server provided by the embodiment of the invention encapsulates the opening capability of the opening capability provider and develops and generates a Widget file comprising a specific identifier, and when the Widget client downloads and uses the file, the Widget server requests the opening capability provider for corresponding data information or service for the Widget client by receiving a calling request comprising the specific identifier sent by the Widget client according to the calling request. According to the technical scheme provided by the embodiment of the invention, the opening capacity of the opening capacity provider is encapsulated, so that a Widget user can use a plurality of opening capacities without knowing the service logic of the opening capacity provider.
Those of ordinary skill in the art will understand that: all or part of the steps for implementing the method embodiments may be implemented by hardware related to program instructions, and the program may be stored in a computer readable storage medium, and when executed, the program performs the steps including the method embodiments; and the aforementioned storage medium includes: various media capable of storing program codes, such as ROM (Read-Only Memory), RAM (random access Memory), magnetic disk, and optical disk.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.