Audio-based data transmission method, device and storage medium
By inserting the data to be transmitted into specific bits of the audio data to be transmitted, forming a modulated data stream, the problem that embedded audio devices require multiple interfaces for data interaction is solved, and cost reduction and debugging efficiency improvement is achieved.
Patent Information
- Application Number
- CN202011471555.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-14
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2040-12-14
AI Technical Summary
Existing embedded audio equipment requires multiple communication interfaces for data interaction and online programming of the system, resulting in increased costs.
By splitting the non-audio data to be transmitted in units of 4 bits bit widths, inserting it into bit9, bit10, bit11 and bit12 of the 16 bit width audio data, forming a modulated data stream and transmitting it through the audio interface.
It realizes the use of a set of interfaces for audio file playback, data interaction and online system upgrades, reducing equipment costs and improving program debugging efficiency.
Smart Images

Figure CN112486452B_ABST
Abstract
Description
Background Art
[0002] In the existing development of embedded audio devices, USB to audio (I2S) conversion (CP2615) can be realized, and audio files on the PC can be transferred to the embedded audio device through USB for playback. However, data interaction between the PC and the embedded audio device and system online programming need to be completed through other interfaces (network port, USB, serial port, JTAG). This requires at least two or more communication interfaces between the embedded audio device and the PC, one for transmitting audio files and the other for data interaction and system online upgrades, which increases the cost of embedded audio devices. Therefore, a data transmission method based on audio carrier is needed to enable other data to be transmitted while transmitting audio. Summary of the invention
[0003] The present invention provides an audio-based data transmission method, device and storage medium, aiming to solve the technical problems mentioned in the above background technology.
[0004] The present invention first provides an audio-based data transmission method, which is applied to a first terminal, and sends an audio file to a second terminal through the first terminal. The audio file consists of audio data with a bit width of 16 bits, and bit9, bit10, bit11 and bit12 of the audio data are all 0. The method comprises the following steps:
[0005] Setting the audio data as a carrier wave of a sine waveform;
[0006] Splitting the data stream to be transmitted in units of 4 bits width to obtain unit data segments, wherein the data stream to be transmitted is other data other than audio information;
[0007] Insert the unit data segment into bit9, bit10, bit11 and bit12 of the audio data in sequence according to the splitting order to obtain a modulated data stream; wherein one audio data corresponds to one unit data segment;
[0008] The modulated data stream is transmitted to the second terminal.
[0009] Furthermore, the audio data inserted into the unit data segment is located in the middle part of the carrier, so that the initial part of the modulated data stream transmitted to the second terminal is the audio data not inserted into the unit data segment.
[0010] The present invention also provides an audio-based data transmission method, which is applied to a second terminal, and the method further includes:
[0011] Acquire a modulated data stream, wherein the modulated data stream is obtained by the first terminal splitting the data stream to be transmitted into unit data segments with a bit width of 4 bits, and sequentially inserting the unit data segments into bit 9, bit 10, bit 11 and bit 12 of the audio data of the carrier set to a sine waveform in the splitting order;
[0012] Monitoring whether the combined data of bit9, bit10, bit11 and bit12 in the audio data is non-zero;
[0013] When the combined data of bit9, bit10, bit11 and bit12 in the audio data is monitored for the first time and is non-zero, the combined data of bit9, bit10, bit11 and bit12 is extracted as the first data, and the subsequent bit9, bit10, bit11 and bit12 information in the audio data are extracted in sequence and combined into the original data stream to be transmitted, wherein the data stream to be transmitted is other data that is not audio information.
[0014] Furthermore, the method further includes a feature detection step, including:
[0015] Detecting whether the modulated data stream is input periodically;
[0016] When it is detected that the modulated data stream is input with a preset number of cycles, the bit9, bit10, bit11 and bit12 information contained in the audio data is monitored.
[0017] The present invention also provides an audio-based data transmission device, applied to a first terminal, comprising:
[0018] A setting module, used for setting the audio data to a carrier wave of a sine waveform;
[0019] A splitting module is used to split the data stream to be transmitted in units of 4 bits width to obtain unit data segments, wherein the data stream to be transmitted is other data other than audio information;
[0020] A modulation module, used for inserting the unit data segment into bit9, bit10, bit11 and bit12 of the audio data in sequence according to the splitting order to obtain a modulated data stream; wherein one audio data corresponds to one unit data segment;
[0021] A transmission module is used to transmit the modulated data stream to the second terminal.
[0022] The present invention also provides an audio-based data transmission device, applied to a second terminal, comprising:
[0023] An acquisition module, used for acquiring a modulated data stream, wherein the modulated data stream is obtained by the first terminal splitting the data stream to be transmitted into unit data segments with a bit width of 4 bits, and sequentially inserting the unit data segments into bit 9, bit 10, bit 11 and bit 12 of the audio data of the carrier set as a sine waveform according to the splitting order;
[0024] A monitoring module, used for monitoring whether the combined data of bit9, bit10, bit11 and bit12 in the audio data is non-zero;
[0025] A data recovery module is used to extract the combined data of bit9, bit10, bit11 and bit12 as the first data when the combined data of bit9, bit10, bit11 and bit12 in the audio data is first monitored to be non-zero, and to extract the subsequent bit9, bit10, bit11 and bit12 information in the audio data in sequence and combine them into the original data stream to be transmitted, wherein the data stream to be transmitted is other data that is not audio information.
[0026] The present invention also provides a storage medium on which a computer program is stored, and when the program is processed and executed, the above-mentioned audio-based data transmission method based on the first terminal is implemented.
[0027] The present invention also provides a storage medium on which a computer program is stored, and when the program is processed and executed, the above-mentioned audio-based data transmission method based on the second terminal is implemented.
[0028] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:
[0029] (1) A set of interfaces is used to realize audio file playback, data interaction and online system upgrade, which does not require the addition or replacement of hardware, nor does it require additional host computer software, thus reducing equipment costs and improving compatibility.
[0030] (2) The operation is simple and easy, which greatly improves the efficiency of program debugging of terminals with audio input functions such as embedded audio devices.
[0031] It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 An audio-based data transmission method applied to a first terminal according to an embodiment of the present invention.
[0033] Figure 2 yes Figure 1 Carrier waveform diagram of an embodiment.
[0034] Figure 3 yes Figure 1 Waveform diagram of a modulated data stream of an embodiment.
[0035] Figure 4 An audio-based data transmission method applied to a second terminal according to an embodiment of the present invention.
[0036] Figure 5 An audio-based data transmission device applied to a first terminal according to an embodiment of the present invention.
[0037] Figure 6 An audio-based data transmission device applied to a second terminal according to an embodiment of the present invention. DETAILED DESCRIPTION
[0038] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be interpreted as limiting the present invention.
[0039] Those skilled in the art will appreciate that, unless otherwise stated, the singular forms "a", "an", "said" and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present invention refers to the presence of the features, integers, steps, operations, but does not exclude the presence or addition of one or more other features, integers, steps, operations.
[0040] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as generally understood by those skilled in the art in the art to which the present invention belongs. It should also be understood that terms such as those defined in general dictionaries should be understood to have meanings consistent with the meanings in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless specifically defined as herein.
[0041] Those skilled in the art should understand that the concepts of "application", "application program", "application software" and similar expressions referred to in the present invention are the same concepts known to those skilled in the art, and refer to computer software suitable for electronic operation that is organically constructed by a series of computer instructions and related data resources. Unless otherwise specified, such naming itself is not limited by the type and level of programming language, nor by the operating system or platform on which it runs. Of course, such concepts are not limited by any form of terminal.
[0042] Those skilled in the art should understand that the user interface and display interface referred to in the present invention generally refer to a display interface that can be used to send the control instruction to the smart terminal. For example, it can be an option (or a button added by the application, the same below) in the settings page of the Android / IOS / Windows Phone system, or it can be an option in the notification bar or interactive page called out from the desktop, or it can be an option in a page constructed by an active component of the application.
[0043] See also Figure 1 The present invention provides an audio-based data transmission method, which is applied to a first terminal, and sends an audio file to a second terminal through the first terminal. The audio file consists of audio data with a bit width of 16 bits, and bit9, bit10, bit11 and bit12 of the audio data are all 0.
[0044] The audio data with a bit width of 16 bits includes bit0, bit1, bit2, bit3, bit4, bit5, bit6, bit7 and bit8, bit9, bit10, bit11 and bit12, bit13, bit14 and bit15. When the data of the audio file is 16 bits wide and the audio volume is 100%, the change of its 16-bit data is within 5% when the audio file is played. The changed bits of the audio data are controlled within the lower eight bits (bit0-bit7), and the upper eight bits (bit8-bit15) are guaranteed not to change. The upper eight bits are used to load the data to be transmitted.
[0045] The data transmission method comprises the following steps:
[0046] S110: Setting the audio data as a carrier wave of a sinusoidal waveform.
[0047] The present invention needs to modulate data into a carrier wave, so first of all, a carrier wave needs to be produced. The carrier wave is designed to be a sine wave of a specific frequency (e.g., 48KHz or other pre-set frequencies). A complete cycle of the sine wave is depicted by eight points corresponding to the audio data, namely: 0x4040, 0x2020, 0x0010, -0x2020, -0x4040, -0x2020, 0x0010, 0x2020. The carrier wave waveform is as follows: Figure 2 shown.
[0048] S120: Split the data stream to be transmitted into units of 4 bits width to obtain unit data segments, wherein the data stream to be transmitted is other data other than audio information.
[0049] S130: Insert the unit data segment into bit9, bit10, bit11 and bit12 of the audio data in sequence according to the splitting order to obtain a modulated data stream; wherein, one audio data corresponds to one unit data segment.
[0050] When performing data modulation in this embodiment, the data to be transmitted is divided into 4 bits as a unit and inserted into bit 9 to bit 12 of the 16-bit carrier data. In this way, 4 bits of data can be transmitted each time while the original frequency remains unchanged.
[0051] For example, the original modulated data is 0x12, 0x34, 0x56, 0x78, four 8-bit wide data. The original modulated data is split into eight 4-bit wide unit data segments of 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8. Then these 8 data are inserted into a cycle of the carrier for modulation. The modulated data is 0x4240, 0x2420, 0x0610, -0x2820, -0x4a40, -0x2c20, 0x0e10, 0x3020. The modulated waveform is as follows: Figure 3 shown.
[0052] S140: Transmit the modulated data stream to the second terminal.
[0053] In this embodiment, the modulated data stream modulated by the carrier wave corresponding to the audio file data and the data stream to be transmitted is transmitted to the second terminal through the audio interface.
[0054] Furthermore, in an embodiment of the present invention, the audio data inserted into the unit data segment is located in the middle part of the carrier, so that the initial part of the modulated data stream transmitted to the second terminal is the audio data without the unit data segment inserted.
[0055] In this embodiment, the unit data segment is inserted into the audio data in the middle part of the carrier, so that when data is transmitted, the audio data without the unit data segment inserted for a certain number of periods will be read first. In order to distinguish the data stream of the audio file from the data stream to be transmitted (such as system online upgrade data, transmission data, etc.), the upper three bits (bit13 to bit15) of the carrier signal are fixed and changed periodically every 8 data to improve recognition.
[0056] Specifically, each time the carrier signal is modulated, the modulation starts from the 81st cycle to ensure that the modulated data (bit9 to bit12) of the first 80 cycles is 0.
[0057] like Figure 4As shown, the present invention also provides an audio-based data transmission method applied to a second terminal. The method also includes:
[0058] S210: Obtain a modulated data stream, wherein the modulated data stream is obtained by the first terminal splitting the data stream to be transmitted into unit data segments with a bit width of 4 bits, and inserting them into bit9, bit10, bit11 and bit12 of the audio data of the carrier set to a sine waveform in sequence according to the splitting order.
[0059] S220: Monitor whether the combined data of bit9, bit10, bit11 and bit12 in the audio data is non-zero.
[0060] S230: When the combined data of bit9, bit10, bit11 and bit12 in the audio data is monitored for the first time and is non-zero, the combined data of bit9, bit10, bit11 and bit12 is extracted as the first data, and the subsequent bit9, bit10, bit11 and bit12 information in the audio data are extracted in sequence and combined into the original data stream to be transmitted, wherein the data stream to be transmitted is other data that is not audio information.
[0061] In this embodiment, when the second terminal (for example, an embedded audio device) continuously monitors multiple characteristic cycles, the device will further monitor the 4-bit modulation data (bit9 to bit12) contained in the audio data. When the first non-zero data appears in the modulation data, it is the first data of the data stream. The device will start to assemble the data from the first data and restore the original data. After the embedded audio device restores the data, it performs the corresponding operation according to the content of the data message.
[0062] Furthermore, in an embodiment of the present invention, the method further comprises a feature detection step, comprising:
[0063] Detecting whether the modulated data stream is input periodically;
[0064] When it is detected that the modulated data stream is input with a preset number of cycles, the bit9, bit10, bit11 and bit12 information contained in the audio data is monitored.
[0065] The present invention also provides an audio-based data transmission device 100, wherein the device stores a plurality of instructions, wherein the instructions are suitable for being loaded by a processor and executed by a method for audio-based data transmission applied to a first terminal, including:
[0066] The audio data is set as a carrier wave of a sinusoidal waveform.
[0067] The data stream to be transmitted is split into units of 4 bits width to obtain unit data segments, wherein the data stream to be transmitted is other data other than audio information.
[0068] The unit data segment is inserted into bit9, bit10, bit11 and bit12 of the audio data in sequence according to the splitting order to obtain a modulated data stream; wherein one audio data corresponds to one unit data segment.
[0069] The modulated data stream is transmitted to the second terminal.
[0070] For the convenience of description, the audio-based data transmission device 100 applied to the first terminal is divided into a functional module architecture, such as Figure 5 As shown, including:
[0071] The setting module 110 is used to set the audio data as a carrier wave of a sine waveform.
[0072] The splitting module 120 is used to split the data stream to be transmitted in units of 4 bits width to obtain unit data segments, wherein the data stream to be transmitted is other data other than audio information.
[0073] The modulation module 130 is used to insert the unit data segment into bit9, bit10, bit11 and bit12 of the audio data in sequence according to the splitting order to obtain a modulated data stream; wherein one audio data corresponds to one unit data segment.
[0074] The transmission module 140 is configured to transmit the modulated data stream to the second terminal.
[0075] The present invention also provides an audio-based data transmission device 200, wherein the device stores a plurality of instructions, wherein the instructions are suitable for being loaded by a processor and executed by a method for audio-based data transmission applied to a second terminal, including:
[0076] Obtain a modulated data stream, wherein the modulated data stream is obtained by the first terminal splitting the data stream to be transmitted into unit data segments with a bit width of 4 bits, and inserting them into bit9, bit10, bit11 and bit12 of the audio data of the carrier set to a sine waveform in sequence according to the splitting order.
[0077] Monitor whether the combined data of bit9, bit10, bit11 and bit12 in the audio data is non-zero.
[0078] When the combined data of bit9, bit10, bit11 and bit12 in the audio data is monitored for the first time and is non-zero, the combined data of bit9, bit10, bit11 and bit12 is extracted as the first data, and the subsequent bit9, bit10, bit11 and bit12 information in the audio data are extracted in sequence and combined into the original data stream to be transmitted, wherein the data stream to be transmitted is other data that is not audio information.
[0079] For ease of description, the audio-based data transmission device 200 applied to the first terminal is divided into a functional module architecture, such as Figure 6 As shown, including:
[0080] The acquisition module 210 is used to obtain a modulated data stream, wherein the modulated data stream is obtained by the first terminal splitting the data stream to be transmitted into unit data segments with a bit width of 4 bits, and inserting them into bit9, bit10, bit11 and bit12 of the audio data of the carrier set to a sine waveform in sequence according to the splitting order.
[0081] The monitoring module 220 is used to monitor whether the combined data of bit9, bit10, bit11 and bit12 in the audio data is non-zero.
[0082] The data recovery module 230 is used to extract the combined data of bit9, bit10, bit11 and bit12 as the first data when the combined data of bit9, bit10, bit11 and bit12 in the audio data is first monitored to be non-zero, and to extract the subsequent bit9, bit10, bit11 and bit12 information in the audio data in sequence and combine them into the original data stream to be transmitted, wherein the data stream to be transmitted is other data that is not audio information.
[0083] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:
[0084] (1) A set of interfaces is used to realize audio file playback, data interaction and online system upgrade, which does not require the addition or replacement of hardware, nor does it require additional host computer software, thus reducing equipment costs and improving compatibility.
[0085] (2) The operation is simple and easy, which greatly improves the efficiency of program debugging of terminals with audio input functions such as embedded audio devices.
[0086] In the specification and claims of the present application, the words "include / comprise" and the words "have / include" and their variations are used to specify the existence of stated features, values, steps or components, but do not exclude the existence or addition of one or more other features, values, steps, components or combinations thereof.
[0087] Some features of the present invention are described in different embodiments for clarity of description, however, these features may also be described in combination in a single embodiment. Conversely, some features of the present invention are described in only a single embodiment for brevity, however, these features may also be described in different embodiments alone or in any suitable combination.
[0088] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. An audio-based data transmission method, applied to a first terminal, sending an audio file to a second terminal through the first terminal, characterized in that: The audio file is composed of audio data with a bit width of 16 bits, bit9, bit10, bit11 and bit12 of the audio data are all 0, and the method comprises the following steps: Setting the audio data as a carrier wave of a sine waveform; Splitting the data stream to be transmitted in units of 4 bits width to obtain unit data segments, wherein the data stream to be transmitted is other data other than audio information; Insert the unit data segment into bit9, bit10, bit11 and bit12 of the audio data in sequence according to the splitting order to obtain a modulated data stream; wherein one audio data corresponds to one unit data segment; The modulated data stream is transmitted to the second terminal.
2. The data transmission method according to claim 1, characterized in that: The audio data inserted into the unit data segment is located in the middle part of the carrier, so that the initial part of the modulated data stream transmitted to the second terminal is the audio data not inserted into the unit data segment.
3. An audio-based data transmission method, applied to a second terminal, sending an audio file to the second terminal via a first terminal, characterized in that: The audio file is composed of audio data with a bit width of 16 bits, bit9, bit10, bit11 and bit12 of the audio data are all 0, and the method further includes: Acquire a modulated data stream, wherein the modulated data stream is obtained by the first terminal splitting the data stream to be transmitted into unit data segments with a bit width of 4 bits, and inserting the unit data segments into bit 9, bit 10, bit 11 and bit 12 of the audio data of the carrier set to a sine waveform in sequence according to the splitting order; Monitoring whether the combined data of bit9, bit10, bit11 and bit12 in the audio data is non-zero; When the combined data of bit9, bit10, bit11 and bit12 in the audio data is monitored for the first time and is non-zero, the combined data of bit9, bit10, bit11 and bit12 is extracted as the first data, and the subsequent bit9, bit10, bit11 and bit12 information in the audio data are extracted in sequence and combined into the original data stream to be transmitted, wherein the data stream to be transmitted is other data that is not audio information.
4. The data transmission method according to claim 3, characterized in that: It also includes a feature detection step, including: Detecting whether the modulated data stream is input periodically; When it is detected that the modulated data stream is input with a preset number of cycles, the bit9, bit10, bit11 and bit12 information contained in the audio data is monitored.
5. An audio-based data transmission device, applied to a first terminal, for sending an audio file to a second terminal via the first terminal, characterized in that: The audio file is composed of audio data with a bit width of 16 bits, bit9, bit10, bit11 and bit12 of the audio data are all 0, and the device includes: A setting module, used for setting the audio data to a carrier wave of a sine waveform; A splitting module is used to split the data stream to be transmitted in units of 4 bits width to obtain unit data segments, wherein the data stream to be transmitted is other data other than audio information; A modulation module, used for inserting the unit data segment into bit9, bit10, bit11 and bit12 of the audio data in sequence according to the splitting order to obtain a modulated data stream; wherein one audio data corresponds to one unit data segment; A transmission module is used to transmit the modulated data stream to the second terminal.
6. An audio-based data transmission device, applied to a second terminal, for sending an audio file to the second terminal via a first terminal, characterized in that: The audio file is composed of audio data with a bit width of 16 bits, bit9, bit10, bit11 and bit12 of the audio data are all 0, and the device includes: An acquisition module, used for acquiring a modulated data stream, wherein the modulated data stream is obtained by the first terminal splitting the data stream to be transmitted into unit data segments with a bit width of 4 bits, and sequentially inserting the unit data segments into bit 9, bit 10, bit 11 and bit 12 of the audio data of the carrier set as a sine waveform according to the splitting order; A monitoring module, used for monitoring whether the combined data of bit9, bit10, bit11 and bit12 in the audio data is non-zero; A data recovery module is used to extract the combined data of bit9, bit10, bit11 and bit12 as the first data when the combined data of bit9, bit10, bit11 and bit12 in the audio data is non-zero for the first time, and sequentially extract the bit9, bit10, bit11 and bit12 information in the subsequent audio data and combine them into the original data stream to be transmitted, wherein the The data stream to be transmitted is other data other than audio information.
7. A storage medium having a computer program stored thereon, characterized in that: When the program is processed and executed, the audio-based data transmission method according to any one of claims 1 to 2 is implemented.
8. A storage medium having a computer program stored thereon, characterized in that: When the program is processed and executed, the audio-based data transmission method as described in any one of claims 3-4 is implemented.
Citation Information
Patent Citations
Encoding / decoding method for audio signals using adaptive sine wave pulse coding and apparatus thereof
CN102396024A
Audio transmitting terminal, audio receiving terminal, data hidden transmission method and system
CN104732980A