Data acquisition method and device, electronic equipment, storage medium and program product
By establishing a data transmission channel between the audio and video source and the data demander, real-time streaming of sound data is achieved, which solves the problem of increased latency in existing technologies, achieves synchronization between real-time inference results and sound signals, and meets the dynamic response requirements of high-timeliness scenarios.
Patent Information
- Application Number
- CN202510752930.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-06
- Publication Date
- 2025-09-23
AI Technical Summary
In scenarios with high timeliness requirements, existing sound data acquisition methods store files first and then read them, which increases data processing delays. The real-time inference results lag behind the actual changes in sound signals and cannot respond to dynamic scene requirements in a timely manner.
By establishing a data transmission channel that directly connects the audio and video source with the data demander, real-time streaming of sound data is achieved, avoiding the file storage link. The data transmission channel is used to pull data from the audio and video source and output the target data, and perform consistency verification and segmentation and splicing.
Reduce data processing latency, ensure real-time inference results are synchronized with actual sound signals, and meet the strict requirements of dynamic response in time-sensitive scenarios.
Smart Images

Figure CN120692255A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of communication technologies, and in particular to a data acquisition method, device, electronic device, storage medium, and program product. Background Art
[0002] Currently, existing methods for acquiring sound data typically involve using the FastForward MPEG (FFMPEG) framework to pull the sound data and save it as a file, which is then read from the file during inference. However, in scenarios with high timeliness requirements, this method of storing the file first and then reading it can increase data processing latency, causing real-time inference results to lag behind actual sound signal changes and fail to respond promptly to dynamic scenario demands. Summary of the Invention
[0003] The present disclosure provides a data acquisition method to, to a certain extent, solve the problem that in scenarios with high timeliness requirements, the method of storing files first and then reading them may lead to increased data processing latency, and the real-time inference results lag behind the actual sound signal changes and cannot respond to dynamic scene requirements in a timely manner.
[0004] According to one aspect of the present disclosure, a data acquisition method is provided, comprising: establishing a data transmission channel; one side of the data transmission channel is an audio and video source; the other side of the data transmission channel is a data demander; using the data transmission channel to pull data from the audio and video source as first input data; when the data demander sends a data request to the data transmission channel, using the data transmission channel to output target data.
[0005] In addition, according to a method according to one aspect of the present disclosure, the first input data includes: a header identification code and sound data.
[0006] In addition, according to a method in one aspect of the present disclosure, when the data demand direction sends a data request to the data transmission channel, the target data is output using the data transmission channel, including: verifying the consistency of the first input data; based on the data request, splitting and splicing the first input data to obtain the target data.
[0007] In addition, according to a method of one aspect of the present disclosure, the verification includes at least one of the following: distribution verification, absolute value verification, and continuity verification; verifying the consistency of the first input data includes: obtaining the second input data in the storage file; the storage file is used to generate a benchmark data set based on the acquisition command; when the verification is a distribution verification, obtaining the first feature of the first input data and the second feature of the second input data; the first feature is used to characterize the probability distribution characteristics of the first input data; the first feature includes at least one of the following: mean, variance, median, maximum value, minimum value, kurtosis, skewness; based on the first feature and the second feature, performing a distribution verification.
[0008] In addition, according to a method in one aspect of the present disclosure, the method also includes: when the verification is an absolute value verification, obtaining a third feature of the first input data and a fourth feature of the second input data; the third feature is used to characterize the absolute time value of the first input data; the third feature includes at least one of the following: time period, moment; based on the third feature and the fourth feature, performing an absolute value verification.
[0009] In addition, according to a method in one aspect of the present disclosure, the method also includes: when the check is a continuity check, obtaining a first data segment of a preset time period N starting from the moment M of the header identification code of the first input data; replacing the data at the M+1 moment of the first input data with the header identification code, and obtaining data of the N time period to form a second data segment; performing a continuity check based on the first data segment and the second data segment.
[0010] In addition, according to a method of one aspect of the present disclosure, based on a data request, the first input data is split and spliced to obtain target data, including: splitting the first input data into a header identification code and sound data; determining the data composition of the data request; the data composition includes at least one of the following: data format, data arrangement time period, multi-process parallel processing; based on the data composition, splicing the head identification code and sound data to obtain the target data.
[0011] According to another aspect of the present disclosure, a data acquisition device is provided, which includes: an establishment unit for establishing a data transmission channel; one side of the data transmission channel is an audio and video source; the other side of the data transmission channel is a data demander; a pulling unit for pulling data from the audio and video source as first input data using the data transmission channel; and an output unit for outputting target data using the data transmission channel when the data demander sends a data request to the data transmission channel.
[0012] According to yet another aspect of the present disclosure, an electronic device is provided, comprising: a memory for storing computer-readable instructions; and a processor for executing the computer-readable instructions so that the electronic device executes the method according to any one embodiment of the one aspect.
[0013] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium is provided for storing computer-readable instructions. When the computer-readable instructions are executed by a processor, the processor is caused to execute the method as described in any embodiment of one aspect.
[0014] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, the method according to any one embodiment of the first aspect is implemented.
[0015] The present disclosure provides a data acquisition method, device, electronic device, storage medium and program product. The present disclosure establishes a data transmission channel; one side of the data transmission channel is an audio and video source; the other side of the data transmission channel is a data demander; the data transmission channel is used to pull data from the audio and video source as the first input data; when the data demander sends a data request to the data transmission channel, the data transmission channel is used to output the target data. In this way, by establishing a data transmission channel that directly connects the audio and video source and the data demander, real-time streaming of sound data can be achieved without going through the file storage link, thereby reducing data processing latency, ensuring that real-time inference results are synchronized with actual sound signals, and meeting the strict requirements of high-timeliness scenarios for dynamic response.
[0016] It is to be understood that both the foregoing general description and the following detailed description are exemplary, and are intended to provide further explanation of the technology as claimed. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The above and other purposes, features, and advantages of the present disclosure will become more apparent through a more detailed description of the embodiments of the present disclosure in conjunction with the accompanying drawings. The accompanying drawings are intended to provide a further understanding of the embodiments of the present disclosure and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the present disclosure and are not intended to limit the present disclosure. In the drawings, the same reference numerals generally represent the same components or steps.
[0018] Figure 1 A flowchart of a data acquisition method provided in an embodiment of the present disclosure;
[0019] Figure 2 A working architecture diagram of a data transmission channel (pipeline) provided in an embodiment of the present disclosure;
[0020] Figure 3 A schematic diagram of continuity verification provided by an embodiment of the present disclosure;
[0021] Figure 4 A schematic diagram of the process of data acquisition in a coal mine scenario provided by an embodiment of the present disclosure;
[0022] Figure 5A structural block diagram of a data acquisition device provided in an embodiment of the present disclosure;
[0023] Figure 6 A hardware block diagram of an electronic device provided in an embodiment of the present disclosure;
[0024] Figure 7 A schematic diagram of a computer-readable storage medium provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0025] In order to make the purpose, technical solutions and advantages of the present disclosure more apparent, the following will describe in detail exemplary embodiments of the present disclosure with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all the embodiments of the present disclosure, and it should be understood that the present disclosure is not limited to the exemplary embodiments described herein.
[0026] Currently, existing methods for acquiring sound data typically involve using the FastForward MPEG (FFMPEG) framework to pull the sound data and save it as a file, which is then read from the file during inference. However, in scenarios with high timeliness requirements, this method of storing the file first and then reading it can increase data processing latency, causing real-time inference results to lag behind actual sound signal changes and fail to respond promptly to dynamic scenario demands.
[0027] Therefore, in response to the above-mentioned problems, the present disclosure provides a data acquisition method, which can achieve real-time streaming transmission of sound data by establishing a data transmission channel that directly connects the audio and video source with the data demander, without going through the file storage link, thereby reducing the data processing delay, ensuring that the real-time inference results are synchronized with the actual sound signal, and meeting the strict requirements of high-timeliness scenarios for dynamic response. First, the present disclosure provides a data acquisition method. Please refer to Figure 1 , Figure 1 A flow chart of a data acquisition method provided in an embodiment of the present disclosure. Figure 1 As shown, the method includes:
[0028] In step S101, a data transmission channel is established; one side of the data transmission channel is the audio and video source; the other side of the data transmission channel is the data demander;
[0029] In step S102, data is pulled from the audio and video source using a data transmission channel as first input data;
[0030] In step S103, when the data demander sends a data request to the data transmission channel, the target data is outputted via the data transmission channel.
[0031] In the present disclosure, the data transmission channel can be understood as a pipe for inter-process communication, which is a buffer with one end connected to a process as input and the other end connected to another process as output to read the data in the pipe. The data information in the pipe can be put into this pipe: when there is no data information in the pipe, the process reading from the pipe will wait until the input process puts the information in; when the pipe is full of information, the input process trying to put the information in will wait until the output process takes out the information. When both sides are terminated, the pipe can also disappear automatically. In the present disclosure, the input is the video source process and the output is the data demander process. It should be noted that the pipe is a unidirectional, first-in-first-out, unstructured byte stream. Once the data is read from the pipe, it no longer exists in the pipe, the data cannot be read repeatedly, and no other process can read the data again. For example, Figure 2 This is a working architecture diagram of the data transmission channel (pipeline) provided in the embodiment of the present disclosure. Figure 2 As can be seen, the pipeline receives data from the input side, starting with a header identifier, followed by sequential 1-second data blocks. These blocks are then queued in the pipeline for reading by the output side. The data demander reads data from the output side in first-in, first-out order. During transmission, the input side can only continue writing data when there is space in the pipeline. The output side continuously reads data to maintain the pipeline data flow, ensuring real-time streaming of sound data.
[0032] Specifically, when the audio and video source process inputs data into the pipeline, the sound data can be pre-processed first (for example, encoded according to a specific audio coding format, etc.), and written into the pipeline in the form of a header identification code and a 1s data block. The specific details will be described in detail later in conjunction with the embodiment. When the data demander sends a data request, its process starts to read data from the output side of the pipeline. First, read the header identification code, configure its own audio processing module parameters according to the metadata information therein (for example, set the appropriate decoding method, sampling rate, etc.), and then read the 1s data blocks in sequence, and send the read data blocks to the subsequent audio processing process, such as real-time speech recognition, audio rendering and playback, and other operations.
[0033] During the entire transmission process, the system can also monitor the status of the pipeline in real time and determine the degree of filling of the pipeline. When the amount of data in the pipeline is lower than the preset low threshold, the system can notify the audio and video source process to speed up the data writing speed; when the amount of data in the pipeline reaches the preset high threshold, the audio and video source process can pause writing to prevent the pipeline from overflowing. The data demander process can also continuously adjust the reading speed to match the data generation speed of the audio and video source and the transmission capacity of the pipeline, ensuring that the sound data can be efficiently and stably transmitted from the audio and video source to the data demander in a real-time streaming manner, meeting various application scenarios with strict real-time requirements for sound data, such as real-time online meetings, live interactive broadcasts, etc.
[0034] In summary, the present invention realizes real-time streaming transmission of sound data by establishing a data transmission channel that directly connects the audio and video source with the data demander, without going through the file storage link, thereby reducing the data processing delay, ensuring that the real-time inference results are synchronized with the actual sound signal, and meeting the strict requirements of high-timeliness scenarios for dynamic response.
[0035] The following specifically describes the first input data of the present disclosure, namely, the specific composition of the pipeline data, including:
[0036] The first input data includes: a header identification code and sound data.
[0037] Specifically, the header identification code can be used to identify the source, format and timestamp information of the data. The identification code contains at least one of the following metadata fields: a device identifier, which can uniquely identify the audio and video source device (such as a Media Access Control Address (MAC) address, a Universally Unique Identifier (UUID), etc.). A timestamp, which can even be accurate to the millisecond level for sampling start time, is used to synchronize multi-device data streams. A data format descriptor, which can define the encoding format of the sound data (such as Pulse-Code Modulation (PCM), Advanced Audio Coding (AAC), etc.).
[0038] Sound data is a continuous sequence of audio samples, divided into independent data blocks with a fixed duration (such as 1 second). Each data block is encoded according to the format specified by the header identifier and maintains strict continuity in the time dimension.
[0039] As above Figure 2 As shown in the figure, the data in the data transmission channel (pipeline) includes a header identifier and a 1s data block. The header identifier, as the leading information of the data block, is written into the pipeline before the 1s audio data block, ensuring that the data requester obtains complete decoding parameters before parsing the sound data.
[0040] The following will specifically describe how the present disclosure utilizes a data transmission channel to obtain target data. The method includes:
[0041] Verifying the consistency of the first input data;
[0042] Based on the data request, the first input data is split and concatenated to obtain target data.
[0043] Specifically, in the process of obtaining the target data using the data transmission channel, it is first necessary to perform a consistency check on the first input data to ensure that the data pulled from the audio and video source through the data transmission channel meets the accuracy requirements. After completing the verification, the system can parse the data request sent by the data demander, which contains at least one of the data format, field arrangement, processing logic, etc. Based on this, the system divides the verified first input data, splits it into basic units of header identification code and sound data, and re-splices each unit according to the rules specified by the data request, thereby generating target data that meets the requirements. For example, when the data request requires that the sound data be converted to a specific encoding format and a timestamp prefix needs to be added, the system will first convert the format of the original sound data, and then splice and output the header identification code containing the timestamp information and the converted sound data.
[0044] The following describes the specific types of verifications disclosed herein, including:
[0045] The verification includes at least one of the following: distribution verification, absolute value verification, and continuity verification.
[0046] Specifically, distribution verification can be understood as a process of verifying whether the probability distribution characteristics of the first input data are consistent with the benchmark data set by comparing statistical features. Absolute value verification can be understood as a numerical accuracy verification mechanism based on the time dimension. Its core lies in performing a point-to-point comparison of the actual measured value of the first input data at a specific moment or time period with a preset benchmark range. Continuity verification can be understood as a verification method for detecting whether the data remains coherent and complete in the time series by using a sliding window comparison. This will be described in detail later in conjunction with the embodiments.
[0047] The following describes how the present disclosure performs different types of verification, including:
[0048] Exemplarily, when the verification type is distributed verification, the method includes:
[0049] Obtain second input data from a storage file; the storage file is used for generating a benchmark data set based on the acquisition command;
[0050] When the check is a distribution check, a first feature of the first input data and a second feature of the second input data are obtained; the first feature is used to characterize the probability distribution characteristics of the first input data; the first feature includes at least one of the following: mean, variance, median, maximum value, minimum value, kurtosis, and skewness;
[0051] Based on the first feature and the second feature, distribution verification is performed.
[0052] In this disclosure, the second input data can be understood as a benchmark data set periodically acquired and stored via a collection command, which can serve as a reference standard for data verification. In short, the acquisition of this second input data can be completely based on existing technology and obtained from the storage file of the pulled data.
[0053] In this disclosure, the first feature can be understood as a set of statistical indicators used to quantitatively characterize the probability distribution characteristics of the first input data. It reflects the inherent distribution law of the data by numerically describing the central tendency, dispersion, and distribution form of the data. Specifically, the mean can reflect the average level of the data, the variance can measure the dispersion of the data around the mean, the median can represent the middle value of the data sequence, the maximum and minimum values can define the range of the data, the kurtosis can be used to measure the degree of peaking of the data distribution compared to the normal distribution, and the skewness reflects the symmetry of the data distribution.
[0054] Specifically, during distribution verification, the system can determine the distribution consistency of the first input data and the second input data by calculating at least one of a comparison histogram, a probability density curve, etc. of the first feature and the second feature corresponding to the first input data and the second input data. If the difference exceeds a preset threshold, it is determined that there is a distribution anomaly in the data.
[0055] Furthermore, the system can employ hypothesis testing to verify the significance of the first input data against the baseline distribution represented by the second input data. If any of these evaluation indicators exceeds a preset difference threshold, the system can determine that the first input data has a distribution anomaly and trigger data correction, retransmission, or an alarm mechanism to ensure the statistical stability of the transmitted data.
[0056] Exemplarily, when the verification type is absolute value verification, the method includes:
[0057] When the check is an absolute value check, a third feature of the first input data and a fourth feature of the second input data are obtained; the third feature is used to represent the absolute time value of the first input data; the third feature includes at least one of the following: time period, time;
[0058] Based on the third and fourth features, absolute value verification is performed.
[0059] In the present disclosure, the third feature can be understood as an attribute identifier used to accurately locate the specific position of the first input data in the time dimension, which records the time information of data generation or correspondence in the form of time period or moment.
[0060] Specifically, during the absolute value verification process, the system can match the second input data with a baseline numerical range for the corresponding time period or moment based on the time information carried by the third feature. This range can be pre-defined by the second input data and / or business rules, such as the normal fluctuation range of audio volume within a specific time period. The system can then compare the actual value of the first input data at the corresponding time point with the baseline numerical range. If the actual value exceeds this range, the data is determined to have an absolute value anomaly, triggering a data correction or discard mechanism.
[0061] Exemplarily, when the verification type is continuity verification, the method includes:
[0062] When the check is a continuity check, the first data segment of the preset time period N is obtained starting from the moment M of the header identification code of the first input data;
[0063] The data at time M+1 of the first input data is replaced with the header identification code, and the data of time period N is obtained to form a second data segment;
[0064] A continuity check is performed based on the first data segment and the second data segment.
[0065] In the present disclosure, the first data segment and the second data segment are both audio data slices with a duration of a preset time period N, but the two partially overlap in the time dimension.
[0066] Specifically, during the continuity check, the first data segment takes the moment M marked by the header identification code as the starting point and completely intercepts the audio data of a duration of N; the second data segment replaces the data at moment M+1 with the header identification code, and intercepts the audio data of a duration of N starting from moment M+1, so that the two data segments have overlapping parts from moment M+1 to moment M+N. Then, the system can determine the continuity of the data by calculating the similarity of the audio features of the two segments in the overlapping area, such as the difference in waveform amplitude, the consistency of frequency change trend, etc. If the difference in the audio features of the overlapping part exceeds the set threshold, or there is at least one situation such as data missing or mutation, the data continuity is determined to be abnormal, thereby triggering the data retransmission or repair process.
[0067] For example, Figure 3 Schematic diagram of continuity check provided by the embodiment of the present disclosure. Assume that the preset time period N is 5s, Figure 3As can be seen in the figure, for the data in the pipeline, when performing continuity verification, taking the first 5s data as an example, starting from the moment M corresponding to its header identification code, the data consisting of the header identification code and the subsequent 5 1s data blocks are intercepted to form a complete 5s duration data as the first data segment. After replacing the data at time M+1 with the header identification code, the data with a duration of 5s is intercepted starting from time M+1 as the second data segment, so that the first data segment and the second data segment have an overlapping part of 4s (i.e., M+2, M+3, M+4 and M+5) from time M+1 to time M+5. The system judges the continuity of the data by accurately calculating the audio feature similarity between each 1s data block in this overlapping part, including but not limited to indicators such as waveform amplitude difference and frequency change trend consistency. If the audio feature difference of the overlapping part exceeds a pre-set threshold, or at least one abnormal situation such as data missing or mutation occurs, it is determined that there is a problem with the continuity of the data segment, and the corresponding data retransmission or repair process is triggered to ensure the continuity and integrity of the sound data in the time dimension. The same verification logic is used for the second, third, and other subsequent 5-second segments of data within the pipeline. It's important to note that pipelines are unidirectional; once data is read, it no longer exists. Therefore, each segment of data must be stored in memory. This can be achieved by building a time-indexed data cache structure in memory (unlike cache files, this structure achieves fast read and write speeds based on memory address mapping, eliminating the need for additional latency associated with disk operations) to store each segment of data. When performing a continuity check, corresponding information for adjacent data segments can be easily extracted from the memory cache, allowing for accurate comparison of overlapping data.
[0068] The following specifically describes how the present disclosure divides and splices data to obtain target data. The method includes:
[0069] Splitting the first input data into a header identification code and sound data;
[0070] Determine the data structure of the data request; the data structure includes at least one of the following: data format, data arrangement time period, and multi-process parallel processing;
[0071] Based on the data structure, the head identification code and the sound data are spliced together to obtain the target data.
[0072] In this disclosure, data composition can be understood as a set of constraints that characterize the format specifications, timing arrangement rules, and processing modes of the target data required by the data demander. It clarifies how to reorganize the segmented header identification code and the sound data to generate an output result that conforms to the business logic. Among them, the data format can be used to specify the encoding standard of the target data (such as PCM, AAC); the data arrangement time period can be used to define the screening range of the sound data in the time dimension (such as sliding extraction by time window, random access based on timestamp, and data blocks according to specified time periods); multi-process parallel processing can be achieved by defining a data copy distribution strategy, that is, synchronously distributing the sound data of the same data source to multiple independent processes for processing, etc.
[0073] Specifically, the system can perform the following segmentation and splicing steps based on the above-mentioned data composition constraints: First, by parsing the timestamp information in the header identification code, the continuous sound data stream is sliced according to a preset time window (such as 1 second) to form a discrete data block sequence; then, according to the data format parameters specified in the data request, the encoding format, sampling rate, etc. of each data block are adapted and converted (such as resampling 44.1kHz PCM data to 16kHz); then, according to the data arrangement time period parameters, a subset of data blocks that meet the time range requirements is screened out and reorganized in timestamp order; finally, if multi-process parallel processing is involved, the system will copy the reorganized data into multiple copies, add an independent processing identifier to each copy, and distribute it to the corresponding processing process through a pipeline. Through this parameterized segmentation and splicing mechanism based on data composition, the present disclosure realizes efficient conversion from original audio stream to target data, which not only ensures the real-time performance of data processing, but also meets the customization requirements of diversified business scenarios.
[0074] In an exemplary embodiment, if the model requires sound data for reasoning, and the time interval for model reasoning is 100ms, then in order to meet the needs of model reasoning in terms of timeliness, the data of the preset time period of 5s can be split into a sliding window data structure of historical 4.9 seconds + the latest read 0.1 seconds, where the historical 4.9 seconds data is stored in the memory cache structure, and the latest read 0.1 second data is obtained in real time through the pipeline, in this way, continuous processing and real-time update of the audio data stream can be achieved. As above Figure 3As shown in , within each 100ms inference cycle, the latest 0.1 seconds of data in the second data segment and the historical 4.9 seconds of data in the first data segment are seamlessly spliced together to form a complete 5s input data for model inference. In this process, the system uses the fast read and write characteristics of the memory cache structure to pre-load and store historical data segments, and at the same time obtains the latest data in real time through the pipeline to ensure that the model can obtain a complete data set containing the latest 0.1 seconds of information each time it infers, effectively balancing the timeliness and continuity of data processing. If it is detected during the data splicing process that the audio feature difference in the overlapping area exceeds the threshold, the system can trigger the data repair mechanism to repair the abnormal data through at least one of forward error correction or data interpolation to ensure that the data quality of the input model meets the inference requirements. This sliding window-based data processing method not only ensures the real-time performance of model inference (input data is updated every 100ms), but also ensures the integrity and accuracy of the data through a continuity verification mechanism, providing an efficient and reliable technical solution for real-time audio processing scenarios.
[0075] In an exemplary embodiment, Figure 4 The following is a flow chart of data acquisition in a coal mine scenario according to an embodiment of the present disclosure. Figure 4 As can be seen, the status of the pickup device must be determined. If the device is operating normally, the next step is to use the FFMPEG pipeline to pull the stream and obtain data. If the device is not operating normally, a polling mechanism must be used to wait until the device is properly powered on before pulling the stream and obtaining data through the FFMPEG pipeline. The pulled data must then be processed, including verification, data composition analysis, and sampling rate adjustment. Once this processing is complete, the final sound data can be returned to the next process.
[0076] The present disclosure also provides a data acquisition device. Figure 5 A structural block diagram of a data acquisition device provided in an embodiment of the present disclosure is shown in FIG. Figure 5 As shown, the data acquisition device 500 includes:
[0077] Establishing unit 501, used to establish a data transmission channel; one side of the data transmission channel is the audio and video source; the other side of the data transmission channel is the data demander;
[0078] A pulling unit 502 is configured to pull data from an audio and video source as first input data using a data transmission channel;
[0079] The output unit 503 is configured to output target data via the data transmission channel when the data request direction sends a data request to the data transmission channel.
[0080] In an exemplary embodiment, the establishing unit 501 is specifically configured to: the first input data includes: a header identification code and sound data.
[0081] In an exemplary embodiment, the output unit 503 is specifically configured to: verify the consistency of the first input data; and based on the data request, split and splice the first input data to obtain target data.
[0082] In an exemplary embodiment, the output unit 503 is specifically used to: verify including at least one of the following: distribution verification, absolute value verification, and continuity verification; verify the consistency of the first input data, including: obtaining the second input data in the storage file; the storage file is used to generate a benchmark data set based on the acquisition command; when the verification is a distribution verification, obtaining the first feature of the first input data and the second feature of the second input data; the first feature is used to characterize the probability distribution characteristics of the first input data; the first feature includes at least one of the following: mean, variance, median, maximum value, minimum value, kurtosis, skewness; based on the first feature and the second feature, perform distribution verification.
[0083] In an exemplary embodiment, the output unit 503 is specifically used to: when the verification is an absolute value verification, obtain the third feature of the first input data and the fourth feature of the second input data; the third feature is used to characterize the absolute time value of the first input data; the third feature includes at least one of the following: time period, moment; based on the third feature and the fourth feature, perform absolute value verification.
[0084] In an exemplary embodiment, the output unit 503 is specifically used to: when the check is a continuity check, obtain the first data fragment of a preset time period N starting from the moment M of the header identification code of the first input data; replace the data at the moment M+1 of the first input data with the header identification code, and obtain the data of the N time period to form a second data fragment; and perform a continuity check based on the first data fragment and the second data fragment.
[0085] In an exemplary embodiment, the output unit 503 is specifically used to: divide the first input data into a header identification code and sound data; determine the data structure of the data request; the data structure includes at least one of the following: data format, data arrangement time period, multi-process parallel processing; based on the data structure, splice the header identification code and sound data to obtain the target data.
[0086] Figure 6 This is a hardware block diagram of an electronic device provided in an embodiment of the present disclosure. The electronic device 600 according to an embodiment of the present disclosure includes at least a processor and a memory for storing computer-readable instructions. When the computer-readable instructions are loaded and executed by the processor, the processor executes the data acquisition method described in any of the preceding embodiments of the present disclosure.
[0087] Figure 6 The electronic device 600 shown specifically includes: a central processing unit (CPU) 601, a graphics processing unit (GPU) 602, and a memory 603. These units are interconnected via a bus 604. The central processing unit (CPU) 601 and / or the graphics processing unit (GPU) 602 can be used as the above-mentioned processor, and the memory 603 can be used as the above-mentioned memory for storing computer-readable instructions. In addition, the electronic device 600 may also include a communication unit 605, a storage unit 606, an output unit 607, an input unit 608, and an external device 609, which are also connected to the bus 604.
[0088] Figure 7 A schematic diagram of a computer-readable storage medium provided in an embodiment of the present disclosure. Figure 7 As shown, a computer-readable storage medium 700 according to an embodiment of the present disclosure has computer-readable instructions 701 stored thereon. When the computer-readable instructions 701 are executed by a processor, the data acquisition method described with reference to the above figures according to any of the above embodiments of the present disclosure is executed. The computer-readable storage medium includes, but is not limited to, volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and / or cache memory. Non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, optical disk, magnetic disk, etc.
[0089] As described above, the present disclosure provides a data acquisition method, device, electronic device, storage medium and program product. The present disclosure establishes a data transmission channel; one side of the data transmission channel is the audio and video source; the other side of the data transmission channel is the data demander; the data transmission channel is used to pull data from the audio and video source as the first input data; when the data demander sends a data request to the data transmission channel, the data transmission channel is used to output the target data. In this way, by establishing a data transmission channel that directly connects the audio and video source and the data demander, real-time streaming of sound data can be achieved without going through the file storage link, thereby reducing the data processing delay, ensuring that the real-time inference results are synchronized with the actual sound signal, and meeting the strict requirements of high-timeliness scenarios for dynamic response.
[0090] The present disclosure further provides a computer program product, including a computer program, which, when executed by a processor, implements the data acquisition method described in any of the foregoing embodiments of the present disclosure.
[0091] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this disclosure.
[0092] The basic principles of the present disclosure have been described above in conjunction with specific embodiments. However, it should be noted that the advantages, strengths, and effects mentioned in this disclosure are merely illustrative and not restrictive, and should not be construed as necessarily possessed by each embodiment of the present disclosure. Furthermore, the specific details disclosed above are provided for illustrative purposes and to facilitate understanding, rather than as limitations. These details do not limit the present disclosure to necessarily being implemented using these specific details.
[0093] The block diagrams of the devices, devices, equipment, and systems involved in this disclosure are merely illustrative examples and are not intended to require or imply that they must be connected, arranged, or configured in the manner shown in the block diagrams. As will be appreciated by those skilled in the art, these devices, devices, equipment, and systems can be connected, arranged, or configured in any manner. Words such as "include," "comprise," "have," and the like are open-ended words, meaning "including but not limited to," and can be used interchangeably therewith. The words "or" and "and" used herein refer to the words "and / or" and can be used interchangeably therewith, unless the context clearly indicates otherwise. The word "such as" used herein refers to the phrase "such as but not limited to," and can be used interchangeably therewith.
[0094] Additionally, as used herein, "or" used in a list of items beginning with "at least one" indicates a separate list, so that, for example, a list of "at least one of A, B, or C" means A or B or C, or AB or AC or BC, or ABC (i.e., A and B and C). Furthermore, the word "exemplary" does not mean that the example described is preferred or better than other examples.
[0095] It should also be noted that in the system and method of the present disclosure, each component or each step can be decomposed and / or recombined. Such decomposition and / or recombination should be regarded as equivalent solutions of the present disclosure.
[0096] Various changes, substitutions, and modifications may be made to the technology described herein without departing from the teachings defined by the appended claims. Moreover, the scope of the claims of this disclosure is not limited to the specific aspects of the processes, machines, manufactures, compositions of things, means, methods, and actions described above. Currently existing or later developed processes, machines, manufactures, compositions of things, means, methods, or actions that perform substantially the same function or achieve substantially the same results as the corresponding aspects described herein may be utilized. Accordingly, the appended claims include within their scope such processes, machines, manufactures, compositions of things, means, methods, or actions.
[0097] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the aspects shown herein, but rather to be accorded the widest scope consistent with the principles and novel features disclosed herein.
[0098] The above description has been provided for the purpose of illustration and description. In addition, this description is not intended to limit the embodiments of the present disclosure to the forms disclosed herein. Although a number of example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and sub-combinations thereof.
Claims
1. A data acquisition method, characterized in that: The method comprises: Establishing a data transmission channel; one side of the data transmission channel is the audio and video source; the other side of the data transmission channel is the data demander; Using the data transmission channel to pull data from the audio and video source as first input data; When the data demander sends a data request to the data transmission channel, the target data is outputted using the data transmission channel.
2. The method according to claim 1, characterized in that The first input data includes: a header identification code and sound data.
3. The method according to claim 1, characterized in that When the data demander sends a data request to the data transmission channel, outputting target data by using the data transmission channel includes: Verifying the consistency of the first input data; Based on the data request, the first input data is segmented and concatenated to obtain the target data.
4. The method according to claim 3, characterized in that The verification includes at least one of the following: distribution verification, absolute value verification, and continuity verification; and the verification of the consistency of the first input data includes: Obtain second input data from a storage file; the storage file is used for generating a benchmark data set based on an acquisition command; When the check is the distribution check, obtaining a first feature of the first input data and a second feature of the second input data; the first feature is used to characterize the probability distribution characteristics of the first input data; the first feature includes at least one of the following: mean, variance, median, maximum value, minimum value, kurtosis, and skewness; The distribution verification is performed based on the first feature and the second feature.
5. The method according to claim 4, characterized in that The method further comprises: When the check is the absolute value check, obtaining a third feature of the first input data and a fourth feature of the second input data; the third feature is used to represent the absolute time value of the first input data; the third feature includes at least one of the following: time period and time; Based on the third feature and the fourth feature, the absolute value check is performed.
6. The method according to claim 4, characterized in that The method further comprises: When the check is the continuity check, obtaining a first data segment of a preset time period N starting from the moment M of the header identification code of the first input data; Replacing the data at time M+1 of the first input data with the header identification code, and obtaining data for time period N to form a second data segment; The continuity check is performed based on the first data segment and the second data segment.
7. The method according to claim 3, characterized in that The step of dividing and concatenating the first input data based on the data request to obtain the target data includes: dividing the first input data into a header identification code and sound data; Determining a data structure of the data request; the data structure includes at least one of the following: data format, data arrangement time period, and multi-process parallel processing; Based on the data composition, the header identification code and the sound data are spliced together to obtain the target data.
8. A data acquisition device, characterized in that: The device comprises: An establishing unit, configured to establish a data transmission channel; one side of the data transmission channel is an audio and video source; the other side of the data transmission channel is a data demander; a pulling unit, configured to pull data from the audio and video source as first input data by using the data transmission channel; The output unit is configured to output target data using the data transmission channel when the data demanding party sends a data request to the data transmission channel.
9. An electronic device, characterized in that: include: a memory for storing computer-readable instructions; as well as A processor is configured to execute the computer-readable instructions so that the electronic device performs the method according to any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium for storing computer-readable instructions, characterized in that: When the computer-readable instructions are executed by a processor, the processor is caused to perform the method according to any one of claims 1 to 7.
11. A computer program product, characterized in that The method comprises a computer program, which implements the method according to any one of claims 1 to 7 when the computer program is executed by a processor.