Summary of the invention
In view of this, the embodiment of the invention provides a kind of network opening ability method for using, system and device, just can realize the use to numerous open ability to realize the service logic that Widget user need not to understand the open ability provider.
The embodiment of the invention is achieved in that
The embodiment of the invention provides a kind of network opening ability method for using, comprising:
Receive the call request that the Widget client is sent to open ability provider open ability; Said call request is encapsulated and develops the open ability of downloading to said open ability provider by said Widget client and generates the Widget file that comprises specific identifier and resolve structure and generate, and carries said specific identifier in the said call request;
Obtain corresponding data message or service according to the call request of carrying said specific identifier from said open ability provider;
Said data message that receives or service are carried out adaptive conversion and be back to said Widget client.
Said said data message that receives or service are carried out protocol conversion and/or data transaction.
The embodiment of the invention provides a kind of network opening ability using system, comprising: Widget server, Widget client and open ability provider, wherein,
Said Widget server is used for open ability provider's open ability is encapsulated and develop the Widget file that generation comprises specific identifier, supplies the Widget client to download; It specifically comprises:
Receiving element; Be used to receive the call request that said Widget client is sent to said open ability provider's open ability; Said call request is generated said Widget document analysis structure by said Widget client, carries said specific identifier in the said call request;
Acquiring unit is used for obtaining corresponding data message or service according to the call request of carrying said specific identifier from said open ability provider;
Adaptive converting unit is used for said data message or service are carried out adaptive conversion;
Transmitting element is used for data message or the service carried out after the adaptive conversion are sent to said Widget client;
Said Widget client is used to download the said Widget file that comprises specific identifier, and said Widget document analysis structure is generated the call request to said open ability provider's open ability, carries said specific identifier in the said call request.
The embodiment of the invention also provides a kind of Widget server, and said Widget server encapsulates the Widget file that the exploitation generation comprises specific identifier to open ability provider's open ability, supplies the Widget client to download, and comprising:
Receiving element; Be used to receive the call request that said Widget client is sent to said open ability provider's open ability; Said call request is generated said Widget document analysis structure by said Widget client, carries said specific identifier in the said call request;
Acquiring unit is used for obtaining corresponding data message or service according to the call request of carrying said specific identifier from said open ability provider;
Adaptive converting unit is used for said data message or service are carried out adaptive conversion;
Transmitting element is used for data message or the service carried out after the adaptive conversion are sent to said Widget client.
The embodiment of the invention encapsulates exploitation through the Widget server to open ability provider's open ability and generates the Widget file that comprises specific identifier; When the Widget client is downloaded the back use with this document; The Widget client only needs the Widget file is resolved; And through sending the call request that comprises this specific identifier to the Widget server, making the Widget server can be that the Widget client is asked corresponding data or service to the open ability provider according to the call request of this said specific identifier.The technical scheme that the embodiment of the invention provided has been owing to carried out the packetized processing to open ability provider's open ability, and the service logic that makes Widget user need not to understand the open ability provider just can realize the use to numerous open ability.
Embodiment
To combine the accompanying drawing in the embodiment of the invention below, the technical scheme in the embodiment of the invention is carried out clear, intactly description, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills are not making the every other embodiment that is obtained under the creative work prerequisite, all belong to the scope of the present invention's protection.
The embodiment of the invention provides a kind of network opening ability method for using; This method comprises: encapsulate and develop the Widget file that generation comprises specific identifier in the open ability to the open ability provider; And after downloading by the Widget client; Concrete method for using is as shown in Figure 1, comprising:
S101: receive the call request that said Widget client is sent to open ability provider open ability; Said call request is encapsulated and develops the open ability of downloading to the open ability provider by said Widget client and generates the Widget file that comprises specific identifier and resolve structure and generate, and carries said specific identifier in the said call request;
S102: resolve said call request and obtain the call parameters that comprises said specific identifier;
S103: obtain corresponding data message or service from corresponding open ability provider according to said call parameters; In the present embodiment, this step be appreciated that for: send data message or service request information according to said call parameters to corresponding open ability provider; Receive data message or service that said corresponding open ability provider sends.
S104: said data message that will receive or service are carried out adaptive conversion and are back to said Widget client.
A kind of network opening ability method for using that the embodiment of the invention provided; Through the Widget server open ability provider's open ability is encapsulated exploitation and generate the Widget file that comprises specific identifier; When the Widget client is downloaded the back use with this document; The Widget client only needs the Widget file is resolved; And through sending the call request that comprises this specific identifier to the Widget server, making the Widget server can be that the Widget client is asked corresponding data or service to the open ability provider according to this call request.The technical scheme that the embodiment of the invention provided has been owing to carried out the packetized processing to open ability provider's open ability, and the service logic that makes Widget user need not to understand the open ability provider just can realize the use to numerous open ability.
The embodiment of the invention provides another kind of network opening ability method for using; Before the use of carrying out open ability; The Widget server at first will encapsulate open ability provider's open ability; And the open ability provider after the encapsulation developed generate the Widget file comprise specific identifier, issue to the Widget client being used for.
Need to prove; Before the Widget server encapsulates open ability provider's open ability; At first need obtain these open ability information, can obtain through dual mode here: first kind, the Widget server obtains through the mode that initiatively grasps to the network; Second kind, open ability provider initiatively registers on the Widget server.And in follow-up operating process, can adopt identical encapsulation development approach to the open ability that dual mode obtains.
For example, can adopt following method that open ability provider's open ability is encapsulated exploitation:
The encapsulation of URL/ access code mode, this mode is mainly used in open ability providers such as Mashup, value-added telecom services.For example: between certain select-elite class match period, the service provider has developed the value-added service of a short message on existing mobile value-added service platform, be used for the televiewer and send the players that the SMS support is liked oneself.And if this moment, the service provider came out this professional ability opening of oneself; Allow Widget developer to carry out secondary development on this basis; Make this value-added service that unique access code externally is provided; And this access code offered the Widget client, thereby operation this when professional, the value-added telecom services platform can identify correspondent service logic through this access code.Through above-mentioned encapsulation development process, describe the professional Widget file of this ballot and comprise following code:
The encapsulation of label mode, this mode are mainly used in the Widget server and are initiatively grabbing to such an extent that open ability perhaps initiatively is registered to the open ability provider on the Widget server on the network.Adopt this mode that open ability provider's business is encapsulated exploitation, normally after encapsulating, the Widget server provides the html tag of some expansions to the developer, and the developer can carry out the exploitation of html page according to these html tags.
JavaScript object mode; The range of application of this mode is basic identical with the range of application of label mode, also is to be applied to the Widget server initiatively grabbing to such an extent that open ability perhaps initiatively is registered to the open ability provider on the Widget server on the network.Adopt this mode that open ability provider's business is encapsulated exploitation, normally after encapsulating, the Widget server provides the JavaScript object of some expansions to the developer, and the developer can develop according to these JavaScript.
Need to prove that a kind of network opening ability method for using that the embodiment of the invention provided when the open ability to the open ability provider encapsulates, can not consider whether these open ability provider is in the consolidated network.For example: related interface, logic and the data format of the messaging service ability that different operators provides under the communication network possibly have difference; But when the open ability to these open ability provider encapsulates; As long as different specific identifiers is provided, and externally do unified simplification encapsulation and unified adaptive management for different open ability providers.Above-mentioned situation is exemplified below: suppose the open ability of data TV under telecom operators 1, telecom operators 2, Internet service provider and the home network has been carried out unified encapsulation at present; So in encapsulation process; Need, adopt JavaScript object mode that it is encapsulated here for each open ability provider sets a specific identifier; Can be expressed as: Message (Tosomebody, content).Service logic after the encapsulation can be represented as follows:
if(Tosomebody.mobilePhone1=online)
The information series business logic of telecom operators 1
elseif(Tosomebody.mobilePhone2=online)
The information series business logic of telecom operators 2
elseif(Tosomebody.IM=online)
The information series business logic of Internet service provider
elseif(Tosomebody.TV=online)
The information series business logic of DTV under the home network
After above-mentioned encapsulation, exploitation; Associated documents are packaged as a compressed file, afterwards, change this compressed file into specific file type that Widget can discern again; The file of * .wgt, * .widget form for example, and final issue is used for user's download.
After finishing, carry out step as shown in Figure 2 to the encapsulation of open ability provider's open ability and Widget file that generation comprises specific identifier:
The Widget file that step 201:Widget client will be passed through the encapsulation exploitation is downloaded to this locality, to carry out the Widget related service.
In step 201, client is downloaded the Widget file through the encapsulation exploitation from network, and operation this document, and gets into step 202.
Step 202:Widget client is resolved structure to the Widget file of downloading and is generated the call request to open ability provider open ability.
In step 202, according to noted earlier three kinds the encapsulation development approaches, the Widget client the Widget file is resolved the time, also can correspondingly run into condition of different:
If in the encapsulation development phase; What adopt is URL/ access code mode; Then this Widget file is when the Widget client is resolved, and client can run into involved URL/ access code in the encapsulation development process in resolving, at this moment; The Widget client need with this URL/ access code add in the call request that will construct to open ability provider open ability, be used to indicate the user need call which kind of open ability.Simultaneously, also to comprise the relevant parameters such as identification information that Widget is professional in the call request of the open ability of structure, be used to show that the user need obtain which kind of data or business from the open ability provider.Further in detail, concrete parameter included in the call request of open ability can be with reference to table 1.
Table 1
In addition, need to prove that generally, this open ability call request is the call request of unified ability package interface, and should ask generally based on HTTP.
Step 203:Widget client will be sent to the Widget server to the call request of open ability.
Call parameters is wherein resolved and obtained to step 204:Widget server to the call request of open ability.
In step 204, the Widget server is resolved this request after the open ability call request that receives the transmission of Widget client, obtains relevant parameter included in this request, the parameters that example is as shown in table 1.
Step 205:Widget server sends data or service request information according to the call parameters of obtaining to corresponding open ability provider.
In step 205, the Widget server can confirm which kind of open ability is the Widget client need call according to comprising content of parameter in the call parameters after obtaining call parameters, and is the suitable open ability provider of Widget client selection.About this point, can further be specially:
Owing to possibly register numerous open ability providers on the Widget server; The Widget server can be according to content included in the call parameters; Know which kind of open ability is the Widget client need call, thereby the Widget server can select to satisfy the open ability provider that open ability is called requirement from numerous open ability providers.
Under the preferable case; The Widget server also can be monitored registration open ability provider on it in real time; Obtaining each open ability provider's running status, and be that the Widget client is selected suitable open ability provider from the good open ability provider of running status.It is sub to give an example like the front, if in telecom operators 1, telecom operators 2, Internet service provider and home network, 1 running status is good if monitored results shows telecom operators, then chooses telecom operators 1 and carries out obtaining of data or service.
Afterwards; The Widget server is according to Widget service identification information included in the call parameters; Confirm that the Widget client hopes to obtain which type of data or service, then the Widget server needs to comprise that the particular request message of this message sends to selected open ability provider.
Step 206: open ability provider provides corresponding data or service according to the request message that the Widget server sends to the Widget server.
Step 207:Widget server receives data or the service that the open ability provider provides, and these data are carried out adaptive conversion.
In step 207; Because the communication protocol that Widget client and open ability provider are adopted, data frame format etc. are all possible different; Therefore; Can not directly be used by Widget institute from data that the open ability provider obtained or service, also need the Widget server that these data or service are carried out corresponding conversion, being received and show by the Widget client is normal.
In addition, if the form as a result that the Widget client has also specified expectation to return in call parameters, then the Widget server also need carry out corresponding conversion to the data or the service that receive according to the form of prior appointment.
Step 208:Widget server will carry out adaptive data converted or service is sent to the Widget terminal.
Because the Widget server has passed through adaptive conversion to the data that send at the Widget terminal, has met each item standard of Widget client, so the Widget client can directly be used and display result after receiving these data or service.
A kind of network opening ability method for using that the embodiment of the invention provided; Through the Widget server open ability provider's open ability is encapsulated exploitation and generate the Widget file that comprises specific identifier; When the Widget client is downloaded the back use with this document; The Widget client only need parse comprising specific identifier; And through sending the call request that comprises this specific identifier to the Widget server, making the Widget server can be that the Widget client is asked corresponding data or service to the open ability provider according to this call request.The technical scheme that the embodiment of the invention provided has been owing to carried out the packetized processing to open ability provider's open ability, and the service logic that makes Widget user need not to understand the open ability provider just can realize the use to numerous open ability.
Correspondingly, the embodiment of the invention also provides a kind of network opening ability using system, and this system configuration is as shown in Figure 3, comprising: Widget server 301, Widget client 302 and open ability provider 303, wherein,
Widget server 301 is used for open ability provider 303 open ability is encapsulated and develop the Widget file that generation comprises specific identifier.
Widget client 302 is used for downloading the said Widget file that comprises specific identifier from Widget server 301; Said Widget document analysis structure is generated the call request to said open ability provider's 303 open ability, carry said specific identifier in the said call request, and said call request is sent to Widget server 301.
In the present embodiment, Widget server 301 also is used to receive the call request to said open ability provider's 303 open ability that Widget client 302 is sent.
In the present embodiment, Widget server 301 also is used to resolve said call request obtaining the call parameters that comprises said specific identifier, and obtains corresponding data message or service according to said call parameters from corresponding open ability provider 303;
In the present embodiment, Widget server 301 also is used for said data message that receives or service are carried out adaptive conversion and be back to said Widget client 302.
A kind of network opening ability using system that the embodiment of the invention provided; Through the Widget server open ability provider's open ability is encapsulated exploitation and generate the Widget file that comprises specific identifier; When the Widget client is downloaded the back use with this document; The Widget client only needs the Widget file is resolved; And through sending the call request that comprises this specific identifier to the Widget server, making the Widget server can be that the Widget client is asked corresponding data or service to the open ability provider according to this call request.The technical scheme that the embodiment of the invention provided has been owing to carried out the packetized processing to open ability provider's open ability, and the service logic that makes Widget user need not to understand the open ability provider just can realize the use to numerous open ability.
Further, the embodiment of the invention also provides a kind of Widget server, and this server concrete structure is as shown in Figure 4, mainly comprises:
Encapsulation development block 401 is used for open ability provider's open ability is encapsulated and develop the Widget file that generation comprises specific identifier;
Receiving element 402; Be used to receive the call request that the Widget client is sent to said open ability provider's open ability; Said call request is generated said Widget document analysis structure by said Widget client, carries said specific identifier in the said call request;
Acquiring unit 403 is used for obtaining corresponding data message or service according to the call request of carrying said specific identifier from said open ability provider;
Adaptive converting unit 404, adaptive conversion is carried out in the said data message or the service that are used for acquiring unit 403 is received;
Transmitting element 405 is used for data message or the service carried out after the adaptive conversion are sent to said Widget client.
Wherein, Also be used to resolve said call request for acquiring unit 403 and obtain the call parameters that comprises said specific identifier; Obtain corresponding data message or service according to the said call parameters of said specific identifier that comprises from said open ability provider, also can further comprise structure as shown in Figure 5:
Resolve subelement 501, be used to resolve said call request and obtain the call parameters that comprises said specific identifier;
Send subelement 502, be used for sending data message or service request information to corresponding open ability provider according to the said call parameters of said specific identifier that comprises;
Receive subelement 503, be used to receive data message or the service that said corresponding open ability provider sends.
A kind of Widget server that the embodiment of the invention provided; This Widget server encapsulates and develops the Widget file that generation comprises specific identifier with open ability provider's open ability; When this document being downloaded the back use by the Widget client; This Widget server is through receiving the call request that comprises said specific identifier that the Widget client is sent, and is that the Widget client is asked corresponding data information or service to the open ability provider according to this call request.The technical scheme that the embodiment of the invention provided has been owing to carried out the packetized processing to open ability provider's open ability, and the service logic that makes Widget user need not to understand the open ability provider just can realize the use to numerous open ability.
One of ordinary skill in the art will appreciate that: all or part of step that realizes said method embodiment can be accomplished through the relevant hardware of program command; Aforesaid program can be stored in the computer read/write memory medium; This program the step that comprises said method embodiment when carrying out; And aforesaid storage medium comprises: various media that can be program code stored such as ROM (Read-Only Memory, read-only storage memory body), RAM (Random Access Memory stores memory body at random), magnetic disc or CD.
To the above-mentioned explanation of the disclosed embodiments, make this area professional and technical personnel can realize or use the present invention.Multiple modification to these embodiment will be conspicuous concerning those skilled in the art, and defined General Principle can realize under the situation that does not break away from the spirit or scope of the present invention in other embodiments among this paper.Therefore, the present invention will can not be restricted to these embodiment shown in this paper, but will meet and principle disclosed herein and features of novelty the wideest corresponding to scope.