A method and apparatus for processing continuous audio stream for a storage-constrained recording device
By encoding and segmenting the continuous audio stream of the recording device, and detecting and deleting unnecessary audio blocks in real time, the problem of recording interruption due to insufficient storage capacity is solved, enabling continuous recording under storage-constrained recording devices and improving the reliability and availability of the recording device.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN JIAYZ PHOTO IND LTD
- Filing Date
- 2026-02-13
- Publication Date
- 2026-06-02
AI Technical Summary
Recording equipment interrupts recording due to insufficient storage capacity, reducing the reliability and availability of the recording equipment.
The received continuous audio stream is encoded and segmented, the storage space of the local audio buffer is detected in real time, audio blocks to be deleted are selected and deleted to expand the available storage space and ensure continuous recording under storage-constrained recording devices.
It extends the recording time of the recording device, reduces the risk of recording interruption due to full storage capacity, and improves the reliability and availability of the recording device.
Smart Images

Figure CN122131978A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of audio data processing technology, and in particular to a method and apparatus for processing continuous audio streams for storage-constrained recording devices. Background Technology
[0002] In pursuit of small size and low power consumption, some recording devices are equipped with small flash memory capacities (e.g., no more than 128MB). When recording time is long, these recording devices often interrupt recording due to insufficient flash memory capacity, thereby reducing the reliability and availability of the recording device. Summary of the Invention
[0003] This invention provides a method and apparatus for continuous audio stream processing for storage-constrained recording devices, in order to improve the reliability and availability of the recording devices.
[0004] According to one aspect of the present invention, a method for processing continuous audio streams for storage-constrained recording devices is provided, the method being executed by the recording device, comprising: The received continuous audio stream is encoded and segmented to obtain multiple audio data blocks, and the current audio block to be stored is determined from the obtained audio data blocks. Get the first available and used storage space of the local audio buffer; If the first available storage space is lower than the first threshold, or the used storage space is higher than the second threshold, the audio blocks to be deleted are selected from the block index table based on the audio data block information recorded in the block index table. Delete the audio block to be deleted from the local audio buffer and obtain the second available storage space in the local audio buffer at this time; Store the audio block to be stored based on the second available storage space.
[0005] According to another aspect of the present invention, a continuous audio stream processing apparatus for a storage-constrained recording device is provided, the apparatus being deployed at the recording device end, comprising: The current audio block to be stored determination module is used to encode and segment the received continuous audio stream to obtain multiple audio data blocks, and determine the current audio block to be stored from the obtained audio data blocks; The local storage space acquisition module retrieves the available and used storage space of the local audio buffer. The audio block filtering module is used to filter out audio blocks to be deleted from the block index table based on the audio data block information recorded in the block index table when the first available storage space is lower than the first threshold or the used storage space is higher than the second threshold. The second available storage space acquisition module is used to delete the audio block to be deleted from the local audio buffer according to the storage address of the audio block to be processed, and to acquire the second available storage space of the local audio buffer at this time. The current audio block storage module is used to store the current audio block according to the second available storage space.
[0006] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising: At least one processor; and a memory communicatively connected to at least one processor; wherein, The memory stores a computer program that can be executed by at least one processor, such that the at least one processor is able to perform a continuous audio stream processing method for a storage-constrained recording device according to any embodiment of the present invention.
[0007] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement a continuous audio stream processing method for a storage-constrained recording device according to any embodiment of the present invention.
[0008] According to another aspect of the present invention, a computer program product is provided, comprising a computer program that, when executed by a processor, implements a continuous audio stream processing method for a storage-constrained recording device according to any embodiment of the present invention.
[0009] The technical solution of this invention involves encoding and segmenting a received continuous audio stream to obtain multiple audio data blocks, and determining the current audio block to be stored from the obtained audio data blocks; obtaining the first available storage space and the used storage space of the local audio buffer; if the first available storage space is detected to be lower than a first threshold, or the used storage space is detected to be higher than a second threshold, selecting the audio block to be deleted from the segmentation index table according to the audio data block information recorded in the segmentation index table; deleting the audio block to be deleted from the local audio buffer, and obtaining the second available storage space of the local audio buffer at this time; and storing the current audio block to be stored according to the second available storage space. The above technical solution, during the process of storing continuous audio streams in blocks, detects the first available storage space and the used storage space of the local audio buffer in real time. When the first available storage space is lower than a first threshold or the used storage space is higher than a second threshold, it determines the audio block to be deleted and deletes the audio block to be deleted from the local audio buffer. This expands the available storage space of the local audio buffer, extends the recording time of the recording device, and enables continuous recording under small capacity (e.g., capacity not exceeding 128MB) storage conditions. It reduces the risk of recording interruption due to local storage capacity being full, thereby improving the reliability and availability of the recording device, especially the recording device with limited storage resources (i.e., storage-constrained recording device).
[0010] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0011] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0012] Figure 1 This is a flowchart of a continuous audio stream processing method for a storage-constrained recording device according to Embodiment 1 of the present invention; Figure 2 This is a flowchart of a continuous audio stream processing method for a storage-constrained recording device according to Embodiment 2 of the present invention; Figure 3 This is a schematic diagram of a continuous audio stream processing device for a storage-constrained recording device according to Embodiment 3 of the present invention; Figure 4This is a schematic diagram of the structure of an electronic device that implements the continuous audio stream processing method for storage-constrained recording devices according to embodiments of the present invention. Detailed Implementation
[0013] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0014] It should be noted that the terms "target," "first," and "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0015] Example 1 Figure 1 This is a flowchart of a continuous audio stream processing method for storage-constrained recording devices according to Embodiment 1 of the present invention. This embodiment is applicable to situations where recording is performed using recording devices with limited storage resources (i.e., storage-constrained recording devices), such as recording devices with a storage capacity of no more than 128MB. This method can be executed by a continuous audio stream processing device for storage-constrained recording devices. This device can be implemented in hardware and / or software and can be configured in an electronic device. Figure 1 As shown, this method is executed by the recording device and includes: S101. Encode and segment the received continuous audio stream to obtain multiple audio data blocks, and determine the current audio block to be stored from the obtained audio data blocks.
[0016] The audio block to be stored refers to the audio data block that needs to be stored at the current moment. Optionally, the audio block to be stored may include at least a block sequence number, a payload length, and a checksum. The payload length refers to the number of valid bytes in the audio data block.
[0017] Specifically, the received continuous audio stream is encoded using a preset encoding algorithm to obtain the target audio sequence; the target audio sequence is divided into blocks according to a preset block duration or a preset number of frames to obtain multiple audio data blocks; and the audio data block with the smallest block number is selected as the current audio block to be stored.
[0018] The preset encoding algorithm can be determined according to the actual recording scenario. For example, for recording scenarios that pursue lossless high fidelity, the preset encoding algorithm can be lossless compression encoding algorithms such as PCM (Pulse Code Modulation) and FLAC (Free Lossless Audio Codec). On the other hand, for recording scenarios that focus on storage and transmission efficiency, the preset encoding algorithm can be lossy compression encoding algorithms such as AAC (Advanced Audio Coding).
[0019] The target audio sequence refers to the discrete data frame sequence obtained after encoding a continuous audio stream. The preset block duration and preset number of frames can be preset based on the experience of those skilled in the art, and this embodiment of the invention does not impose specific limitations on them.
[0020] S102. Obtain the first available storage space and the used storage space of the local audio buffer.
[0021] The local audio buffer refers to a dedicated memory area in the recording device used to store recording data. The first available storage space refers to the available storage space in the local audio buffer before storing the current audio block to be stored. The used storage space refers to the storage space already used in the local audio buffer before storing the current audio block to be stored. It should be noted that the sum of the first available storage space and the used storage space equals the total storage space of the local audio buffer.
[0022] Specifically, the target acquisition method can be determined based on the device type of the recording device; through the target acquisition method, the first available storage space and the used storage space of the local audio buffer can be obtained. Here, the target acquisition method refers to the method of obtaining the local audio buffer storage space information.
[0023] S103. If the first available storage space is detected to be lower than the first threshold, or the used storage space is higher than the second threshold, the audio blocks to be deleted are selected from the block index table according to the audio data block information recorded in the block index table.
[0024] The first and second thresholds can be preset based on the experience of those skilled in the art, and are not limited in this embodiment. It should be noted that the first threshold is not equal to the second threshold. The block index table records the block information of audio data blocks. The audio data block information includes the upload status and confirmation status of the audio data block. The upload status refers to the status of the audio data block being uploaded to the processing end. The confirmation status refers to the status of the audio data block being confirmed by the processing end. It should be noted that initially, the upload status of each audio data block in the block index table is "not uploaded," and the confirmation status is "not confirmed by the processing end." Audio blocks to be deleted refer to audio data blocks in the local audio buffer that can be deleted. It should be noted that there is more than one audio block to be deleted. Optionally, the audio data block information may also include the storage address of the audio data block, the block number of the audio data block, and the write time of the audio data block. The storage address of the audio data block refers to the storage address of the audio data block in the local audio buffer. The write time of the audio data block refers to the time it takes for the audio data block to be written to the local audio buffer.
[0025] Specifically, if the first available storage space is lower than the first threshold, or the used storage space is higher than the second threshold, the audio data blocks with the upload status of "upload completed" in the block index table are designated as audio blocks to be deleted, based on the upload status of the audio data blocks recorded in the block index table.
[0026] Optionally, to avoid data loss that may occur due to the above method of determining audio blocks to be deleted, improve the accuracy of audio blocks to be deleted, and thus ensure the integrity of the recording data, if the first available storage space is lower than the first threshold or the used storage space is higher than the second threshold, the audio data blocks with the upload status of "completed upload" and the confirmation status of "accepted by the processing end" recorded in the block index table can be used as audio blocks to be deleted, based on the upload status and confirmation status of the audio data blocks recorded in the block index table.
[0027] S104. Delete the audio block to be deleted from the local audio buffer and obtain the second available storage space of the local audio buffer at this time.
[0028] The second available storage space refers to the storage space available in the local audio buffer after deleting the audio block to be deleted from the local audio buffer.
[0029] Specifically, the storage address and block number of each audio block to be deleted are obtained from the block index table. Based on the storage address and block number of each audio block to be deleted, each audio block to be deleted is deleted from the local audio buffer in the order of the block numbers, and the second available storage space of the local audio buffer is obtained at this time.
[0030] Understandably, during the recording process, the recording device expands the available storage space of the local audio buffer by deleting removable audio data blocks in real time. This extends the recording duration, avoids the risk of recording interruption due to the local audio buffer being full, and improves the reliability of the recording device, especially storage-constrained recording devices (i.e., storage-constrained recording devices). This makes storage-constrained recording devices better suited for long-term continuous recording scenarios, thereby improving the reliability and availability of the recording device, especially storage-constrained recording devices.
[0031] S105. Store the audio block to be stored according to the second available storage space.
[0032] Specifically, it checks whether the second available storage space is larger than the size of the current audio block to be stored; if so, it stores the current audio block to be stored in the local audio buffer and records the block information of the current audio block to be stored in the block index table; if not, it overwrites the current audio block to be stored into the earliest written area in the local audio buffer and records the overwrite mark in the block index table.
[0033] More specifically, the system checks whether the second available storage space is larger than the size of the current audio block to be stored. If the second available storage space is larger than the size of the current audio block to be stored, the current audio block to be stored is stored in the local audio buffer, and the block information such as the block number, storage address, write time, upload status, and confirmation status of the current audio block to be stored is recorded in the block index table. If the second available storage space is less than or equal to the size of the current audio block to be stored, an overwriting strategy is adopted, using the current audio block to overwrite the earliest written audio data block in the local audio buffer to ensure that the recording data can be continuously written. At the same time, the overwriting flag corresponding to the current audio block to be stored is recorded in the block index table to record the overwriting time and reason for the overwriting of the current audio block to be stored, which is convenient for subsequent data traceability.
[0034] Optionally, the process of overwriting the currently stored audio block into the earliest written region in the local audio buffer further includes: if the audio data block in the earliest written region is detected to be a critical audio data block, an alarm is triggered to avoid the loss of the critical audio data block, and an alarm flag is recorded in the block index table. Here, a critical audio data block refers to an audio data block that is essential for the subsequent generation of the recording file.
[0035] The technical solution of this invention involves encoding and segmenting a received continuous audio stream to obtain multiple audio data blocks, and determining the current audio block to be stored from the obtained audio data blocks; obtaining the first available storage space and the used storage space of the local audio buffer; if the first available storage space is detected to be lower than a first threshold, or the used storage space is detected to be higher than a second threshold, selecting the audio block to be deleted from the segmentation index table according to the audio data block information recorded in the segmentation index table; deleting the audio block to be deleted from the local audio buffer, and obtaining the second available storage space of the local audio buffer at this time; and storing the current audio block to be stored according to the second available storage space. The above technical solution, during the process of storing continuous audio streams in blocks, detects the first available storage space and the used storage space of the local audio buffer in real time. When the first available storage space is lower than a first threshold or the used storage space is higher than a second threshold, it determines the audio block to be deleted and deletes the audio block to be deleted from the local audio buffer. This expands the available storage space of the local audio buffer, extends the recording time of the recording device, and enables continuous recording under small capacity (e.g., capacity not exceeding 128MB) storage conditions. It reduces the risk of recording interruption due to local storage capacity being full, thereby improving the reliability and availability of the recording device, especially the recording device with limited storage resources (i.e., storage-constrained recording device).
[0036] Example 2 Figure 2 This is a flowchart of a continuous audio stream processing method for a storage-constrained recording device according to Embodiment 2 of the present invention. Based on the above embodiments, this embodiment provides an optional implementation scheme for confirming the upload of the currently stored audio block. It should be noted that parts not described in detail in this embodiment can be referred to in the relevant descriptions of other embodiments. For example... Figure 2 As shown, this method is executed by the recording device and includes: S201. Encode and segment the received continuous audio stream to obtain multiple audio data blocks, and determine the current audio block to be stored from the obtained audio data blocks; S202. Obtain the first available storage space and the used storage space of the local audio buffer.
[0037] S203. If the first available storage space is detected to be lower than the first threshold, or the used storage space is higher than the second threshold, the audio blocks to be deleted are selected from the block index table according to the audio data block information recorded in the block index table.
[0038] S204. Delete the audio block to be deleted from the local audio buffer and obtain the second available storage space of the local audio buffer at this time.
[0039] S205. Store the audio block to be stored according to the second available storage space.
[0040] S206. Upload the current audio block to be stored to the processing end so that the processing end can verify the received audio block to be stored and obtain the verification result.
[0041] Specifically, the data link can be activated based on the data transmission command received from the processing end by the control link. The current audio block to be stored is then uploaded to the processing end via the data link. The processing end, based on a preset checksum generation algorithm, generates a new checksum corresponding to the current audio block. This new checksum is compared with the original checksum in the current audio block. If they match perfectly, the verification is successful; otherwise, it fails. The control link is the communication link between the recording device and the processing end, and it maintains a constant connection. The data link is the link used by the recording device to transmit data to the processing end.
[0042] S207. Receive the verification result from the processing end, and process the current audio block to be stored according to the verification result.
[0043] Specifically, the receiving processing end sends a verification result. If the verification result is successful, the upload status of the audio block to be stored in the block index table is updated to "upload completed" and the confirmation status is updated to "confirmed by the processing end". If the verification result is unsuccessful, the audio block to be stored is re-uploaded to the processing end.
[0044] The technical solution of this invention involves encoding and segmenting a received continuous audio stream to obtain multiple audio data blocks, and determining the current audio block to be stored from the obtained audio data blocks; acquiring the first available storage space and the used storage space of the local audio buffer; if the first available storage space is lower than a first threshold or the used storage space is higher than a second threshold, filtering out the audio block to be deleted from the segmentation index table according to the audio data block information recorded in the segmentation index table; deleting the audio block to be deleted from the local audio buffer, and acquiring the second available storage space of the local audio buffer at this time; storing the current audio block to be stored according to the second available storage space; uploading the current audio block to be stored to the processing end so that the processing end can verify the received current audio block to be stored and obtain the verification result; receiving the verification result fed back by the processing end, and processing the current audio block to be stored according to the verification result. The above technical solution, during the process of storing continuous audio streams in blocks, continuously monitors the first available storage space and the used storage space of the local audio buffer. If the first available storage space falls below a first threshold, or the used storage space exceeds a second threshold, it identifies the audio block to be deleted and removes it from the local audio buffer. This expands the available storage space of the local audio buffer, extends the recording time of the recording device, and enables continuous recording under small-capacity (e.g., no more than 128MB) storage conditions. It reduces the risk of recording interruptions due to full local storage capacity, thereby improving the reliability and availability of the recording device, especially for recording devices with limited storage resources (i.e., storage-constrained recording devices). Simultaneously, during the process of uploading audio data blocks to the processing end, it receives the verification results of the audio data blocks from the processing end to update the block information in the block index table, ensuring the accuracy of the block index table. Alternatively, it re-uploads the audio data blocks to avoid missing audio data blocks, ensuring the accuracy of the audio data blocks.
[0045] Based on the above embodiments, as an optional embodiment of the present invention, when transmitting audio data blocks to the processing end, if a transmission interruption is detected, the highest consecutive acknowledgment number is obtained from the processing end; audio data blocks with block numbers greater than the highest consecutive acknowledgment number are selected from the block index table as missing audio data blocks; the missing audio data blocks are re-uploaded to the processing end, so as to ensure the reliability of audio data block transmission, avoid the loss of audio data blocks, and ensure the integrity of recording data in the scenario where the connection between the recording device and the processing end is interrupted.
[0046] Example 3 Figure 3This is a schematic diagram of a continuous audio stream processing device for storage-constrained recording devices provided in Embodiment 3 of the present invention. This embodiment is applicable to situations where recording is performed using recording devices with limited storage resources (i.e., storage-constrained recording devices), such as recording devices with a storage capacity of no more than 128MB. This device can be implemented in hardware and / or software and can be configured in electronic devices. Figure 3 As shown, the device includes: The current audio block to be stored determination module 301 is used to encode and segment the received continuous audio stream to obtain multiple audio data blocks, and determine the current audio block to be stored from the obtained audio data blocks; Local storage space acquisition module 302 acquires the first available storage space and the used storage space of the local audio buffer; The audio block filtering module 303 is used to filter out audio blocks to be deleted from the block index table based on the audio data block information recorded in the block index table when the first available storage space is lower than the first threshold or the used storage space is higher than the second threshold. Available storage space acquisition module 304 is used to delete the audio block to be deleted from the local audio buffer and acquire the second available storage space of the local audio buffer at this time; The audio block storage module 305 is used to store the audio block to be stored according to the second available storage space.
[0047] The technical solution of this invention involves encoding and segmenting a received continuous audio stream to obtain multiple audio data blocks, and determining the current audio block to be stored from the obtained audio data blocks; obtaining the first available storage space and the used storage space of the local audio buffer; if the first available storage space is detected to be lower than a first threshold, or the used storage space is detected to be higher than a second threshold, selecting the audio block to be deleted from the segmentation index table according to the audio data block information recorded in the segmentation index table; deleting the audio block to be deleted from the local audio buffer, and obtaining the second available storage space of the local audio buffer at this time; and storing the current audio block to be stored according to the second available storage space. The above technical solution, during the process of storing continuous audio streams in blocks, detects the first available storage space and the used storage space of the local audio buffer in real time. When the first available storage space is lower than a first threshold or the used storage space is higher than a second threshold, it determines the audio block to be deleted and deletes the audio block to be deleted from the local audio buffer. This expands the available storage space of the local audio buffer, extends the recording time of the recording device, and enables continuous recording under small capacity (e.g., capacity not exceeding 128MB) storage conditions. It reduces the risk of recording interruption due to local storage capacity being full, thereby improving the reliability and availability of the recording device, especially the recording device with limited storage resources (i.e., storage-constrained recording device).
[0048] Optionally, the audio data block information includes the upload status and confirmation status of the audio data block; The audio block filtering module 303 to be deleted is specifically used for: Based on the upload and confirmation status of the audio data blocks recorded in the block index table, audio data blocks with an upload status of "upload completed" and a confirmation status of "confirmed by the processing end" in the block index table are designated as audio blocks to be deleted.
[0049] Optionally, the available storage space acquisition module 304 includes a deletion unit for audio blocks to be deleted, which is specifically used for: Obtain the storage address and block number of each audio block to be deleted from the block index table; Each audio block to be deleted is removed from the local audio buffer based on its storage address and block number.
[0050] Optionally, the audio block storage module 305 to be stored is specifically used for: Check if the second available storage space is larger than the size of the current audio block to be stored; If so, the current audio block to be stored is stored in the local audio buffer, and the block information of the current audio block to be stored is recorded in the block index table; If not, the current audio block to be stored is overwritten into the earliest written area in the local audio buffer, and an overwrite mark is recorded in the block index table.
[0051] Optionally, the device may also include: The audio block upload module is used to upload the currently stored audio block to the processing end so that the processing end can verify the received audio block and obtain the verification result. The audio block processing module is used to receive the verification results fed back from the processing end, and to process the audio block to be stored based on the verification results.
[0052] Optional, audio block processing module, specifically used for: If the verification result is successful, the upload status of the audio block to be stored in the block index table will be updated to the uploaded status and the confirmation status will be updated to the confirmation status obtained from the processing end. If the verification result is a failure, the current audio block to be stored will be re-uploaded to the processing end.
[0053] The continuous audio stream processing apparatus for storage-constrained recording devices provided in the embodiments of the present invention can execute the continuous audio stream processing method for storage-constrained recording devices provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the continuous audio stream processing method for each storage-constrained recording device.
[0054] According to embodiments of the present invention, the present invention also provides an electronic device, a readable storage medium, and a computer program product.
[0055] Example 4 Figure 4 A schematic diagram of an electronic device 10, which can be used to implement embodiments of the present invention, is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0056] like Figure 4As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded into the RAM 13 from storage unit 18. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0057] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0058] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as continuous audio stream processing methods for storage-constrained recording devices.
[0059] In some embodiments, the continuous audio streaming processing method for a storage-constrained recording device can be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the continuous audio streaming processing method for a storage-constrained recording device described above can be performed. Alternatively, in other embodiments, processor 11 can be configured to perform the continuous audio streaming processing method for a storage-constrained recording device by any other suitable means (e.g., by means of firmware).
[0060] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0061] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0062] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0063] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0064] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0065] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0066] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0067] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A method for processing continuous audio streams for storage-constrained recording devices, characterized in that, The method, executed by the recording device, includes: The received continuous audio stream is encoded and segmented to obtain multiple audio data blocks, and the current audio block to be stored is determined from the obtained audio data blocks. Get the first available and used storage space of the local audio buffer; If the first available storage space is detected to be lower than the first threshold, or the used storage space is higher than the second threshold, the audio blocks to be deleted are selected from the block index table according to the audio data block information recorded in the block index table. Delete the audio block to be deleted from the local audio buffer, and obtain the second available storage space of the local audio buffer at this time; The audio block to be stored is stored according to the second available storage space.
2. The method according to claim 1, characterized in that, The audio data block information includes the upload status and confirmation status of the audio data block; Based on the audio data block information recorded in the block index table, the audio blocks to be deleted are selected from the block index table, including: Based on the upload and confirmation status of the audio data blocks recorded in the block index table, audio data blocks with an upload status of "upload completed" and a confirmation status of "confirmed by the processing end" in the block index table are designated as audio blocks to be deleted.
3. The method according to claim 2, characterized in that, Deleting the audio block to be deleted from the local audio buffer includes: Obtain the storage address and block number of each audio block to be deleted from the block index table; Each audio block to be deleted is removed from the local audio buffer based on its storage address and block number.
4. The method according to claim 1, characterized in that, Based on the second available storage space, the current audio block to be stored is stored, including: Detect whether the second available storage space is greater than the size of the current audio block to be stored; If so, the current audio block to be stored is stored in the local audio buffer, and the block information of the current audio block to be stored is recorded in the block index table; If not, the current audio block to be stored is overwritten into the earliest written area in the local audio buffer, and an overwrite mark is recorded in the block index table.
5. The method according to claim 2, characterized in that, The method further includes: The current audio block to be stored is uploaded to the processing terminal so that the processing terminal can verify the received current audio block to be stored and obtain the verification result. The system receives the verification result from the processing terminal and processes the current audio block to be stored based on the verification result.
6. The method according to claim 5, characterized in that, Based on the verification result, the current audio block to be stored is processed, including: If the verification result is successful, the upload status of the current audio block to be stored in the block index table is updated to the uploaded status and the confirmation status is updated to the confirmation status obtained from the processing end. If the verification result is a verification failure, the current audio block to be stored will be re-uploaded to the processing end.
7. A continuous audio stream processing apparatus for storage-constrained recording devices, characterized in that, Deployed on the recording device, the device includes: The current audio block to be stored determination module is used to encode and segment the received continuous audio stream to obtain multiple audio data blocks, and determine the current audio block to be stored from the obtained audio data blocks; The local storage space acquisition module acquires the first available storage space and the used storage space of the local audio buffer. The audio block filtering module is used to filter out audio blocks to be deleted from the block index table based on the audio data block information recorded in the block index table when the first available storage space is lower than a first threshold or the used storage space is higher than a second threshold. The available storage space acquisition module is used to delete the audio block to be deleted from the local audio buffer and acquire the second available storage space of the local audio buffer at this time; The current audio block storage module is used to store the current audio block according to the second available storage space.
8. An electronic device, characterized in that, The electronic device includes: At least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, which enables the at least one processor to perform the continuous audio stream processing method for a storage-constrained recording device as described in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed by a processor, implement the continuous audio stream processing method for a storage-constrained recording device as described in any one of claims 1-6.
10. A computer program product, characterized in that, The method includes a computer program that, when executed by a processor, implements the continuous audio stream processing method for a storage-constrained recording device as described in any one of claims 1-6.