Dual-file-system compatible storage method, device and equipment of embedded video recording device and medium

CN122884412APending Publication Date: 2026-10-09HANGZHOU MEARI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611176615.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-04
Publication Date
2026-10-09

AI Technical Summary

Technical Problem

[0003]该私有存储体系首要问题是兼容能力不足,私有裸流无标准封装,普通计算机无法直接读取播放录像,必须配套专用软件,用户操作门槛高

Benefits of technology

[0015]本申请中,将嵌入式录像设备的存储介质划分为私有录像存储区和exFAT公开兼容区;所述私有录像存储区与所述exFAT公开兼容区通过地址映射机制相互逻辑隔离;在初始化阶段,在所述exFAT公开兼容区中,一次性预分配连续的簇链空间,并在所述簇链空间创建包含目录项的目录结构,以构建exFAT文件系统;其中,所述exFAT文件系统包括FAT表;所述FAT表仅在所述初始化阶段写入所述簇链空间的占用状态,所述FAT表在被写入完成后被设置为只读模式;在录像运行阶段,将采集的音视频数据以裸流形式写入所述私有录像存储区,并通过私有索引表对写入的裸流数据进行管理,形成录像文件,将所述录像文件的存储信息同步记录至所述目录结构中对应的目录项,并在所述簇链空间中为所述录像文件生成预设标准封装格式的、且与所述裸流数据关联的文件头,以便外部设备通过识别所述exFAT文件系统,并利用所述目录项和所述文件头播放所述录像文件;其中,当所述录像文件更新时,仅更新与所述录像文件对应的目录项中发生变化的字段。由上可见,本申请将嵌入式录像设备的存储介质分区设置为私有录像存储区与exFAT公开兼容区,两区借助地址映射完成逻辑隔离。系统初始化过程中,于exFAT公开兼容区内一次性分配连续簇链空间,依托该簇链空间搭建带有目录项的目录结构,完成exFAT文件系统搭建;该文件系统配置FAT表,FAT表只允许在初始化阶段填写簇链空间占用情况,数据写入完毕后FAT表固定为只读属性。设备录像工作期间,采集所得音视频数据以裸流格式存入私有录像存储区,经由私有索引表管理裸流数据生成录像文件,同步把录像文件存储信息填写至匹配的目录项内,同时在簇链空间生成和裸流数据绑定、符合标准封装格式的文件头,外部设备识别exFAT文件系统后,依托目录项与文件头即可回放录像文件;录像文件产生改动时,只需修改对应目录项内部发生变更的字段。这样一来,对于嵌入式录像设备,本申请能够实现一种可兼容双文件体系、无需大幅改动原有录像逻辑的存储处理方案。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122884412A_ABST
    Figure CN122884412A_ABST
Patent Text Reader

Abstract

The application discloses a dual-file system compatible storage method and device of embedded video recording equipment, equipment and medium, relates to the technical field of embedded monitoring video recording storage, and comprises that the storage medium of the embedded video recording equipment is divided into a private video recording storage area and an exFAT public compatible area. When initialized, a continuous cluster chain space is pre-allocated in the exFAT public compatible area to build a directory structure with directory items, and an exFAT file system is completed. In the video recording running stage, audio and video raw streams are written into the private video recording storage area, and a private index table is relied on to control the generation of a video recording file; video recording storage information is synchronously entered into corresponding directory items, a standard encapsulation file header binding raw stream data is generated in the cluster chain, an external device can identify the exFAT file system, and the video is read and played by means of the directory items and the file header. The application can realize a video recording storage processing scheme compatible with dual file systems.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of embedded surveillance video storage technology, and in particular to a dual file system compatible storage method, apparatus, device, and medium for embedded video recording devices. Background Technology

[0002] Currently, most embedded recording devices such as vehicle dashcams and surveillance cameras adopt a storage architecture that combines private raw streams with private index tables to ensure real-time recording and stable operation. This architecture relies on sequential writing of raw streams and private indexes to complete data management, resulting in excellent write performance. However, this storage solution has several inherent defects.

[0003] The primary problem with this private storage system is its insufficient compatibility. The private raw stream lacks a standard encapsulation, making it impossible for ordinary computers to directly read and play recordings; dedicated software is required, significantly increasing the learning curve for users. Using the exFAT (Extended File Allocation Table) universal file system to solve the compatibility issue would introduce flash memory wear and write stuttering: the FAT table's continuous and frequent updates and erases of the flash memory chips drastically shorten the lifespan of memory cards and flash drives; dynamic storage allocation continuously generates file fragments, easily leading to recording interruptions and frame drops during high-bitrate HD recording. Reconstructing the existing private recording program to adapt to a standard format would be a massive undertaking with a long development cycle; mature business logic is prone to failure, and smooth iteration on existing devices would be difficult; furthermore, the raw stream data lacks a standard encapsulation structure, requiring additional transcoding after recording export, a complex and time-consuming process.

[0004] Therefore, for embedded recording devices, how to achieve a storage and processing solution that is compatible with dual file systems and does not require significant changes to the original recording logic is a pressing technical problem that needs to be solved. Summary of the Invention

[0005] In view of this, the purpose of this invention is to provide a dual-file system compatible storage method, apparatus, device, and medium for embedded recording devices, which can realize a storage processing scheme that is compatible with dual file systems and does not require significant changes to the original recording logic. The specific scheme is as follows: In a first aspect, this application provides a dual-file system compatible storage method for an embedded recording device, including: The storage medium of the embedded recording device is divided into a private recording storage area and an exFAT public compatible area; the private recording storage area and the exFAT public compatible area are logically isolated from each other through an address mapping mechanism. During the initialization phase, a contiguous cluster chain space is pre-allocated in the exFAT public compatibility zone, and a directory structure containing directory entries is created in the cluster chain space to build the exFAT file system; wherein, the exFAT file system includes a FAT table; the FAT table is only written with the occupancy status of the cluster chain space during the initialization phase, and the FAT table is set to read-only mode after being written; During the recording process, the collected audio and video data is written to the private recording storage area in raw stream form. The written raw stream data is managed through a private index table to form a recording file. The storage information of the recording file is synchronously recorded to the corresponding directory entry in the directory structure. A file header with a preset standard encapsulation format associated with the raw stream data is generated for the recording file in the cluster chain space, so that external devices can recognize the exFAT file system and play the recording file using the directory entry and the file header. When the recording file is updated, only the fields in the directory entry corresponding to the recording file that have changed are updated.

[0006] Optionally, creating a directory structure containing directory entries in the cluster chain space includes: The cluster chain space is divided into a contiguous directory storage area and a file data storage area; wherein, the size of the cluster chain space is adaptively determined based on the types of video files that the embedded recording device is expected to store; A directory structure containing directory entries is created in the directory storage area with a fixed folder size and a fixed number of directory entries.

[0007] Optionally, the process of building the exFAT file system also includes: Write the Master Boot Record and a globally unique identifier partition table to the exFAT public compatibility region to define the partition type and partition size of the exFAT public compatibility region; Write the partition boot sector to the exFAT exposed compatibility zone, and define the cluster size of the exFAT file system in the partition boot sector; After writing the FAT table to the exFAT public compatibility region, the allocation bitmap of the FAT table is filled to mark the clusters corresponding to the cluster chain space as occupied.

[0008] Optionally, when the video file is updated, only the fields in the directory entry corresponding to the video file that have changed are updated, including: When the file length of the video file increases or the timestamp changes, while keeping the FAT table in read-only mode and without updating the FAT table, only the fields in the file length field, modification time field, and data offset address field of the directory entry corresponding to the video file that have changed are updated.

[0009] Optionally, the method further includes: When writing to the target critical area of ​​the exFAT file system, a preset low-level driver code is used to complete the writing by manipulating the physical offset address of the storage medium; The target key area includes the Master Boot Record, the Globally Unique Identifier Partition Table, the Partition Boot Sector, the FAT Table, and the directory entries.

[0010] Optionally, generating a file header in the cluster chain space for the video file with a preset standard encapsulation format and associated with the raw stream data includes: Based on the track information, encoding format, and duration of the raw stream data, a corresponding MP4 file header is generated and written into the storage location reserved for the video file in the cluster chain space, so that the external device can recognize the video file in the exFAT public compatibility area as a standard MP4 file and play it.

[0011] Optionally, the exFAT public compatibility region is constructed using an existing private recording system externally attached to the embedded recording device; During the construction and use of the exFAT file system, the original private recording system's writing process and index management logic for the private recording storage area remain unchanged.

[0012] Secondly, this application provides a dual-file system compatible storage device for an embedded recording device, comprising: The device partitioning module is used to divide the storage medium of the embedded recording device into a private recording storage area and an exFAT public compatibility area; the private recording storage area and the exFAT public compatibility area are logically isolated from each other through an address mapping mechanism. An initialization module is used to pre-allocate contiguous cluster chain space in the exFAT public compatibility zone during the initialization phase, and create a directory structure containing directory entries in the cluster chain space to build an exFAT file system; wherein, the exFAT file system includes a FAT table; the FAT table is only written with the occupancy status of the cluster chain space during the initialization phase, and the FAT table is set to read-only mode after being written; The recording execution module is used to write the acquired audio and video data into the private recording storage area in the form of raw streams during the recording execution phase, and manage the written raw stream data through a private index table to form a recording file. The storage information of the recording file is synchronously recorded to the corresponding directory entry in the directory structure, and a file header with a preset standard encapsulation format associated with the raw stream data is generated for the recording file in the cluster chain space, so that external devices can recognize the exFAT file system and play the recording file using the directory entry and the file header; wherein, when the recording file is updated, only the fields that have changed in the directory entry corresponding to the recording file are updated.

[0013] Thirdly, this application provides an electronic device, comprising: Memory, used to store computer programs; A processor is used to execute the computer program to implement the aforementioned dual file system compatible storage method for embedded recording devices.

[0014] Fourthly, this application provides a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned dual-file system compatible storage method for embedded recording devices.

[0015] In this application, the storage medium of the embedded recording device is divided into a private recording storage area and an exFAT public compatible area; the private recording storage area and the exFAT public compatible area are logically isolated from each other through an address mapping mechanism; during the initialization phase, a contiguous cluster chain space is pre-allocated in the exFAT public compatible area, and a directory structure containing directory entries is created in the cluster chain space to construct an exFAT file system; wherein, the exFAT file system includes a FAT table; the FAT table is only written with the occupancy status of the cluster chain space during the initialization phase, and the FAT table is set to read-only mode after being written; During the recording operation phase, the collected audio and video data is written to the private recording storage area in raw stream form. The written raw stream data is managed through a private index table to form a recording file. The storage information of the recording file is synchronously recorded to the corresponding directory entry in the directory structure. A file header with a preset standard encapsulation format, associated with the raw stream data, is generated for the recording file in the cluster chain space. This allows external devices to recognize the exFAT file system and play the recording file using the directory entry and the file header. When the recording file is updated, only the changed fields in the directory entry corresponding to the recording file are updated. As can be seen, this application partitions the storage medium of the embedded recording device into a private recording storage area and an exFAT public compatible area, with logical isolation achieved through address mapping. During system initialization, a contiguous cluster chain space is allocated once within the exFAT public compatible area. A directory structure with directory entries is built based on this cluster chain space, completing the exFAT file system setup. This file system is configured with a FAT table. The FAT table only allows the cluster chain space occupancy information to be filled during the initialization phase; after data writing is complete, the FAT table is fixed as read-only. During recording, the acquired audio and video data is stored in a private recording storage area in raw stream format. A private index table manages the raw stream data to generate recording files, and the recording file storage information is simultaneously filled into the matching directory entries. At the same time, a file header bound to the raw stream data and conforming to a standard encapsulation format is generated in the cluster chain space. After external devices recognize the exFAT file system, they can play back the recording files based on the directory entries and file headers. When a recording file is modified, only the changed fields within the corresponding directory entry need to be modified. In this way, for embedded recording devices, this application provides a storage processing solution that is compatible with dual file systems and does not require significant modifications to the original recording logic. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention 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 embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0017] Figure 1 This application discloses a flowchart of a dual file system compatible storage method for an embedded recording device. Figure 2 This is a diagram of a dual file system architecture for a storage medium disclosed in this application; Figure 3 This application discloses an exFAT partition initialization flowchart; Figure 4 This application discloses a flowchart for video recording and computer compatibility. Figure 5 This is a schematic diagram of the dual file system compatible storage device structure of an embedded recording device disclosed in this application; Figure 6 This is a structural diagram of an electronic device disclosed in this application. Detailed Implementation

[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. 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 are within the scope of protection of the present invention.

[0019] Currently, the primary problem with private storage systems is insufficient compatibility. Private raw streams lack standard encapsulation, making it impossible for ordinary computers to directly read and play recordings; dedicated software is required, resulting in a high learning curve for users. Using the exFAT universal file system to solve compatibility issues leads to flash memory wear and write stuttering: the FAT table's continuous and frequent updates and erases of flash memory chips significantly shorten the lifespan of memory cards and flash drives; dynamic storage allocation continuously generates file fragments, easily causing recording interruptions and frame drops during high-bitrate HD recording. Reconstructing the existing private recording program to adapt to a standard format involves a large amount of engineering work, a long development cycle, and mature business logic is prone to failure, making smooth iteration difficult for existing devices; furthermore, the lack of a standard encapsulation structure for raw stream data necessitates additional transcoding after recording export, a complex and time-consuming process. Therefore, this application provides a dual-file system compatible storage method, apparatus, device, and medium for embedded recording devices, enabling a storage processing solution that is compatible with both file systems without significant modifications to the original recording logic.

[0020] See Figure 1 As shown, this embodiment of the invention discloses a dual-file system compatible storage method for an embedded recording device, including: Step S11: Divide the storage medium of the embedded recording device into a private recording storage area and an exFAT public compatible area; the private recording storage area and the exFAT public compatible area are logically isolated from each other through an address mapping mechanism.

[0021] In this embodiment, the storage medium of the embedded recording device is first divided into two independent storage areas: a private recording storage area and an exFAT public compatibility area. The private recording storage area is used to store private recording data generated by the embedded recording device under normal operating conditions, while the exFAT public compatibility area is used to provide data exchange capabilities with external devices, enabling external devices to directly identify and read the data stored in this area.

[0022] It should be noted that the exFAT public compatibility area is constructed using an existing private recording system externally integrated into the embedded recording device. During the construction and use of the exFAT file system, the writing process and index management logic of the existing private recording system for the private recording storage area remain unchanged. This allows the embedded recording device to retain all the functions and data management habits of the original private recording system while providing data exchange capabilities compatible with external devices, effectively solving the problem of incompatibility between private recording formats and external devices in traditional embedded recording devices.

[0023] Step S12: During the initialization phase, a contiguous cluster chain space is pre-allocated in the exFAT public compatibility zone, and a directory structure containing directory entries is created in the cluster chain space to construct the exFAT file system; wherein, the exFAT file system includes a FAT table; the FAT table is only written with the occupancy status of the cluster chain space during the initialization phase, and the FAT table is set to read-only mode after being written.

[0024] In this embodiment, the initialization phase can be the phase in which the embedded recording device formats the exFAT public compatibility area and builds the file system after its first power-on startup. During the initialization phase, the embedded recording device pre-allocates a continuous cluster chain space in the exFAT public compatibility area in one go.

[0025] Furthermore, the cluster chain space is divided into a contiguous directory storage area and a file data storage area; wherein, the size of the cluster chain space is adaptively determined based on the types of video files that the embedded recording device is expected to store; with a fixed folder size and a fixed number of directory entries, a directory structure containing directory entries is created in the directory storage area to construct an exFAT file system through the directory structure.

[0026] Furthermore, the exFAT file system includes a FAT table, which records the allocation status of each cluster in the cluster chain space and the links between clusters. It's important to note that the FAT table is only written to the cluster chain space during the initialization phase. That is, the occupancy status of all clusters in the cluster chain space is recorded only once during initialization. Subsequently, during device operation, regardless of changes in the data stored in the exFAT public compatibility area, the occupancy status in the FAT table is not updated. After being written, the FAT table is set to read-only mode, meaning it can only be read by external devices and cannot be modified or overwritten during subsequent use.

[0027] In addition, in this embodiment, a master boot record and a globally unique identifier partition table are written to the exFAT public compatibility zone to define the partition type and partition size of the exFAT public compatibility zone; a partition boot sector is written to the exFAT public compatibility zone, and the cluster size of the exFAT file system is defined in the partition boot sector; after writing the FAT table to the exFAT public compatibility zone, the allocation bitmap of the FAT table is filled to mark the clusters corresponding to the cluster chain space as occupied, thereby ensuring that external devices can correctly identify occupied clusters when accessing the exFAT public compatibility zone.

[0028] Step S13: During the recording operation phase, the collected audio and video data is written to the private recording storage area in the form of raw streams, and the written raw stream data is managed through a private index table to form a recording file. The storage information of the recording file is synchronously recorded to the corresponding directory entry in the directory structure, and a file header with a preset standard encapsulation format associated with the raw stream data is generated for the recording file in the cluster chain space, so that external devices can recognize the exFAT file system and play the recording file using the directory entry and the file header; wherein, when the recording file is updated, only the fields that have changed in the directory entry corresponding to the recording file are updated.

[0029] In this embodiment, the recording operation stage can be the stage after the embedded recording device has completed initialization and the exFAT file system has been built, and then it enters the normal working state to collect and record audio and video data.

[0030] In this stage, the embedded recording device acquires audio and video data in real time using cameras and microphones, and writes the acquired audio and video data directly into the private recording storage area in raw stream form. Raw stream form means that no formatting or encapsulation is performed on the audio and video data; the original audio and video frame data are written to the storage medium sequentially according to the acquisition time to ensure writing efficiency meets the requirements of real-time recording. Simultaneously, a private index table manages the written raw stream data. The private index table records management information such as the storage location, start time, end time, and data length of each recording file in the private recording storage area. The embedded recording device can quickly retrieve and locate all recording files in the private recording storage area by querying this private index table, thus forming recording files available for subsequent playback and retrieval.

[0031] After a video file is created, its storage information is synchronously recorded in the directory entry corresponding to the video file within the exFAT public compatibility zone. By synchronizing this storage information to the directory entry, external devices can obtain the basic attribute information of the video file by reading the directory entry when accessing the exFAT public compatibility zone.

[0032] Furthermore, this embodiment generates a corresponding MP4 file header based on the track information, encoding format, and duration of the raw stream data, and writes the MP4 file header into the storage location reserved for the video file in the cluster chain space, so that the external device can recognize the video file in the exFAT public compatibility area as a standard MP4 file and play it. That is, the preset standard container format can be MP4 format.

[0033] It should be noted that when writing to the target critical area of ​​the exFAT file system, a preset low-level driver code is used to complete the write operation by manipulating the physical offset address of the storage medium. The target critical area includes the Master Boot Record (MBR), the globally unique identifier partition table, the partition boot sector, the FAT table, and the directory entries. By directly manipulating the physical offset address through the preset low-level driver code, it is ensured that the write operation accurately reaches the specified physical location on the storage medium, thereby guaranteeing the reliability and accuracy of data writing to the target critical area.

[0034] Furthermore, when the file length of the recorded video file increases or the timestamp changes, while keeping the FAT table in read-only mode and without updating the FAT table itself, only the changed fields in the file length field, modification time field, and data offset address field of the directory entry corresponding to the recorded video file are updated. By updating only the changed fields, the number of write operations to the exFAT public compatibility area can be minimized, thereby reducing wear and tear on the storage medium and extending its lifespan.

[0035] As can be seen from the above, this application partitions the storage medium of the embedded recording device into a private recording storage area and an exFAT public compatible area, with the two areas logically isolated through address mapping. During system initialization, a contiguous cluster chain space is allocated once within the exFAT public compatible area. A directory structure with directory entries is built based on this cluster chain space, completing the exFAT file system setup. This file system is configured with a FAT table, which only allows the cluster chain space occupancy information to be filled during the initialization phase. After the data is written, the FAT table is fixed as read-only. During device recording, the acquired audio and video data is stored in the private recording storage area in raw stream format. The raw stream data is managed by a private index table to generate recording files. Simultaneously, the recording file storage information is filled into the matching directory entries. At the same time, a file header bound to the raw stream data and conforming to the standard encapsulation format is generated in the cluster chain space. After the external device recognizes the exFAT file system, it can play back the recording files based on the directory entries and file headers. When the recording files are modified, only the changed fields within the corresponding directory entries need to be modified. In this way, for embedded recording devices, this application can realize a storage processing solution that is compatible with dual file systems and does not require significant changes to the original recording logic.

[0036] This application presents a combined solution of "dual file system coexistence, exFAT deep optimization, and raw stream standard encapsulation". The technical solutions of the embodiments of this application are described in detail below.

[0037] Reference Figure 2 For the dual-file system coexistence architecture design, the storage medium is logically divided into two independent areas: a private recording storage area, which retains the original private raw stream data storage, private index table management, and sequential write logic, undertaking core recording business and ensuring that the stability of the original system is not affected; and an exFAT public compatible area, which adds an independent and contiguous physical space, used only to build a standard exFAT file system structure to realize computer-side recognition and playback functions. The two areas are physically contiguous but logically isolated, and the boundaries are defined by an address mapping mechanism to ensure that data does not overwrite or interfere with each other, and they share the same storage medium (such as flash memory or hard disk).

[0038] For the implementation of the external exFAT compatibility layer (i.e., the exFAT public compatibility area), the original private recording system's write process and index management logic remain completely unchanged, requiring no intrusive modifications. The new exFAT compatibility layer adopts an "initialization construction + runtime synchronization" mode: Initialization phase: only the exFAT file system basic structure is built in the free space of the storage medium; Runtime phase: only the necessary information of the recording files (such as data address, length, timestamp) is synchronized to the exFAT compatibility area (i.e., the exFAT public compatibility area), without affecting the original recording real-time performance. This design supports adding compatibility functions to existing devices through firmware upgrades without hardware modifications, demonstrating strong adaptability.

[0039] For exFAT file system initialization optimization, the partitioning plan is as follows: During the exFAT compatible area initialization phase, a contiguous cluster chain space is pre-allocated in one go, clearly defining the directory storage area and the file data storage area; the structure is fixed: a design of "fixed folder size + fixed number of directory entries" is adopted, and the directory structure does not change after initialization, ensuring physical continuity of the storage area; the FAT table is read-only: the FAT table is only written once during initialization to record the occupancy status of the pre-allocated cluster chain, and is set to read-only mode throughout the runtime, without any modification operations.

[0040] The decoupled update mechanism for directory entries and the FAT table ensures that when a video file is updated (e.g., its length increases or its timestamp is modified), only the directory entries in the exFAT-compatible area are updated: only the changed fields in the directory entry are modified (e.g., file length, modification time, data offset address), without rewriting the entire entry; the FAT table is not touched at all, avoiding wear and I / O overhead caused by frequent FAT table updates. This design achieves complete decoupling of directory entry metadata updates from cluster allocation status, significantly improving update efficiency and reducing storage media wear.

[0041] For direct writing to critical areas of exFAT, targeting key structures of the exFAT file system (MBR (Master Boot Record), GPT (Globally Unique Identifier Partition Table), DBR (DOS Boot Record), FAT table, and directory entries), the standard file system API (Application Programming Interface) provided by the operating system is not used. Instead, self-developed low-level driver code is used to write data by directly manipulating physical offset addresses, bypassing system interface overhead, improving operational controllability and stability, and avoiding uncontrollable risks caused by system interface calls.

[0042] For private raw stream real-time MP4 (i.e., MPEG-4 Part 14, a universal multimedia container format) encapsulation, the underlying recording data is still written to the private storage area in raw stream form to ensure the writing efficiency of the core recording business; in the file structure of the exFAT compatible area, the standard MP4 file header is dynamically generated and updated, and the raw stream data is associated with the MP4 file header; the computer recognizes the file in the exFAT compatible area as the standard MP4 format, which can be opened directly by a general player without additional format conversion.

[0043] As can be seen, the beneficial effects of this application include: significantly improved compatibility: the computer can directly recognize standard MP4 files in the exFAT compatible area without the need for special tools, greatly improving ease of use; extended storage lifespan: the FAT table is initialized and written only once, avoiding wear and tear on the storage medium caused by frequent erasures and writes, thus extending the lifespan of embedded devices; no file fragmentation: pre-allocated continuous cluster chains + fixed directory structure eliminate file fragmentation at the source, ensuring the stability of continuous writing for high bitrate recordings; optimized IO efficiency: designs such as updating only directory entries and writing directly to the underlying address significantly reduce the number of IO operations and improve system response speed; stability of existing systems: dual-system isolation + external compatibility layer does not damage the original private recording system, reducing development and upgrade risks; strong adaptability: supports smooth upgrades of existing devices without hardware modifications, reducing product iteration costs.

[0044] The technical solutions of the embodiments of this application will be specifically described below in conjunction with actual application processes.

[0045] The hardware environment may include: Embedded recording device: The main control chip is ARM (Advanced RISC Machines) Cortex-A9 (a multi-core high-performance processor core), and the storage medium is 64GB eMMC (Embedded Multi Media Card) flash memory, supporting real-time audio and video capture and writing; Computer side: Supports Windows / macOS systems (i.e., operating systems), and has a USB (Universal Serial Bus) interface or card reader interface.

[0046] Implementation steps may include: Storage media partitioning: The 64GB eMMC flash memory is divided into a 48GB private recording storage area and a 16GB exFAT public compatible area. The physical address range of the two areas is defined by an address mapping table (e.g., private area: 0x00000000-0x180000000, exFAT area: 0x180000000-0x200000000).

[0047] exFAT compatibility area initialization: Refer to Figure 3 Write the MBR (Master Boot Record) boot sector and GPT (Globally Unique Partition Table) partition table to define the exFAT partition type and size; initialize exFAT metadata and set the cluster size to 64KB (adapting to large file recording storage); pre-allocate a 16GB contiguous cluster chain at once, dividing it into a directory area (i.e., directory storage area, 1GB) and a file data area (i.e., file data storage area, 15GB); write to the FAT table to record the cluster chain occupancy status, and then set the FAT table area to read-only; populate the FAT BITMAP (i.e., file allocation table bitmap) to mark the pre-allocated clusters as occupied; create a root directory entry with a fixed structure and reserve storage space for MP4 file headers (each file header occupies 512 bytes). Video recording service operation: Refer to Figure 4 The device collects audio and video data and writes it to the 48GB private recording storage area in the original private format, while updating the private index table. The exFAT compatibility layer synchronizes the physical address of the raw stream data to the exFAT file data area. A standard MP4 file header (containing track information, encoding format, duration, etc.) is generated and written to the reserved position in the directory entry. When the length of the recording file increases or the timestamp is updated, only the corresponding fields in the exFAT directory entry are modified, and the FAT table remains read-only.

[0048] PC compatibility: See below Figure 4 Connect the storage medium to the computer via USB or a card reader. The computer will automatically recognize the exFAT partition and display it as a standard MP4 file, which the user can directly open and play with a media player.

[0049] Effect verification may include: Compatibility: It can directly recognize exFAT partitions and play MP4 files on Windows 10 and macOS Ventura systems without the need for special software.

[0050] Wear test: 720 hours of continuous recording, the FAT table area was erased and written once (initialization only). Compared with the traditional exFAT's 100,000+ erase and write cycles, the wear was reduced by 99.9%.

[0051] Fragmentation test: After continuously writing 100 video files (each file is 1GB), the exFAT partition showed no file fragmentation, and the file read speed remained stable at 80MB / s.

[0052] Real-time performance: The video recording write latency is ≤50ms, consistent with the latency of the original private system, and is not affected by the compatibility layer.

[0053] Accordingly, see Figure 5 As shown, this application embodiment provides a dual-file system compatible storage device for an embedded recording device, including: The device partitioning module 11 is used to divide the storage medium of the embedded recording device into a private recording storage area and an exFAT public compatible area; the private recording storage area and the exFAT public compatible area are logically isolated from each other through an address mapping mechanism. Initialization module 12 is used to pre-allocate a contiguous cluster chain space in the exFAT public compatibility zone during the initialization phase, and create a directory structure containing directory entries in the cluster chain space to build an exFAT file system; wherein, the exFAT file system includes a FAT table; the FAT table is only written with the occupancy status of the cluster chain space during the initialization phase, and the FAT table is set to read-only mode after being written; The recording execution module 13 is used to write the collected audio and video data into the private recording storage area in the form of raw streams during the recording execution phase, and manage the written raw stream data through a private index table to form a recording file. The storage information of the recording file is synchronously recorded to the corresponding directory entry in the directory structure, and a file header with a preset standard encapsulation format associated with the raw stream data is generated for the recording file in the cluster chain space, so that external devices can recognize the exFAT file system and play the recording file using the directory entry and the file header. When the recording file is updated, only the fields that have changed in the directory entry corresponding to the recording file are updated.

[0054] In some specific embodiments, the initialization module 12 specifically includes: A space partitioning unit is used to divide the cluster chain space into a contiguous directory storage area and a file data storage area; wherein, the size of the cluster chain space is adaptively determined based on the types of video files that the embedded recording device is expected to store; The directory creation unit is used to create a directory structure containing directory entries in the directory storage area with a fixed folder size and a fixed number of directory entries.

[0055] In some specific embodiments, the initialization module 12 further includes: The partition definition unit is used to write the master boot record and the globally unique identifier partition table into the exFAT public compatibility zone to define the partition type and partition size of the exFAT public compatibility zone; The cluster size definition unit is used to write the partition boot sector to the exFAT public compatibility area and define the cluster size of the exFAT file system in the partition boot sector; The cluster marking unit is used to fill the allocation bitmap of the FAT table after writing the FAT table to the exFAT public compatibility area, so as to mark the cluster corresponding to the cluster chain space as occupied.

[0056] In some specific embodiments, the video recording module 13 specifically includes: The field update unit is used to update only the fields that have changed in the file length field, modification time field, and data offset address field of the directory entry corresponding to the video file when the file length of the video file increases or the timestamp changes, while keeping the FAT table in read-only mode and not updating the FAT table.

[0057] In some specific embodiments, the device further includes: The region writing unit is used to complete the writing by operating the physical offset address of the storage medium using preset low-level driver code when writing to the target critical region of the exFAT file system. The target key area includes the Master Boot Record, the Globally Unique Identifier Partition Table, the Partition Boot Sector, the FAT Table, and the directory entries.

[0058] In some specific embodiments, the video recording module 13 specifically includes: The file header writing unit is used to generate a corresponding MP4 file header based on the track information, encoding format, and duration of the raw stream data, and write the MP4 file header into the storage location reserved for the video file in the cluster chain space, so that the external device can recognize the video file in the exFAT public compatibility area as a standard MP4 file and play it.

[0059] In some specific implementations, the exFAT public compatibility region is constructed through an existing private recording system externally attached to the embedded recording device; During the construction and use of the exFAT file system, the original private recording system's writing process and index management logic for the private recording storage area remain unchanged.

[0060] Furthermore, embodiments of this application also disclose an electronic device, Figure 6 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content of the diagram should not be construed as limiting the scope of this application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the dual-file system compatible storage method of the embedded recording device disclosed in any of the foregoing embodiments. Furthermore, the electronic device 20 in this embodiment may specifically be an electronic computer.

[0061] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.

[0062] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored thereon can include operating system 221, computer program 222, etc., and the storage method can be temporary storage or permanent storage.

[0063] The operating system 221 is used to manage and control the various hardware devices on the electronic device 20 and the computer program 222, which may be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program capable of performing the dual-file system compatible storage method of the embedded recording device executed by the electronic device 20 as disclosed in any of the foregoing embodiments, the computer program 222 may further include computer programs capable of performing other specific tasks.

[0064] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned dual-file system compatible storage method for embedded recording devices. Specific steps of this method can be found in the corresponding content disclosed in the foregoing embodiments, and will not be repeated here.

[0065] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.

[0066] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0067] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0068] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0069] The technical solutions provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A dual-file system compatible storage method for an embedded recording device, characterized in that, include: The storage medium of the embedded recording device is divided into a private recording storage area and an exFAT public compatible area; The private video storage area and the exFAT public compatible area are logically isolated from each other through an address mapping mechanism; During the initialization phase, a contiguous cluster chain space is pre-allocated in the exFAT public compatibility zone, and a directory structure containing directory entries is created in the cluster chain space to build the exFAT file system; wherein, the exFAT file system includes a FAT table; the FAT table is only written with the occupancy status of the cluster chain space during the initialization phase, and the FAT table is set to read-only mode after being written; During the recording process, the collected audio and video data is written to the private recording storage area in raw stream form. The written raw stream data is managed through a private index table to form a recording file. The storage information of the recording file is synchronously recorded to the corresponding directory entry in the directory structure. A file header with a preset standard encapsulation format associated with the raw stream data is generated for the recording file in the cluster chain space so that external devices can recognize the exFAT file system and play the recording file using the directory entry and the file header. When the recording file is updated, only the fields in the directory entry corresponding to the recording file that have changed are updated.

2. The dual-file system compatible storage method for embedded recording devices according to claim 1, characterized in that, Creating a directory structure containing directory entries in the cluster chain space includes: The cluster chain space is divided into a contiguous directory storage area and a file data storage area; wherein, the size of the cluster chain space is adaptively determined based on the types of video files that the embedded recording device is expected to store; A directory structure containing directory entries is created in the directory storage area with a fixed folder size and a fixed number of directory entries.

3. The dual-file system compatible storage method for embedded recording devices according to claim 1, characterized in that, The process of building the exFAT file system also includes: Write the Master Boot Record and a globally unique identifier partition table to the exFAT public compatibility region to define the partition type and partition size of the exFAT public compatibility region; Write the partition boot sector to the exFAT exposed compatibility zone, and define the cluster size of the exFAT file system in the partition boot sector; After writing the FAT table to the exFAT public compatibility region, the allocation bitmap of the FAT table is filled to mark the clusters corresponding to the cluster chain space as occupied.

4. The dual-file system compatible storage method for embedded recording devices according to claim 1, characterized in that, When the video file is updated, only the fields in the directory entry corresponding to the video file that have changed are updated, including: When the file length of the video file increases or the timestamp changes, while keeping the FAT table in read-only mode and without updating the FAT table, only the fields in the file length field, modification time field, and data offset address field of the directory entry corresponding to the video file that have changed are updated.

5. The dual-file system compatible storage method for embedded recording devices according to claim 1, characterized in that, Also includes: When writing to the target critical area of ​​the exFAT file system, a preset low-level driver code is used to complete the writing by manipulating the physical offset address of the storage medium; The target key area includes the Master Boot Record, the Globally Unique Identifier Partition Table, the partition boot sector, the FAT table, and the directory entries.

6. The dual-file system compatible storage method for an embedded recording device according to any one of claims 1 to 5, characterized in that, The step of generating a file header in the cluster chain space for the video file in a preset standard encapsulation format and associated with the raw stream data includes: Based on the track information, encoding format, and duration of the raw stream data, a corresponding MP4 file header is generated and written into the storage location reserved for the video file in the cluster chain space, so that the external device can recognize the video file in the exFAT public compatibility area as a standard MP4 file and play it.

7. The dual-file system compatible storage method for embedded recording devices according to claim 1, characterized in that, The exFAT public compatibility zone is constructed through the existing private recording system externally attached to the embedded recording device; During the construction and use of the exFAT file system, the original private recording system's writing process and index management logic for the private recording storage area remain unchanged.

8. A dual-file system compatible storage device for an embedded recording device, characterized in that, include: The device partitioning module is used to divide the storage medium of the embedded recording device into a private recording storage area and an exFAT public compatible area. The private video storage area and the exFAT public compatible area are logically isolated from each other through an address mapping mechanism; An initialization module is used to pre-allocate a contiguous cluster chain space in the exFAT public compatibility zone during the initialization phase, and create a directory structure containing directory entries in the cluster chain space to build an exFAT file system; wherein, the exFAT file system includes a FAT table; the FAT table is only written with the occupancy status of the cluster chain space during the initialization phase, and the FAT table is set to read-only mode after being written; The recording execution module is used to write the acquired audio and video data into the private recording storage area in the form of raw streams during the recording execution phase, and manage the written raw stream data through a private index table to form a recording file. The storage information of the recording file is synchronously recorded to the corresponding directory entry in the directory structure, and a file header with a preset standard encapsulation format associated with the raw stream data is generated for the recording file in the cluster chain space, so that external devices can recognize the exFAT file system and play the recording file using the directory entry and the file header; wherein, when the recording file is updated, only the fields that have changed in the directory entry corresponding to the recording file are updated.

9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the dual file system compatible storage method for an embedded recording device as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, Used to store computer programs; wherein, when the computer programs are executed by a processor, they implement the dual file system compatible storage method of the embedded recording device as described in any one of claims 1 to 7.