CN110856029B - Method and system for synchronizing local area network set top box resources - Google Patents
Method and system for synchronizing local area network set top box resources Download PDFInfo
- Publication number
- CN110856029B CN110856029B CN201910986380.3A CN201910986380A CN110856029B CN 110856029 B CN110856029 B CN 110856029B CN 201910986380 A CN201910986380 A CN 201910986380A CN 110856029 B CN110856029 B CN 110856029B
- Authority
- CN
- China
- Prior art keywords
- top box
- identification information
- set top
- area network
- local area
- Prior art date
- Legal status (The legal status 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 status listed.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
- H04N21/4302—Content synchronisation processes, e.g. decoder synchronisation
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
- H04N21/436—Interfacing a local distribution network, e.g. communicating with another STB or one or more peripheral devices inside the home
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/60—Network structure or processes for video distribution between server and client or between remote clients; Control signalling between clients, server and network components; Transmission of management data between server and client, e.g. sending from server to client commands for recording incoming content stream; Communication details between server and client
- H04N21/63—Control signaling related to video distribution between client, server and network components; Network processes for video distribution between server and clients or between remote clients, e.g. transmitting basic layer and enhancement layers over different transmission paths, setting up a peer-to-peer communication via Internet between remote STB's; Communication protocols; Addressing
- H04N21/632—Control signaling related to video distribution between client, server and network components; Network processes for video distribution between server and clients or between remote clients, e.g. transmitting basic layer and enhancement layers over different transmission paths, setting up a peer-to-peer communication via Internet between remote STB's; Communication protocols; Addressing using a connection between clients on a wide area network, e.g. setting up a peer-to-peer communication via Internet for retrieving video segments from the hard-disk of other client devices
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The invention provides a method and a system for synchronizing local area network set-top box resources, wherein the method comprises the following steps: the method comprises the steps that a first set top box device to be synchronized in a local area network is subjected to power-on self-test, data resources in a memory of the first set top box device are traversed, and effective data resource information is generated; the first set top box device broadcasts a synchronization protocol to other set top box devices in the local area network; and the second set-top box equipment in the local area network receives the synchronization protocol, extracts the effective data identification information in the effective data resource information, stores the effective data identification information into the memory set, and establishes a mutual mapping relation with the first set-top box equipment identification information to synchronize the local area network set-top box resources. The problem that the set top box resource synchronization in the local area network is abnormal or cannot be synchronized is effectively solved, and the efficiency and the accuracy of the set top box resource synchronization in the local area network are improved.
Description
Technical Field
The invention relates to the technical field of set top box communication, in particular to a method and a system for synchronizing local area network set top box resources.
Background
With the continuous development of communication technology, 3 technical solutions exist in the field of set-top box communication technology. The scheme is a server version, namely, a plurality of set top boxes are connected with a local server, then the local server is connected with a cloud server through a router or a switch, a plurality of hard disks are stored in the local server, and the server and cloud synchronous resources are stored in the hard disks. The set-top box is connected with the server and acquires data resources from the server. In this architecture, the server is the hub of the entire system network, is the resource center of the local star network, and has irreplaceable important roles.
And the second scheme is a single machine version, and a plurality of set top boxes are connected with the cloud server through a router or a switch, directly acquire data resources of the cloud and store the data resources to the local hard disk. In this manner, each set-top box has its own local storage and no longer relies on a central server.
The third scheme is a local area network version, all set-top boxes are connected through a router or a switch, no server exists in one local area network, each box is provided with a hard disk, and the set-top boxes can be used as a single version and can also share data in one local area network.
In the three technical schemes, a server version stores a plurality of hard disks in a local server, and the hard disks are connected with a set top box in a local area network, so that the cost is high. And one server goes wrong, can cause all STB that link to each other with the server to can not normally work, and practicality is poor.
The set-top box with the hard disk in the single version is adopted, the storage space of one hard disk of the set-top box is limited, the requirement of a user cannot be met, and the cost is increased if the hard disk is added, so that the mode has the problem of self.
The local area network version can effectively reduce the use cost and risk, and has more storable resources and good user experience. However, due to the special use environment of the version, the situations that data resources are not synchronized timely or synchronized abnormally due to the problems of damage of some set top boxes, damage of hard disks, active deletion of hard disk songs and the like may occur.
That is, when the local area network is shared by the set-top box resources, the real meaning of the local area network version is not brought into play due to the problems of data synchronization failure caused by equipment uncertainty, hard disk replacement, equipment damage and the like.
In view of the above problems, at present, there is no technical solution that can effectively solve the technical problem.
Disclosure of Invention
The invention provides a method and a system for synchronizing local area network set top box resources, which effectively solve the problem that the synchronization of the local area network set top box resources is abnormal or cannot be synchronized, and improve the efficiency and the accuracy of the local area network set top box resource synchronization.
In one aspect, the present invention provides a method for synchronizing resources of a local area network set top box, including:
step 1, a first set top box device to be synchronized in a local area network is started and self-checked, data resources in a memory of the first set top box device are traversed, and effective data resource information is generated, wherein the effective data resource information comprises effective data identification information and type information of each data resource;
step 2, the first set top box device broadcasts a synchronization protocol to other set top box devices in the local area network, wherein the synchronization protocol comprises identification information of the first set top box device, a current timestamp and the effective data resource information;
step 3, a second set top box device in the local area network receives the synchronization protocol and judges whether the identification information of the first set top box device is in a memory set, wherein the memory set is a set in which the identification information of the set top box device and the identification information of the data resource are mapped with each other;
and 4, when the first set top box equipment identification information does not exist in the memory set, adding the first set top box equipment identification information into the memory set, when the first set top box equipment identification information exists in the memory set, extracting effective data identification information in the effective data resource information, storing the effective data identification information into the memory set, establishing a mutual mapping relation among the first set top box equipment identification information in the memory set, and executing synchronization of local area network set top box resources.
In one embodiment, in step 4, storing the valid data information in the memory set includes:
traversing and comparing the effective data identification information with a data identification information subset corresponding to the first set top box equipment identification information mapping in the memory set;
if the effective data identification information does not belong to the data identification information subset, adding the effective data identification information to the data identification information subset by applying an adding principle, and establishing a mapping relation in the first set top box equipment identification information;
and if the data identification information subset contains a data identification information element which does not belong to the effective data identification information, applying a deleting principle to delete the mapping relation between the data identification information element and the first set top box, judging whether the data identification information element has the mapping relation with the equipment identification information of other set top boxes, and if not, deleting the data identification information element.
In an embodiment, in step 1, the power-on self-test includes detecting conditions of a hard disk and a network, and when the hard disk fails to work normally, determining the first set-top box device as a non-resource sharing mode device, where the non-resource sharing mode is to synchronize only data resources of other set-top box devices in a local area network, and not to synchronize local data resources to other set-top box devices.
In one embodiment, after step 1, the method further comprises: the first set top box device broadcasts a starting protocol and searches for the resource sharing mode device, receives starting feedback information of other set top box devices in the local area network, and generates and stores address identification information of the resource sharing mode device in the feedback information into a list.
In one embodiment, after step 4, the method further comprises: the first set top box device receives synchronous feedback information of all resource sharing mode devices in a local area network and stores the synchronous feedback information into a local memory set, wherein the synchronous feedback information is set top box device identification information and memory set information for sending the synchronous feedback information.
On the other hand, the invention also provides a system for synchronizing the local area network set-top box resources, which comprises the following steps:
the data resource generation module is used for performing power-on self-check on a first set-top box device to be synchronized in a local area network, traversing data resources in a memory of the first set-top box device, and generating effective data resource information, wherein the effective data resource information comprises effective data identification information and type information of each data resource;
the broadcast protocol module is used for broadcasting a synchronization protocol to other set top box equipment in the local area network by the first set top box equipment, wherein the synchronization protocol comprises identification information of the first set top box equipment, a current timestamp and the effective data resource information;
the judgment identification module is used for receiving the synchronization protocol by a second set top box device in the local area network and judging whether the identification information of the first set top box device is in a memory set, wherein the memory set is a set in which the identification information of the set top box device and the identification information of the data resource are mapped with each other;
and the mapping synchronization module is used for adding the first set top box equipment identification information into the memory set when the first set top box equipment identification information does not exist in the memory set, extracting effective data identification information in the effective data resource information when the first set top box equipment identification information exists in the memory set, storing the effective data identification information into the memory set, establishing a mutual mapping relation among the first set top box equipment identification information in the memory set, and executing synchronization of local area network set top box resources.
In one embodiment, the map synchronization module includes:
the traversal comparison module is used for performing traversal comparison on the effective data identification information and a data identification information subset corresponding to the first set top box equipment identification information mapping in the memory set; (ii) a
The adding module is used for adding the effective data identification information into the data identification information subset by applying an adding principle if the effective data identification information does not belong to the data identification information subset, and establishing a mapping relation in the first set top box equipment identification information;
and the deleting module is used for deleting the mapping relation between the data identification information element and the first set top box by applying a deleting principle if a data identification information element in the data identification information subset does not belong to the effective data identification information, judging whether the data identification information element still has the mapping relation with other set top box equipment identification information, and deleting the data identification information element if the data identification information element does not belong to the effective data identification information.
In one embodiment, the data resource generating module includes a power-on self-test module, configured to detect a hard disk and a network condition, and determine that the first set top box device is a device in a non-resource sharing mode when the hard disk fails to work normally, where the non-resource sharing mode is to synchronize only data resources of other set top box devices in a local area network, and not to synchronize local data resources to other set top box devices.
In one embodiment, the system further comprises:
and the broadcast starting module is used for searching the resource sharing mode equipment by the first set top box equipment according to the broadcast starting protocol, receiving starting feedback information of other set top box equipment in the local area network by the first set top box equipment, and generating a list of address identification information of the resource sharing mode equipment in the feedback information for storage.
In one embodiment, the system further comprises:
and the synchronous feedback module is used for receiving synchronous feedback information of all resource sharing mode devices in a local area network by the first set top box device and storing the synchronous feedback information into a local memory set, wherein the synchronous feedback information is set top box device identification information and memory set information for sending the synchronous feedback information.
The method comprises the steps that the first set top box equipment to be deployed to the local area network is subjected to power-on self-check, data resources in a memory are traversed, and effective data resource information is generated; the first set top box device broadcasts a synchronization protocol to other set top box devices in the local area network; and the second set-top box equipment in the local area network receives the synchronization protocol, extracts the effective data identification information in the effective data resource information, stores the effective data identification information into the memory set, and establishes a mutual mapping relation with the first set-top box equipment identification information to synchronize the local area network set-top box resources. The problem that the set top box resource synchronization in the local area network is abnormal or cannot be synchronized is effectively solved, and the efficiency and the accuracy of the set top box resource synchronization in the local area network are improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flow chart of a method for synchronizing set-top box resources of a local area network according to the present invention;
FIG. 2 is an example of an application of a method for synchronizing set-top box resources of a local area network;
fig. 3 is a structure diagram of a set-top box resource synchronization system of a lan.
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.
In this specification, adjectives such as first and second may only be used to distinguish one element or action from another, without necessarily requiring or implying any actual such relationship or order. References to an element or component or step (etc.) should not be construed as limited to only one of the element, component, or step, but rather to one or more of the element, component, or step, etc., where the context permits.
In the present specification, the sizes of the respective portions shown in the drawings are not drawn in an actual proportional relationship for the convenience of description.
Fig. 1 is a flow chart of a method for synchronizing resources of a set-top box of a local area network according to the present invention.
S11, performing power-on self-test on the first set-top box device to be synchronized in the local area network, traversing the data resources in the memory, and generating effective data resource information, wherein the effective data resource information comprises effective data identification information and type information of each data resource;
s12, broadcasting a synchronization protocol to other set top box equipment in the local area network by the first set top box equipment, wherein the synchronization protocol comprises identification information of the first set top box equipment, a current timestamp and the effective data resource information;
s13, the second set-top box device in the local area network receives the synchronization protocol and judges whether the identification information of the first set-top box device is in a memory set, wherein the memory set is a set in which the identification information of the set-top box device and the identification information of the data resource are mapped with each other;
s14, when the first set-top box equipment identification information does not exist in the memory set, adding the first set-top box equipment identification information into the memory set, when the first set-top box equipment identification information exists in the memory set, extracting effective data identification information in the effective data resource information, storing the effective data identification information into the memory set, establishing a mutual mapping relation among the first set-top box equipment identification information in the memory set, and executing synchronization of local area network set-top box resources.
The valid data resource information in step S11 is data resource information obtained after the first set-top box device performs power-on self-test and deletes invalid data or erroneous data in the hard disk. Specifically, the execution operation of the power-on self-test includes detecting the conditions of the hard disk and the network, detecting all data resource information in the hard disk when the hard disk works well, and directly deleting the invalid or error data if other invalid data or error data such as damage, temporary data and the like occur, so that the problem of resource synchronization errors caused by the invalid or error data can be avoided in the subsequent synchronization process.
When the first set top box device is subjected to power-on self-test, and the hard disk cannot work normally, if the hard disk fails or is not loaded, the first set top box device is judged as a non-resource sharing mode device, wherein the non-resource sharing mode is only used for synchronizing data resources of other set top box devices, and local data resources are not synchronized to other set top box devices. That is, if the power-on self-test of the first set-top box finds that the hard disk can not work normally, the subsequent data synchronization work is not executed.
When the first set-top box device is in power-on self-test and the running state is normal, data resources in the memory of the first set-top box device are traversed to generate effective data resource information, wherein the effective data resource information comprises effective data identification information and type information of each data resource in the memory of the first set-top box. That is, if the data resource stored in the first set top box is song file information, the valid data identification information thereof may be a name of a song, and the type information may be playing format information of the song, etc.
The first set top box device broadcasts a starting protocol to search for resource sharing mode devices in the local area network after the first set top box device generates and completes power-on self-check and generates effective data resource information, receives starting feedback information of other set top box devices in the local area network, and generates and stores address identification information of the fed back resource sharing mode devices into a list.
That is, any one of the second set top box devices in the local area network receives the start protocol of the first set top box, determines whether the device is a resource sharing mode device, and sends a return protocol to the first set top box device, where the return protocol includes identification information and device mode information of the set top box device that sent the return protocol. That is, if the set-top box device is a non-resource sharing mode device, the device mode information in the return protocol is the non-resource sharing mode device, and if the set-top box device is a resource sharing mode device, the device mode information in the return protocol is the resource sharing mode device. And then, the first set top box stores the identification information of all set top box devices of which the device mode information in the return protocol is the resource sharing mode device, generates a list and stores the list.
After the steps are completed, the first set top box device broadcasts a synchronization protocol to other set top box devices in the local area network, wherein the synchronization protocol comprises identification information of the first set top box device, a current timestamp and the effective data resource information.
And the second set top box equipment in the local area network receives the synchronization protocol and judges whether the identification information of the first set top box equipment is in a memory set, wherein the memory set is a set formed by mapping the identification information of the set top box equipment and the identification information of the data resource.
Specifically, storing the valid data information in the memory set includes:
traversing and comparing the effective data identification information with a data identification information subset corresponding to the first set top box equipment identification information mapping in the memory set;
if the effective data identification information does not belong to the data identification information subset, adding the effective data identification information to the data identification information subset by applying an adding principle, and establishing a mapping relation in the first set top box equipment identification information;
and if the data identification information subset contains a data identification information element which does not belong to the effective data identification information, applying a deleting principle to delete the mapping relation between the data identification information element and the first set top box, judging whether the data identification information element has the mapping relation with the equipment identification information of other set top boxes, and if not, deleting the data identification information element.
The principle of no repeated addition is applied, the use of the memory is effectively reduced, and the retrieval efficiency is improved.
A memory set storage mode is as follows: establishing two sets in a memory of a second set-top box device, wherein an index pointer of one set is identification information of the set-top box device, such as a mac address and the like, and a content pointer is a data identification information subset, namely, in the set 1, at least one piece of data identification information is mapped correspondingly to the identification information of one index pointer and one set-top box device; the index pointer of the other set is data identification information, and the content pointer is a subset of set-top box device identification information, that is, in the set 2, one index pointer and one piece of data identification information at least correspond to and map identification information of at least one set-top box device.
The optimized storage mode is that the identification information and the data identification information of all the set-top box devices are stored in the memory thereof to generate a memory set, and then the corresponding mapping relationship between the identification information and the data identification information of the set-top box devices is established, that is, one set-top box device identification information can correspond to at least one piece of data identification information, and one piece of data identification information can also correspond to at least one set-top box device identification information, and the basis for establishing the mapping relationship between the two is as follows: the set-top box equipment hard disk content represented by the set-top box equipment identification information has corresponding data identification information.
When any set top box device in the local area network receives a synchronization protocol broadcasted by a first set top box device, judging whether identification information of the first set top box device exists in a memory set of the second set top box device, at the moment, traversing and searching the identification information of the set top box device in the memory set of the second set top box device, and if the identification information of the set top box device corresponding to the first set top box device is not searched, indicating that the first set top box device is a set top box device newly added to the local area network, and synchronizing effective data resource information in the first set top box device; if the set top box device identification information corresponding to the first set top box device is found, it is indicated that the first set top box device is an old set top box device accessing the local area network, and the effective data resource information in the first set top box device needs to be synchronized due to the replacement of the hard disk and the addition or deletion of data in the hard disk.
When the first set-top box device is judged to be a set-top box device newly added to the local area network, the effective data resource information in the first set-top box device needs to be synchronized, that is, firstly, the identification information of the first set-top box device is added to a memory set of a second set-top box, and then, the effective data identification information extracted from the effective data resource information is added under the first set-top box identification information element of the memory set to form a data identification information set corresponding to the first set-top box identification information element mapping.
Optimally, in order to save the utilization rate of the memory, a non-repeated addition principle can be adopted, that is, after the identification information of the first set top box device is added into the memory set of the second set top box, all the effective data identification information is extracted from the effective data resource information, and the effective data identification information is continuously traversed and compared with all the data identification information in the memory set of the second set-top box, if a certain piece of effective data identification information exists in the memory set of the second set-top box, then directly establishing a mapping relation between the data identification information and the first set-top box equipment identification information element, if a certain effective data identification information does not exist in the second set-top box memory set, the effective data identification information is established under the condition that the first set-top box equipment identification information element is established according to the adding method, and a mapping relation is established in the first set-top box equipment identification information element.
When the first set-top box device is judged not to be the set-top box device newly added to the local area network, the effective data resource information in the first set-top box device may need to be synchronized due to the replacement of the hard disk and the addition or deletion of data in the hard disk. All the data identification information in the memory set, which has a mapping relationship with the first set-top box device identification information element, is only required to be found out to form a data identification information subset corresponding to the first set-top box device identification information element mapping.
Then, all elements in the data identification information subset are compared with the extracted effective data identification information one by one. If the effective data identification information does not belong to the data identification information subset, the effective data identification information is a data resource file newly added into the memory of the first set-top box device, the effective data identification information is added into the data identification information subset by applying an adding principle, and a mapping relation is established in the first set-top box device identification information.
In another case, a data identifier element in the data identifier subset does not belong to the valid data identifier, that is, a certain data identifier element in the data identifier subset does not exist in the valid data identifier, indicating that the first set-top box device deletes the data identifier, applying a deletion rule to delete the mapping relationship between the data identifier element and the first set-top box, determining whether the data identifier element still has a mapping relationship with other set-top box device identifiers, and if not, deleting the data identifier element.
After the step of S14, receiving, at the first set top box device, synchronization feedback information of all resource sharing mode devices in the local area network, and storing the synchronization feedback information in a local memory set, where the synchronization feedback information is set top box device identification information and memory set information that send the synchronization feedback information.
At this time, the common sign for judging that all resources are completely finished is that all the shared resource mode devices in the local area network return synchronous feedback information.
Certainly, under the condition that a normal set-top box device in the local area network suddenly fails and cannot work, at this time, heartbeat information needs to be sent to all set-top box devices in the local area network every fixed interval time to judge whether the current set-top box device is in the local area network. Each set top box device in the local area network needs to send reply information back to the set top box device sending the heartbeat information after receiving the heartbeat information, if the set top box device in the local area network continuously has a frequency which is larger than a preset threshold value and does not return the reply information, the device is considered to be offline, song information under the device needs to be removed, and if the device recovers the heartbeat after the message is removed, the data resource of the set top box device replying the heartbeat needs to be synchronized again.
The following is a specific application example of the method.
In the KTV industry, there is one set-top box per box for ordering songs.
In some small-place KTVs, the business requirements of the small-place KTVs can be better met by applying the versions of the local area network set top boxes. However, due to the uncertainty of the set-top box devices in each box, when the devices are damaged and the hard disk needs to be replaced due to aging, the problem that data synchronization is wrong or the update is not timely occurs, which leads to the problem that songs cannot be played successfully or song resources need to be downloaded. In view of the above problems, the present invention proposes the following technical solutions.
A specific embodiment is shown in fig. 2.
S21: when the set-top box A is to be deployed in a local area network, firstly, performing power-on self-check, traversing and searching data resources in a hard disk of the set-top box A and generating local effective song resource file information;
s22: the set top box A broadcasts a starting protocol to all other set top box devices in the local area network, searches for the resource sharing mode device, receives starting feedback information of other set top box devices in the local area network, and generates a list of address identification information of the fed back resource sharing mode device for storage;
s23: the set top box A broadcasts a synchronization protocol to all other set top box devices in the local area network, wherein the synchronization protocol comprises a broadcast current timestamp and local valid song resource file information;
s24: after any set top box B in the local area network receives the synchronization protocol broadcasted by the set top box A, local memory data of the set top box B is updated, and songs in the memory are displayed in a list.
The specific updating method of the local memory data is as follows:
step 1, a set is created in a memory of a set top box B by taking a current timestamp as a standard, and a set mapped correspondingly by equipment identification information and song identification information is stored;
step 2, after the set-top box B receives the sharing protocol sent by the set-top box A, searching whether the equipment identification information in the memory set contains the equipment identification information of the set-top box A, and synchronously updating the resource information in the memory set;
if the equipment identification information of the set top box A does not exist, adding the identification information of the set top box A into a memory set, extracting the identification information of all effective songs from the effective song resource file information shared by the set top box A, storing the identification information of the effective songs, establishing a mapping relation with the identification information of the set top box A in the memory set, if the identification information a of a certain effective song does not exist in the memory set of the set top box B, adding the identification information a of the effective song into the memory of the set top box B, then establishing a mapping relation with the identification information of the set top box A in the set, and if the identification information a of the effective song does not exist in the memory set of the set top box B, directly establishing a mapping relation between the identification information a of the effective song and the identification information of the set top A in the set;
if the device identification information of the set top box A exists, after the identification information of all effective songs is extracted from the effective song resource file information shared by the set top box A, the extracted effective song identification information is compared with all song identification information corresponding to the device identification information mapping of the set top box A in a memory set of the set top box B, and the song identification information added or deleted in the extracted effective song identification information is found. Applying an adding principle to the added song identification information B, adding the identification information B of the song into a memory of the set top box B, and establishing a mapping relation with the identification information of the set top box A. Similarly, the method for adding the added song identification information B into the memory of the set top box B is the same as the method for adding the effective song identification information a, and the principle of no repeated addition is followed. And for the deleted song identification information c, applying a deletion principle, searching the song identification information c in a memory of the set top box B, deleting the mapping relation between the song identification information c and the identification information of the set top box A if the set top box identification information corresponding to the song identification information c exists at least 2, namely the set top box identification information except the set top box A is contained, and deleting the identification information c of the song in the memory if the set top box equipment corresponding to the song identification information c only has the identification information of the set top box A.
When the song list in the set top box B is displayed, the song list is displayed according to the data stored in the memory, and the priority is as follows: local storage > local area network > cloud. The same song is displayed locally when both the local area network and the local area network exist, the local area network is displayed if only the local area network exists, and the cloud end is displayed if the local area network does not exist.
S25: and after the set top boxes in other shared resource modes in the local area network are updated, sending a shared feedback message to the set top box A. The non-shared resource mode set-top box does not send the shared feedback message, and the set-top box A stores the received shared feedback message in the memory.
Specifically, in S21, when the set-top box a is to be deployed in the lan, the set-top box a first performs power-on self-test to detect whether the hard disk and the external network are in good condition, and when the hard disk is damaged or the hard disk is not mounted, the current set-top box a is to be set as a non-resource sharing mode device, that is, the non-resource sharing mode device has the specific meaning: the set-top box a can only synchronize the resource information of other set-top box devices in the local area network, but cannot provide the local resource information of the set-top box a for the other set-top box devices in the local area network.
After the set-top box a detects the states of the hard disk and the external network, the song files in the hard disk need to be searched in a traversing manner, damaged files and temporary files are deleted, and errors occur when the song files are played or synchronized due to the damage of the files and the like. And after traversing the song files in the hard disk is finished, storing the information of the residual effective song files after deletion and generating a local resource information document, wherein the document preferably comprises information such as the names of the effective songs and the types of the songs.
And if the set top box A does not mount the hard disk or traverse the set top box A, and the effective song file is zero, generating an empty document.
After the set-top box A completes the power-on self-test, the data of other set-top box equipment in the local area network can be synchronized according to the state of the current set-top box.
Before synchronization, we first define a User Datagram Protocol (UDP), whose contents are: protocol header and protocol body. The protocol body mainly includes a MAC address of the device, a current IP of the device, a device mode (non-resource sharing mode or resource sharing mode), an ACTION (a purpose of sending the protocol), a current timestamp of the sending protocol, and the like, and the protocol body mainly includes an MSG (structure in Windows program) message.
After the set-top box A completes the power-on self-test, the set-top box A sends an online start broadcast to all other set-top box equipment in the local area network, the action in the protocol header is 'boot', and then whether the equipment is in a resource sharing mode is provided in the protocol header. And when other set top box equipment in the local area network receives the starting broadcast, sending a feedback message, wherein the feedback message carries the information whether the equipment is the sharing mode equipment. Therefore, the set-top box a may obtain feedback information of all other set-top box devices in the local area network, and store the address identification information of the resource sharing mode device in the current local area network in the memory in a list form according to the feedback information.
The execution process of S23 is specifically that, the set-top box a broadcasts the sharing protocol to all other set-top box devices in the local area network, the protocol header is a local message, the action is "share", the timestamp is a "current timestamp" of the broadcast sharing protocol, and the MSG message is local valid song resource file information.
In addition, in an actual operation process, there are the following problems: one set top box in the local area network suddenly breaks down and cannot provide resources. In order to solve the problem, a mode of registering a hardware unloading/mounting system broadcast is adopted, when a hard disk unloading broadcast is received, a broadcast with action of 'abnormal' is sent to inform other set top boxes in a local area network, and then the other set top boxes in the local area network delete the data of the failed set top box in the memory according to the deletion principle in a traversal mode.
In addition, if a problem that one set top box in the local area network cannot be turned on or turned off occurs, a problem that data cannot be updated in real time may be caused. The method for solving the problem is as follows: sending heartbeat messages to all devices (once in 5 minutes), only judging whether the current set-top box device is in a local area network, sending the heartbeat messages by a set-top box A (action: heartbeat), replying the messages (action: alive) according to the device identification information in the current local area network stored before when other set-top boxes in the local area network receive the heartbeat messages, considering that a certain device is offline if the device does not reply for more than five times, eliminating song information under the device, sending 'share' messages to the set-top box device recovering the heartbeat by the set-top box A if the device recovers the heartbeat after eliminating the messages, replying 'share _ back' messages after the device receives the messages, and synchronizing the data.
In order to ensure the robustness of the synchronization of the local area network set-top box equipment resources, the problems of equipment abnormality, such as set-top box faults, network abnormality, power failure and the like, when data are loaded from the set-top box, such as song ordering, need to be considered. Therefore, when loading the lan resources, the robustness of the system is also considered, for example, when playing song resources on the set-top box of the lan, the content of about 10s needs to be cached in advance, when the subsequent caching is interrupted, the caching is tried again, if the song resources still cannot be successfully played, the exception handling mechanism is invoked, the player throws an exception, the set-top box end prompts the resource exception, the playing fails, and then other songs after the list are played.
According to the technical scheme, all set top boxes in a local area network can synchronize the latest data to the local, the problems that the original set top boxes can only synchronize initial resources, cannot synchronize newly added resources and locally deleted resources and cannot synchronize data due to equipment failure of the set top boxes of the local area network are solved, the method for synchronizing the resources of the set top boxes of the local area network is optimized, the data are efficiently processed, the occupation rate of a CPU (central processing unit) is reduced, the searching efficiency is improved, and the efficiency and the performance of synchronizing the resources of the set top boxes of the local area network are greatly improved.
In addition, the present invention also provides a system for synchronizing resources of a local area network set-top box, as shown in fig. 3, including:
the data resource generating module 31 is configured to perform power on self-test on a first set top box device to be synchronized in a local area network, traverse data resources in a memory of the first set top box device, and generate effective data resource information, where the effective data resource information includes effective data identification information and type information of each data resource;
a broadcast synchronization module 32, configured to broadcast, by a first set top box device, a synchronization protocol to other set top box devices in a local area network, where the synchronization protocol includes first set top box device identification information, a current timestamp, and the valid data resource information;
a judgment identification module 33, configured to receive the synchronization protocol by a second set top box device in the local area network, and judge whether the first set top box device identification information is in a memory set, where the memory set is a set in which the set top box device identification information and the data resource identification information are mapped to each other;
a mapping synchronization module 34, configured to add the first set-top box device identifier information to the memory set when the first set-top box device identifier information does not exist in the memory set, extract valid data identifier information in the valid data resource information when the first set-top box device identifier information exists in the memory set, store the valid data identifier information in the memory set, establish a mutual mapping relationship between the first set-top box device identifier information in the memory set, and perform synchronization of local area network set-top box resources.
A map synchronization module, comprising:
a traversal comparison module 341, configured to perform traversal comparison on the valid data identification information and a data identification information subset corresponding to the mapping of the first set top box device identification information in the memory set;
an adding module 342, configured to apply an adding principle if there is valid data identification information that does not belong to the data identification information subset, add the valid data identification information to the data identification information subset, and establish a mapping relationship with the first set-top box device identification information;
a deleting module 343, configured to, if there is a data identifier information element in the data identifier information subset that does not belong to the valid data identifier information, apply a deleting principle to delete the mapping relationship between the data identifier information element and the first set top box, determine whether the data identifier information element still has a mapping relationship with other set top box device identifier information, and if not, delete the data identifier information element.
The data resource generating module includes a power-on self-test module 311, configured to detect a hard disk and a network condition, and determine that the first set top box device is a device in a non-resource sharing mode when the hard disk fails to work normally, where the non-resource sharing mode is to synchronize only data resources of other set top box devices, and not to synchronize local data resources to other set top box devices.
The above system further comprises:
and the broadcast starting module 35 is configured to search the resource sharing mode device for a broadcast starting protocol of the first set top box device, receive starting feedback information of other set top box devices in the local area network, and generate a list of address identification information of the fed back resource sharing mode device for storage.
The above system further comprises:
a synchronous feedback module 36, configured to receive, by the first set top box device, synchronous feedback information of all resource sharing mode devices in a local area network, and store the synchronous feedback information in a local memory set, where the synchronous feedback information is set top box device identification information and memory set information that send the synchronous feedback information.
From the above description, it can be seen that the present invention performs power-on self-test on the first set-top box device to be deployed to the local area network, and traverses the data resources in the memory to generate effective data resource information; the first set top box device broadcasts a synchronization protocol to other set top box devices in the local area network; and the second set-top box equipment in the local area network receives the synchronization protocol, extracts the effective data identification information in the effective data resource information, stores the effective data identification information into the memory set, and establishes a mutual mapping relation with the first set-top box equipment identification information to synchronize the local area network set-top box resources. The problem that the set top box resource synchronization in the local area network is abnormal or cannot be synchronized is effectively solved, and the efficiency and the accuracy of the set top box resource synchronization in the local area network are improved.
Thus far, the present invention has been described in detail. Some details well known in the art have not been described in order to avoid obscuring the concepts of the present invention. Those skilled in the art can fully appreciate how to implement the disclosed embodiments in light of the foregoing description.
The above-mentioned embodiments are intended to illustrate the objects, technical solutions and advantages of the present invention in further detail, and it should be understood that the above-mentioned embodiments are merely exemplary embodiments of the present invention, and are not intended to limit the scope of the present invention, and any modifications, equivalent substitutions, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.
Claims (8)
1. A method for synchronizing local area network set-top box resources is characterized by comprising the following steps:
step 1, a first set top box device to be synchronized in a local area network is started and self-checked, data resources in a memory of the first set top box device are traversed, and effective data resource information is generated, wherein the effective data resource information comprises effective data identification information and type information of each data resource;
step 2, the first set top box device broadcasts a synchronization protocol to other set top box devices in the local area network, wherein the synchronization protocol comprises identification information of the first set top box device, a current timestamp and the effective data resource information;
step 3, a second set top box device in the local area network receives the synchronization protocol and judges whether the identification information of the first set top box device is in a memory set, wherein the memory set is a set in which the identification information of the set top box device and the identification information of the data resource are mapped with each other;
step 4, when the first set-top box equipment identification information does not exist in the memory set, adding the first set-top box equipment identification information into the memory set, when the first set-top box equipment identification information exists in the memory set, extracting effective data identification information in the effective data resource information, storing the effective data identification information into the memory set, establishing a mutual mapping relation among the first set-top box equipment identification information in the memory set, and executing synchronization of local area network set-top box resources;
in step 4, storing the valid data identification information in the memory set includes:
traversing and comparing the effective data identification information with a data identification information subset corresponding to the first set top box equipment identification information mapping in the memory set;
if the effective data identification information does not belong to the data identification information subset, adding the effective data identification information to the data identification information subset by applying an adding principle, and establishing a mapping relation in the first set top box equipment identification information;
and if the data identification information subset contains a data identification information element which does not belong to the effective data identification information, applying a deleting principle to delete the mapping relation between the data identification information element and the first set top box, judging whether the data identification information element has the mapping relation with the equipment identification information of other set top boxes, and if not, deleting the data identification information element.
2. The method according to claim 1, wherein in step 1, the power-on self-test includes detecting conditions of a hard disk and a network, and when the hard disk fails to work normally, the first set-top box device is determined as a device in a non-resource sharing mode, wherein the non-resource sharing mode is to synchronize only data resources of other set-top box devices in a local area network, and not to synchronize local data resources to other set-top box devices.
3. The method of claim 2, further comprising, after step 1: the first set top box device broadcasts a starting protocol and searches for the resource sharing mode device, receives starting feedback information of other set top box devices in the local area network, and generates and stores address identification information of the resource sharing mode device in the feedback information into a list.
4. The method of claim 3, further comprising, after step 4: the first set top box device receives synchronous feedback information of all resource sharing mode devices in a local area network and stores the synchronous feedback information into a local memory set, wherein the synchronous feedback information is set top box device identification information and memory set information for sending the synchronous feedback information.
5. A system for synchronizing set-top box resources in a local area network, comprising:
the data resource generation module is used for performing power-on self-check on a first set-top box device to be synchronized in a local area network, traversing data resources in a memory of the first set-top box device, and generating effective data resource information, wherein the effective data resource information comprises effective data identification information and type information of each data resource;
the broadcast protocol module is used for broadcasting a synchronization protocol to other set top box equipment in the local area network by the first set top box equipment, wherein the synchronization protocol comprises identification information of the first set top box equipment, a current timestamp and the effective data resource information;
the judgment identification module is used for receiving the synchronization protocol by a second set top box device in the local area network and judging whether the identification information of the first set top box device is in a memory set, wherein the memory set is a set in which the identification information of the set top box device and the identification information of the data resource are mapped with each other;
a mapping synchronization module, configured to add first set-top box device identification information to the memory set when the first set-top box device identification information does not exist in the memory set, extract valid data identification information in the valid data resource information when the first set-top box device identification information exists in the memory set, store the valid data identification information in the memory set, establish a mutual mapping relationship between the first set-top box device identification information in the memory set, and perform synchronization of local area network set-top box resources;
wherein the mapping synchronization module comprises:
the traversal comparison module is used for performing traversal comparison on the effective data identification information and a data identification information subset corresponding to the first set top box equipment identification information mapping in the memory set;
the adding module is used for adding the effective data identification information into the data identification information subset by applying an adding principle if the effective data identification information does not belong to the data identification information subset, and establishing a mapping relation in the first set top box equipment identification information;
and the deleting module is used for deleting the mapping relation between the data identification information element and the first set top box by applying a deleting principle if a data identification information element in the data identification information subset does not belong to the effective data identification information, judging whether the data identification information element still has the mapping relation with other set top box equipment identification information, and deleting the data identification information element if the data identification information element does not belong to the effective data identification information.
6. The system according to claim 5, wherein the data resource generating module includes a power-on self-test module, configured to detect a hard disk and a network condition, and determine the first set top box device as a non-resource sharing mode device when the hard disk fails to work normally, where the non-resource sharing mode is to synchronize only data resources of other set top box devices in the local area network, and not to synchronize local data resources to other set top box devices.
7. The system of claim 6, further comprising:
and the broadcast starting module is used for searching the resource sharing mode equipment by the first set top box equipment according to the broadcast starting protocol, receiving starting feedback information of other set top box equipment in the local area network by the first set top box equipment, and generating a list of address identification information of the resource sharing mode equipment in the feedback information for storage.
8. The system of claim 7, further comprising:
and the synchronous feedback module is used for receiving synchronous feedback information of all resource sharing mode devices in a local area network by the first set top box device and storing the synchronous feedback information into a local memory set, wherein the synchronous feedback information is set top box device identification information and memory set information for sending the synchronous feedback information.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910986380.3A CN110856029B (en) | 2019-10-17 | 2019-10-17 | Method and system for synchronizing local area network set top box resources |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910986380.3A CN110856029B (en) | 2019-10-17 | 2019-10-17 | Method and system for synchronizing local area network set top box resources |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110856029A CN110856029A (en) | 2020-02-28 |
CN110856029B true CN110856029B (en) | 2022-04-01 |
Family
ID=69597743
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910986380.3A Active CN110856029B (en) | 2019-10-17 | 2019-10-17 | Method and system for synchronizing local area network set top box resources |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110856029B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114866502B (en) * | 2022-05-17 | 2023-04-07 | 四川虹美智能科技有限公司 | Method for pushing intelligent household appliance message |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103297821A (en) * | 2012-02-24 | 2013-09-11 | 北京四达时代软件技术股份有限公司 | Method and system for achieving IP two-direction function |
CN103442286A (en) * | 2013-08-22 | 2013-12-11 | 深圳市九洲电器有限公司 | Set top box file sharing method and system |
CN104469476A (en) * | 2014-11-19 | 2015-03-25 | 深圳市九洲电器有限公司 | Set top box network standby control method and system |
CN105491417A (en) * | 2015-11-26 | 2016-04-13 | 深圳市创维软件有限公司 | Method, device and system for pushing program to one-way set-top box through hand-held terminal |
CN106210872A (en) * | 2016-07-27 | 2016-12-07 | 深圳创维数字技术有限公司 | A kind of live sharing method based on Set Top Box and system |
CN106341279A (en) * | 2016-10-31 | 2017-01-18 | 普联技术有限公司 | Configuration information synchronizing method and device |
CN106411542A (en) * | 2015-07-27 | 2017-02-15 | 中兴通讯股份有限公司 | Method and device of realizing device search |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8458742B2 (en) * | 2009-06-30 | 2013-06-04 | Echostar Technologies L.L.C. | Apparatus systems and methods for securely sharing content with a plurality of receiving devices |
CN103916423A (en) * | 2012-12-31 | 2014-07-09 | 华为技术有限公司 | Data synchronization method and device |
CN103986738B (en) * | 2013-02-07 | 2018-10-16 | 百度在线网络技术(北京)有限公司 | A kind of synchronous method between multiple terminals and system |
CN105245500A (en) * | 2015-08-31 | 2016-01-13 | 北京奇艺世纪科技有限公司 | Multimedia resource sharing method and device |
-
2019
- 2019-10-17 CN CN201910986380.3A patent/CN110856029B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103297821A (en) * | 2012-02-24 | 2013-09-11 | 北京四达时代软件技术股份有限公司 | Method and system for achieving IP two-direction function |
CN103442286A (en) * | 2013-08-22 | 2013-12-11 | 深圳市九洲电器有限公司 | Set top box file sharing method and system |
CN104469476A (en) * | 2014-11-19 | 2015-03-25 | 深圳市九洲电器有限公司 | Set top box network standby control method and system |
CN106411542A (en) * | 2015-07-27 | 2017-02-15 | 中兴通讯股份有限公司 | Method and device of realizing device search |
CN105491417A (en) * | 2015-11-26 | 2016-04-13 | 深圳市创维软件有限公司 | Method, device and system for pushing program to one-way set-top box through hand-held terminal |
CN106210872A (en) * | 2016-07-27 | 2016-12-07 | 深圳创维数字技术有限公司 | A kind of live sharing method based on Set Top Box and system |
CN106341279A (en) * | 2016-10-31 | 2017-01-18 | 普联技术有限公司 | Configuration information synchronizing method and device |
Also Published As
Publication number | Publication date |
---|---|
CN110856029A (en) | 2020-02-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106982236B (en) | Information processing method, device and system | |
US9491100B2 (en) | Method and device for updating routing lookup tree | |
US10069941B2 (en) | Scalable event-based notifications | |
CN109976941B (en) | Data recovery method and device | |
CN112506702B (en) | Disaster recovery method, device, equipment and storage medium for data center | |
CN110633168A (en) | Data backup method and system for distributed storage system | |
CN106850724B (en) | Data pushing method and device | |
CN110856029B (en) | Method and system for synchronizing local area network set top box resources | |
CN111526185B (en) | Data downloading method, device, system and storage medium | |
CN110855627B (en) | Application deployment method, device, equipment and medium | |
CN108900337B (en) | Fault recovery method, server, client and system for metadata service | |
CN110585724B (en) | Method and device for updating form data in game client | |
CN109344202B (en) | Data synchronization method and management node | |
CN112000850A (en) | Method, device, system and equipment for data processing | |
CN111708763A (en) | Data migration method and device of fragment cluster and fragment cluster system | |
US9852031B2 (en) | Computer system and method of identifying a failure | |
CN113535482B (en) | Cloud backup chain data backup method and device, equipment and readable medium | |
CN113312073B (en) | Installation package file processing method and related device | |
CN111736944A (en) | Docker container positioning method and device based on Kubernetes | |
CN111106966B (en) | Information processing method and device, equipment and storage medium | |
CN113778761A (en) | Time sequence database cluster and fault processing and operating method and device thereof | |
CN111522649B (en) | Distributed task allocation method, device and system | |
CN112711382A (en) | Data storage method and device based on distributed system and storage node | |
CN112291343A (en) | Information acquisition method and device and electronic equipment | |
CN107704462B (en) | Resource metadata maintenance method, equipment and storage device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |