Audio frequency data transmission method, device and system and computer storage medium
Through the audio data transmission method, the problem of low transmission efficiency of industrial products is solved, wireless data transmission and analysis are realized, and production management efficiency and quality are improved.
Patent Information
- Application Number
- CN202411126231.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-16
- Publication Date
- 2024-12-13
AI Technical Summary
In industrial production, the product has built-in buzzer pieces but lacks other communication means, resulting in the removal of the housing and use of production test fixtures when uploading production data to the manufacturing execution system (MES), which has inefficient transmission efficiency.
Using the audio transmission method, the audio signals transmitted by the buzzer are received and processed, including signal sampling, filtering, envelope processing, sampling judgment and data verification analysis, to realize wireless transmission and analysis of data without removing the shell or using production Test fixture.
It improves data transmission efficiency, simplifies operational processes, realizes product information management, enhances production quality and management efficiency, and facilitates the traceability and inspection of production data.
Smart Images

Figure CN119135216A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to an audio data transmission method, device, system and computer storage medium. Background Art
[0002] Currently, in industrial production, some products have built-in buzzers, but the product may not have other communication means (for example, Wi-Fi, Bluetooth, RFID, etc.) other than the buzzer to transmit data with external devices.
[0003] However, when the product is completed, its related production data (such as production date, production batch, quality inspection results, etc.) needs to be uploaded to the Manufacturing Execution System (MES) for production traceability and quality management. The traditional method is usually to remove the product shell, pass the PCBA through the production test fixture and upload the production data by wire. Due to the removal of the product shell and the need to use the production test fixture, the transmission efficiency is low. Summary of the invention
[0004] In order to overcome the deficiencies of the prior art, the present invention provides an audio data transmission method, device, system and computer storage medium, which improves data transmission efficiency without removing the product casing and using production test fixtures.
[0005] A first aspect of the present application provides a method for transmitting data via audio, the method comprising: When receiving the initial audio data transmitted by the data transmitting end according to the transmission frequency, transmission rate and transmission protocol, sampling the initial audio data to obtain an initial audio signal, wherein the initial audio data includes the production data of the data transmitting end; Performing signal processing on the initial audio signal to obtain a target audio signal; The target audio signal is subjected to data verification and analysis according to the transmission protocol to obtain the production data.
[0006] In an optional implementation, the performing signal processing on the initial audio signal to obtain the target audio signal comprises: Performing filtering processing on the initial audio signal to obtain a first audio signal; Performing envelope processing on the first audio signal to obtain a second audio signal; Performing sampling and decision processing on the second audio signal to obtain a third audio signal; The third audio signal is determined as the target audio signal.
[0007] In an optional implementation, performing envelope processing on the first audio signal to obtain the second audio signal includes: Performing signal smoothing and signal flipping on the first audio signal; Determine a fundamental period of the first audio signal, and determine a sliding window length according to the fundamental period; Extracting the maximum signal amplitude of the first audio signal after the signal smoothing and the signal flipping are completed according to the sliding window length; A second audio signal in the first audio signal is determined based on the maximum signal amplitude.
[0008] In an optional implementation manner, the step of performing sampling and decision processing on the second audio signal to obtain a third audio signal comprises: Determine the sample amplitude of each sampling point in the second audio signal on the time axis, and divide the sample amplitude into N equal intervals to obtain N equally spaced intervals, where N is an integer greater than or equal to 2; Determine the distribution probability of the sampling point in each of the N equally spaced intervals; Divide the N equally spaced intervals into two equal parts to obtain a first equally spaced interval and a second equally spaced interval; Determine a first sub-equally spaced interval in the first equally spaced interval and a second sub-equally spaced interval in the second equally spaced interval according to the distribution probability; Determine a first decision point of the first sub-equally spaced interval and a second decision point of the second sub-equally spaced interval; Signal conversion is performed on each sampling point according to the first decision point and the second decision point to obtain the third audio signal.
[0009] In an optional implementation, before performing signal conversion on each sampling point according to the first decision point and the second decision point, the method further includes: Determine the interval amplitudes of the first sub-equally spaced interval and the second sub-equally spaced interval; Determining whether the second audio signal is abnormal according to the interval spacing amplitude and the amplitude range interval; When it is determined that the second audio signal is abnormal, the judgment fails and the second audio signal is determined to be invalid; When it is determined that there is no abnormality in the second audio signal, the decision is successful, and the operation of performing signal conversion on each sampling point according to the first decision point and the second decision point is performed.
[0010] In an optional implementation, the performing data verification and analysis on the target audio signal according to the transmission protocol includes: Determine whether there is an invalid audio signal with a width greater than 2 code elements in the target audio signal; When the invalid audio signal exists in the target audio signal, determining the polarity duration of each symbol in the target audio signal; Determine the representative data bit of each symbol according to the polarity duration and the preset transmission symbol width, and determine the complete data symbol sequence corresponding to the target audio signal according to the representative data bit; Perform data verification and analysis on the complete data symbol sequence.
[0011] In an optional embodiment, the transmission protocol includes: a preamble, a synchronization word, a load length, a payload of audio data and a check code, the preamble occupies 1 byte, the synchronization word occupies 1 byte, the payload occupies N bytes, wherein N is related to the length of the audio data, and the check code occupies 1 byte.
[0012] A second aspect of the present application provides an audio data transmission device, the device comprising: A receiving module, configured to sample the initial audio data transmitted by the data transmitting end according to the transmission frequency, transmission rate and transmission protocol to obtain an initial audio signal, wherein the initial audio data includes the production data of the data transmitting end; A processing module, used for performing signal processing on the initial audio signal to obtain a target audio signal; The verification module is used to perform data verification and analysis on the target audio signal according to the transmission protocol to obtain the production data.
[0013] A third aspect of the present application provides an audio data transmission system, the system comprising: A data sending end and a data receiving end, wherein the data sending end is communicatively connected with the data receiving end; The data transmitting end is used to transmit the collected initial audio data to the data receiving end according to the transmission frequency, transmission rate and transmission protocol; The data receiving end includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the audio data transmission method are implemented.
[0014] A fourth aspect of the present application provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the above-mentioned audio data transmission method when executed by a processor.
[0015] In summary, the audio data transmission method, device, system and computer storage medium provided by the present application have at least the following beneficial effects: (1) Wireless data transmission between the data transmitter and the data receiver without removing the casing or using production test fixtures; (2) Data transmission can be completed through audio signals, which greatly simplifies the operation process; (3) By optimizing the transmission frequency selection, encoding method, transmission rate and receiving end processing technology, parsing the production data contained in the audio data at the data receiving end, and uploading the data to the MES system, the information management of products is realized, the management efficiency and production quality are improved, and the traceability and investigation of production data are facilitated. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 It is a structural schematic diagram of an audio data transmission system shown in an embodiment of the present application; Figure 2 It is a schematic diagram of a spectrum response curve of a buzzer / buzzer shown in an embodiment of the present application; Figure 3 is a flow chart of an audio data transmission method shown in an embodiment of the present application; Figure 4 is a time domain waveform diagram of an initial audio signal shown in an embodiment of the present application; Figure 5 is a time domain waveform diagram of another initial audio signal shown in an embodiment of the present application; Figure 6 is a frequency domain waveform diagram of an initial audio signal shown in an embodiment of the present application; Figure 7 is a time domain waveform diagram of a 5.6KHz signal in a first audio signal shown in an embodiment of the present application; Figure 8 is a time domain waveform diagram of a 6.6KHz signal in a first audio signal shown in an embodiment of the present application; Fig. 9 is a time domain waveform diagram of a second audio signal shown in an embodiment of the present application; Fig.10 is a schematic diagram of a square wave of a third audio signal shown in an embodiment of the present application; Fig.11 It is a functional module diagram of an audio data transmission device shown in an embodiment of the present application; Fig.12 It is a structural schematic diagram of a data receiving end shown in an embodiment of the present application. DETAILED DESCRIPTION
[0017] The present invention is further described below in conjunction with the accompanying drawings and embodiments.
[0018] The following will clearly and completely describe the concept, specific structure and technical effects of the present invention in combination with the embodiments and drawings, so as to fully understand the purpose, characteristics and effects of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, other embodiments obtained by technicians in this field without creative work are all within the scope of protection of the present invention. In addition, all the connection / connection relationships involved in the patent do not refer to the direct connection of components, but refer to the formation of a better connection structure by adding or reducing connection accessories according to the specific implementation situation. The various technical features in the invention can be combined interchangeably without conflicting with each other.
[0019] Reference Figure 1 As shown, Figure 1 This is a schematic diagram of the structure of an audio data transmission system according to an embodiment of the present application. The audio data transmission system 1 includes a data sending end 10 and a data receiving end 20, wherein the data sending end 10 is communicatively connected with the data receiving end 20.
[0020] The data transmitting end 10 is used to collect audio data, determine the transmission frequency, transmission rate and transmission protocol of the audio data, and transmit the audio data to the data receiving end 20 according to the transmission frequency, the transmission rate and the transmission protocol.
[0021] The data transmitting end 10 refers to a product that only has a buzzer / buzzer and no other communication means, and may include, but is not limited to, devices that need to upload data during the production process, but are limited by factors such as cost, design complexity or specific application scenarios, and do not integrate wireless communication modules such as Bluetooth, Wi-Fi, NFC, etc. Therefore, it can only choose to use a buzzer as a medium for data transmission. In some embodiments, the data transmitting end 10 can be a disposable or low-cost electronic device, such as a security alarm, a children's toy, etc. In other embodiments, the data transmitting end 10 can also be a temporary device, such as a temporary alarm system, a disaster warning device, etc.
[0022] In some embodiments, the audio data includes production data of the data transmitting end 10 , and the production data may include, but is not limited to: production date, production batch, quality inspection result, etc.
[0023] Refer to Figure 2, which represents the frequency response characteristics of the buzzer / buzzer at different frequencies, including the change of sound pressure level with frequency, performance parameters at specific frequency points, sweep mode and speed and other test conditions. When the data sending end 10 needs to send the audio data it has collected to the data receiving end 20, it is necessary to further determine the transmission frequency, transmission rate and transmission protocol according to which the data sending end 10 transmits. The main frequency of human speech is generally below 3KHz, and the resonance frequency of the buzzer cavity is generally 3.4KHz, that is, 3.4KHz is the resonance frequency of the cavity. Therefore, the transmission frequency can be selected with a suitable sound pressure amplitude and a frequency point as far away from 3.4KHz as possible, that is, 5.6KHz and 6.6KHz can be selected. Since an excessively large amplitude may trigger the resonance of the buzzer, causing noise or interference, after determining the transmission frequency, transmission efficiency and transmission protocol of the audio data, the data transmitter 10 can use FSK modulation for transmission, and the duty cycle can be set to 10%, that is, in each signal cycle, the time that the signal is at a high level accounts for 10% of the entire cycle, which helps to reduce power consumption while reducing the impact of the buzzer resonance frequency. Specifically, the physical layer carrier frequency f1 is 5.6KHz (indicating 1), and the carrier frequency f2 is 6.6KHz (indicating 0). The LSB (Least Significant Bit) is low-order first, that is, when transmitting digital data composed of multiple bits, the lowest bit is sent first. When it is necessary to transmit 1 in the signal, the carrier frequency of the signal is set to 5.6KHz, and when it is necessary to transmit 0 in the signal, the carrier frequency of the signal is adjusted to 6.6KHz.
[0024] Secondly, considering the application scenario and in order to enhance the anti-interference capability and eliminate the influence of different IC crystal oscillator errors, the data transmitter 10 uses Manchester coding for transmission while transmitting audio data, and each code element is modulated into 2 levels. There is a jump in the middle of each bit, and the jump in the middle of the bit is a clock signal, that is, a data signal. Low high (01) represents 1, and high low (10) represents 0. Every two clock signals are synchronized once.
[0025] Due to hardware characteristics, after the transmission frequency is switched, the buzzer oscillation frequency will gradually change to a stable state, which lasts about 1 to 3 ms. In order to ensure the transmission success rate, the code element width of the transmission needs to be greater than the stabilization time. Therefore, the code element width can be set to 5 ms, and the number of code elements that can be transmitted per second is 1 / 0.005 = 200 code elements / second.
[0026] Taking into account the reliability, efficiency and scalability of data during transmission, the data transmitter 10 can set the transmission protocol to preamble + synchronization word + load length + effective load + check code, where the preamble occupies 1 byte, the synchronization word occupies 1 byte, the load length occupies 1 byte, the effective load occupies N bytes and the check code occupies 1 byte.
[0027] Among them, the preamble is used as the starting mark of data transmission to help the data receiving end 20 quickly identify the start of data transmission. Since the signal transmission data stream is serially transmitted, in order to prevent bit errors caused by interference signals, a fixed bit sequence needs to be set to synchronize the start bit to prevent misalignment caused by interference signals. After the preamble, adding a synchronization word can further confirm the start of the data packet and enhance the robustness of synchronization. That is, after the data receiving end 20 receives the signal, it needs to parse the preamble and synchronization word to determine that the received data is valid data, and continue to receive and parse the data transmitted by the data sending end 10. The setting protocol of the load length and the effective load supports audio data transmission of different lengths, which enhances the flexibility and scalability of the protocol. The effective load contains the actual audio data, and its length N is determined by the field of the actual audio data, ensuring the accuracy and integrity of the data transmission. The check code is used to verify the integrity and accuracy of the data during the transmission process. By calculating the check value of the data (including the preamble, synchronization word, load length and effective load) at the data sending end 10 and verifying it at the data receiving end 200, any error or data damage during the transmission process can be detected. Secondly, through the checksum, the data receiving end 20 can request retransmission of any damaged or erroneous data packets, thereby improving the reliability and accuracy of data transmission.
[0028] In other embodiments, the transmission frequency, transmission rate and transmission protocol may also be determined by the data receiving end 20, and the data receiving end 20 transmits a transmission instruction carrying the transmission frequency, transmission efficiency and transmission protocol to the data sending end 10, so that after receiving the transmission instruction, the data sending end 10 transmits the collected audio signal to the data receiving end 20 according to the transmission frequency, transmission efficiency and transmission protocol in the transmission instruction.
[0029] The data receiving end 20 is used to process the audio data when receiving the audio data.
[0030] In some embodiments, the data receiving end 20 can be a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application-specific integrated circuits, programmable gate arrays, digital processors and embedded devices, such as computers, mobile phones and tablets in electronic devices.
[0031] The data receiving end 20 is also provided with an audio data transmission device 30 for processing the audio data after receiving the audio data successfully sent by the data sending end 10 .
[0032] Reference Figure 3 , which is a flow chart of an audio data transmission method shown in an embodiment of the present application, and the audio data transmission method includes the following steps.
[0033] S31, when receiving the initial audio data transmitted by the data transmitting end according to the transmission frequency, transmission rate and transmission protocol, sampling the initial audio data to obtain an initial audio signal.
[0034] The initial audio data includes production data of the data sending end, and the production data may include, but is not limited to: production date, production batch, quality inspection result, etc.
[0035] In some embodiments, the data transmitting end or the data receiving end may determine the transmission frequency, transmission efficiency, and transmission protocol used by the data transmitting end to transmit data, so that the data transmitting end can normally transmit the production data to the data receiving end. When the data receiving end receives the audio data successfully sent by the data transmitting end, it is necessary to process the audio data to obtain an audio signal that can be parsed to obtain the production data of the data transmitting end 10. The unprocessed audio data is determined as the initial audio data, and the processed audio data is determined as the target audio data.
[0036] In some embodiments, when the data receiving end needs to sample the received initial audio data, it is necessary to determine the sampling rate and frequency. Specifically, considering the rate currently supported by the microphone, the data receiving end can set the sampling rate to 48KHz when sampling the received initial audio data. According to the Nyquist theorem, in order to restore the original signal from the sampled signal without distortion, the sampling frequency must be greater than or equal to twice the highest frequency of the original signal, and the sampling frequency is high enough to more accurately represent the original analog signal. Therefore, the sampling frequency is expressed by the following mathematical expression: fs ≥2 fmax·fs ≥2 fmax in, fs is the sampling frequency, fmax is the highest frequency of the original signal.
[0037] Therefore, in the embodiment of the present application, at a sampling rate of 48KHz, as long as the highest frequency of the original signal does not exceed 24KHz, it can be ensured that important information will not be lost during the conversion and recovery process of the signal, thereby achieving high-quality audio reconstruction.
[0038] Through the above optional implementation, the sampling rate is set to 48KHz and the sampling frequency is determined according to the Nyquist sampling theorem, which can ensure the distortion-free nature of the audio signal during the conversion and recovery process, reduce the aliasing effect, improve the audio quality, and enhance the device compatibility.
[0039] S32, performing signal processing on the initial audio signal to obtain a target audio signal.
[0040] After the data receiving end samples the initial audio data to obtain the initial audio signal, it is necessary to perform signal processing on the initial audio signal, including signal filtering, envelope processing and sampling judgment, so as to obtain the target audio signal that can be parsed to produce the data.
[0041] In an optional implementation, the performing signal processing on the initial audio signal to obtain the target audio signal comprises: Performing filtering processing on the initial audio signal to obtain a first audio signal; Performing envelope processing on the first audio signal to obtain a second audio signal; Performing sampling and decision processing on the second audio signal to obtain a third audio signal; The third audio signal is determined as the target audio signal.
[0042] Refer to Figures 4 to 5 , is the unprocessed initial audio signal. In some embodiments, the data receiving end first filters the initial audio signal so that the audio signal (first audio signal) after the filtering process is completed does not contain noise and other interference. Specifically, the data receiving end can use a digital filter to filter out the noise and other interference in the initial audio signal to filter out the original signal frequency points of 5.6KHz and 6.6KHz, and combine Fast Fourier Transformation (FFT) for spectrum analysis and signal reconstruction, that is, converting the time domain signal into a frequency signal, clearing or attenuating the frequency point signals that are not of interest on the spectrum signal, and only retaining the frequency point signals of 5.6KHz and 6.6KHz. Then convert it from the frequency domain back to the time domain to obtain the filtered time domain signals of 5.6KHz and 6.6KHz, refer to Figure 7 and Figure 8 .
[0043] Furthermore, after the data receiving end completes the filtering process of the initial audio signal to obtain the first audio signal, it continues to perform envelope processing on the first audio signal, and the first audio signal after the envelope processing is completed is called the second audio signal.
[0044] In an optional implementation, performing envelope processing on the first audio signal to obtain the second audio signal includes: performing signal smoothing and signal inversion on the first audio signal; Determine a fundamental period of the first audio signal, and determine a sliding window length according to the fundamental period; Extracting the maximum signal amplitude of the first audio signal after the signal smoothing and the signal flipping are completed according to the sliding window length; A second audio signal in the first audio signal is determined based on the maximum signal amplitude.
[0045] In some embodiments, the data receiving end first uses a sliding average method to smooth the first audio signal to remove high-frequency noise and subtle fluctuations in the first audio signal, making the signal smoother and easier to process later. Specifically, a sliding window with a length of K is selected, and the average value of multiple sampling points is calculated at each position to form a new smoothed signal. The sliding window length K is determined according to the basic period of the first audio signal.
[0046] Next, the data receiving end performs signal inversion on the first audio signal after signal smoothing. Specifically, the zero crossing point of the first audio signal (i.e., the point where the signal changes from positive to negative or from negative to positive) is determined. For each negative pulse after the zero crossing point, the inversion factor (usually -1) is calculated and applied to invert it into a positive pulse.
[0047] Finally, the data receiving end performs envelope processing on the first audio signal after the signal is flipped, that is, extracts the envelope of the first audio signal, that is, the trajectory of the maximum value of the signal amplitude changing with time. Specifically, according to the same embodiment as above, first determine the basic period of the first audio signal. For example, for a 5.6KHz signal, the period is T=1 / f =1 / 5600 seconds. In envelope processing, directly using the basic period as the sliding window length will cause the signal processing to be too fine or too rough, so an integer multiple of the basic period is selected as the sliding window length K. In each sliding window, all sampling points are traversed to find the maximum value (maximum signal amplitude) of the sampling point as the envelope value at that time point. By continuously moving the sliding window to cover the entire first audio signal, the envelope value of the entire first audio signal is finally obtained, and the time domain waveform after envelope processing is drawn according to the envelope value, that is, the envelope values obtained in each window are connected in time sequence to form the envelope curve of the entire signal, referring to Fig. 9 .
[0048] It should be noted that the value of the sliding window length K is not fixed, and the value of K depends on the specific signal characteristics and processing requirements (for example, the degree of envelope detail).
[0049] In some embodiments, reference Figures 7 to 9After drawing the time domain waveform after envelope processing, the data receiving end can compare the time domain waveform with the time domain waveform of the first audio signal to ensure the correctness and effectiveness of envelope extraction.
[0050] Through the above optional implementation, after the first audio signal is smoothed, flipped and enveloped, the second audio signal obtained can clearly represent the amplitude variation trend of the first audio signal, providing strong support for subsequent signal processing and judgment.
[0051] After the data receiving end completes the envelope processing of the first audio signal to obtain the second audio signal, it continues to perform sampling and decision processing on the second audio signal to convert the continuous envelope signal (the second audio signal) into a discrete binary signal (0 and 1). The second audio signal after the sampling and decision processing is called the third audio signal, that is, the target audio signal.
[0052] In an optional implementation manner, the step of performing sampling and decision processing on the second audio signal to obtain a third audio signal comprises: Determine the sample amplitude of each sampling point in the second audio signal on the time axis, and divide the sample amplitude into N equal intervals to obtain N equally spaced intervals, where N is an integer greater than or equal to 2; Determine the distribution probability of the sampling point in each of the N equally spaced intervals; Divide the N equally spaced intervals into two equal parts to obtain a first equally spaced interval and a second equally spaced interval; Determine a first sub-equally spaced interval in the first equally spaced interval and a second sub-equally spaced interval in the second equally spaced interval according to the distribution probability; Determine a first decision point of the first sub-equally spaced interval and a second decision point of the second sub-equally spaced interval; Signal conversion is performed on each sampling point according to the first decision point and the second decision point to obtain the third audio signal.
[0053] In some embodiments, the data receiving end first divides the sample amplitude on the time axis into N equal parts, that is, divides the amplitude range of the sample into N equally spaced intervals. By counting the number or probability of samples in each equally spaced interval, the amplitude distribution can be obtained, that is, the distribution probability in each equally spaced interval. Next, the N equally spaced intervals are divided into two equal parts, and in each half (the first half and the second half), the two intervals with the largest distribution probability are selected, which are respectively called the first equally spaced interval and the second equally spaced interval. For the first equally spaced interval and the second equally spaced interval selected in each half, take 1 / 2 of them as the decision point, and the decision point of the first equally spaced interval is called the first decision point, that is, the decision point of the second equally spaced interval is called the second decision point.
[0054] It should be noted that the second audio signal after envelope processing is not stable on the time axis, and the jitter amplitude is affected by the microphone sensitivity of the data receiving end, the sound wave incident angle, the environmental noise, the transmission distance, etc. In addition, there are jitter phenomena of different amplitudes in the peak and trough parts of the signal. In order to ensure the success rate of reception, the decision point cannot be fixed and needs to be selected dynamically. Secondly, the value of N is also dynamically changing. The larger the N value, the more accurate the statistics. The larger the jitter amplitude of the peak and the trough, the larger N should be. In addition, in order to make the peaks and troughs in the signal in their own different intervals, and their distribution intervals cannot be too close to each other, N cannot be too small. In addition, the data receiving end can select the voltage amplitude with the largest distribution probability in the peak and the trough to calculate the decision point. Under normal circumstances, N is about 20, which can be a good way to dynamically calculate the decision point.
[0055] In the embodiment of the present application, since the median is less sensitive to extreme values and the use of the median can better reflect the overall distribution of the data, the middle value of the amplitude of the maximum probability of the statistical peak and the trough is selected as the decision point.
[0056] In an optional implementation, before performing signal conversion on each sampling point according to the first decision point and the second decision point, the method further includes: Determine the interval amplitudes of the first sub-equally spaced interval and the second sub-equally spaced interval; Determining whether the second audio signal is abnormal according to the interval spacing amplitude and the amplitude range interval; When it is determined that the second audio signal is abnormal, the judgment fails and the second audio signal is determined to be invalid; When it is determined that there is no abnormality in the second audio signal, the decision is successful, and the operation of performing signal conversion on each sampling point according to the first decision point and the second decision point is performed.
[0057] In some embodiments, after the data receiving end completes the sampling and judgment processing of the second audio signal, it is necessary to further determine whether there is an abnormality in the signal amplitude. Specifically, the two intervals with the largest distribution probability in the front and back halves are selected, that is, from the first sub-equal interval and the second sub-equal interval, the peaks and troughs of the two intervals are determined, and the difference in the signal amplitude value between the peaks and the troughs is the interval interval amplitude. Next, the amplitude range interval is calculated according to the peak value and the N value. For example, the maximum sound pressure amplitude is 1000, divided into 20 equal parts, and the amplitude range interval corresponding to each interval is 50. Further, the interval spacing amplitude and the amplitude range interval are compared. If the interval spacing amplitude is smaller than the amplitude range interval, it means that the signal amplitude is abnormal or unstable, and the judgment is judged to have failed. Otherwise, the judgment is judged to be successful.
[0058] When it is determined that the judgment is successful, the data receiving end performs signal conversion on each sampling point in the second audio signal after the sampling judgment processing is completed based on the first judgment point and the second judgment point. Specifically, for each sample point, if its amplitude is greater than the judgment point, it is converted to 1 (or a logic high level); if it is less than or equal to the judgment point, it is converted to 0 (or a logic low level). It should be understood that the amplitude of the sample points in the first equally spaced interval is compared with the first judgment point, while the sample points in the second equally spaced interval are compared with the second judgment point. Therefore, the second audio signal is converted into a series of 0s and 1s (i.e., the third audio signal) after the sampling judgment processing, which is easier for subsequent transmission and processing.
[0059] Through the above optional method, by dynamically dividing the intervals into equal intervals and calculating the decision points, the unsteadiness and jitter of the audio signal are effectively dealt with, and the success rate of signal reception is improved. At the same time, by detecting the interval amplitude to judge the signal abnormality, the accuracy and reliability of signal processing are further ensured. Finally, the audio signal is converted into a sequence of 0 and 1 that is easy to transmit and process, simplifying the subsequent processing process.
[0060] S33, performing data verification and analysis on the target audio signal according to the transmission protocol to obtain the production data carried in the target audio signal.
[0061] In some embodiments, since the square wave signal is converted after sampling and judgment, and various interference signals such as environmental noise will cause the high and low polarity duration of the square wave to be very short, secondary filtering is required to make the polarity of the signal with a very short polarity duration follow the previous polarity or the next polarity. Specifically, the data receiving end first checks whether there is a polarity level that exceeds 2 code element widths continuously according to the Manchester coding specification, that is, whether there is an invalid audio signal that is continuously greater than 2 code element widths. When there is an invalid audio signal in the target audio signal, the polarity (high level or low level) duration of each code element in the target audio signal is determined, and the data bit (0 or 1) represented by each code element is determined according to the polarity duration and the preset transmission code element width (such as 5ms). Due to the use of Manchester coding, there is a jump in the middle of each bit, low high (01) represents 1, and high low (10) represents 0, so the data receiving end will convert the polarity duration into the corresponding data bit according to this rule.
[0062] After it is determined that the audio data transmitted by the data sending end has been received, the data check code is calculated according to the check code in the transmission protocol to verify the data integrity. After it is determined that the audio data has been successfully received, the audio data is parsed to obtain the production data included in the audio data, and the production data is uploaded to the MES system to achieve production traceability, equipment monitoring, fault diagnosis, etc., and to achieve product information management, improve production quality and management efficiency. Specifically, the data receiving end can extract audio features from the target audio signal, and use machine learning or deep learning algorithms (such as convolutional neural networks, recurrent neural networks, etc.) to perform pattern recognition on the audio features to identify the production data of the data sending end, such as specific patterns related to the status of production equipment and production data. In addition, the data receiving end can be connected to the MES system in real time, and when the production data is parsed, the production data is uploaded in real time to ensure that the production data can be reflected in the MES system immediately.
[0063] In some embodiments, in order to improve the transmission success rate in scenarios with relatively high noise environments, forward error correction coding transmission technology may be added to the data sending end.
[0064] Compared with the prior art, for the production of some products that only have buzzers / buzzers and no other communication methods, this application proposes an audio data transmission method to upload the product production data (such as test results, production information, etc.) to the MES system for subsequent production traceability and quality management. There is no need to remove the shell or use production test fixtures. Data transmission can be completed through audio signals, which greatly simplifies the operation process. Secondly, the characteristic of the buzzer that can make sound is utilized. By optimizing the transmission frequency selection, encoding method, transmission rate and receiving end processing technology, and parsing the production data contained in the audio data at the data receiving end, and uploading the data to the MES system, the information management of the product is realized, the management efficiency and production quality are improved, and the production data is traceable and checked.
[0065] Reference Fig.11 , which is a functional module diagram of an audio data transmission device shown in an embodiment of the present application.
[0066] In some embodiments, the audio data transmission device 30 may include a plurality of functional modules composed of computer program segments. The computer programs of the various program segments of the audio data transmission device 30 may be stored in a memory of a preset terminal and executed by at least one processor to perform the function of audio data transmission.
[0067] In this embodiment, the audio data transmission device 30 can be divided into multiple functional modules according to the functions it performs. The functional modules may include: a receiving module 301, a processing module 302, a checking module 303 and a judging module 304. The module referred to in this application refers to a series of computer program segments that can be executed by at least one processor and can complete fixed functions, which are stored in a memory. In this embodiment, the functions of each module will be described in detail in subsequent embodiments.
[0068] The receiving module 301 is used to sample the initial audio data transmitted by the data sending end according to the transmission frequency, transmission rate and transmission protocol to obtain an initial audio signal, wherein the initial audio data includes the production data of the data sending end.
[0069] The processing module 302 is used to perform signal processing on the initial audio signal to obtain a target audio signal.
[0070] The verification module 303 is used to perform data verification and analysis on the target audio signal according to the transmission protocol to obtain the production data.
[0071] The processing module 302 is further specifically used to: perform filtering processing on the initial audio signal to obtain a first audio signal; perform envelope processing on the first audio signal to obtain a second audio signal; perform sampling and decision processing on the second audio signal to obtain a third audio signal; and determine the third audio signal as the target audio signal.
[0072] The processing module 302 is further specifically used to: perform signal smoothing and signal flipping on the first audio signal; determine the basic period of the first audio signal, and determine the sliding window length according to the basic period; extract the maximum signal amplitude of the first audio signal after the signal smoothing and the signal flipping are completed according to the sliding window length; and determine the second audio signal in the first audio signal according to the maximum signal amplitude.
[0073] The processing module 302 is also specifically used to: determine the sample amplitude of each sampling point in the second audio signal on the time axis, and divide the sample amplitude into N equal intervals to obtain N equally spaced intervals, where N is an integer greater than or equal to 2; determine the distribution probability of the sampling point in each of the N equally spaced intervals; divide the N equally spaced intervals into two equal intervals to obtain a first equally spaced interval and a second equally spaced interval; determine a first sub-equally spaced interval in the first equally spaced interval and a second sub-equally spaced interval in the second equally spaced interval according to the distribution probability; determine a first decision point in the first sub-equally spaced interval and a second decision point in the second sub-equally spaced interval; perform signal conversion on each sampling point according to the first decision point and the second decision point to obtain the third audio signal.
[0074] The judgment module 304 is used to: determine the interval interval amplitude between the first sub-equally spaced interval and the second sub-equally spaced interval; judge whether the second audio signal has an abnormality based on the interval interval amplitude and the amplitude range interval; when it is determined that the second audio signal has an abnormality, the judgment fails and the second audio signal is determined to be invalid; when it is determined that the second audio signal has no abnormality, the judgment succeeds and the operation of performing signal conversion on each sampling point based on the first judgment point and the second judgment point is executed.
[0075] The verification module 303 is further specifically used to: determine whether there is an invalid audio signal with a continuous width greater than 2 code elements in the target audio signal; when the invalid audio signal exists in the target audio signal, determine the polarity duration of each code element in the target audio signal; determine the representative data bit of each code element according to the polarity duration and the preset transmission code element width, and determine the complete data code element sequence corresponding to the target audio signal according to the representative data bit; and perform data verification analysis on the complete data code element sequence.
[0076] It should be understood that the various variations and specific embodiments of the audio data transmission method provided in the above embodiment are also applicable to the audio data transmission device of the present embodiment. Through the above detailed description of the audio data transmission method, those skilled in the art can clearly understand the implementation method of the audio data transmission device in the present embodiment. For the sake of brevity of the specification, it will not be described in detail here.
[0077] Reference Fig.12 , which is a schematic diagram of a data receiving terminal according to an embodiment of the present application. In a preferred embodiment of the present application, the data receiving terminal 20 includes a memory 201, at least one processor 202 and at least one communication bus 203.
[0078] Those skilled in the art should understand that Fig.12 The structure of the data receiving end shown does not constitute a limitation of the embodiments of the present application, and can be either a bus structure or a star structure. The data receiving end 20 can also include more or less other hardware or software than shown in the figure, or a different component arrangement.
[0079] In the above embodiments provided in the present application, it should be understood that the disclosed methods, devices, computer-readable storage media, and electronic devices can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as multiple components or modules can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or components or modules, which can be electrical, mechanical or other forms.
[0080] The components described as separate components may or may not be physically separated, and the components shown as components may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the components may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0081] In addition, each functional module in each embodiment of the present invention may be integrated into one processing module, or each component may exist physically separately, or two or more modules may be integrated into one module. The above integrated modules may be implemented in the form of hardware or in the form of software functional modules.
[0082] If the integrated module is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0083] It should be noted that, for the convenience of description, the aforementioned method embodiments are all described as a series of action combinations, but those skilled in the art should be aware that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
[0084] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0085] The above is a specific description of the preferred implementation of the present invention, but the invention is not limited to the embodiments. Those skilled in the art can make various equivalent modifications or substitutions without violating the spirit of the present invention. These equivalent modifications or substitutions are all included in the scope defined by the claims of this application.
Claims
1. A method for transmitting data via audio, characterized in that: The method comprises: When receiving the initial audio data transmitted by the data transmitting end according to the transmission frequency, transmission rate and transmission protocol, sampling the initial audio data to obtain an initial audio signal, wherein the initial audio data includes the production data of the data transmitting end; Performing signal processing on the initial audio signal to obtain a target audio signal; The target audio signal is subjected to data verification and analysis according to the transmission protocol to obtain the production data.
2. The method for transmitting data via audio according to claim 1, characterized in that: The performing signal processing on the initial audio signal to obtain a target audio signal comprises: Performing filtering processing on the initial audio signal to obtain a first audio signal; Performing envelope processing on the first audio signal to obtain a second audio signal; Performing sampling and decision processing on the second audio signal to obtain a third audio signal; The third audio signal is determined as the target audio signal.
3. The method for transmitting data via audio according to claim 2, characterized in that: The step of performing envelope processing on the first audio signal to obtain a second audio signal comprises: Performing signal smoothing and signal flipping on the first audio signal; Determine a fundamental period of the first audio signal, and determine a sliding window length according to the fundamental period; Extracting the maximum signal amplitude of the first audio signal after the signal smoothing and the signal flipping are completed according to the sliding window length; A second audio signal in the first audio signal is determined based on the maximum signal amplitude.
4. The method for transmitting data via audio according to claim 2, wherein: The sampling and decision processing of the second audio signal to obtain the third audio signal comprises: Determine the sample amplitude of each sampling point in the second audio signal on the time axis, and divide the sample amplitude into N equal intervals to obtain N equally spaced intervals, where N is an integer greater than or equal to 2; Determine the distribution probability of the sampling point in each of the N equally spaced intervals; Divide the N equally spaced intervals into two equal parts to obtain a first equally spaced interval and a second equally spaced interval; Determine a first sub-equally spaced interval in the first equally spaced interval and a second sub-equally spaced interval in the second equally spaced interval according to the distribution probability; Determine a first decision point of the first sub-equally spaced interval and a second decision point of the second sub-equally spaced interval; Signal conversion is performed on each sampling point according to the first decision point and the second decision point to obtain the third audio signal.
5. The method for transmitting data via audio according to claim 4, characterized in that: Before performing signal conversion on each sampling point according to the first decision point and the second decision point, the method further includes: Determine the interval amplitudes of the first sub-equally spaced interval and the second sub-equally spaced interval; Determining whether the second audio signal is abnormal according to the interval spacing amplitude and the amplitude range interval; When it is determined that the second audio signal is abnormal, the judgment fails and the second audio signal is determined to be invalid; When it is determined that there is no abnormality in the second audio signal, the decision is successful, and the operation of performing signal conversion on each sampling point according to the first decision point and the second decision point is performed.
6. The method for transmitting data via audio according to claim 1, wherein: The performing data verification and analysis on the target audio signal according to the transmission protocol includes: Determine whether there is an invalid audio signal with a width greater than 2 code elements in the target audio signal; When the invalid audio signal exists in the target audio signal, determining the polarity duration of each symbol in the target audio signal; Determine the representative data bit of each symbol according to the polarity duration and the preset transmission symbol width, and determine the complete data symbol sequence corresponding to the target audio signal according to the representative data bit; Perform data verification and analysis on the complete data symbol sequence.
7. The method for transmitting data via audio according to claim 1, characterized in that: The transmission protocol includes: a preamble, a synchronization word, a load length, a valid load of audio data and a check code, wherein the preamble occupies 1 byte, the synchronization word occupies 1 byte, the valid load occupies N bytes, wherein N is related to the length of the audio data, and the check code occupies 1 byte.
8. An audio data transmission device, characterized in that: The device comprises: A receiving module, configured to sample the initial audio data transmitted by the data transmitting end according to the transmission frequency, transmission rate and transmission protocol to obtain an initial audio signal, wherein the initial audio data includes the production data of the data transmitting end; A processing module, used for performing signal processing on the initial audio signal to obtain a target audio signal; The verification module is used to perform data verification and analysis on the target audio signal according to the transmission protocol to obtain the production data.
9. An audio data transmission system, characterized in that: The system comprises: A data sending end and a data receiving end, wherein the data sending end is communicatively connected with the data receiving end; The data transmitting end is used to transmit the collected initial audio data to the data receiving end according to the transmission frequency, transmission rate and transmission protocol; The data receiving end includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the audio data transmission method described in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for transmitting audio data according to any one of claims 1 to 7 are implemented.
