Summary of the invention
In view of this, the embodiment of the invention provides a kind of network opening ability using method, system and device, just can realize the use to numerous open ability to realize 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 using method, comprising:
Receive the call request that described Widget client sends to open ability provider open ability, described call request is encapsulated and develops the open ability of downloading to described open ability provider by described Widget client and generates the Widget file that comprises specific identifier and resolve structure and generate, and carries described specific identifier in the described call request;
Obtain corresponding data message or service according to the call request of carrying described specific identifier from described open ability provider;
The described data message or the service that receive are carried out adaptive conversion and be back to described Widget client.
The embodiment of the invention provides a kind of network opening ability using system, comprising: Widget server, Widget client and open ability provider, wherein,
Described Widget server is used for open ability provider's open ability is encapsulated and develop the Widget file that generation comprises specific identifier;
Described Widget client is used to download the described Widget file that comprises specific identifier, to the call request of described Widget document analysis structure generation to described open ability provider's open ability, carries described specific identifier in the described call request;
Wherein, described Widget server also is used to receive the described call request that described Widget client sends, obtain corresponding data message or service according to the call request of carrying described specific identifier from described open ability provider, the described data message or the service that receive are carried out adaptive conversion and be back to described Widget client.
The embodiment of the invention also provides a kind of Widget server, and described Widget server encapsulates the Widget file that the exploitation generation comprises specific identifier to open ability provider's open ability, downloads for the Widget client, comprising:
Receiving element, be used to receive the call request that described Widget client sends to described open ability provider's open ability, described call request is generated described Widget document analysis structure by described Widget client, carries described specific identifier in the described call request;
Acquiring unit is used for obtaining corresponding data message or service according to the call request of carrying described specific identifier from described open ability provider;
Adaptive converting unit is used for described data message or service are carried out adaptive conversion;
Transmitting element, the data message or the service that are used for carrying out after the adaptive conversion are sent to described Widget client.
The embodiment of the invention encapsulates exploitation by 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 by 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 described specific identifier.The technical scheme that the embodiment of the invention provided has been owing to carried out the encapsulationization 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
Below in conjunction with the accompanying drawing in the embodiment of the invention, the technical scheme in the embodiment of the invention is clearly and completely described, 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 belong to the scope of protection of the invention not making the every other embodiment that is obtained under the creative work prerequisite.
The embodiment of the invention provides a kind of network opening ability using method, 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 using method comprises as shown in Figure 1:
S101: receive the call request that described Widget client sends to open ability provider open ability, described call request is encapsulated and develops the open ability of downloading to the open ability provider by described Widget client and generates the Widget file that comprises specific identifier and resolve structure and generate, and carries described specific identifier in the described call request;
S102: resolve described call request and obtain the call parameters that comprises described specific identifier;
S103: obtain corresponding data message or service from corresponding open ability provider according to described call parameters; In the present embodiment, this step can be understood as: send data message or service request information according to described call parameters to corresponding open ability provider; Receive data message or service that described corresponding open ability provider sends.
S104: described data message that will receive or service are carried out adaptive conversion and are back to described Widget client.
A kind of network opening ability using method that the embodiment of the invention provided, by 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 by 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 encapsulationization 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 using method, 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 to obtain these open ability information, can obtain by dual mode here: first kind, the Widget server obtains by 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 by this access code.Through above-mentioned encapsulation development process, describe the professional Widget file of this ballot and comprise following code:
<html>
<head?tile=“Poll?Widget″/>
<body>
<label value=" player's numbering: "/〉<input type=" text " name=" input1 "/
<label value=" message content: "/〉<input type=" text " name=" input2 "/
<input type=" hidden " name=" SPcode " value=" SP access code * * * "/
<input type=" submit " value=" transmission "
onclick=″f(input1.value,input2.value,SPcode.value)″/>
</body>
</html>
The encapsulation of label mode, this mode be mainly used in the Widget server initiatively grab on the network open ability or initiatively be registered to open ability provider on the Widget server.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 be applied to the Widget server initiatively grab on the network open ability or initiatively be registered to open ability provider on the Widget server.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 using method 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 may have difference, but when the open ability to these open ability provider encapsulates, as long as for different open ability providers provides different specific identifiers, and externally do unified simplification encapsulation and unified adaptive management.Now 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, so in encapsulation process, need set a specific identifier for each open ability provider, herein, adopt JavaScript object mode that it is encapsulated, can be expressed as: Message (Tosomebody, content).Service logic after the encapsulation can be carried out following expression:
if(Tosomebody.mobilePhone?1=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 Digital Television under the home network
After above-mentioned encapsulation, exploitation, associated documents are packaged as a compressed file, afterwards, again this compressed file are changed into the specific file type that Widget can discern, 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:
Step 201:Widget client will be downloaded to this locality through the Widget file of encapsulation exploitation, to carry out the Widget related service.
In step 201, client is downloaded the Widget file of developing through encapsulation from network, and operation this document, and enters step 202.
Step 202:Widget client is resolved the call request of structure generation to open ability provider open ability to the Widget file of downloading.
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 different situations:
If in the encapsulation development phase, what adopt is URL/ access code mode, then this Widget file is when the Widget client is resolved, client can run into involved URL/ access code in the encapsulation development process in resolving, at this moment, the Widget client needs this URL/ access code is added in the call request to open ability provider open ability that will construct, is used to indicate the user need call which kind of open ability.Simultaneously, also to comprise the relevant parameters such as identification information of Widget business 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.
Wherein call parameters is 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 determine 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 may 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 in real time to registration open ability provider thereon, 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.As the front given example, 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, determine that the Widget client wishes to obtain which type of data or service, then the Widget server needs to comprise that the specific 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. all may be different, therefore, can not directly be used by Widget institute from data or service that the open ability provider obtained, also need the Widget server that these data or service are carried out corresponding conversion, can and showing by the normal reception of Widget client.
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 the Widget terminal sends, and has met every 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 using method that the embodiment of the invention provided, by 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 by 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 encapsulationization 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 comprises as shown in Figure 3: 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 described Widget file that comprises specific identifier from Widget server 301; To the call request of described Widget document analysis structure generation, carry described specific identifier in the described call request, and described call request is sent to Widget server 301 described open ability provider's 303 open ability.
In the present embodiment, Widget server 301 also is used to receive the call request to described open ability provider's 303 open ability that Widget client 302 sends.
In the present embodiment, Widget server 301 also is used to resolve described call request obtaining the call parameters that comprises described specific identifier, and obtains corresponding data message or service according to described call parameters from corresponding open ability provider 303;
In the present embodiment, the Widget server 301 described data message or the service that also are used for receiving carried out adaptive conversion and is back to described Widget client 302.
A kind of network opening ability using system that the embodiment of the invention provided, by 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 by 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 encapsulationization 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 mainly comprises as shown in Figure 4:
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 sends to described open ability provider's open ability, described call request is generated described Widget document analysis structure by described Widget client, carries described specific identifier in the described call request;
Acquiring unit 403 is used for obtaining corresponding data message or service according to the call request of carrying described specific identifier from described open ability provider;
Adaptive converting unit 404, adaptive conversion is carried out in the described data message or the service that are used for acquiring unit 403 is received;
Transmitting element 405, the data message or the service that are used for carrying out after the adaptive conversion are sent to described Widget client.
Wherein, also be used to resolve described call request for acquiring unit 403 and obtain the call parameters that comprises described specific identifier, obtain corresponding data message or service according to the described call parameters of described specific identifier that comprises from described open ability provider, also can further comprise structure as shown in Figure 5:
Resolve subelement 501, be used to resolve described call request and obtain the call parameters that comprises described specific identifier;
Send subelement 502, be used for sending data message or service request information to corresponding open ability provider according to the described call parameters of described specific identifier that comprises;
Receive subelement 503, be used to receive data message or the service that described 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 by receiving the call request that comprises described specific identifier that the Widget client sends, 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 encapsulationization 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 finished by the relevant hardware of program command, aforesaid program can be stored in the computer read/write memory medium, this program is carried out 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 (RandomAccess 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 herein General Principle can realize under the situation that does not break away from the spirit or scope of the present invention in other embodiments.Therefore, the present invention will can not be restricted to these embodiment shown in this article, but will meet and principle disclosed herein and features of novelty the wideest corresponding to scope.