CN110798458B - Data synchronization method, device, equipment and computer readable storage medium - Google Patents

Data synchronization method, device, equipment and computer readable storage medium Download PDF

Info

Publication number
CN110798458B
CN110798458B CN201911007340.6A CN201911007340A CN110798458B CN 110798458 B CN110798458 B CN 110798458B CN 201911007340 A CN201911007340 A CN 201911007340A CN 110798458 B CN110798458 B CN 110798458B
Authority
CN
China
Prior art keywords
sound card
data volume
playing
threshold
current
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
Application number
CN201911007340.6A
Other languages
Chinese (zh)
Other versions
CN110798458A (en
Inventor
李光英
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Weifang Goertek Microelectronics Co Ltd
Original Assignee
Weifang Goertek Microelectronics Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Weifang Goertek Microelectronics Co Ltd filed Critical Weifang Goertek Microelectronics Co Ltd
Priority to CN201911007340.6A priority Critical patent/CN110798458B/en
Publication of CN110798458A publication Critical patent/CN110798458A/en
Application granted granted Critical
Publication of CN110798458B publication Critical patent/CN110798458B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/60Network streaming of media packets
    • H04L65/61Network streaming of media packets for supporting one-way streaming services, e.g. Internet radio
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/25Flow control; Congestion control with rate being modified by the source upon detecting a change of network conditions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/29Flow control; Congestion control using a combination of thresholds
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/60Network streaming of media packets
    • H04L65/75Media network packet handling

Abstract

The invention discloses a data synchronization method, a data synchronization device, data synchronization equipment and a computer readable storage medium. The method comprises the following steps: under the condition that the data volume in the sound card cache is greater than a first threshold value for the first time, executing the operation of playing the sound signal by the sound card; acquiring the current data volume in the cache during the sound card playing the sound signal; under the condition that the current data volume is smaller than a second threshold or larger than a third threshold, determining the playing rate adjustment amount of the sound card according to the difference value between the current data volume and the historical data volume and the time interval between the acquisition of the current data volume and the acquisition of the historical data volume; the historical data volume is the data volume in the cache when the playing speed of the sound card is adjusted last time, and the first threshold is larger than the second threshold and smaller than the third threshold; and adjusting the current playing speed of the sound card according to the playing speed adjustment quantity.

Description

Data synchronization method, device, equipment and computer readable storage medium
Technical Field
The present invention relates to the field of acoustic technologies, and in particular, to a data synchronization method, a data synchronization apparatus, an audio playback device, and a computer-readable storage medium.
Background
Currently, when a user listens to a sound signal (e.g., music) through a device such as a computer, the device first decodes an audio file into an audio data stream and then sends the audio data stream to a sound card (the sound card may be a sound card of the device or a sound card of an audio device connected to the device). The sound card stores the audio data stream sent by the equipment in a buffer memory of the sound card, and then converts the audio data stream in the buffer memory into a sound signal. Based on which the listening of the sound signal is realized.
However, the device and the sound card are not synchronized in terms of clock, because the device and the sound card are operated independently under their own clocks, and the operating system on which the device operates is usually a non-real-time operating system. This results in the rate at which the device decodes the audio file into an audio data stream not being the same as the rate at which the sound card converts the audio data stream into a sound signal, which affects the quality of the sound signal played by the sound card.
Specifically, when the rate of decoding the audio file into the audio data stream by the device is greater than the rate of converting the audio data stream into the sound signal by the sound card, the audio data stream in the buffer of the sound card will overflow, resulting in the loss of part of the audio data stream, and further resulting in the situations of noise, discontinuous playing, and the like of the sound signal played by the sound card. When the rate of decoding the audio file into the audio data stream by the device is less than the rate of converting the audio data stream into the sound signal by the sound card, the situation that the sound card finishes converting the audio data stream in the buffer memory and the buffer memory is empty exists. At this time, the sound card will temporarily stop playing the sound signal until the audio data stream is newly stored in the buffer.
Disclosure of Invention
It is an object of the present invention to provide a new solution for data synchronization.
According to a first aspect of the present invention, there is provided a data synchronization method, comprising:
under the condition that the data volume in the sound card cache is greater than a first threshold value for the first time, executing the operation of playing the sound signal by the sound card;
acquiring the current data volume in the cache during the sound card playing sound signals;
under the condition that the current data volume is smaller than a second threshold or larger than a third threshold, determining the play rate adjustment quantity of the sound card according to the difference value between the current data volume and the historical data volume and the time interval between the acquisition of the current data volume and the acquisition of the historical data volume; the historical data amount is the data amount in the cache when the playing rate of the sound card is adjusted last time, and the first threshold is greater than the second threshold and smaller than the third threshold;
and adjusting the current playing speed of the sound card according to the playing speed adjustment quantity.
Optionally, the obtaining the current data size in the sound card buffer during the sound card playing the sound signal includes:
and during the sound signal playing period of the sound card, regularly acquiring the current data volume in the sound card cache according to a set time interval.
Optionally, when the current data amount is smaller than a second threshold, determining a play rate adjustment amount of the sound card according to a difference between the current data amount and a historical data amount and a time interval between the time when the current data amount is obtained and the time when the historical data amount is obtained, including:
and determining the playing rate adjustment amount of the sound card according to the difference value between the current data volume and the historical data volume and the time interval between the acquisition of the current data volume and the acquisition of the historical data volume under the condition that the current data volume is smaller than the second threshold and new data is written in the cache.
Optionally, the method further includes a step of determining whether new data is written into the cache, where the determining whether new data is written into the cache includes:
and determining whether new data is written in the cache or not according to whether an instruction which is sent by an upper computer and used for representing the completion of the transmission of the audio data stream is received or not.
Optionally, the adjusting the current playing speed of the sound card according to the playing speed adjustment amount includes:
determining the clock frequency adjustment quantity of the phase-locked loop of the sound card according to the play rate adjustment quantity;
and adjusting the current playing speed of the sound card by adjusting the clock frequency output by the phase-locked loop according to the clock adjustment quantity.
Optionally, a main phase-locked loop and a standby phase-locked loop are arranged in the sound card; the main phase-locked loop is used for controlling the playing speed of the sound card through the clock frequency output by the main phase-locked loop; the adjusting the current playing speed of the sound card according to the playing speed adjustment quantity comprises:
determining the clock frequency adjustment quantity of the standby phase-locked loop according to the rate adjustment quantity;
adjusting the clock frequency of the standby phase-locked loop according to the clock frequency adjustment amount;
and switching the adjusted standby phase-locked loop into a new main phase-locked loop so as to adjust the current playing speed of the sound card through the clock frequency output by the new main phase-locked loop.
Optionally, the sound card is a sound card based on a USB Audio protocol.
According to a second aspect of the present invention, there is provided a data synchronization apparatus comprising:
the execution module is used for executing the operation of playing the sound signal by the sound card under the condition that the data volume in the sound card cache is greater than a first threshold value for the first time;
the acquisition module is used for acquiring the current data volume in the cache during the sound card playing sound signals;
the determining module is used for determining the playing rate adjustment amount of the sound card according to the difference value between the current data volume and the historical data volume and the time interval between the acquisition of the current data volume and the acquisition of the historical data volume under the condition that the current data volume is smaller than a second threshold or larger than a third threshold; the historical data volume is the data volume in the cache when the playing speed of the sound card is adjusted last time, and the first threshold is larger than the second threshold and smaller than the third threshold;
and the adjusting module is used for adjusting the current playing speed of the sound card according to the playing speed adjusting quantity.
According to a third aspect of the present invention, there is provided an audio playback apparatus comprising:
the apparatus according to the second aspect described above, or,
comprising a memory for storing computer instructions and a processor for invoking the computer instructions from the memory for performing the data synchronization method of any of the first aspects.
According to a fourth aspect of the present invention, there is provided a computer-readable storage medium comprising:
the storage medium stores computer instructions which, when executed by a processor, implement the data synchronization method of any one of the first aspect.
In the embodiment of the present invention, when the current data amount is smaller than the second threshold or larger than the third threshold, it indicates that the rate at which the upper computer decodes the audio file into the audio data stream is different from the playing rate of the sound signal played by the sound card, and will affect the quality of the sound signal played by the sound card. At the moment, determining the play rate adjustment quantity of the sound card according to the difference value between the current data quantity and the historical data quantity and the time interval between the acquisition of the current data quantity and the acquisition of the historical data quantity; and adjusting the current playing speed of the sound card according to the playing speed adjustment quantity. In this way, by adjusting the current playing rate of the sound card, the amount of data in the buffer memory can be greater than or equal to the second threshold and less than or equal to the third threshold in the following. I.e. to bring the amount of data in the buffer close to the first threshold. At this time, the rate at which the upper computer decodes the audio file into the audio data stream is explained to be approximately the same as the playing rate of the sound signal played by the sound card. Therefore, the quality of the sound signal played by the sound card cannot be influenced, thereby avoiding the situations that the sound signal played by the sound card has noise, discontinuous playing and the like, and avoiding the situation that the sound card temporarily stops playing the sound signal.
Other features of the present invention and advantages thereof will become apparent from the following detailed description of exemplary embodiments thereof, which proceeds with reference to the accompanying drawings.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description, serve to explain the principles of the invention.
Fig. 1 is a schematic flow chart of a data synchronization method according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a data synchronization apparatus according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of an audio playing device according to an embodiment of the present invention.
Detailed Description
Various exemplary embodiments of the present invention will now be described in detail with reference to the accompanying drawings. It should be noted that: the relative arrangement of the components and steps, the numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present invention unless specifically stated otherwise.
The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the invention, its application, or uses.
Techniques, methods, and apparatus known to those of ordinary skill in the relevant art may not be discussed in detail but are intended to be part of the specification where appropriate.
In all examples shown and discussed herein, any particular value should be construed as merely illustrative, and not limiting. Thus, other examples of the exemplary embodiments may have different values.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, further discussion thereof is not required in subsequent figures.
< method examples >
The embodiment of the invention provides a data synchronization method, and the execution main body of the method is a data synchronization device. The apparatus may be an audio playback device comprising a sound card. Or the apparatus may also be a hardware module and/or a software module in the audio playing device.
In one embodiment, the audio playing device may be a computer or a mobile phone. In another embodiment, the audio playing device may also be a sound box connected to a device such as a computer or a mobile phone.
As shown in fig. 1, the data synchronization method provided in this embodiment includes the following steps S101 to S104:
s101, under the condition that the data volume in the sound card cache is larger than a first threshold value for the first time, the sound card is executed to play sound signals.
In this embodiment, the first threshold may be determined according to actual requirements or the size of the sound card buffer capacity. This embodiment is not limited thereto.
In addition, the above-mentioned playing of the sound signal by the sound card means that the sound card converts the data amount in the buffer into the sound signal. In addition, the data corresponding to the data amount in the buffer is an audio data stream.
It should be noted that, when the sound card starts playing the sound signal, the sound card plays the sound signal at a preset playing rate.
In one embodiment, the sound card in S101 may be a sound card based on a USB Audio protocol.
S102, during the sound signal playing period of the sound card, the current data volume in the cache is obtained.
In one embodiment, the step S101 may be: and randomly acquiring the current data volume in the sound card buffer memory during the sound card playing the sound signal.
In another embodiment, the step S101 may further include: and during the sound signal playing period of the sound card, regularly acquiring the current data volume in the sound card cache according to a set time interval. The set time interval may be 1s, but may be other. This embodiment is not limited thereto.
S103, under the condition that the current data volume is smaller than a second threshold or larger than a third threshold, determining the playing rate adjustment amount of the sound card according to the difference value between the current data volume and the historical data volume and the time interval between the acquisition of the current data volume and the acquisition of the historical data volume.
The historical data amount is the data amount in the cache when the playing speed of the sound card is adjusted last time, and the first threshold is larger than the second threshold and smaller than the third threshold.
In this embodiment, the second threshold is a difference obtained by subtracting the maximum deviation from the first threshold. The third threshold is the sum of the first threshold plus the maximum deviation. The maximum deviation refers to the maximum variation of the data amount in the buffer memory without affecting the quality of the sound signal played by the sound card during the period of playing the sound signal by the sound card. Based on this, when the current data amount is smaller than the second threshold or larger than the third threshold, the quality of the sound signal played by the sound card is affected, and at this time, the playing rate of the sound card needs to be adjusted.
In addition, when the current data volume is smaller than the second threshold, it indicates that the current playing speed of the sound card is greater than the speed of the upper computer decoding the audio file into the audio data stream, and the situation that the sound card is about to temporarily stop playing the sound signal occurs. Correspondingly, when the current data volume is larger than the third threshold, it indicates that the current playing rate of the sound card is smaller than the rate of the upper computer decoding the audio file into the audio data stream, and the audio data stream in the sound card cache will overflow.
In one example, when the sound card is a sound card in a sound box connected to a device such as a mobile phone or a computer, the upper computer is the device such as the mobile phone or the computer. In another example, when the sound card is a computer or a mobile phone, the upper computer is recorded as the computer or the mobile phone.
In one example, the current data size is denoted as M1, the history data size is denoted as M2, the time interval between the acquisition of the current data size M1 and the acquisition of the history data size M2 is denoted as t, and the rate adjustment amount is denoted as Δ V. The above-mentioned S103 can be specifically expressed by the following formula:
ΔV=K*(M1-M2)/t
wherein K is an adjustment coefficient, and K is an integer less than or equal to 1. In addition, the specific value of K can be set according to experience, and generally K takes a value between 0.1 and 0.5.
Based on the above formula, Δ V is less than 0 when M1 is greater than M2. When M1 is greater than M2, Δ V is greater than 0. When M1 equals M2, Δ V equals 0.
It should be noted that, when the current data size is smaller than the second threshold for the first time, or is larger than the third threshold for the first time, the historical data size is the first threshold.
And S104, adjusting the current playing speed of the sound card according to the playing speed adjustment quantity.
In this embodiment, the foregoing S104 is specifically implemented as: and adjusting the playing speed of the sound card to be the vector sum of the current playing speed and the playing speed adjustment quantity and the corresponding playing speed.
It should be noted that, the present embodiment does not limit the specific implementation of adjusting the current playing rate of the sound card.
In the embodiment of the present invention, when the current data amount is smaller than the second threshold or larger than the third threshold, it indicates that the rate at which the upper computer decodes the audio file into the audio data stream is different from the playing rate of the sound signal played by the sound card, and will affect the quality of the sound signal played by the sound card. At the moment, determining the play rate adjustment quantity of the sound card according to the difference value between the current data quantity and the historical data quantity and the time interval between the acquisition of the current data quantity and the acquisition of the historical data quantity; and adjusting the current playing speed of the sound card according to the playing speed adjustment quantity. In this way, by adjusting the current playing speed of the sound card, the amount of data in the buffer will be greater than or equal to the second threshold and less than or equal to the third threshold in the following. I.e. to bring the amount of data in the buffer close to the first threshold. At this time, the rate at which the upper computer decodes the audio file into the audio data stream is explained to be approximately the same as the playing rate of the sound signal played by the sound card. Therefore, the quality of the sound signal played by the sound card cannot be influenced, thereby avoiding the situations that the sound signal played by the sound card has noise, discontinuous playing and the like, and avoiding the situation that the sound card temporarily stops playing the sound signal.
In an embodiment, when the current data amount is smaller than the second threshold in S103, determining the playing rate adjustment amount of the sound card according to the difference between the current data amount and the historical data amount and the time interval between the obtaining of the current data amount and the obtaining of the historical data amount may specifically include the following S1031:
and S1031, under the condition that the current data volume is smaller than the second threshold and new data is written in the cache, determining the playing rate adjustment amount of the sound card according to the difference value between the current data volume and the historical data volume and the time interval between the acquisition of the current data volume and the acquisition of the historical data volume.
In this embodiment, when new data is written in the cache, it is described that the audio file has not been decoded by the upper computer, and the upper computer needs to continue the decoding operation. In this case, there is a case where the rate at which the upper computer decodes the audio file into the audio data stream is different from the rate at which the sound card plays. Therefore, at this time, the playing rate adjustment amount of the sound card needs to be determined according to the difference between the current data amount and the historical data amount and the time interval between the acquisition of the current data amount and the acquisition of the historical data amount.
In this embodiment, since the step of determining the playing rate adjustment amount of the sound card according to the difference between the current data amount and the historical data amount and the time interval between the acquisition of the current data amount and the acquisition of the historical data amount is performed only when the current data amount is smaller than the second threshold and new data is written in the cache, it is avoided that the audio file is decoded by the upper computer and the rate at which the audio file is decoded into an audio data stream by the upper computer is not the same as the playing rate of the sound card, and unnecessary resource waste of the sound card is avoided.
Based on the previous embodiment, the data synchronization method provided in this embodiment further includes a step of determining whether new data is written in the cache. Wherein determining whether new data is written in the cache comprises:
and determining whether new data is written in the cache or not according to whether an instruction which is sent by the upper computer and used for representing the completion of the transmission of the audio data stream is received or not.
In this embodiment, after the upper computer sends the audio data streams converted by the audio files to the sound card, an instruction representing that the audio data streams are completely transmitted is sent to the sound card. Therefore, when an instruction which is sent by the upper computer and used for representing the completion of the transmission of the audio data stream is received, it is determined that new data is not written into the cache. And otherwise, when the instruction which is sent by the upper computer and used for representing the completion of the transmission of the audio data stream is not received, determining that the new data is written in the cache.
On the basis of any of the above embodiments, the above S104 may be implemented by a phase-locked loop in the sound card. Based on this, the present embodiment provides the following two ways to realize the above S104 by the phase-locked loop.
In a first mode, the sound card is provided with a phase-locked loop, and the phase-locked loop is used for controlling the playing rate of the sound card through the clock frequency output by the phase-locked loop. In this manner, the above S104 may be implemented by the following S1041 and S1042:
s1041, according to the play rate adjustment quantity, determining a clock frequency adjustment quantity of a phase-locked loop of the sound card.
In this embodiment, there is a mapping relationship between the play rate and the clock frequency. In one example, when the sound card is a binaural sound card, the amount of clock frequency adjustment corresponding to the phase locked loop is equal to the amount of adjustment of the playback rate multiplied by 64.
In addition, when the sound card is a two-channel sound card, the clock frequency output by the phase-locked loop is equal to the playing rate multiplied by 64.
And S1042, adjusting the current playing speed of the sound card by adjusting the clock frequency output by the phase-locked loop according to the clock adjustment amount.
In the second mode, a main phase-locked loop and a standby phase-locked loop are arranged in the sound card, and the main phase-locked loop is used for controlling the playing speed of the sound card through the clock frequency output by the main phase-locked loop. In this manner, S104 can be implemented by the following S1043 to S1045:
and S1043, determining the clock frequency adjustment quantity of the standby phase-locked loop according to the rate adjustment quantity.
And S1044, adjusting the clock frequency of the standby phase-locked loop according to the clock frequency adjustment amount.
And S1045, switching the adjusted standby phase-locked loop into a new main phase-locked loop so as to adjust the current playing speed of the sound card through the clock frequency output by the new main phase-locked loop.
In this embodiment, the phase-locked loop adjusts the clock frequency in a gradual manner, rather than in a single step. If the clock frequency is adjusted during the phase locked loop's control of the playback rate of the sound card by the clock frequency output by the phase locked loop, this will result in a harsh sound signal being played back by the sound card, such as a "squeak". Therefore, the clock frequency can be adjusted by adopting a standby phase-locked loop, and when the clock frequency output by the standby phase-locked loop is stable, the standby phase-locked loop is used for replacing the main phase-locked loop. This will prevent the sound signal played by the sound card from being harsh.
In addition, when the standby phase-locked loop is switched to the new main phase-locked loop, the original main phase-locked loop becomes the new standby phase-locked loop.
< apparatus embodiment >
The present invention provides a data synchronization apparatus 20, as shown in fig. 2, the apparatus 20 comprising: an execution module 21, an acquisition module 22, a determination module 23, and an adjustment module 24. Wherein:
the execution module 21 is configured to execute an operation of playing a sound signal by the sound card when the data amount in the sound card cache is greater than a first threshold for the first time;
an obtaining module 22, configured to obtain a current data size in the cache during a period when the sound card plays the sound signal;
a determining module 23, configured to determine, when the current data amount is smaller than a second threshold or larger than a third threshold, a play rate adjustment amount of the sound card according to a difference between the current data amount and a historical data amount and a time interval between the time when the current data amount is obtained and the time when the historical data amount is obtained; the historical data volume is the data volume in the cache when the playing speed of the sound card is adjusted last time, and the first threshold is larger than the second threshold and smaller than the third threshold;
and the adjusting module 24 is configured to adjust the current playing rate of the sound card according to the playing rate adjustment amount.
In one embodiment, the obtaining module 22 is specifically configured to:
and during the sound signal playing period of the sound card, regularly acquiring the current data volume in the sound card cache according to a set time interval.
In one embodiment, the determining module 23 is specifically configured to: and determining the playing rate adjustment amount of the sound card according to the difference value between the current data volume and the historical data volume and the time interval between the acquisition of the current data volume and the acquisition of the historical data volume under the condition that the current data volume is smaller than the second threshold and new data is written in the cache.
In one embodiment, the determination module 23 is further configured to: and determining whether new data is written in the cache or not according to whether an instruction which is sent by an upper computer and used for representing the completion of the transmission of the audio data stream is received or not.
In one embodiment, the adjusting module 24 is specifically configured to: determining the clock frequency adjustment quantity of the phase-locked loop of the sound card according to the play rate adjustment quantity;
and adjusting the current playing speed of the sound card by adjusting the clock frequency output by the phase-locked loop according to the clock adjustment quantity.
In one embodiment, a main phase-locked loop and a standby phase-locked loop are arranged in the sound card; the main phase-locked loop is configured to control a playing rate of the sound card through a clock frequency output by the main phase-locked loop, and the adjusting module 24 is specifically configured to:
determining the clock frequency adjustment quantity of the standby phase-locked loop according to the rate adjustment quantity;
adjusting the clock frequency of the standby phase-locked loop according to the clock frequency adjustment amount;
and switching the adjusted standby phase-locked loop into a new main phase-locked loop so as to adjust the current playing speed of the sound card through the clock frequency output by the new main phase-locked loop.
In one embodiment, the sound card is a sound card based on the USB Audio protocol.
< apparatus embodiment >
The present embodiment provides an audio playback device 30, and the device 30 comprises the data synchronization apparatus 20 as shown in the above apparatus embodiment.
Alternatively, as shown in fig. 3, the audio playing device 30 includes a memory 31 and a processor 32. Wherein the memory 31 is used for storing computer instructions, and the processor 32 is used for calling the computer instructions from the memory 31 to execute the data synchronization method according to any one of the method embodiments provided above.
In this embodiment, the audio playing device 30 may be a computer or a mobile phone. In another embodiment, the audio playing device 30 may also be a sound box connected to a computer or a mobile phone.
< computer-readable storage Medium >
The present embodiment provides a computer-readable storage medium. Wherein the storage medium stores computer instructions, and when the computer instructions in the storage medium are executed by the processor, the data synchronization method provided by any one of the above method embodiments is realized.
The present invention may be a system, method and/or computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions embodied therewith for causing a processor to implement various aspects of the present invention.
The computer-readable storage medium may be a tangible device that can hold and store the instructions for use by the instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic memory device, a magnetic memory device, an optical memory device, an electromagnetic memory device, a semiconductor memory device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a Static Random Access Memory (SRAM), a portable compact disc read-only memory (CD-ROM), a Digital Versatile Disc (DVD), a memory stick, a floppy disk, a mechanical coding device, such as punch cards or in-groove projection structures having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media as used herein is not to be construed as transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission medium (e.g., optical pulses through a fiber optic cable), or electrical signals transmitted through electrical wires.
The computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to a respective computing/processing device, or to an external computer or external storage device via a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers. The network adapter card or network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in the respective computing/processing device.
The computer program instructions for carrying out operations of the present invention may be assembler instructions, Instruction Set Architecture (ISA) instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, aspects of the present invention are implemented by personalizing an electronic circuit, such as a programmable logic circuit, a Field Programmable Gate Array (FPGA), or a Programmable Logic Array (PLA), with state information of computer-readable program instructions, which can execute the computer-readable program instructions.
Aspects of the present invention are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer-readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer-readable program instructions may also be stored in a computer-readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer-readable medium storing the instructions comprises an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions. It is well known to those skilled in the art that implementation by hardware, by software, and by a combination of software and hardware are equivalent.
Having described embodiments of the present invention, the foregoing description is intended to be exemplary, not exhaustive, and not limited to the embodiments disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terms used herein were chosen in order to best explain the principles of the embodiments, the practical application, or technical improvements to the techniques in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein. The scope of the invention is defined by the appended claims.

Claims (10)

1. A method of data synchronization, comprising:
under the condition that the data volume in the sound card cache is greater than a first threshold value for the first time, executing the operation of playing the sound signal by the sound card;
acquiring the current data volume in the cache during the sound card playing sound signals;
under the condition that the current data volume is smaller than a second threshold or larger than a third threshold, determining the playing rate adjustment amount of the sound card according to the difference value between the current data volume and the historical data volume and the time interval between the acquisition of the current data volume and the acquisition of the historical data volume; the historical data volume is the data volume in the cache when the playing speed of the sound card is adjusted last time, and the first threshold is larger than the second threshold and smaller than the third threshold;
and adjusting the current playing speed of the sound card according to the playing speed adjustment quantity.
2. The method according to claim 1, wherein the obtaining the current data amount in the sound card buffer during the sound card playing the sound signal comprises:
and during the sound signal playing period of the sound card, regularly acquiring the current data volume in the sound card cache according to a set time interval.
3. The method according to claim 1, wherein the determining the playing rate adjustment amount of the sound card according to the difference between the current data volume and the historical data volume and the time interval between obtaining the current data volume and obtaining the historical data volume when the current data volume is smaller than a second threshold comprises:
and determining the playing rate adjustment amount of the sound card according to the difference value between the current data volume and the historical data volume and the time interval between the acquisition of the current data volume and the acquisition of the historical data volume under the condition that the current data volume is smaller than the second threshold and new data is written in the cache.
4. The method of claim 3, further comprising the step of determining whether new data is written to the cache, wherein the determining whether new data is written to the cache comprises:
and determining whether new data is written in the cache or not according to whether an instruction which is sent by an upper computer and used for representing the completion of the transmission of the audio data stream is received or not.
5. The method according to any one of claims 1-4, wherein said adjusting the current playing rate of the sound card according to the playing rate adjustment amount comprises:
determining the clock frequency adjustment quantity of the phase-locked loop of the sound card according to the play rate adjustment quantity;
and adjusting the current playing speed of the sound card by adjusting the clock frequency output by the phase-locked loop according to the clock frequency adjustment amount.
6. The method according to any one of claims 1-4, wherein a main phase-locked loop and a standby phase-locked loop are provided in the sound card; the main phase-locked loop is used for controlling the playing speed of the sound card through the clock frequency output by the main phase-locked loop; the adjusting the current playing speed of the sound card according to the playing speed adjustment quantity comprises:
determining the clock frequency adjustment quantity of the standby phase-locked loop according to the rate adjustment quantity;
adjusting the clock frequency of the standby phase-locked loop according to the clock frequency adjustment amount;
and switching the adjusted standby phase-locked loop into a new main phase-locked loop so as to adjust the current playing speed of the sound card through the clock frequency output by the new main phase-locked loop.
7. The method of claim 1, wherein the sound card is a sound card based on a USB Audio protocol.
8. A data synchronization apparatus, comprising:
the execution module is used for executing the operation of playing the sound signal by the sound card under the condition that the data volume in the sound card cache is greater than a first threshold value for the first time;
the acquisition module is used for acquiring the current data volume in the cache during the sound card playing sound signals;
the determining module is used for determining the playing rate adjustment amount of the sound card according to the difference value between the current data volume and the historical data volume and the time interval between the acquisition of the current data volume and the acquisition of the historical data volume under the condition that the current data volume is smaller than a second threshold or larger than a third threshold; the historical data volume is the data volume in the cache when the playing speed of the sound card is adjusted last time, and the first threshold is larger than the second threshold and smaller than the third threshold;
and the adjusting module is used for adjusting the current playing speed of the sound card according to the playing speed adjusting quantity.
9. An audio playback device, comprising the apparatus of claim 8; alternatively, the first and second liquid crystal display panels may be,
comprising a memory for storing computer instructions and a processor for invoking the computer instructions from the memory to perform the data synchronization method of any one of claims 1-7.
10. A computer-readable storage medium, wherein the storage medium stores computer instructions, which when executed by a processor, implement the data synchronization method of any one of claims 1-7.
CN201911007340.6A 2019-10-22 2019-10-22 Data synchronization method, device, equipment and computer readable storage medium Active CN110798458B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911007340.6A CN110798458B (en) 2019-10-22 2019-10-22 Data synchronization method, device, equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911007340.6A CN110798458B (en) 2019-10-22 2019-10-22 Data synchronization method, device, equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN110798458A CN110798458A (en) 2020-02-14
CN110798458B true CN110798458B (en) 2022-05-06

Family

ID=69440908

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911007340.6A Active CN110798458B (en) 2019-10-22 2019-10-22 Data synchronization method, device, equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN110798458B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112948296A (en) * 2021-02-24 2021-06-11 合肥宏晶微电子科技股份有限公司 Method for transmitting audio data, electronic device, and computer-readable storage medium
CN113436639B (en) * 2021-08-26 2021-12-03 北京百瑞互联技术有限公司 Audio stream compensation method, device, storage medium and equipment
CN114416013A (en) * 2022-01-04 2022-04-29 深圳Tcl新技术有限公司 Data transmission method, data transmission device, electronic equipment and computer-readable storage medium

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0669587A2 (en) * 1994-02-24 1995-08-30 AT&T Corp. Networked system for display of multimedia presentations
CN1674704A (en) * 2005-05-19 2005-09-28 北京北方烽火科技有限公司 Method and apparatus for realizing clock redundancy back-up in WCDMA system base station
CN101286087A (en) * 2008-05-04 2008-10-15 普天信息技术研究院有限公司 Flash memory card power consumption control method and terminal
CN101530332A (en) * 2008-03-14 2009-09-16 深圳迈瑞生物医疗电子股份有限公司 Method and system for real-time synchronization of images and sounds in ultrasound diagnostic equipment
CN103165149A (en) * 2011-12-09 2013-06-19 上海博泰悦臻电子设备制造有限公司 Vehicle-mounted terminal and vehicle-mounted terminal music playing method
CN103916414A (en) * 2012-12-31 2014-07-09 华为技术有限公司 Transmission rate configuration method, terminal device, server and system
CN105704554A (en) * 2016-01-22 2016-06-22 广州视睿电子科技有限公司 Audio play method and device
CN105812902A (en) * 2016-03-17 2016-07-27 联发科技(新加坡)私人有限公司 Data play method, device and system
CN106775560A (en) * 2016-11-30 2017-05-31 四川长虹电子部品有限公司 Usb audio output device and its processing method
CN109819108A (en) * 2019-01-04 2019-05-28 Oppo广东移动通信有限公司 Method, apparatus, electronic equipment and the storage medium of adjustment driving parameter
CN110073341A (en) * 2016-09-08 2019-07-30 帝威视有限公司 The system and method for automatic adaptation cushion for digital video frequency flow transmission

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7683903B2 (en) * 2001-12-11 2010-03-23 Enounce, Inc. Management of presentation time in a digital media presentation system with variable rate presentation capability

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0669587A2 (en) * 1994-02-24 1995-08-30 AT&T Corp. Networked system for display of multimedia presentations
CN1674704A (en) * 2005-05-19 2005-09-28 北京北方烽火科技有限公司 Method and apparatus for realizing clock redundancy back-up in WCDMA system base station
CN101530332A (en) * 2008-03-14 2009-09-16 深圳迈瑞生物医疗电子股份有限公司 Method and system for real-time synchronization of images and sounds in ultrasound diagnostic equipment
CN101286087A (en) * 2008-05-04 2008-10-15 普天信息技术研究院有限公司 Flash memory card power consumption control method and terminal
CN103165149A (en) * 2011-12-09 2013-06-19 上海博泰悦臻电子设备制造有限公司 Vehicle-mounted terminal and vehicle-mounted terminal music playing method
CN103916414A (en) * 2012-12-31 2014-07-09 华为技术有限公司 Transmission rate configuration method, terminal device, server and system
CN105704554A (en) * 2016-01-22 2016-06-22 广州视睿电子科技有限公司 Audio play method and device
CN105812902A (en) * 2016-03-17 2016-07-27 联发科技(新加坡)私人有限公司 Data play method, device and system
CN110073341A (en) * 2016-09-08 2019-07-30 帝威视有限公司 The system and method for automatic adaptation cushion for digital video frequency flow transmission
CN106775560A (en) * 2016-11-30 2017-05-31 四川长虹电子部品有限公司 Usb audio output device and its processing method
CN109819108A (en) * 2019-01-04 2019-05-28 Oppo广东移动通信有限公司 Method, apparatus, electronic equipment and the storage medium of adjustment driving parameter

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
基于PCI总线的四通道音频高速播放设备的设计;张艳;《西南民族大学学报(自然科学版)》;20080615(第03期);全文 *
基于微处理器核的AAC解码软硬件协同优化;周建等;《浙江大学学报(工学版)》;20070815(第08期);全文 *

Also Published As

Publication number Publication date
CN110798458A (en) 2020-02-14

Similar Documents

Publication Publication Date Title
CN110798458B (en) Data synchronization method, device, equipment and computer readable storage medium
US7669206B2 (en) Dynamic redirection of streaming media between computing devices
CN109089130B (en) Method and device for adjusting timestamp of live video
TWI485619B (en) Automatic audio configuration based on an audio output device
JP6006749B2 (en) Method and system for providing incoming call notification using video multimedia
CN109167890B (en) Sound and picture synchronization method and device and display equipment
US8285886B1 (en) Live media playback adaptive buffer control
AU2014295217B2 (en) Audio processor for orientation-dependent processing
US9804633B2 (en) Indirect clock measuring and media adjustment
CN109582274B (en) Volume adjusting method and device, electronic equipment and computer readable storage medium
US9230529B2 (en) Music reproducing apparatus
US10027994B2 (en) Interactive audio metadata handling
EP3174312A1 (en) Playback method and playback device for a multiroom sound system
CN108495177B (en) Audio frequency speed change processing method and device
CN106057222B (en) Multimedia file playing method and electronic equipment
WO2014128360A1 (en) Synchronization of audio and video content
WO2021120124A1 (en) Method and apparatus for video display, and computer storage medium
CN113035206B (en) Signal processing device, signal processing method, program, and computer-readable medium
US20170085682A1 (en) Method and system for interchangeable network communications protocol configurations
CN109375892B (en) Method and apparatus for playing audio
CN111193570A (en) Method, device, system, medium and electronic equipment for executing instructions
CN110138991B (en) Echo cancellation method and device
CN108540830A (en) A kind of more playback equipment synchronous broadcast methods, system and terminal
KR102526699B1 (en) Apparatus and method for providing call quality information
EP3477887A1 (en) Synchronization setting device, distribution system, synchronization setting method, and program

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
TA01 Transfer of patent application right

Effective date of registration: 20200603

Address after: 261061 building 10, Geer phase II Industrial Park, No. 102, Ronghua Road, Ronghua community, Xincheng street, high tech Zone, Weifang City, Shandong Province

Applicant after: Weifang goer Microelectronics Co.,Ltd.

Address before: 261031 Dongfang Road, Weifang high tech Development Zone, Shandong, China, No. 268

Applicant before: GOERTEK Inc.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant