Method, device, system, equipment and storage medium for playing media data
阅读说明:本技术 播放媒体数据的方法、装置、系统、设备及存储介质 (Method, device, system, equipment and storage medium for playing media data ) 是由 徐豪杰 汤戈 赵硕 于 2019-09-30 设计创作,主要内容包括:本申请公开了一种播放媒体数据的方法、装置、系统、设备及存储介质,属于计算机技术领域。所述方法包括:接收触发指令;基于存储的第一计数值和预设算法,生成第二计数值,存储第二计数值;生成携带有预存的权限标识和所述第二计数值的音频信号;发出所述音频信号。本申请可以防止通过录音方式盗播媒体数据。(The application discloses a method, a device, a system, equipment and a storage medium for playing media data, belonging to the technical field of computers. The method comprises the following steps: receiving a trigger instruction; generating a second count value based on the stored first count value and a preset algorithm, and storing the second count value; generating an audio signal carrying a pre-stored authority identifier and the second count value; and sending out the audio signal. The method and the device can prevent media data from being embezzled in a recording mode.)
1. A method for playing media data, applied to a first terminal, the method comprising:
receiving a trigger instruction;
generating a second count value based on the stored first count value and a preset algorithm, and storing the second count value, wherein the second count value is different from the first count value;
generating an audio signal carrying a pre-stored authority identifier and the second count value;
and sending the audio signal, wherein the audio signal is used for indicating a second terminal receiving the audio signal to acquire the authority identifier and the second count value carried in the audio signal, and sending the authority identifier and the second count value to a server.
2. The method of claim 1, wherein the generating an audio signal carrying a pre-stored permission identifier and the second count value comprises:
generating a digest value based on a pre-stored authority identifier, the second count value and a pre-stored key;
and generating an audio signal carrying the authority identification, the second counting value and the abstract value.
3. The method of claim 2, wherein the generating an audio signal carrying the permission identifier, the second count value, and the digest value comprises:
randomly sequencing the abstract value, the second counting value and the authority identification and generating corresponding sequence information;
and generating an audio signal carrying the sequence information and the randomly ordered digest value, the second count value and the authority identifier.
4. The method according to any one of claims 1-3, wherein generating the second count value based on the stored first count value and a preset algorithm comprises:
and increasing a preset increasing value for the stored first counting value to generate a second counting value.
5. A method for playing media data, applied to a second terminal, the method comprising:
receiving an audio signal sent by a first terminal;
acquiring digital information carried in the audio signal, wherein the digital information comprises an authority identifier and a second count value;
sending the digital information to a server;
and receiving a playing address of the media data sent by the server, and playing the media data based on the playing address.
6. A method for playing media data, applied to a server, the method comprising:
receiving digital information sent by a second terminal, wherein the digital information comprises an authority identifier and a second count value;
if the locally stored legal authority identifier comprises the authority identifier in the digital information and the second count value meets a preset condition relative to the first count value, acquiring a playing address of media data corresponding to the pre-stored authority identifier;
and sending the playing address of the media data corresponding to the authority identification to the second terminal.
7. The method according to claim 6, wherein the digital information further includes a digest value, and before the playing address of the media data corresponding to the pre-stored right identifier is obtained if the locally stored legal right identifier includes the right identifier in the digital information and the second count value satisfies a preset condition with respect to the first count value, the method further includes:
generating a digest value based on the authority identification, the second counting value and a pre-stored secret key in the digital information;
and determining that the generated abstract value is the same as the abstract value in the digital information.
8. The method according to claim 7, wherein the digital information further includes sequence information, the sequence information is used for recording the sequence of the authority identifier, the second count value and the digest value in the digital information, and before generating the digest value based on the authority identifier, the second count value and a pre-stored key in the digital information, the method further includes:
and acquiring the authority identification, the second counting value and the abstract value in the digital information based on the sequence information.
9. The method according to any one of claims 6 to 8, wherein the second count value satisfies a preset condition with respect to the first count value, including: the second count value is greater than the first count value.
10. An apparatus for playing media data, the apparatus comprising:
the receiving module receives a trigger instruction;
the counting module generates a second counting value based on the stored first counting value and a preset algorithm, and stores the second counting value, wherein the second counting value is different from the first counting value;
the generating module is used for generating an audio signal carrying a pre-stored authority identifier and the second counting value;
and the sending module is used for sending the audio signal, wherein the audio signal is used for indicating a second terminal receiving the audio signal to acquire the authority identifier and the second count value carried in the audio signal and sending the authority identifier and the second count value to a server.
11. The apparatus of claim 10, wherein the generating module is configured to:
generating a digest value based on a pre-stored authority identifier, the second count value and a pre-stored key;
and generating an audio signal carrying the authority identification, the second counting value and the abstract value.
12. The apparatus of claim 11, wherein the generating module is configured to:
randomly sequencing the abstract value, the second counting value and the authority identification and generating corresponding sequence information;
and generating an audio signal carrying the sequence information and the randomly ordered digest value, the second count value and the authority identifier.
13. The apparatus of any one of claims 10-12, wherein the base count module is configured to:
and increasing a preset increasing value for the stored first counting value to generate a second counting value.
14. An apparatus for playing media data, the apparatus comprising:
the receiving module is used for receiving the audio signal sent by the first terminal;
the acquisition module is used for acquiring digital information carried in the audio signal, wherein the digital information comprises an authority identifier and a second count value;
the sending module is used for sending the digital information to a server;
and the playing module is used for receiving the playing address of the media data sent by the server and playing the media data based on the playing address.
15. An apparatus for playing media data, the apparatus comprising:
the receiving module is used for receiving digital information sent by a second terminal, wherein the digital information comprises an authority identifier and a second counting value;
the acquisition module is used for acquiring a playing address of media data corresponding to a prestored authority identifier if the locally stored legal authority identifier comprises the authority identifier in the digital information and the second counting value meets a preset condition relative to the first counting value;
and the sending module is used for sending the playing address of the media data corresponding to the authority identifier to the second terminal.
16. The apparatus of claim 15, wherein the digital information further comprises a digest value, the apparatus further comprising:
the generating module generates an abstract value based on the authority identification, the second counting value and a pre-stored secret key in the digital information;
and the determining module is used for determining that the generated abstract value is the same as the abstract value in the digital information.
17. The apparatus of claim 16, wherein the digital information further comprises sequence information, and the obtaining module is further configured to:
and acquiring the authority identification, the second counting value and the abstract value in the digital information based on the sequence information.
18. The apparatus according to any one of claims 15-17, wherein the second count value satisfies a preset condition with respect to the first count value, including: the second count value is greater than the first count value.
19. A system for playing media data, the system comprising a first terminal, a second terminal and a server, wherein:
the first terminal receives a trigger instruction; generating a second count value based on the stored first count value and a preset algorithm, and storing the second count value, wherein the second count value is different from the first count value; generating an audio signal carrying a pre-stored authority identifier and the second count value; and sending out the audio signal.
The second terminal receives the audio signal sent by the first terminal; acquiring digital information carried in the audio signal, wherein the digital information comprises the authority identification and the second counting value; sending the digital information to a server; and receiving a playing address of the media data sent by the server, and playing the media data based on the playing address.
The server receives the digital information sent by the second terminal; if the locally stored legal authority identifier comprises the authority identifier in the digital information and the second count value meets a preset condition relative to the first count value, acquiring a playing address of the media data corresponding to the pre-stored authority identifier; and sending the playing address of the media data corresponding to the authority identification to the second terminal.
20. A computer device comprising a processor and a memory, the memory having stored therein at least one instruction that is loaded and executed by the processor to perform operations performed by a method of playing media data according to any one of claims 1 to 9.
21. A computer-readable storage medium having stored therein at least one instruction which is loaded and executed by a processor to perform operations performed by a method of playing media data according to any one of claims 1 to 9.
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, a system, a device, and a storage medium for playing media data.
Background
Nowadays, listening to songs is an important entertainment item in people's life, and people can buy albums in order to meet the demand of listening to songs, but with the development of networks, people do not buy physical albums any more, but buy digital albums instead.
The method comprises the steps that a user purchases an external card of a corresponding album, the external card can be regarded as a micro audio playing device, after the user obtains the external card, the user can trigger the external card to enable the external card to play a stored sound signal, the sound signal carries identification information of the external card, the terminal receives the sound signal, converts the sound signal into digital information and sends the digital information to a server, the server verifies the identification information carried in the received digital information, and after verification is completed, a notice allowing the album to be played is sent to the terminal.
In the process of implementing the present application, the inventor finds that the prior art has at least the following problems:
the sound signals played by the peripheral cards are the same every time, and if the sound signals are recorded, the album is stolen.
Disclosure of Invention
The embodiment of the application provides a method, a device, a system, equipment and a storage medium for playing media data, which can solve the problem of album stealing. The technical scheme is as follows:
in one aspect, a method for playing media data is provided, where the method is used for a first terminal, and the method includes:
receiving a trigger instruction;
generating a second count value based on the stored first count value and a preset algorithm, and storing the second count value, wherein the second count value is different from the first count value;
generating an audio signal carrying a pre-stored authority identifier and the second count value;
and sending the audio signal, wherein the audio signal is used for indicating a second terminal receiving the audio signal to acquire the authority identifier and the second count value carried in the audio signal, and sending the authority identifier and the second count value to a server.
Optionally, the generating an audio signal carrying a pre-stored authority identifier and the second count value includes:
generating a digest value based on a pre-stored authority identifier, the second count value and a pre-stored key;
and generating an audio signal carrying the authority identification, the second counting value and the abstract value.
Optionally, the generating an audio signal carrying the permission identifier, the second count value, and the digest value includes:
randomly sequencing the abstract value, the second counting value and the authority identification and generating corresponding sequence information;
and generating an audio signal carrying the sequence information and the randomly ordered digest value, the second count value and the authority identifier.
Optionally, the generating a second count value based on the stored first count value and a preset algorithm includes:
and increasing a preset increasing value for the stored first counting value to generate a second counting value.
In another aspect, a method of playing media data is provided, the method being used for a second terminal, the method including:
receiving an audio signal sent by a first terminal;
acquiring digital information carried in the audio signal, wherein the digital information comprises an authority identifier and a second count value;
sending the digital information to a server;
and receiving a playing address of the media data sent by the server, and playing the media data based on the playing address.
In another aspect, a method of playing media data is provided, the method being used for a server, the method including:
receiving digital information sent by a second terminal, wherein the digital information comprises an authority identifier and a second count value;
if the locally stored legal authority identifier comprises the authority identifier in the digital information and the second count value meets a preset condition relative to the first count value, acquiring a playing address of media data corresponding to the pre-stored authority identifier;
and sending the playing address of the media data corresponding to the authority identification to the second terminal.
Optionally, the digital information further includes a digest value, and before the playing address of the media data corresponding to the pre-stored authority identifier is acquired if the locally stored legal authority identifier includes the authority identifier in the digital information and the second count value satisfies the preset condition with respect to the first count value, the method further includes:
generating a digest value based on the authority identification, the second counting value and a pre-stored secret key in the digital information;
and determining that the generated abstract value is the same as the abstract value in the digital information.
Optionally, the digital information further includes sequence information, where the sequence information is used to record the sequence of the authority identifier, the second count value, and the digest value in the digital information, and before generating the digest value based on the authority identifier, the second count value, and a pre-stored key in the digital information, the method further includes:
and acquiring the authority identification, the second counting value and the abstract value in the digital information based on the sequence information.
Optionally, the second count value satisfies a preset condition with respect to the first count value, and the method includes: the second count value is greater than the first count value.
In another aspect, an apparatus for playing media data is provided, the apparatus being applied to a first terminal, and the apparatus including:
the receiving module receives a trigger instruction;
the counting module generates a second counting value based on the stored first counting value and a preset algorithm, and stores the second counting value, wherein the second counting value is different from the first counting value;
the generating module is used for generating an audio signal carrying a pre-stored authority identifier and the second counting value;
and the sending module is used for sending the audio signal, wherein the audio signal is used for indicating a second terminal receiving the audio signal to acquire the authority identifier and the second count value carried in the audio signal and sending the authority identifier and the second count value to a server.
Optionally, the generating module is configured to:
generating a digest value based on a pre-stored authority identifier, the second count value and a pre-stored key;
and generating an audio signal carrying the authority identification, the second counting value and the abstract value.
Optionally, the generating module is configured to:
randomly sequencing the abstract value, the second counting value and the authority identification and generating corresponding sequence information;
and generating an audio signal carrying the sequence information and the randomly ordered digest value, the second count value and the authority identifier.
Optionally, the base count module is configured to:
and increasing a preset increasing value for the stored first counting value to generate a second counting value.
In another aspect, an apparatus for playing media data is provided, the apparatus being applied to a second terminal, and the apparatus including:
the receiving module is used for receiving the audio signal sent by the first terminal;
the acquisition module is used for acquiring digital information carried in the audio signal, wherein the digital information comprises an authority identifier and a second count value;
the sending module is used for sending the digital information to a server;
and the playing module is used for receiving the playing address of the media data sent by the server and playing the media data based on the playing address.
In another aspect, an apparatus for playing media data is provided, the apparatus being applied to a server, and the apparatus including:
the receiving module is used for receiving digital information sent by a second terminal, wherein the digital information comprises an authority identifier and a second counting value;
the acquisition module is used for acquiring a playing address of media data corresponding to a prestored authority identifier if the locally stored legal authority identifier comprises the authority identifier in the digital information and the second counting value meets a preset condition relative to the first counting value;
and the sending module is used for sending the playing address of the media data corresponding to the authority identifier to the second terminal.
Optionally, the digital information further includes a digest value, and the apparatus further includes:
the generating module generates an abstract value based on the authority identification, the second counting value and a pre-stored secret key in the digital information;
and the determining module is used for determining that the generated abstract value is the same as the abstract value in the digital information.
Optionally, the digital information further includes sequence information, and the obtaining module is further configured to:
and acquiring the authority identification, the second counting value and the abstract value in the digital information based on the sequence information.
Optionally, the second count value satisfies a preset condition with respect to the first count value, and the method includes: the second count value is greater than the first count value.
In another aspect, a system for playing media data is provided, where the system includes a first terminal, a second terminal, and a server, where:
the first terminal receives a trigger instruction; generating a second count value based on the stored first count value and a preset algorithm, and storing the second count value, wherein the second count value is different from the first count value; generating an audio signal carrying a pre-stored authority identifier and the second count value; and sending out the audio signal.
The second terminal receives the audio signal sent by the first terminal; acquiring digital information carried in the audio signal, wherein the digital information comprises the authority identification and the second counting value; sending the digital information to a server; and receiving a playing address of the media data sent by the server, and playing the media data based on the playing address.
The server receives the digital information sent by the second terminal; if the locally stored legal authority identifier comprises the authority identifier in the digital information and the second count value meets a preset condition relative to the first count value, acquiring a playing address of the media data corresponding to the pre-stored authority identifier; and sending the playing address of the media data corresponding to the authority identification to the second terminal.
In yet another aspect, a computer device is provided that includes one or more processors and one or more memories having at least one instruction stored therein, the instruction being loaded and executed by the one or more processors to implement the operations performed by the method of playing media data.
In yet another aspect, a computer-readable storage medium having at least one instruction stored therein is provided, which is loaded and executed by a processor to implement the operations performed by the method for playing media data.
The technical scheme provided by the embodiment of the application has the following beneficial effects:
in the embodiment of the application, the digital information transmitted to the second terminal by the first terminal through the audio signal further comprises a count value which changes continuously except the authority identifier, so that the count value in the audio signal obtained through recording is the count value which is used, and when the server judges the count value, the playing address of the media data is sent to the terminal only when the count value meets the change condition, so that the media data can be prevented from being illegally played in a recording mode.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic diagram of an implementation environment provided by an embodiment of the present application;
fig. 2 is a schematic view of a listening interface provided in an embodiment of the present application;
fig. 3 is a schematic view of an album interface provided in an embodiment of the present application;
fig. 4 is a flowchart of a first terminal side in a method for playing media data according to an embodiment of the present application;
fig. 5 is a flowchart of a second terminal side in a method for playing media data according to an embodiment of the present application;
fig. 6 is a flowchart of a server side in a method for playing media data according to an embodiment of the present application;
fig. 7 is a flowchart illustrating interaction between a terminal and a server in a method for playing media data according to an embodiment of the present application;
fig. 8 is a schematic diagram of a list in a database of a server in a method for playing media data according to an embodiment of the present application;
fig. 9 is a flowchart illustrating permission verification performed by a server in a method for playing media data according to an embodiment of the present application;
fig. 10 is a schematic structural diagram of a first terminal side in a device for playing media data according to an embodiment of the present application;
fig. 11 is a schematic structural diagram of a second terminal side in a device for playing media data according to an embodiment of the present application;
fig. 12 is a schematic structural diagram of a server side in a device for playing back media data according to an embodiment of the present application;
fig. 13 is a schematic structural diagram of a terminal provided in an embodiment of the present application;
fig. 14 is a schematic structural diagram of a server provided in an embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
Fig. 1 is a schematic diagram of an implementation environment of a method for playing media data according to an embodiment of the present application. Referring to fig. 1, an embodiment of the present application provides a method for playing media data, which may be implemented by a first terminal, a second terminal, and a server together. The first terminal may have a data storage function, a data calculation function, and a data conversion function, the first terminal may have a screen, a switch, a speaker, and the like, and the first terminal may be an external card. The second terminal can have the functions of receiving audio and data conversion and can be connected to the internet, a media data playing application program such as an audio and video player can be operated on the second terminal, the second terminal can have components such as a display screen, a microphone and a loudspeaker, and the second terminal can be a mobile phone, a tablet computer, intelligent wearable equipment, a desktop computer, a notebook computer and the like. The server may be a background server for the application, and the server may establish communication with the second terminal. The server may be a single server or a server group, if the server is a single server, the server may be responsible for all processing that needs to be performed by the server in the following scheme, if the server is a server group, different servers in the server group may be responsible for different processing in the following scheme, respectively, and the specific processing allocation condition may be set arbitrarily by a technical person according to actual needs, and is not described herein again.
The method for playing the media data provided in the embodiment of the application can acquire the same digital album according to different audio signals generated by the same device. In the embodiment of the present application, the detailed description of the scheme is performed by taking an example that the first terminal is an external card, the second terminal is a mobile phone, the application program is a music player, and the media data is a digital album, and other cases are similar and will not be described again. The peripheral card may send audio signals, the music player may receive the audio signals and convert them to digital information, and may play a digital album.
When a user wants to play a digital album, the user can open a music player on the mobile phone to enter a monitoring interface, as shown in fig. 2, and then click a switch of the peripheral card to open the peripheral card, and the peripheral card can play an audio signal after being opened. The music player receives the audio signal, converts the audio signal into digital information and sends the digital information to the server, the server checks the digital information after receiving the digital information, a digital album is sent to the mobile phone after the check is completed, the music player automatically jumps to an album interface after the mobile phone receives the digital album, as shown in fig. 3, a user can send comments in the album interface by using an account number bound with a peripheral card and can download pictures in the digital album, and meanwhile, the bound account number can display the account number place in all interfaces and add a unique identifier of the digital album.
Fig. 4 is a flowchart of a first terminal side in a method for playing media data according to an embodiment of the present application. Referring to fig. 4, the embodiment includes:
step 401, receiving a trigger instruction.
Step 402, generating a second count value based on the stored first count value and a preset algorithm, and storing the second count value, wherein the second count value is different from the first count value.
And step 403, generating an audio signal carrying the pre-stored authority identifier and the second count value.
And step 404, sending an audio signal, wherein the audio signal is used for indicating a second terminal receiving the audio signal to acquire the authority identifier and the second count value carried in the audio signal, and sending the authority identifier and the second count value to the server.
Fig. 5 is a flowchart of a second terminal side in a method for playing media data according to an embodiment of the present application. Referring to fig. 5, the embodiment includes:
Fig. 6 is a flowchart of a server side in a method for playing media data according to an embodiment of the present application. Referring to fig. 6, the embodiment includes:
Fig. 7 is a flowchart illustrating interaction between a terminal and a server in a method for playing media data according to an embodiment of the present application. Referring to fig. 7, the embodiment includes:
Wherein the second count value is different from the first count value.
In implementation, a user clicks a switch of the peripheral card to electrify the peripheral card, the peripheral card inputs a first count value pre-stored inside into a function for increasing a preset increase value to perform calculation, so as to obtain a second count value, for example, the first count value is 0, the preset increase value is increased to 1, the first count value 0 is input into the function, a second count value 1 is obtained through function operation, and then the obtained second count value is stored to cover the first count value.
The peripheral card generates an audio signal through a conversion function, wherein the conversion function can be the corresponding relation between the first 16 bits in the ASCI I code and the audio frequency, each audio frequency is the only one audio frequency in the range of 18kHz-22kHz, namely the conversion function is the corresponding relation between the audio frequency and the characters.
In an implementation, the peripheral card first generates a digest value based on the pre-stored authority identifier, the second count value and the pre-stored key, and the method may process the following steps:
firstly, the peripheral card performs initial digest value calculation, the step can be performed through an SHA256 algorithm, and the peripheral card inputs the authority identifier, the second count value and a pre-stored key into the SHA256 algorithm to obtain an initial digest value with 32 bits.
And step two, the peripheral card shortens the calculated initial digest value to a digest value with a uniform preset length, the step can be carried out through an MD5 message digest algorithm, and the peripheral card inputs the initial digest value obtained in the step into an MD5 message digest algorithm to obtain a digest value with a preset length of 16 bits.
Secondly, the peripheral card randomly orders the abstract value, the second count value and the authority identifier and generates corresponding sequence information, and the specific processing can be as follows:
after the abstract value is obtained, three sections of character strings to be processed, namely the abstract value, the second counting value and the authority identification, are stored in the peripheral card, the three sections of character strings to be processed are randomly sequenced to generate a sending queue, the sending queue is a queue for finally inputting a conversion function, and the sequence of all the character strings in the sending queue is recorded as another section of character string, namely sequence information.
Then, the peripheral card generates an error correction code based on the digest value, the second count value, the authority identifier, and the final arrangement order of the order information, and the specific processing may be as follows:
after the order information is obtained, it may be placed at the forefront or the rearmost in the transmission queue. The peripheral card generates an error correcting code based on the four-segment character string of the transmission queue, the generated error correcting code can be a hamming error correcting code, and the generation of the hamming error correcting code firstly needs to calculate the number of the error correcting code according to the binary digit number of all characters in the transmission queue and the preset binary digit number of the transmission queue. And secondly, finding the position of the power of 2 n in the binary digits of all characters in the transmission queue as the insertion position of the error correcting code. Each error correcting code detects the character 2 power of n-1 before the error correcting code to obtain the parity of the part, and repeats the operation to obtain all the error correcting codes and stores the error correcting codes in the queue.
After the sending queue is subjected to the operation, the peripheral card inputs the sending queue into the conversion function to obtain a section of audio signals composed of different audio frequencies, and the peripheral card sends the audio signals outwards.
Step 703, the first terminal sends out an audio signal to the outside.
In the implementation, the peripheral card plays the audio signal of 18kHz-22kHz which can not be heard by human ears through a loudspeaker on the peripheral card, so that the influence of noise in the environment on the audio information is reduced as much as possible.
The digital information includes the right identifier and the second count value, and may further include the digest value and the sequence information, and may further include the error correction code.
In implementation, a user opens a music player in a mobile phone to log in an account, then enters a monitoring interface, the music player enters a monitoring state, the music player receives an audio signal sent by an external card, records the audio frequency of the received audio signal, namely records the audio signal as digital information, and sends the recorded digital information and the account to a server.
Step 705, the server receives the digital information sent by the second terminal.
In implementation, the digital information is sent to the server, and the specific processing may be as follows:
firstly, a server receives digital information and an account number sent by a second terminal, the server extracts the account number from all received contents, the rest contents are the digital information, the digital information is recorded in the form of audio frequency, the rest digital information is input into a conversion function, and the server analyzes the digital information into a binary character string according to the corresponding relation between the audio frequency and characters in the conversion function.
And step two, after the character string is obtained, the server corrects errors according to the error correcting codes, divides the characters covered by each error correcting code into one group, and performs logic exclusive-or operation on all the groups, wherein if the operation results of all the groups are 0, the character string has no errors, if the operation result of one group is 1, the character string has errors, and if the results of the groups are wrong, the characters covered by the groups at the same time have errors, and the errors can be corrected by negating the characters with errors. The corrected character string may include the authority identifier and the second count value, and may further include the digest value and the sequence information.
Step 706, if the legal authority identifier stored locally in the server includes the authority identifier in the digital information, and the second count value satisfies the preset condition relative to the first count value, the playing address of the media data corresponding to the pre-stored authority identifier is obtained.
Wherein the preset condition is set before executing the scheme.
In implementation, the server obtains a correct character string after error correction, then obtains a digest value, a second count value and an authority identifier according to sequence information, and respectively checks the three sections of characters, firstly checks whether the authority identifier is the correct authority identifier, then checks whether the second count value of the terminal is greater than the first count value of the server, and finally checks whether the digest value is the same as the digest value calculated by the server.
After the verification, whether the peripheral card is legal or not can be judged, whether the sound signal is correct or not can be judged, whether the secret key is correct or not can be judged, after the verification is completed, the server verifies whether the authority identification in the list stored in the database is bound with the account number or not, if the account number is not bound, the corresponding peripheral card can be known to be used for the first time, the account number is bound to the authority identification, namely, the account number is added to the corresponding position in the list shown in the figure 8, the second counting value of the terminal is assigned to the first counting value of the server, meanwhile, the server can obtain the sales volume of the digital album based on the number of the bound authority identification and the account number, and the server can also add one to the sales volume of the digital album when the authority identification and the account number are timed.
Step 707, the server sends the play address of the media data corresponding to the permission identifier to the second terminal.
In implementation, after the server completes the above operation, the server sends the play address of the digital album corresponding to the authority identifier in the list to the mobile phone. If the account number is bound, the corresponding peripheral card is known to be not used for the first time, and the playing address of the digital album corresponding to the authority identifier is directly sent to the mobile phone according to the list.
In
In implementation, when the mobile phone receives a play address of a digital album, the music player directly accesses the play address, if the account logged in the mobile phone is a bound account, a unique identifier of the album is displayed below the account, comments, pictures, the digital album and the like can be downloaded in an album interface, and if the account is a non-bound account, only the digital album can be played.
Fig. 9 is a flowchart illustrating an authority check performed by a server in a method for playing media data according to an embodiment of the present application. Referring to fig. 9, the embodiment includes:
In the implementation, the server checks the authority identifier in the list, checks whether the authority identifier in the list is the same as the authority identifier of the terminal, and if the authority identifier in the list is the same as the authority identifier of the terminal, carries out the next check.
And step 902, comparing the second count value of the terminal with the first count value of the server.
In implementation, the server queries a first count value of the server stored in the database, compares the first count value with a second count value of the terminal after the first count value is obtained, and performs the next inspection if the first count value of the server is smaller than the second count value of the terminal.
And 903, generating a digest value based on the authority identifier, the second count value and a pre-stored key in the digital information.
In implementation, the server first performs the initial digest value calculation of the server, which may be performed by using the SHA256 algorithm, first queries the list according to the authority identifier to obtain the key of the server, and then inputs the authority identifier, the second count value of the terminal, and the key of the server into the SHA256 algorithm to obtain the initial digest value of the server with 32 bits.
Secondly, the server shortens the calculated initial digest value of the server to a digest value with a uniform preset length, the step can be performed by using an MD5 message digest algorithm, and the initial digest value obtained in the step is input into an MD5 message digest algorithm, so that a digest value of the server with the preset length of 16 bits is obtained.
In practice, the obtained digest value of the server is compared with the obtained digest value of the terminal, and if they are the same, the check is completed.
If the result of the check in any of the above steps is negative, the server sends a notification that the digital album cannot be acquired to the second terminal.
In the embodiment of the application, the digital information transmitted to the second terminal by the first terminal through the audio signal further comprises a count value which changes continuously except the authority identifier, so that the count value in the audio signal obtained through recording is the count value which is used, and when the server judges the count value, the playing address of the media data is sent to the terminal only when the count value meets the change condition, so that the media data can be prevented from being illegally played in a recording mode.
All the above optional technical solutions may be combined arbitrarily to form optional embodiments of the present application, and are not described herein again.
An embodiment of the present application provides an apparatus for playing media data, where the apparatus may be a first terminal in the foregoing embodiment, and as shown in fig. 10, the apparatus includes:
the receiving module 1010 receives a trigger instruction.
The counting module 1020 generates a second count value based on the stored first count value and a preset algorithm, and stores the second count value, wherein the second count value is different from the first count value.
The generating module 1030 generates an audio signal carrying the pre-stored authority identifier and the second count value.
The sending module 1040 is configured to send the audio signal to the outside, where the audio signal is used to instruct a second terminal that receives the audio signal to obtain the permission identifier and the second count value that are carried in the audio signal, send the permission identifier and the second count value to a server, receive a play address of media data sent by the server, and play the media data based on the play address.
Optionally, the generating module 1030 is configured to:
and generating a digest value based on the pre-stored authority identification, the second counting value and a pre-stored secret key.
And generating an audio signal carrying the authority identification, the second counting value and the abstract value.
Optionally, the generating module 1030 includes:
and randomly sequencing the abstract value, the second counting value and the authority identification, and generating corresponding sequence information.
And generating an audio signal carrying the sequence information and the randomly ordered digest value, the second count value and the authority identifier.
Optionally, the base count module 1020 is configured to:
and increasing a preset increasing value for the stored first counting value to generate a second counting value.
An embodiment of the present application provides a device for playing media data, where the device may be a second terminal in the foregoing embodiment, as shown in fig. 11, the device includes:
the receiving module 1110 receives an audio signal transmitted by a first terminal.
The obtaining module 1120 obtains digital information carried in the audio signal, where the digital information includes an authority identifier and a second count value.
The sending module 1130 sends the digital information to a server.
The playing module 1140 receives a playing address of the media data sent by the server, and plays the media data based on the playing address.
An embodiment of the present application provides an apparatus for playing media data, where the apparatus may be a server in the foregoing embodiment, and as shown in fig. 12, the apparatus includes:
the
The obtaining
The sending
Optionally, the digital information further includes a digest value, and the apparatus further includes:
and the generation module generates a digest value based on the authority identification, the second counting value and a pre-stored secret key in the digital information.
And the determining module is used for determining that the generated abstract value is the same as the abstract value in the digital information.
Optionally, the digital information further includes sequence information, and the obtaining
and acquiring the authority identification, the second counting value and the abstract value in the digital information based on the sequence information.
Optionally, the second count value satisfies a preset condition with respect to the first count value, and the method includes: the second count value is greater than the first count value.
In the embodiment of the application, the digital information transmitted to the second terminal by the first terminal through the audio signal further comprises a count value which changes continuously except the authority identifier, so that the count value in the audio signal obtained through recording is the count value which is used, and when the server judges the count value, the playing address of the media data is sent to the terminal only when the count value meets the change condition, so that the media data can be prevented from being illegally played in a recording mode. It should be noted that: in the device for playing media data according to the foregoing embodiment, when playing media data, the above-mentioned division of each functional module is merely used as an example, and in practical applications, the above-mentioned function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the above-mentioned functions. In addition, the embodiments of the method for playing media data provided in the foregoing embodiments belong to the same concept, and specific implementation processes thereof are described in the embodiments of the method for playing media data, and are not described herein again.
An embodiment of the present application further provides a system for playing media data, where the system includes a first terminal, a second terminal, and a server, where:
the first terminal receives a trigger instruction; generating a second count value based on the stored first count value and a preset algorithm, and storing the second count value, wherein the second count value is different from the first count value; generating an audio signal carrying a pre-stored authority identifier and the second count value; and sending the audio signal to the outside.
The second terminal receives the audio signal sent by the first terminal; acquiring digital information carried in the audio signal, wherein the digital information comprises an authority identifier and a second count value; sending the digital information to a server; and receiving a playing address of the media data sent by the server, and playing the media data based on the playing address.
The server receives digital information sent by the second terminal; if the locally stored legal authority identifier comprises the authority identifier in the digital information and the second count value meets a preset condition relative to the first count value, acquiring a playing address of media data corresponding to the pre-stored authority identifier; and sending the playing address of the media data corresponding to the authority identification to the second terminal.
Fig. 13 shows a block diagram of a terminal 1300 according to an exemplary embodiment of the present application. The terminal may be the first terminal or the second terminal in the above embodiments. The terminal 1300 may be: a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III, motion video Experts compression standard Audio Layer 3), an MP4 player (Moving Picture Experts Group Audio Layer IV, motion video Experts compression standard Audio Layer 4), a notebook computer, or a desktop computer. Terminal 1300 may also be referred to by other names such as user equipment, portable terminal, laptop terminal, desktop terminal, etc.
In general, terminal 1300 includes: a
In some embodiments, terminal 1300 may further optionally include: a
The
The
The
The
The
In some embodiments, terminal 1300 also includes one or more sensors 1310. The one or more sensors 1310 include, but are not limited to: acceleration sensor 1311, gyro sensor 1312, pressure sensor 1313, fingerprint sensor 1314, optical sensor 1315, and proximity sensor 1316.
The acceleration sensor 1311 can detect the magnitude of acceleration on three coordinate axes of the coordinate system established with the
The gyro sensor 1312 may detect the body direction and the rotation angle of the terminal 1300, and the gyro sensor 1312 may cooperate with the acceleration sensor 1311 to acquire a 3D motion of the user with respect to the
Pressure sensor 1313 may be disposed on a side bezel of terminal 1300 and/or
The fingerprint sensor 1314 is used for collecting the fingerprint of the user, and the
The optical sensor 1315 is used to collect the ambient light intensity. In one embodiment, the
Proximity sensor 1316, also known as a distance sensor, is typically disposed on a front panel of terminal 1300. Proximity sensor 1316 is used to gather the distance between the user and the front face of terminal 1300. In one embodiment, the
Those skilled in the art will appreciate that the configuration shown in fig. 13 is not intended to be limiting with respect to terminal 1300 and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components may be employed.
Fig. 14 is a schematic structural diagram of a server according to an embodiment of the present application, where the
In an exemplary embodiment, a computer-readable storage medium, such as a memory, including instructions executable by a processor in a terminal to perform the method of playing media data in the above embodiments is also provided. For example, the computer-readable storage medium may be a Read-only Memory (ROM), a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the protection scope of the present application.
- 上一篇:一种医用注射器针头装配设备
- 下一篇:音频特征提取方法、装置及介质