[ summary of the invention ]
Based on this, it is necessary to provide a playlist information synchronization method that ensures unlimited acquisition of playlist information.
In addition, it is necessary to provide a server for playlist information synchronization, which ensures unlimited acquisition of playlist information.
A playlist information synchronization method, comprising the steps of:
A. logging in a client, and uploading local playlist information to a server;
B. and comparing whether the local playlist information is the same as the playlist information on the server, if so, returning the playlist information on the server to the local, if not, not returning the information, and if not, deleting the local playlist information.
Preferably, in the step B, comparing the local playlist information timestamp with the playlist information timestamp on the server to compare whether the two are the same, and performing corresponding operation on the local according to the comparison result, and updating the playlist information timestamps on the local and the server.
Preferably, the method further comprises step C: and updating the local playlist information according to the modification operation, uploading the updated local playlist information to the server, and updating the playlist information timestamps on the local and server.
Preferably, step C specifically comprises the steps of:
C1. modifying the local playlist information;
C2. merging the modified local playlist information and the modified local playlist information which fails to be uploaded last time, and sending an uploading request to a server;
C3. if the request is successful, uploading operation is carried out, the time stamps of the playlist information on the local server and the server are updated, and if the request is failed, the secondary uploaded local playlist information is put into a failure queue.
Preferably, step C further comprises the steps of:
C4. judging whether the uploading operation exits or not;
C5. if the uploading operation is quitted, judging whether updated local playlist information which is not uploaded exists or not and whether the user tries to upload or not, if so, executing the uploading operation, and if not, ending the uploading operation;
C6. and judging whether the uploading operation is successful, if so, ending, otherwise, returning to the step C5.
Preferably, the method further includes temporarily storing the uploaded modified local playlist information in the buffer and/or temporarily storing the playlist information on the server to be processed in the buffer.
A server for playlist information synchronization, the server comprising:
the communication module is used for receiving the uploaded local playlist information;
the processing module is used for comparing the local playlist information with the playlist information on the server stored in the storage module, if the local playlist information is different from the playlist information on the server, returning the playlist information on the server to the local through the communication module, if the local playlist information is the same as the playlist information on the server, not returning the information, and if the uploaded playlist information does not exist on the server, deleting the local playlist information;
and the storage module is used for storing the playlist information and the playing content information on the server.
Preferably, the processing module compares the local playlist information timestamp with the playlist information timestamp on the server, performs corresponding operation on the local according to the comparison result, and updates the playlist information timestamps on the local and the server.
Preferably, the processing module receives a request for uploading the modified local playlist information through the communication module, and receives the uploaded modified local playlist information.
Preferably, the server further includes a staticizing module, configured to generate staticized playlist information according to the staticized notification information sent by the processing module and the uploaded modified local playlist information, update the playlist information timestamp on the server, and update the local playlist information timestamp by the processing module.
Preferably, the server further includes a cache module, configured to temporarily store the uploaded playlist information that is not stored in the storage module and/or the static playlist information to be processed by the processing module.
According to the playlist information synchronization method and the server for playlist information synchronization, the local playlist information is compared with the playlist information on the server, and the local playlist information is updated according to the comparison result when the local playlist information and the playlist information are different, so that the playlist information can be obtained without limitation.
In addition, the time stamps are adopted to compare whether the two are the same, so that the method is simple and convenient; the local playlist information is uploaded to the server after being modified, so that real-time updating of the playlist information on the server is guaranteed.
[ detailed description ] embodiments
As shown in fig. 1, a playlist information synchronization method includes the following steps:
and step S10, logging in the client, and uploading local playlist information to the server. After logging in the client, the user uploads all local playlist information to the server through an http protocol or a TCP protocol, if uploading fails, the user is prevented from further using the local playlist information, and all local playlist information is uploaded again. The playlist information includes a list name, a timestamp, and the like, and the timestamp is a mark of the playlist information and records the last update time of the playlist information. In this embodiment, the playlist information may be song list information in a music box or song collection list information in a music play collection. In addition, the mode of logging in the player by using the client is more, and the player can be directly logged in by adopting a registered account of the player, or by logging in the instant messaging software and then logging in the player through an entrance associated with the instant messaging software and the player, or by logging in through other modes associated with the player. Therefore, the threshold of login is reduced, and the user can experience better.
Step S20, comparing whether the local playlist information is the same as the playlist information on the server, and according to different comparison results, respectively executing step S210, step S220 and step S230.
And step S210, if the difference is different, returning the playlist information on the server to the local.
In step S220, if the uploaded playlist information does not exist on the server, the playlist information on the local is deleted.
In step S230, if the two are the same, no information is returned.
Specifically, the method comprises the following steps: and comparing the uploaded local playlist information with the playlist information stored on the server, and performing corresponding operation on the local according to the comparison result. When the two are different, the play list information on the server is returned to the local, the play content information is pulled from the server according to the returned play list information at regular time (time is set by a system), when the user switches to the list of the synchronous player, the client displays the interaction being pulled in the local play list, the pulling is failed, the continuous use of the local player list is not influenced, and the synchronous downloading update can be continuously tried or the player can be started to update next time; when the two are the same, the user may finish the synchronization before exiting for the previous time, and the local playlist information is the latest data and does not need to be updated; and when the local uploaded playlist information does not exist on the server, directly deleting the local playlist information.
In one embodiment, comparing the local playlist information to the playlist information on the server may determine whether the local playlist information is the same as the playlist information on the server by comparing the time stamp of the local playlist information to the time stamp of the playlist information on the server and updating the time stamps of the playlist information on the local and server. Thus, the method is simple and convenient. In addition, if the time stamp of the playlist information on the server is earlier than the time stamp of the local playlist information, which occurs when some data of the server is still in the cache queue processing, the server may issue information to allow the client to continue using the locally stored playlist information, and the playlist information will not be uploaded again. In addition, the playing content information may be music playing collection information, and the collection information includes a collection basic information table, a collection time stamp table, a collection song list, and the like. The collection information stores songs of the music library and stealing-link songs, and the songs are identified by adding identification codes to types. The player information may also be music box song information including staticized list information, a music box total time stamp table, and a user operation record table stored on the server.
As shown in fig. 2, step S30 is to update the local playlist information according to the modification operation, and upload the updated local playlist information to the server. In one embodiment, the local playlist information is modified at the client, the updated playlist information and timestamps are recorded, and the playlist information and timestamps are uploaded to the server. As shown in fig. 3, the method specifically includes the following steps:
step S300, modify the local playlist information. And modifying the playlist information on the local client, wherein the modification comprises adding, deleting, modifying and the like of the local playlist information. For example, adding songs to a list of songs on a music player, or deleting songs from an existing list, or making changes to song names, to the order of songs in a list, etc.
Step S301, merging the modified local playlist information and the modified local playlist information that failed to be uploaded last time, and sending an upload request to the server. In one embodiment, the local playlist information and the modified local playlist information that failed the previous upload are merged at the protocol layer, and then an upload request is issued to the server.
Step S302, determine whether the upload request is successful, if so, execute step S303, otherwise, execute step S304.
In step S303, an upload operation is performed.
Step S304, the local playlist information uploaded at the secondary level is put into a failure queue. And when the user operates next time, the user requests the uploading operation of the playlist information of the time again.
In step S305, it is determined whether the upload operation is exited, if not, the process returns to step S300, and if so, step S306 is executed.
Step S306, determining whether there is updated local playlist information that has not been uploaded and whether the user attempts to upload, if yes, performing step S307, and if not, ending the process.
In step S307, an upload operation is performed.
In step S308, it is determined whether the uploading operation is successful, if so, the process is terminated, and if not, the process returns to step S305.
The playlist information synchronization method further comprises the step of temporarily storing the uploaded modified local playlist information in the cache region and/or temporarily storing the playlist information on the server to be processed in the cache region, so that the uploaded playlist information is temporarily stored in the cache region, data is not easy to lose, the playlist information on the server to be processed is temporarily stored in the cache region, and the processing module on the server acquires processing data from the cache region to enable the processing speed to be higher.
In one embodiment, as shown in fig. 4, a server for playlist information synchronization includes a communication module 10, a processing module 20, and a storage module 30. Wherein,
the communication module 10 is configured to receive uploaded local playlist information. The playlist information includes a list name, a timestamp, and the like, and the timestamp is a mark of the playlist information and records the last update time of the playlist information. In this embodiment, the playlist information may be song list information in a music box or song collection list information in a music play collection.
The processing module 20 compares the acquired local playlist information with the playlist information on the server stored in the storage module 30, and if not, returns the playlist information on the server to the local through the communication module 10. When the two are the same, no information is returned. And if the play list information does not exist on the server, the user operation is shown to delete the play list information, and the local play list information is deleted. In one embodiment, the processing module 20 may also determine whether the local playlist information timestamp is the same as the on-server playlist information timestamp by comparing the two.
Stored in the storage module 30 is playlist information of the server. In one embodiment, the storage module 30 also stores the playback content information. The playing content information can be music playing collection information or music box song information. The music playing collection information comprises a collection basic information table, a collection time stamp table, a collection song list and the like. The collection information stores songs of the music library and stealing-link songs, and the songs are identified by adding identification codes to types. In addition, the music playing collection information has a large number of music pieces, the granularity can be enlarged, and each collection list is a database record. The playing content information may also be music box song information including staticized list information, a music box total time stamp table, and a user operation record table stored on the server.
In one embodiment, as shown in FIG. 5, the server further includes a staticizing module 40. The staticizing module 40 is configured to process the playlist information according to a storage manner on the server, generate staticized playlist information, and store the generated staticized playlist information. The communication module 10 receives a request for uploading the modified local playlist information at the client, and transmits the upload request to the processing module 20. The processing module 20 determines to receive the upload request according to the user behavior, the server, and other factors, starts to receive the modified local playlist information, and sends notification information for performing the staticizing processing on the received modified local playlist information to the staticizing module 40. The staticizing module 40 processes the received local playlist information to generate staticized playlist information, records a timestamp of the generated staticized playlist information, updates the generated staticized playlist information and the recorded timestamp in the storage module 30, and transmits the timestamp to the processing module 20. The processing module 20 on the server transmits the time stamp to the local client through the communication module 10, and updates the time stamp of the local playlist information, thereby realizing data synchronization between the server and the local client.
In one embodiment, the server further comprises a download service module and a cache module (not shown in the figure). The download service module is used for downloading the playlist information and the timestamp of the playlist information on the server to the local and also downloading the playing content information to the local. The cache module is configured to temporarily store the uploaded playlist information that is not stored in the storage module 30 and/or the staticized playlist information on the server to be processed by the processing module 20. The cache module ensures that data is not lost through uploading the information of the playlist which is not processed in time. In addition, the speed of directly calling the staticized playlist information from the storage module by the processing module 20 is relatively slow, and the speed is increased by temporarily storing the staticized playlist information to be processed in the cache module, so that the processing module 20 reads data from the cache module.
According to the playlist information synchronization method and the server for playlist information synchronization, the local playlist information is compared with the playlist information on the server, and the local playlist information is updated according to the comparison result when the local playlist information and the playlist information are different, so that the playlist information can be obtained without limitation.
In addition, the time stamps are adopted to compare whether the two are the same, so that the method is simple and convenient; the local playlist information is uploaded to the server after being modified, so that real-time updating of the playlist information on the server is guaranteed; the playlist information on the server to be processed is temporarily stored in the cache region, so that the processing speed is higher.
The above-mentioned embodiments only express several embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.