Audio file power-off storage circuit and audio recording device
Patent Information
- Application Number
- CN202610948945.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-29
- Publication Date
- 2026-09-25
AI Technical Summary
[0004]本申请的主要目的是提出一种录音文件断电存储电路和录音装置,旨在解决传统人工智能录音充电宝在录音过程中,异常断电后导致的录音文件丢失损坏的问题
[0007]通过上述方式,供电切换模块在主电源异常时自动切换至备用供电,并同时输出中断信号,存储保护模块在录音过程中持续生成独立片段文件及索引,将整场录音分割为多个独立文件,使得断电发生时只需处理当前片段,断电风险被物理隔离在单个片段内,而非波及其他已完成的完整片段。在接收到中断信号后,即时对当前片段执行封包和索引更新,确保当前录音片段形成可独立播放、可索引的完整文件,克服了传统方案中整场录音文件因文件头/文件尾未写入而整场不可播放的缺陷。并通过“进入第一写保护模式”,在断电保护阶段阻止非关键的存储写入操作,降低低电压下不完整写命令导致FAT表、目录项或NAND映射表损坏的风险,保护设备中已有录音文件的可用性,有效降低录音文件丢失损坏的风险。本申请并不以断电后继续长时间录音为主要目的,而是在主供电异常后的有限备用供电窗口内优先完成当前录音片段的封包、索引更新和写保护,以提高录音片段的可播放性和文件系统完整性。
Smart Images

Figure CN122822005A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data storage technology, and in particular to a circuit for storing audio files when power is off and an audio recording device. Background Technology
[0002] Portable recording devices such as AI-powered recording power banks, magnetic recording power banks, and voice recorders typically write recording data continuously to storage media when recording meetings, calls, or environmental data. After recording ends or the periodic saving condition is met, the file header, file footer, index, FAT table, or flash memory mapping table are updated. This process works normally when the main power supply is stable. However, in real-world scenarios, devices may face various situations where the main power supply is suddenly interrupted: user accidentally unplugging the charging cable, accidental detachment of the magnetic contacts, triggering of battery over-discharge protection, forced shutdown due to temperature protection, abnormal charging protocol, loose cables, or poor interface contact. In these scenarios, the main control chip may lose power before completing the recording file encapsulation, resulting in incomplete recording files, missing indexes, or even file system corruption.
[0003] Currently, some recording devices use software-timed saving, typically saving recordings to disk every 30 or 60 seconds. While this method can reduce the risk of long-term data loss to some extent, it cannot guarantee the integrity of the file header, segment index, and file system metadata being written at the moment of power failure. In meeting recording scenarios, the last recording often contains important content such as meeting conclusions, task assignments, or end confirmations. If a power outage renders the recording unplayable or unindexable, it will significantly reduce the usability of the entire meeting record. Summary of the Invention
[0004] The main purpose of this application is to propose a power-off storage circuit and recording device for audio files, which aims to solve the problem of audio file loss or damage caused by abnormal power failure during the recording process in traditional AI-powered recording power banks.
[0005] To achieve the above objectives, this application provides a power-off storage circuit for audio recording files, comprising: a main power supply module, a backup power supply module, a power supply switching module, and a storage protection module; the main power supply module and the backup power supply module are coupled to the recording device through the power supply switching module; the storage protection module is coupled to the recording device and the power supply switching module; the power supply switching module is used to output a power interruption signal and switch the power supply path of the recording device to the power supply path between the backup power supply module and the recording device when it detects that the output voltage of the main power supply module is lower than a first power supply threshold and the duration is higher than a first time threshold; the storage protection module is used to generate recording segment files according to a preset time interval during the recording process of the recording device, and generate corresponding recording segment indexes; and after receiving the power interruption signal, to encapsulate the current recording segment of the recording device and update the corresponding index, and enter a first write protection mode.
[0006] To achieve the above objectives, this application also provides a recording device, including: a recording equipment; and a recording file power-off storage circuit, the recording file power-off storage circuit being coupled to the recording equipment, and the recording file power-off storage circuit being the recording file power-off storage circuit described in any of the above embodiments.
[0007] Through the above method, the power supply switching module automatically switches to backup power when the main power supply fails, and simultaneously outputs an interrupt signal. The storage protection module continuously generates independent segment files and indexes during recording, dividing the entire recording into multiple independent files. This ensures that only the current segment needs to be processed when a power outage occurs, physically isolating the power outage risk within a single segment rather than affecting other completed segments. Upon receiving the interrupt signal, the module immediately performs packetization and index updates on the current segment, ensuring that the current recording segment forms a complete, independently playable and indexable file. This overcomes the defect in traditional solutions where the entire recording file becomes unplayable due to missing headers / ends. Furthermore, by entering "first write protection mode," non-critical storage write operations are prevented during the power outage protection phase, reducing the risk of FAT tables, directory entries, or NAND mapping tables being damaged due to incomplete write commands under low voltage. This protects the availability of existing recording files in the device and effectively reduces the risk of lost or damaged recording files. This application does not primarily aim to continue recording for extended periods after a power outage, but rather prioritizes packetization, index updates, and write protection of the current recording segment within the limited backup power window after a main power failure, thereby improving the playability of the recording segment and the integrity of the file system. Attached Figure Description
[0008] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on the structures shown in these drawings without creative effort.
[0009] Figure 1 This is a schematic diagram of the first embodiment of the power-off storage circuit for audio files provided in this application.
[0010] Figure 2 This is a schematic diagram of the second embodiment of the power-off storage circuit for audio files provided in this application.
[0011] Figure 3 This is a schematic diagram of the power-off protection steps of an embodiment of the recording file power-off storage circuit provided in this application.
[0012] Figure 4 This is a schematic diagram of an embodiment of the recording device provided in this application.
[0013] Figure 5 This is a schematic diagram of the main power supply switching and key power supply domain of an embodiment of the power-off storage circuit for audio files provided in this application.
[0014] Figure 6 This is a timing diagram of the power-off protection of an embodiment of the recording file power-off storage circuit provided in this application.
[0015] Figure 7 This is a schematic diagram of the recording segment file and index data structure of an embodiment of the recording file power-off storage circuit provided in this application.
[0016] Figure 8 This is a schematic diagram of the power-on recovery verification and segment repair process of an embodiment of the power-off storage circuit for audio files provided in this application.
[0017] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0018] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0019] It should be noted that if any directional indications (such as up, down, left, right, front, back, etc.) are involved in the embodiments of this application, such directional indications are only used to explain the relative positional relationships and movement of the components in a specific posture. If the specific posture changes, the directional indications will also change accordingly.
[0020] Furthermore, if the embodiments of this application involve descriptions such as "first" or "second," these descriptions are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, a feature defined with "first" or "second" may explicitly or implicitly include at least one of those features. Additionally, the use of "and / or" or "and / or" throughout the text includes three parallel solutions. For example, "A and / or B" includes solution A, solution B, or a solution that simultaneously satisfies A and B. Furthermore, the technical solutions of the various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. When the combination of technical solutions is contradictory or impossible to implement, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed in this application.
[0021] The traditional approach has the following problems: Defect 1: The existing solution mainly relies on software to save at regular intervals or to package the data uniformly after the recording ends. When the main power supply is suddenly interrupted, the main control chip lacks a hardware backup power supply window and cannot reliably complete the writing of the current segment file header, metadata and file system index.
[0022] Defect 2: Recording files are usually written continuously as long files. When the power is off, the entire file may remain open. If the file header, file footer, or index area is not written completely, the recorded content may not be recognized and played normally.
[0023] Defect 3: The main power failure detection and file protection actions lack hardware-level linkage. Software polling may have a delay of milliseconds to seconds, making it difficult to trigger write protection, packetization, index backup, or main / backup power switching in a timely manner.
[0024] Defect 4: The storage medium may still receive incomplete write commands during power loss, causing damage to the FAT table, directory entries, NAND mapping table, or recording index, which may affect not only the current recording segment but also existing recording files.
[0025] Defect 5: After power-on recovery, there is a lack of automatic verification and repair mechanisms. Users usually need to manually check whether the recording files are damaged, and cannot know the time of power failure, the scope of loss, and the recoverable segments.
[0026] Defect 6: The lack of a systematic design between recording file protection and hardware power failure protection, backup power capacity, segmented indexing, and write protection control makes it difficult to stably implement in a low-cost, small-sized AI recording power bank.
[0027] This application proposes a power-off storage circuit for audio recordings to solve the above-mentioned problems.
[0028] Please see Figure 1 As shown, Figure 1 This is a schematic diagram of the structure of the first embodiment of the recording file power-off storage circuit provided in this application; the recording file power-off storage circuit 100 includes: a main power supply module 110, a backup power supply module 120, a power supply switching module 130, and a storage protection module 140; the main power supply module 110 and the backup power supply module 120 are coupled to the recording device through the power supply switching module 130; the storage protection module 140 is coupled to the recording device and the power supply switching module 130; the power supply switching module 130 is used to output a power interruption signal and switch the power supply path of the recording device to the power supply path between the backup power supply module 120 and the recording device when it detects that the output voltage of the main power supply module 110 is lower than a first power supply threshold and the duration is higher than a first time threshold; the storage protection module 140 is used to generate recording segment files according to a preset time interval during the recording process of the recording device, and generate corresponding recording segment indexes; and after receiving the power interruption signal, to encapsulate the current recording segment of the recording device and update the corresponding index, and enter the first write protection mode.
[0029] In the above method, the power supply switching module 130 automatically switches to the backup power supply and outputs an interrupt signal when the main power supply fails. Compared with the pure software polling method (millisecond to second delay), it achieves microsecond to millisecond-level hardware linkage response, avoiding packet failure caused by software polling delay. By setting dual judgment conditions of "below the first power supply threshold" and "maintenance time above the first time threshold", power glitches and instantaneous jitters are effectively filtered out, avoiding false triggering of protection processes and interruption of normal recording due to brief voltage fluctuations (such as contact bounce, load transients). The storage protection module 140 continuously generates independent segment files and indexes during the recording process, dividing the entire recording into multiple independent files. This ensures that only the current segment needs to be processed when a power failure occurs, and the risk of power failure is physically isolated within a single segment, rather than affecting other completed segments. After receiving the interrupt signal, the storage protection module 140 immediately performs packet and index updates on the current segment, ensuring that the current recording segment forms a complete file that can be played independently and indexed. This overcomes the defect in traditional solutions where the entire recording file cannot be played because the file header / end is not written. By "entering first write protection mode", non-critical storage write operations are prevented during the power failure protection phase, reducing the risk of FAT table, directory entries or NAND mapping table being damaged due to incomplete write commands under low voltage, and protecting the availability of existing recording files in the device.
[0030] In an optional embodiment, the main power supply module 110 is used to provide operating power to the recording main controller, storage medium, and peripheral circuits under normal operating conditions. Specifically, the main power supply module 110 may include a lithium battery, a charging management chip, and a power path management circuit, used to provide normal operating power to the recording main controller chip, memory, wireless / wired communication, and peripheral circuits.
[0031] In an optional embodiment, the backup power supply module 120 is used to provide backup power to critical power domains after the failure of the main power supply module 110. Preferably, the backup power supply module 120 employs a supercapacitor bank, which can be composed of supercapacitors of 2.7V / 3F to 10F connected in series or in parallel, and is coupled with voltage equalization resistors or active equalization circuits. For products requiring a longer protection window, a rechargeable button battery or a small-capacity lithium battery can also be connected in parallel. The capacity configuration of the backup power supply module 120 preferably ensures that the recording device can complete the current recording segment file encapsulation operation for no less than 50 milliseconds after the failure of the main power supply module 110, more preferably 100 milliseconds to 500 milliseconds. That is, the capacity configuration of the backup power supply module 120 ensures that the recording device can complete the current recording segment encapsulation and index update for no less than 50 milliseconds after the failure of the main power supply module 110.
[0032] In an optional embodiment, the power switching module 130 is connected between the main power supply module 110, the backup power supply module 120, and the critical power supply domain, and is used to switch the critical power supply domain to the backup power supply when the main power supply voltage drops. The power switching module 130 can be implemented using a diode ORing circuit, an ideal diode controller, or a power multiplexing chip, and the switching time is preferably less than 1 microsecond to tens of microseconds.
[0033] In an optional embodiment, the power supply switching module 130 is further configured to output a power supply interruption signal and switch the power supply path of the recording device to the power supply path between the backup power supply module 120 and the recording device when the output voltage of the main power supply module 110 is lower than the first power supply threshold and the duration is higher than the first time threshold.
[0034] In one optional embodiment, specifically, when the power supply switching module 130 detects a power supply abnormality in the main power supply module 110, it switches to the backup power supply module 120 to supply power to the core power supply area of the recording device and shuts down non-core loads in the recording device. The core power supply area is the basic hardware power supply area required for the recording device to complete recording operations; power supply abnormalities include: the output voltage of the main power supply module 110 being lower than a first power supply threshold and the duration exceeding a first time threshold, or a short circuit or open circuit in the output of the main power supply module 110.
[0035] By maintaining only the core power supply area (the basic hardware required for recording) and shutting down non-core loads (screen, wireless communication, AI inference, etc.), the limited backup power is concentrated on recording packet operations, maximizing the effective protection window. Furthermore, the determination of power supply anomalies is not limited to voltage drops but also covers extreme situations such as short circuits and open circuits, ensuring that the system can reliably trigger protection procedures under various abnormal scenarios and avoiding protection failure due to detection blind spots.
[0036] In one optional embodiment, the core power supply area includes: a recording master control chip, a storage controller, a backup power supply module manager, and a clock / reset circuit. The clock / reset circuit is coupled to the recording master control chip, the storage controller, and the backup power supply module manager, respectively, providing clock and reset signals to all three. The recording master control chip is coupled to both the storage controller and the backup power supply module manager. The recording master control chip transmits recording and storage data with the storage controller, and the recording master control chip interacts with the backup power supply module manager to exchange power supply status signals and power supply switching control signals.
[0037] In the above embodiments, the core power supply components are clearly defined. The clock / reset circuit provides clock and reset signals to the recording master control chip, storage controller, and backup power supply module manager, ensuring that the clock phases of the three are synchronized and their reset states are consistent at the moment of power failure switching, avoiding communication timing errors and data transmission errors caused by clock asynchrony. The bidirectional status signal interaction between the recording master control chip and the backup power supply module manager enables the manager to know the working status of the master control chip in real time (whether packet encapsulation is completed), and the master control chip to know the power supply status (remaining energy) in real time, realizing closed-loop collaborative control.
[0038] In one alternative embodiment, non-core loads include at least one of the following: a screen in the recording device, a wireless communication module, an artificial intelligence inference accelerator, and indicator lights. During the power failure protection phase, the aforementioned non-core loads are shut down or degraded to conserve backup energy.
[0039] Understandably, upon detecting a main power supply failure, other non-essential devices are shut down as much as possible to conserve energy, prioritizing recording and storage needs. Non-essential devices can be disabled based on actual requirements, reducing backup power consumption to a fraction of the normal operating level, significantly extending the effective protection window.
[0040] In an optional embodiment, the storage protection module 140 is used to generate recording segment files at preset time intervals during the recording process of the recording device, and to generate corresponding recording segment indexes. The segment duration can be set from 30 seconds to 120 seconds, preferably 60 seconds.
[0041] In an optional embodiment, the storage protection module 140 is further configured to, upon receiving a power interruption signal, encapsulate the current recording segment of the recording device and update the corresponding index, and enter the first write protection mode.
[0042] Specifically, in one embodiment, after receiving a power interruption signal, the storage protection module 140 performs the following operations in order of priority: encapsulating the recording segment file, entering the first write protection mode, generating the corresponding segment index, providing a user prompt, and logging the power outage event. The first priority is the current audio segment encapsulation; the second priority is the safe shutdown of the file system (i.e., entering the first write protection mode); the third priority is double index backup; and the fourth priority is the user prompt and log supplementation. Through this priority mechanism, even if the backup power is insufficient to complete all operations, the recoverability of the recorded content can be maximized.
[0043] Understandably, given the limited and unpredictable nature of backup power, prioritizing "fragmentation" ensures that limited energy is allocated primarily to critical protection operations. This guarantees maximum recoverability of recorded content even if backup power is insufficient to complete all operations. After fragmentation is complete, write protection mode is entered first to prevent uncontrolled writes due to further voltage drops during subsequent operations (such as user prompts and log writing), prioritizing system safety as the second most important objective.
[0044] In an optional embodiment, the storage protection module 140 further enters a second write protection mode in response to the completion of the current recording segment encapsulation or when the supply voltage of the backup power supply module 120 is lower than the second power supply threshold; the protection strength of the second write protection mode is greater than that of the first write protection mode. For example, the first write protection mode can be a software-level write prohibition, while the second write protection mode can be a hardware-level write protection pin pull-high.
[0045] Understandably, setting two write protection modes with different strengths—using the first mode (software-level protection) during normal power outage protection and upgrading to the second mode (hardware-level protection) when critical operations are completed or energy is about to run out—forms a progressively hardened protection strategy. When the backup power supply voltage falls below the second threshold, even if the fragment has not yet been fully packaged, it is forced into high-strength write protection to prevent uncontrollable writes at extremely low voltages from causing more severe systemic damage to the storage medium than damage to a single fragment (such as damaging the entire file system).
[0046] In an optional embodiment, the storage protection module 140 includes a first storage partition and a second storage partition. The first storage partition is used to store recording segment files, recording segment indexes, and power failure event logs; the second storage partition is used to store configuration, logs, and cached data in the recording system. By isolating the dedicated recording partition from system configuration, logs, cached data, etc., the impact of other write operations on the recording files is reduced.
[0047] By employing the above methods, through physical isolation between the first storage partition (dedicated to recording) and the second storage partition (system data), and by hierarchically setting the first write protection mode (software level) and the second write protection mode (hardware level), a differentiated security strategy is achieved, prioritizing the protection of recording data and providing secondary protection for system data. Physically isolating recording data from system configuration, logs, and cache data prevents write operations to the system partition from interfering with or damaging the area containing the recording files during power outages. During power-on recovery, the scanning range is limited to the first storage partition, eliminating the need to traverse the entire storage medium and accelerating power-on recovery.
[0048] In one optional embodiment, the storage protection module 140 connects each recording segment file through a segment linked list or segment index, and writes the segment index to both the primary index and the backup index. The primary index and backup index are stored in different physical storage units, and both include a version number, timestamp, and checksum. The recording index employs a dual-backup mechanism; the primary index and backup index are written to different physical storage blocks and carry the version number, timestamp, and checksum. Upon power-on recovery, the system cross-checks the index validity based on the version number and checksum.
[0049] Understandingly, storing the primary and backup indexes in different physical units ensures that even if one physical storage block is damaged due to a power outage and write failure, the other index can still function normally, preventing the extreme situation where a single index failure would render the entire recording unrecoverable. Through a triple verification mechanism using version number, timestamp, and checksum, the system can quickly determine which index version is newer and has complete data after power-on, automatically selecting the optimal index for recovery. When the primary and backup indexes are inconsistent, a cross-checking of version number and checksum can be performed item by item to accurately identify damaged index entries and repair them using undamaged entries.
[0050] In one embodiment, the audio file segmentation and saving module splits continuous recordings into multiple independent segment files according to a preset time interval. Each segment file has an independent file header, audio data area, metadata area, and verification information. See the table below for details:
[0051] Understandably, the segments are linked together through the main index file, backup index file, and segment list pointers to form a set of segments that can be played sequentially, restored, and used for generating subsequent meeting minutes.
[0052] For example, during normal recording, the system periodically encapsulates segments and creates the next segment; in the event of a power outage, the power outage protection logic prioritizes encapsulating the segment currently being written, rather than reorganizing all historical segments. This design significantly reduces the time required for power outage protection and limits the risk of power outage to the current segment.
[0053] In some embodiments, the recording format may be WAV, AAC, OPUS, M4A, or other formats that support independent segment playback and fast packetization. The storage medium may be microSD, eMMC, NAND Flash, NOR Flash, or UFS.
[0054] In one embodiment, such as Figure 2 As shown, Figure 2This is a schematic diagram of the second embodiment of the recording file power-off storage circuit provided in this application; the recording file power-off storage circuit 100 further includes: a self-test module 150, which is coupled to the main power supply module 110 and the storage protection module 140. When the self-test module 150 detects that the power supply voltage of the main power supply module 110 has recovered to a value greater than a preset recovery threshold and has continued for more than a preset recovery time, it performs a self-test operation.
[0055] The self-test operation includes: obtaining the power failure event log, main index, backup index and segment file verification information in the storage protection module 140; outputting a normal flag in response to the completion of the current recording segment packetization; or marking the current recording segment flag as an abnormal flag in response to the failure of the current recording segment packetization.
[0056] In one embodiment, after marking the current recording segment as an anomalous identifier, the following operations are performed: reconstructing the file header based on the written audio data, trimming the damaged tail according to the audio frame boundaries, and restoring the segment based on the backup index.
[0057] Specifically, after the main power is restored, the self-test module 150 (which can also be implemented by the backup power supply module manager or the main control chip) reads the power failure event log, the main index, the backup index, and the segment file verification information to determine whether the current segment was completely encapsulated before the power failure. If the current segment is complete, normal recording is resumed or the user is prompted to continue. If the current segment is not completely encapsulated, it is marked as an incomplete segment and an attempt is made to repair it—for example, reconstructing the WAV file header based on the written audio data, trimming the damaged tail according to the audio frame boundaries, and restoring the segment order according to the backup index.
[0058] For segments that fail to be fully encapsulated, the file header is reconstructed so that the written audio PCM data can be recognized by the player, invalid noise data is removed by trimming the damaged tail, and the playback order of the segments is restored by backing up the index—preserving the main content of the segment even in the worst case, rather than discarding the entire segment.
[0059] After the recovery process is complete, the system can display to the user the power outage time, cause, protection result, whether there are incomplete segments, and the remaining playback time. By displaying diagnostic information such as the power outage time, cause, protection result, incomplete segments, and remaining playback time, users can understand the device status without professional skills, reducing after-sales complaint rates and technical support costs.
[0060] In one embodiment, this application employs precise timing design to ensure that critical protection operations are completed within a limited time window following a main power failure. See the table below for details:
[0061] The power failure detection can be achieved through ADC sampling, hardware comparators, battery protection signals, charging protocol status, interface plug-in / plug-out detection, or multi-signal fusion. The de-jitter time is preferably 1 to 10 milliseconds, more preferably 5 milliseconds, to avoid accidental triggering due to momentary glitches.
[0062] In one embodiment, such as Figure 3 As shown, Figure 3 This is a schematic diagram of the power-off protection steps of an embodiment of the audio file power-off storage circuit provided in this application; when the power-off detection module outputs a power-off interrupt signal, the backup power supply module and the main control chip jointly enter the power-off protection process. In some embodiments, the backup power supply module manager can be a low-power MCU; it has non-volatile memory or registers; it is used to record power-off events, packet status, write-protection status, and recovery flags; it can continue to perform minimal monitoring during main control abnormality or low voltage stages.
[0063] The process includes the following steps: Step S501: Stop writing new recording data.
[0064] Step S502: Read the last buffer audio and refresh the encoding buffer.
[0065] By using S502 to "read the last buffer audio and refresh the encoding buffer", the last frame data that has not yet been written to the disk inside the audio encoder is forced to be output and written to the storage medium, thus avoiding the last frame data being permanently lost due to being stuck in the encoder buffer when power is off.
[0066] Step S503: Rewrite the beginning and end of the current segment file.
[0067] Step S504: Update fragment metadata.
[0068] Step S505: Update the primary index and backup index.
[0069] By using S505, subsequent steps are only initiated after the primary and backup indexes have been updated, ensuring data consistency between the two indexes—that is, both indexes are either in the updated state or in the unupdated state at the same time, thus avoiding recovery difficulties caused by data inconsistency between indexes.
[0070] Step S506: Pull the write-protect pin high to enter write-protected state.
[0071] Step S507: Record the power outage event log.
[0072] Step S508: Enter low-power sleep mode.
[0073] In one embodiment, the specific triggering process is shown in the table below:
[0074] If the backup power supply has insufficient remaining energy, priority is given to ensuring that the current segment file can be played (steps S501-S503), followed by ensuring that the main index is updated (steps S504-S505), and finally performing backup index and log writing (steps S506-S508). Through the priority design of "segment playability, main index, backup index, and log", the power failure protection process abandons non-critical operations according to their importance as energy gradually depletes, ensuring that the optimal protection result is achieved under the current energy conditions even if the process is interrupted at any time.
[0075] The write protection control module pulls the write protection pin of the storage medium high during the power-down protection phase and releases the write protection after the main power is restored and the file system verification passes. This write protection control prevents incomplete write operations under low voltage from damaging the file system.
[0076] In some embodiments, the power supply switching module 130 or the power failure detection module may also generate a power supply interruption signal based on one or more of the following: interface connection status, battery protection signal, charging protocol abnormal signal, temperature protection signal, or main power supply voltage drop slope.
[0077] This application also proposes a recording device 300, such as... Figure 4 As shown, Figure 4 This is a schematic diagram of an embodiment of the recording device provided in this application; the recording device 300 includes a recording device 200 and a recording file power-off storage circuit 100. The recording file power-off storage circuit 100 is coupled to the recording device 200, and the recording file power-off storage circuit 100 is the recording file power-off storage circuit 100 as described in any of the above embodiments.
[0078] The recording device 300 can be used with AI recording power banks, magnetic recording power banks, power banks with recording functions, conference recording peripherals, voice recorders, or other low-power portable recording devices.
[0079] Taking a 10000mAh AI magnetic recording power bank as an example, if a user accidentally removes the power bank from the back of their phone during a meeting recording, causing a momentary interruption of the main power supply path, the power failure detection module detects the main power voltage drop within 3ms, completes the jitter determination within 5ms, and triggers the power failure interruption. The diode ORing circuit or ideal diode controller switches the critical power supply domain to the supercapacitor bank, with a switching time of less than 1μs. The main control chip stops recording and writing, refreshes the encoding buffer, rewrites the current segment file header and metadata, and updates index.dat and index.bak. Approximately 50ms later, the current segment is encapsulated, the write protection control module pulls high the storage medium write protection pin, and the main control enters low-power sleep mode.
[0080] In one embodiment, the key parameters are shown in the table below:
[0081] When the recording duration is long and the battery voltage approaches the over-discharge threshold, the battery protection circuit may cut off the main power supply. Since the recording file is saved in 60-second segments, each preceding segment is an independent and complete file; in the event of a power outage, the system only needs to perform a minimal packetization operation on the current segment with backup power. If the current segment packetization is successful, the entire recording may only lose less than 200ms of audio between the power outage detection and the packetization; if the current segment packetization is incomplete, it can be repaired and marked as an incomplete segment after power-on.
[0082] In the event of a handshake anomaly in the wireless or wired charging protocol, the main power supply may experience a momentary power outage and recover within 0.5 seconds. The system performs current segment protection the instant the power is lost, and upon power-up, the self-test module notifies the main controller to perform index verification. If both the main index and the backup index pass verification, the system resumes recording; if the main index is corrupted but the backup index is valid, the backup index overwrites the main index; if both indices are corrupted, the system scans the segment files in the dedicated recording partition and rebuilds the linked list according to the filename and segment timestamp.
[0083] Referring to the above embodiments, see Figures 5-8 As shown, to better understand the scheme of this application, wherein Figures 5-8 The content, combined with the above scheme, can be described as a separate embodiment. Among them, Figure 5 This is a schematic diagram of the main power supply switching and key power supply domain of an embodiment of the power-off storage circuit for audio files provided in this application. Figure 6 This is a timing diagram of the power-off protection of an embodiment of the recording file power-off storage circuit provided in this application. Figure 7 This is a schematic diagram of the recording segment file and index data structure of an embodiment of the recording file power-off storage circuit provided in this application. Figure 8 This is a schematic diagram of the power-on recovery verification and segment repair process of an embodiment of the power-off storage circuit for audio files provided in this application.
[0084] The technical solution of this application employs a systematic design that utilizes a dual-power supply system (main and backup power modules), a power switching module for rapid response to power outages, and a storage protection module for segmented storage of recording files, prioritizing the encapsulation of the current segment during a power outage. This ensures the secure encapsulation of the current recording segment within a limited time window after a main power failure, significantly reducing the risk of recording loss and file system corruption. Furthermore, a self-test module automatically performs index verification and segment repair after main power is restored, further improving the reliability of the recording files and the user experience. This application does not primarily aim to continue recording for extended periods after a power outage; rather, it prioritizes the encapsulation, index update, and write protection of the current recording segment within the limited backup power window following a main power failure, thereby improving the playability of the recording segment and the integrity of the file system.
[0085] The above are merely exemplary embodiments of this application and do not limit the patent scope of this application. Any equivalent structural transformations made based on the technical concept of this application and the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included within the patent protection scope of this application.
Claims
1. A circuit for storing audio files when power is off, characterized in that, The power-off storage circuit for the audio files includes: a main power supply module, a backup power supply module, a power supply switching module, and a storage protection module; The main power supply module and the backup power supply module are coupled to the recording device through the power supply switching module; The storage protection module is coupled to the recording device and the power supply switching module; The power supply switching module is used to output a power supply interruption signal and switch the power supply path of the recording device to the power supply path between the backup power supply module and the recording device when it detects that the output voltage of the main power supply module is lower than the first power supply threshold and the duration is higher than the first time threshold. The storage protection module is used to generate recording segment files at preset time intervals and generate corresponding recording segment indexes during the recording process of the recording device; and after receiving the power interruption signal, to encapsulate the current recording segment of the recording device and update the corresponding index, and enter the first write protection mode.
2. The recording file power-off storage circuit as described in claim 1, characterized in that, The power-off storage circuit for the audio files also includes: The self-test module is coupled to the main power supply module and the storage protection module. When the self-test module detects that the power supply voltage of the main power supply module has recovered to a level greater than a preset recovery threshold and has continued for a preset recovery time, it performs a self-test operation. The self-test operation includes: Obtain the power failure event log, main index, backup index, and fragment file verification information from the storage protection module; In response to the completion of packetization of the current recording segment, a normal flag is output; or in response to the failure of packetization of the current recording segment, the flag of the current recording segment is marked as an abnormal flag.
3. The recording file power-off storage circuit as described in claim 1, characterized in that, The storage protection module includes: The first storage partition is used to store recording segment files, recording segment indexes, and power outage event logs. The second storage partition is used to store the configuration, logs, and cached data of the recording system.
4. The recording file power-off storage circuit as described in claim 1, characterized in that, The storage protection module connects each recording segment file through a segment linked list or segment index, and writes the segment index into both the main index and the backup index simultaneously. The primary index and the backup index are stored in different physical storage units, and both the primary index and the backup index include a version number, a timestamp, and a checksum.
5. The recording file power-off storage circuit as described in claim 1, characterized in that, Upon receiving the power interruption signal, the storage protection module performs the following steps in order of priority: encapsulating the recording segment file, entering the first write protection mode, generating the corresponding segment index, providing user prompts, and logging the power outage event.
6. The recording file power-off storage circuit as described in claim 1, characterized in that, The storage protection module enters a second write protection mode in response to the completion of the current recording segment encapsulation or when the power supply voltage of the backup power supply module is lower than the second power supply threshold; the protection strength of the second write protection mode is greater than that of the first write protection mode.
7. The recording file power-off storage circuit as described in claim 1, characterized in that, When the power supply switching module detects an abnormality in the main power supply module, it switches to the backup power supply module to supply power to the core power supply area of the recording device and shuts down the non-core loads in the recording device. The core power supply area is the basic hardware power supply area required to support the recording device in completing the recording operation; the power supply abnormality includes: the output voltage of the main power supply module is lower than the first power supply threshold and the duration is higher than the first time threshold, and the output of the main power supply module is short-circuited or open-circuited.
8. The recording file power-off storage circuit as described in claim 7, characterized in that, The core power supply area includes: a recording main control chip, a storage controller, a backup power supply module manager, and a clock / reset circuit; The clock / reset circuit is coupled to the recording main control chip, the storage controller, and the backup power supply module manager, respectively, and provides clock and reset signals to the three. The recording main control chip is coupled to the storage controller and the backup power supply module manager. The recording main control chip transmits recording and storage data to the storage controller, and the recording main control chip interacts with the backup power supply module manager to exchange power supply status signals and power supply switching control signals.
9. The recording file power-off storage circuit as described in claim 7, characterized in that, The non-core load includes at least one of the following in the recording device: screen, wireless communication module, artificial intelligence inference accelerator, and indicator light.
10. A recording device, characterized in that, The recording device includes: Recording equipment; A recording file power-off storage circuit, wherein the recording file power-off storage circuit is coupled to the recording device, and the recording file power-off storage circuit is the recording file power-off storage circuit as described in any one of claims 1-9.