Summary of the invention
The main technical problem to be solved in the present invention is, method of data synchronization and system in a kind of interactive television are provided, the data sync in can be the faster more stable realization interactive television.
For solving the problems of the technologies described above, the present invention has adopted following technical scheme:
Method of data synchronization in a kind of interactive television comprises:
Set up index server, resource allocation provides the resource index information of equipment on described index server;
Provide the resource change on the equipment to upgrade described resource index information synchronously according to described resource.
In a kind of embodiment of the method for the invention, described resource index information comprises that described resource provides the resource index file of equipment, and perhaps described resource provides the index of the resource index file of equipment.
In a kind of embodiment of the method for the invention, provide the described resource index information of the synchronous renewal of resource change on the equipment to comprise according to described resource: resource index file and the change of monitoring own resource that resource provides equipment to generate the index own resource, and when resource changes, upgrade described resource index file and pass to described index server.
In a kind of embodiment of the method for the invention,, then detect the resource that this carries out content update behind the delay predetermined time again when described resource changes to resource content when upgrading.
In a kind of embodiment of the method for the invention, described resource provides equipment to comprise resource providing server and client node.
In a kind of embodiment of the method for the invention, described resource comprises the electronic program list data.
The present invention also provides the data synchronous system in a kind of interactive television, comprise: dispose the resource index information index server that resource provides equipment, described index server is used for providing the resource change on the equipment to upgrade described resource index information synchronously according to described resource.
In a kind of embodiment of system of the present invention, described resource provides equipment to comprise resource providing server and client node.
The present invention also provides a kind of method of utilizing above-mentioned data synchronous system to realize data sync, comprising:
Client is to index server request resource index information;
Client provides the device request resource to the resource at the resource index information place that index server returns.
In a kind of embodiment of said method, resource index information comprises that described resource provides the resource index file of equipment, and perhaps described resource provides the index of the resource index file of equipment.
In a kind of embodiment of said method, client provides the device request resource to comprise according to the resource index information that index server returns to the resource of correspondence:
Client is to index server request resource index file;
Client provides device request resource index file to the resource at the resource index file place that index server returns;
Client provides the device request resource according to the resource index file that described resource provides equipment to return to resource.
The present invention provides the resource index information of equipment and can provide the resource change of equipment to upgrade resource index information synchronously according to resource with resource allocation by setting up index server, thereby can utilize Resource Server to obtain the resource place fast, the data sync in the realization interactive television that can be faster, more stable.
Embodiment
In conjunction with the accompanying drawings the present invention is described in further detail below by embodiment.
Method of data synchronization among the IPTV of the embodiment of the invention mainly is by setting up index server, and resource allocation provides the resource index information of equipment on index server; Then provide the resource change on the equipment to upgrade described resource index information synchronously according to resource.In embodiments of the present invention, resource provides equipment, not only comprises resource providing server, also comprises client node.Resource providing server and client node can be one or more.
Fig. 1 has showed the data synchronous system according to the method for data synchronization structure of the IPTV of the embodiment of the invention, among Fig. 1, it is example with the resource providing server that resource provides equipment, resource providing server comprises management by synchronization server DTS_S_SM and content source server DTS_S_SP, index server DTS_S_RM, being used for resource allocation provides the resource index information of server (DTS_S_SM and DTS_S_SP).Client DTS_C is to index server DTS_S_RM request resource index information; Then the resource to the resource index information place that index server returns provides the device request resource.
Resource index information in this example, comprises that resource provides the resource index file of equipment, and perhaps resource provides the index of the resource index file of equipment.Promptly can be directly on index server resource allocation the resource index file of equipment is provided, also can each resource provide equipment each self-configuring its other resources index file, then, on index server, set up the index of these resource index files.
When utilizing above-mentioned data synchronous system to carry out data sync, client is sent the content search request to index server, the request resource index information, index server response query requests, return resource providing server and the client node tabulation with request content to client, client is to resource providing server or client node request media content.
It should be noted that, client and client node in fact all are clients, client node is other clients outside the client of request content, with " client " and " client node " two notions the two role is distinguished herein.At this, refer to the client of request content with " client ", refer to other clients that resource can be provided to client with " client node ", promptly client both can be to the resource providing server request resource, also can be to the client node request resource.
Providing each self-configuring its other resources index file of equipment with resource below is that example describes.In the example of Fig. 1, resource providing server comprises management by synchronization server DTS_S_SM and content source server DTS_S_SP.Management by synchronization server DTS_S_SM is deployed on the valut of resource providing server, guarantee that the file renewal (comprising file increase, file deletion, up-to-date) on the valut can in time detect, and generate the index file of current monitored directory and then content of announcement source server DTS_S_SP.
Management by synchronization server DTS_S_SM comprises following function:
When A, startup, scanning needs the catalogue of monitoring, and index All Files information generates index file.
B, monitoring assigned catalogue (for example utilizing the mechanism of (SuSE) Linux OS) when the catalogue generation file of being monitored upgrades, produce the index upgrade signal.
C, after the index upgrade signal produces, then start scanning to respective directories, generate new index file.
D, according to the comparison of new and old index, judge that file upgrades (file increase, up-to-date, file deletion etc.), is recorded in the new index file.
When judging that according to new and old index file file upgrades, if up-to-date is arranged, when newly-increased file is perhaps arranged, need scanning once more that the catalogue of upgrading takes place, the file of renewal is arranged at those, if file size is consistent when scanning with the last time, decidable file does not for this reason upgrade, if file size changes, shows that file content upgrades, then need delay predetermined time to rescan, so that judge the file that upgrades whether finish by update all.
Content source server DTS_S_SP resolves index file, and at the content in the index file, notifies index server one by one, and sets up the index of index file on index server, and the synchronous renewal of carrying out resource index information.
Resource provides the equipment can be to the segmentation of all content requests, and burst provides correct file content response, promptly comprise the providing of index file, and providing each medium content file described in the index file.
When new client terminal start-up,, and report self state, resource information at first to index server login, registration.So that in index server, set up corresponding resource index information,, carry out resource and provide thereby client can be used as client node by index server unified management client.Resource provides, mainly be meant the content file that the media content that contains client-requested is provided for client, client can obtain various content files from resource providing server or client node, if and renewal has taken place in the content file of resource providing server or client node, the resource change has also promptly taken place, then client also can be carried out the renewal of content file by the login index server, client can be at first to index server request index file, after the renewal of index file affirmation content file, ask the content file of renewal again, the main flow process of client login index server request content comprises:
A, client login;
B, client are to the up-to-date index file of index server query requests;
C, index server return the resource providing server of the index file that existence asks and the address list of client node to client;
D, client send the request index messages to the resource providing server or the client node of the index file that has request;
E, resource providing server or client node return the index file of request to client;
F, client are obtained after the index file, resolve index file.
G, client are asked the content file that upgrades according to index file.
Further may further comprise the steps among the step G:
G1, client are to index server query requests content file;
G2, index server return the resource providing server of the content file that existence asks or the address list of client node;
G3, client send request content message to the resource providing server or the client node of the content file that has request;
G4, resource providing server or client node return the content file of request to client.
As shown in Figure 2, resource providing server is set up the process of index on index server, and its detailed implementation step is as follows:
1, DTS_S_SM generates index file, when receiving the file update signal, carries out index file and upgrades.
2, DTS_S_SM detects file increases, and behind deletion or the content update, according to old index file, generates new file index tabulation, and deposits in the new index file.
3, DTS_S_SM notice DTS_S_SP reaches the standard grade.
4, DTS_S_SP resolves the new index file that generates in step 2, and the legitimacy of each file in the checking index file, at each file wherein, send message to DTS_S_RM, each file in the notice index file is reached the standard grade, and also promptly illustrates that to index server each file of index file index can provide service.
5, index server DTS_S_RM receives the message that DTS_S_SP sends, and sets up index in internal memory, so that correct return results during client-requested, the while is returned acknowledge message to DTS_S_SP.
6, the DTS_S_SP message that will comprise index file name sends to index server DTS_S_RM, builds up index at index file on index server DTS_S_RM.
7, similarly, provide EPG, the placard of equipment for other resources, information such as emergency data adopt above-mentioned steps, and DTS_S_RM builds up index at index server.
After building up index on the index server DTS_S_RM, the content file of index file index then can provide service to client, for resource providing server, its DTS_S_SP is when being distributed to client to content file, and it is consistent providing the mode of data with other client nodes.
The present invention is by setting up index server, and correspondingly provides the resource change of equipment to carry out the synchronous renewal of resource index information with resource, can faster, more stably realize the data sync among the IPTV.
Above content be in conjunction with concrete execution mode to further describing that the present invention did, can not assert that concrete enforcement of the present invention is confined to these explanations.For the general technical staff of the technical field of the invention, without departing from the inventive concept of the premise, can also make some simple deduction or replace, all should be considered as belonging to protection scope of the present invention.