Data storage method and device for vehicle-mounted built-in DVR, electronic equipment and medium

By using DDR encoded memory and bitmap tag management technology, the problem of slow data writing speed of USB flash drive in vehicle DVR equipment has been solved, realizing real-time data storage and efficient management, and improving storage efficiency.

CN120849311BActive Publication Date: 2026-01-06SHENZHEN ZHONGHONG TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511351124.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-22
Publication Date
2026-01-06
Estimated Expiration
2045-09-22

AI Technical Summary

Technical Problem

In existing in-vehicle DVR devices, the data write speed of USB flash drives is relatively low, resulting in low storage efficiency.

Method used

DDR encoded memory is used for memory page allocation to generate data files in a preset format, and memory pages are managed through bitmap marking to achieve real-time storage and efficient management of data files.

Benefits of technology

It improves data storage efficiency, reduces memory fragmentation, ensures that data files are not disturbed during storage, and avoids data loss and storage failure.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120849311B_ABST
    Figure CN120849311B_ABST
Patent Text Reader

Abstract

The application provides a data storage method and device for a vehicle-mounted built-in DVR, electronic equipment and a medium, and relates to the technical field of vehicle-mounted systems. In the method, DVR data is acquired, data preprocessing is performed on the DVR data, and a data file in a preset format is generated. A memory page allocation is performed on a preset DDR encoding memory, a continuous memory page is obtained, the continuous memory page is locked in the DDR encoding memory, so that the data file exclusively occupies the continuous memory page. The continuous memory page is divided and marked to obtain a plurality of key memory pages and bitmap markers corresponding to each key memory page, wherein each key memory page is used to store the data file. It is judged whether a mobile storage device is connected. In the case where the mobile storage device is not connected, it is judged whether the DDR encoding memory has a remaining space. In the case where the DDR encoding memory has a remaining space, the data file is stored in the key memory page according to the bitmap marker, real-time storage can be realized, and the storage efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of vehicle system technology, specifically to a data storage method, device, electronic device, and medium for a vehicle-mounted built-in DVR. Background Technology

[0002] A DVR (Digital Video Recorder) in a vehicle system is a device installed in a vehicle to record video information of the road ahead, the interior of the vehicle, and the surrounding environment in real time, as well as to download and play back the video information. In related technologies, the DVR built into the vehicle system uses direct encoding to store the recorded video information on a memory card (USB flash drive). However, there are many brands and types of USB flash drives, and they are limited by the USB interface protocol (such as USB 2.0 / 3.0) and the performance of the flash memory chips. Data storage is managed through a file system, and data transmission is achieved through protocol conversion and physical interfaces. When data is written to the USB flash drive, interface protocol conversion is required, resulting in a low continuous data write speed and low storage efficiency. Summary of the Invention

[0003] This application provides a data storage method, device, electronic device, and medium for an in-vehicle built-in DVR, which can achieve real-time storage and improve storage efficiency.

[0004] The technical solution of this application embodiment is as follows:

[0005] In a first aspect, embodiments of this application provide a data storage method for an in-vehicle built-in DVR, the method comprising:

[0006] Acquire DVR data, perform data preprocessing on the DVR data, and generate a data file in a preset format;

[0007] Memory pages are allocated to the preset DDR encoded memory to obtain contiguous memory pages, and the contiguous memory pages are locked in the DDR encoded memory so that the data file exclusively occupies the contiguous memory pages;

[0008] The contiguous memory pages are divided and marked to obtain multiple key memory pages and bitmap markers corresponding to each key memory page, wherein each key memory page is used to store the data file;

[0009] Determine whether a mobile storage device is connected so that the data file in the DDR encoded memory can be transferred to the mobile storage device; if no mobile storage device is connected, determine whether there is remaining space in the DDR encoded memory.

[0010] If there is remaining space in the DDR encoded memory, the data file is stored in the critical memory page according to the bitmap marker.

[0011] In the above technical solution, DVR data is first acquired to provide a data foundation for subsequent data storage. The DVR data is then preprocessed to generate a data file in a preset format. Converting the DVR data to a storage format ensures data integrity and consistency, removes noise and invalid data, improves data quality, and reduces memory usage. Next, memory pages are allocated to a preset DDR encoded memory to obtain contiguous memory pages. Using DDR encoded memory allows encoded data to be written to memory via hardware channels, enabling real-time data stream processing with high read / write speeds. Allocating contiguous memory pages reduces memory fragmentation and improves memory access efficiency. Locking these contiguous memory pages within the DDR encoded memory ensures that the data file has exclusive access to them, preventing other processes or threads from accessing the data file during storage. Interference is reduced to improve data read / write efficiency. Then, contiguous memory pages are divided and marked to obtain multiple critical memory pages and their corresponding bitmap markers. This enables efficient memory management, facilitating the reading, writing, and release of data files. Each critical memory page is used to store data files. The system determines whether a removable storage device is connected, allowing data files in the DDR encoded memory to be transferred to it. If no removable storage device is connected, it checks if there is remaining space in the DDR encoded memory to ensure data has storage space and prevent data loss or storage failure. If there is remaining space in the DDR encoded memory, the data file is stored in the critical memory pages according to the bitmap markers. Management through bitmap markers ensures that data is accurately written to the allocated memory pages, improving storage efficiency. By using DDR encoded memory, real-time data writing can be achieved, and memory locking and bitmap marker management improve data storage efficiency.

[0012] In some embodiments of this application, the step of dividing and marking the contiguous memory pages to obtain multiple key memory pages and bitmap markers corresponding to each key memory page includes:

[0013] The contiguous memory pages are divided into buffers to obtain a first buffer and a second buffer;

[0014] The first buffer and the second buffer are divided into fixed-page partitions to obtain multiple critical memory pages;

[0015] A dynamic window mapping is established for the first buffer to obtain the mapping window corresponding to the first buffer;

[0016] Each of the key memory pages is marked to obtain a bitmap marker corresponding to each key memory page, and an association relationship is established between the bitmap marker and the mapping window. The bitmap marker is used to indicate the first buffer or the second buffer to which the key memory page belongs, and whether the data file is stored therein.

[0017] In some embodiments of this application, storing the data file into the critical memory page according to the bitmap marker includes:

[0018] Based on the bitmap marker, the corresponding mapping window is found in the association relationship, and the first buffer corresponding to the mapping window is determined.

[0019] The data file is written to the key memory page of the first buffer. When the amount of data in the first buffer reaches a preset data threshold, the mapping relationship between the first buffer and the mapping window is released, the second buffer is mapped to the mapping window, and the data file is written to the key memory page of the second buffer.

[0020] In some embodiments of this application, after determining whether a mobile storage device is connected, the method further includes:

[0021] When a mobile storage device is connected and the DDR encoded memory has no remaining space, the data file in the first buffer is copied to the mobile storage device, and a file with the same name is deleted from the first buffer. The file with the same name has the same file name as the data file.

[0022] The mapping relationship between the second buffer and the mapping window is released, the first buffer is mapped to the mapping window, and the data file is written into the key memory page of the first buffer.

[0023] In some embodiments of this application, locking the contiguous memory pages in the DDR encoded memory includes:

[0024] The contiguous memory pages are divided into buffers to obtain a first buffer and a second buffer;

[0025] The Fibonacci sequence is initialized based on the first buffer, and the Fibonacci sequence is mapped to a preset locking level to obtain the first locking sequence corresponding to the first buffer. The first locking sequence corresponding to the first buffer is phase-shifted to obtain the second locking sequence corresponding to the second buffer.

[0026] The first locking sequence and the second locking sequence are adjusted by misaligned waveform locking to obtain the first locking sequence corresponding to the first buffer and the second locking sequence corresponding to the second buffer.

[0027] The DDR encoded memory is locked according to the adjusted first locking sequence and the adjusted second locking sequence.

[0028] In some embodiments of this application, the step of performing misaligned waveform locking adjustment on the first locking sequence and the second locking sequence to obtain the adjusted first locking sequence corresponding to the first buffer and the adjusted second locking sequence corresponding to the second buffer includes:

[0029] Obtain the write rate of the data file;

[0030] The writing rate is added to a preset first parameter, and then multiplied by a preset second parameter to obtain the adjusted wavelength;

[0031] The second locking sequence is set to lag the first locking sequence by a preset phase difference, thereby obtaining the adjusted first locking sequence corresponding to the first buffer and the adjusted second locking sequence corresponding to the second buffer. The phase difference is obtained by multiplying the preset golden ratio by the adjusted wavelength.

[0032] In some embodiments of this application, the step of preprocessing the DVR data to generate a data file in a preset format includes:

[0033] The DVR data is converted to NV21 format data;

[0034] The NV21 format data is encoded using a preset encoder to obtain encoded data;

[0035] The encoded data is processed using a preset mixer to generate a video, resulting in a data file in a preset format.

[0036] Secondly, embodiments of this application provide a data storage device for an in-vehicle built-in DVR, the device comprising:

[0037] The data acquisition and processing module is used to acquire DVR data, preprocess the DVR data, and generate a data file in a preset format.

[0038] The first memory processing module is used to allocate memory pages to a preset DDR encoded memory to obtain contiguous memory pages, and lock the contiguous memory pages in the DDR encoded memory so that the data file exclusively occupies the contiguous memory pages;

[0039] The second memory processing module is used to divide and mark the contiguous memory pages to obtain multiple key memory pages and bitmap markers corresponding to each key memory page, wherein each key memory page is used to store the data file;

[0040] The determination module is used to determine whether a mobile storage device is connected, so that the data file in the DDR encoded memory can be transferred to the mobile storage device. If no mobile storage device is connected, it determines whether there is remaining space in the DDR encoded memory.

[0041] The data storage module is used to store the data file into the critical memory page according to the bitmap marker, provided that there is remaining space in the DDR encoded memory.

[0042] Thirdly, embodiments of this application provide an electronic device including a processor, a memory, a user interface, a communication bus, and a network interface. The processor, the memory, the user interface, and the network interface are respectively connected to the communication bus. The memory is used to store instructions. The user interface and the network interface are used to communicate with other devices. The processor is used to execute the instructions stored in the memory to cause the electronic device to perform the method described in any one of the first aspects.

[0043] Fourthly, embodiments of this application provide a computer-readable storage medium storing instructions that, when executed, perform the method described in any one of the methods provided in the first aspect above.

[0044] In summary, one or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages:

[0045] 1. By first acquiring DVR data to provide a data foundation for subsequent data storage, and preprocessing the DVR data to generate a data file in a preset format, the system converts the DVR data into data conforming to the storage format. This ensures data integrity and consistency, removes noise and invalid data, improves data quality, and reduces memory space usage. Next, memory pages are allocated to the preset DDR encoded memory to obtain contiguous memory pages. Using DDR encoded memory allows data to be encoded and written to memory via hardware channels, enabling real-time data stream processing with high read / write speeds. Allocating contiguous memory pages reduces memory fragmentation and improves memory access efficiency. Locking these contiguous memory pages within the DDR encoded memory ensures that the data file has exclusive access to these pages, preventing interference from other processes or threads during storage. The system addresses issues such as interference and data read / write efficiency. It first divides and marks contiguous memory pages to obtain multiple key memory pages and corresponding bitmap markers, enabling efficient memory management and facilitating data file reading, writing, and release. Each key memory page stores the data file. The system then determines whether a removable storage device is connected, allowing data files to be transferred from the DDR encoded memory. If no removable storage device is connected, it checks for available space in the DDR encoded memory to ensure data storage and prevent data loss or failure. If there is available space in the DDR encoded memory, the data file is stored in the key memory pages based on the bitmap markers. Bitmap marker management ensures data is accurately written to the allocated memory pages, improving storage efficiency. By using DDR encoded memory, real-time data writing is achieved, and memory locking and bitmap marker management further enhance data storage efficiency. Therefore, this effectively solves the problem of low continuous data write speed and low storage efficiency caused by USB flash drives in related technologies.

[0046] 2. By dividing the data into a first buffer and a second buffer and establishing a dynamic window mapping, it is beneficial to the accurate storage of data and the release of memory space, so as to store more data and improve storage efficiency.

[0047] 3. By locking the first and second buffers, interference from other processes or linear processes is avoided, ensuring the security and stability of memory access and improving memory utilization. Attached Figure Description

[0048] Figure 1 This is a flowchart illustrating a data storage method for an in-vehicle built-in DVR according to an embodiment of this application;

[0049] Figure 2 yes Figure 1 A flowchart illustrating a sub-step of step S200;

[0050] Figure 3 yes Figure 1 A flowchart illustrating a sub-step of step S300;

[0051] Figure 4 This is a flowchart illustrating a data storage method for an in-vehicle built-in DVR provided in another embodiment of this application;

[0052] Figure 5 This is a schematic diagram of the data storage device of an in-vehicle built-in DVR provided in one embodiment of this application;

[0053] Figure 6 This is a schematic diagram of the structure of an electronic device provided in one embodiment of this application. Detailed Implementation

[0054] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments.

[0055] In the description of the embodiments of this application, the words "for example" or "for instance" are used to indicate examples, illustrations, or explanations. Any embodiment or design that is described as "for example" or "for instance" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design options. Rather, the use of the words "for example" or "for instance" is intended to present the relevant concepts in a specific manner.

[0056] In the description of the embodiments of this application, the term "multiple" means two or more. For example, multiple systems means two or more systems, and multiple screen terminals means two or more screen terminals. Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the indicated technical features. Thus, a feature defined with "first" or "second" may explicitly or implicitly include one or more of that feature. The terms "comprising," "including," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.

[0057] This application provides a data storage method, apparatus, electronic device, and readable storage medium for an in-vehicle built-in DVR. The data storage method first acquires DVR data to provide a data foundation for subsequent data storage. It preprocesses the DVR data to generate a data file in a preset format, converting the DVR data into data conforming to the storage format. This ensures data integrity and consistency, removes noise and invalid data, improves data quality, and reduces memory space usage. Next, it allocates memory pages to a preset DDR encoded memory to obtain contiguous memory pages. Using DDR encoded memory allows data to be encoded and written to memory via hardware channels, enabling real-time data stream processing and providing high read / write speeds. Allocating contiguous memory pages reduces memory fragmentation and improves memory access efficiency. Finally, it locks the contiguous memory pages in the DDR encoded memory, ensuring that the data file exclusively occupies the contiguous memory pages. This process ensures that data files are not interfered with by other processes or threads during storage, improving data read and write efficiency. Then, contiguous memory pages are divided and marked to obtain multiple key memory pages and corresponding bitmap markers for each key memory page. This enables efficient memory management, facilitating the reading, writing, and release of data files. Each key memory page is used to store the data file. The system determines whether a removable storage device is connected, allowing data files in the DDR encoded memory to be transferred to the removable storage device. If no removable storage device is connected, it checks if there is remaining space in the DDR encoded memory to ensure that data has storage space and avoids data loss and storage failure. If there is remaining space in the DDR encoded memory, the data file is stored in the key memory pages according to the bitmap markers. Management through bitmap markers ensures that data is accurately written to the allocated memory pages, improving storage efficiency. By using DDR encoded memory, real-time data writing can be achieved, and memory locking and bitmap marker management improve data storage efficiency.

[0058] It should be noted that this data storage method for in-vehicle built-in DVRs is applied to scenarios where dashcams are used in smart cockpits and in-vehicle central control systems. It supports stable and reliable low-latency zero-frame-dropping fast encoding and storage, as well as continuous data writing. It has low CPU resource consumption, enables real-time storage, and improves storage efficiency.

[0059] The technical solutions provided in the embodiments of this application will be further described below with reference to the accompanying drawings.

[0060] Reference Figure 1 , Figure 1This is a flowchart illustrating the data storage method for an in-vehicle built-in DVR provided in this application embodiment. The data storage method for an in-vehicle built-in DVR is applied to the data storage device of the in-vehicle built-in DVR and is executed by a processor in an electronic device or a readable storage medium. The data storage method for the in-vehicle built-in DVR includes steps S100, S200, S300, S400, and S500.

[0061] Step S100: Acquire DVR data, perform data preprocessing on the DVR data, and generate a data file in a preset format.

[0062] In one embodiment, DVR data refers to digital video data recorded and stored by a digital video recorder. DVR data includes video data, audio data, timestamps, and metadata. DVR uses a raw frame format, representing data in YUV or RGB. Specifically, video data (real-time video footage captured from surveillance cameras) is the main component of DVR data; audio data (some DVR devices support audio recording, simultaneously recording sound information from the video); timestamps (recording the time information of each video frame or recording segment for subsequent retrieval and playback); and metadata (potentially including camera information such as location and number), recording settings such as resolution and frame rate, and alarm information). DVR data can be collected via cameras, networks, or video capture software, and then stored. A preset data reading function is used to retrieve the collected DVR data, providing data support for subsequent data storage.

[0063] In one embodiment, the DVR data is preprocessed to generate a data file in a preset format, including but not limited to: converting the DVR data to obtain NV21 format data; encoding the NV21 format data using a preset encoder to obtain encoded data; and generating video from the encoded data using a preset mixer to obtain a data file in the preset format.

[0064] In some possible embodiments of this application, a preset G2D (Graphics to Display) method is used to convert DVR data to NV21 format data. G2D is used to handle graphics data conversion, enabling efficient image processing. Specifically, a G2D input buffer and output buffer are configured. The input buffer points to the original frame data (DVR data), and the output buffer points to a memory area for storing NV21 format data. Color space conversion is performed using G2D to convert the DVR data and output NV21 format data, where NV21 format data is YUV420P format data. This allows for subsequent data processing of the NV21 format data to achieve video data processing.

[0065] Then, the NV21 format data is encoded using a preset encoder to obtain encoded data. The preset encoder can be a CODEC codec, which encodes the NV21 format data (YUV420P format) into H.264 encoded data. Alternatively, a software encoder can be used to encode the YUV420P format data into H.265 encoded data. Data encoding is then used to compress the data, making it easier to store in subsequent video processing.

[0066] Based on the H.264 or H.265 encoded data obtained above, a preset mixer is used to generate video from the encoded data, resulting in a data file in a preset format. The preset mixer is the MUXER mixer, and the preset format data file is an MP4 file. For example, using the MUXER mixer to generate an MP4 file from H.264 encoded data involves: first, creating an MP4 file; then, initializing the video stream parameters of the H.264 encoded data (e.g., resolution and frame rate), writing these parameters into the header of the MP4 file; then, writing the H.264 encoded data frame by frame into the MP4 file; and finally, saving the MP4 file. This MP4 file is then used for subsequent data storage.

[0067] Step S200: Allocate memory pages in the preset DDR encoded memory to obtain contiguous memory pages, and lock the contiguous memory pages in the DDR encoded memory so that the data file has exclusive access to the contiguous memory pages.

[0068] In one embodiment, an ION memory allocator can be used to allocate memory for DDR encoded memory, and large page memory can be reserved in a preset DDR encoded memory. This embodiment uses reserved large page memory; for example, 20 large pages are reserved, each large page being 2MB in size. The aforementioned large pages are partitioned into contiguous memory spaces within the DDR encoded memory for allocation, resulting in contiguous memory pages. These contiguous memory pages reduce memory fragmentation and improve memory access efficiency. The preset DDR (Double Data Rate) encoded memory does not refer to a single storage technology or device, but rather a series of encoding, transmission, and storage mechanisms related to DDR memory. DDR memory achieves double the data transmission rate by transmitting data on both the rising and falling edges of the clock signal. By employing DDR encoded memory, data can be encoded and written to memory via hardware channels, enabling real-time processing of the data stream and providing high read / write speeds.

[0069] In one embodiment, locking contiguous memory pages in DDR encoded memory can be achieved using the MLOCK system call, ensuring that the data file has exclusive access to the contiguous memory pages. Alternatively, dynamic alternating locking can be used to lock contiguous memory pages in DDR encoded memory, ensuring that the data file has exclusive access to the contiguous memory pages.

[0070] like Figure 2 As shown, locking contiguous memory pages in DDR encoded memory includes, but is not limited to, the following steps:

[0071] Step S210: Divide the contiguous memory pages into buffers to obtain a first buffer and a second buffer.

[0072] In some possible embodiments of this application, contiguous memory pages are divided into a buffer according to a preset ratio to obtain a first buffer and a second buffer. The preset ratio can be 5:5 or 6:4. When the preset ratio is 6:4, the first buffer occupies 60% and the second buffer occupies 40%, or alternatively, the first buffer occupies 40% and the second buffer occupies 60%. Since data file writing is typically prioritized in the first buffer, when the preset ratio is 6:4, the first buffer occupies 60% and the second buffer occupies 40%. This buffer division facilitates subsequent alternating locking.

[0073] In other possible embodiments of this application, the first buffer is further divided according to a preset segmentation ratio, dividing it into a core region lock, a transition region lock, and an edge region lock. The second buffer is also divided according to a preset segmentation ratio, dividing it into an edge region lock, a transition region lock, and a core region lock, with the division areas of the first and second buffers being opposite. The preset segmentation ratio is the golden ratio of 0.618. For example, the proportions of the first buffer are core region lock (61.8%), transition region lock (23.6%), and edge region lock (14.6%), while the proportions of the second buffer are edge region lock (14.6%), transition region lock (23.6%), and core region lock (61.8%). This division of the first and second buffers facilitates subsequent alternating locking.

[0074] Step S220: Initialize the Fibonacci sequence according to the first buffer, map the Fibonacci sequence to the preset locking level to obtain the first locking sequence corresponding to the first buffer, and perform phase shift on the first locking sequence corresponding to the first buffer to obtain the second locking sequence corresponding to the second buffer.

[0075] In some possible embodiments of this application, a Fibonacci sequence is initialized based on the first buffer. For example, the sequence length is set to 16, and the sequence is initially initialized to [0, 1]. If the length is less than the sequence length, the value at the current position in the sequence is the sum of the value at the previous position and the values ​​at the two previous positions, resulting in the initialized Fibonacci sequence. Then, the Fibonacci sequence is mapped to a preset locking level. The preset locking level is divided into 8 levels. The values ​​in the Fibonacci sequence are moduloed by the locking level to obtain the locking level corresponding to the Fibonacci sequence, thereby obtaining the first locking sequence corresponding to the first buffer.

[0076] Then, a phase shift is performed on the first locking sequence corresponding to the first buffer. Specifically, the first locking sequence is subjected to a golden ratio phase shift to obtain the second locking sequence corresponding to the second buffer. The formula for calculating the golden ratio phase shift is:

[0077] phi=int(len(fid_mod)*0.618), buf2_seq=fib_mod[phi:]+fid_mod[:phi]

[0078] Where fid_mod represents the first locking sequence, buf2_seq represents the second locking sequence, 0.618 is the golden ratio parameter, len() is the length function, int() is the integer function, and phi is the position parameter.

[0079] In the above formula, 0.618 is the golden ratio parameter, which provides a better segmentation method for sequence segmentation and optimizes the calculation of the Fibonacci sequence. Specifically, after calculating the length and rounding, a portion of the data is truncated to obtain phi. phi is used as the segmentation sequence index. Then, a first locked sequence slice is spliced ​​from the sequence index using sequence slicing. The first locked sequence is then cyclically shifted or rotated to obtain the second locked sequence. This allows for subsequent waveform adjustment based on the first and second locked sequences, achieving cross-locked memory.

[0080] Step S230: Perform misaligned waveform locking adjustment on the first locking sequence and the second locking sequence to obtain the adjusted first locking sequence corresponding to the first buffer and the adjusted second locking sequence corresponding to the second buffer.

[0081] In one embodiment, a staggered waveform locking adjustment is performed on the first locking sequence and the second locking sequence to obtain the adjusted first locking sequence corresponding to the first buffer and the adjusted second locking sequence corresponding to the second buffer. This includes, but is not limited to: obtaining the write rate of the data file; adding a preset first parameter to the write rate and then multiplying it by a preset second parameter to obtain the adjustment wavelength; setting the second locking sequence to lag behind the first locking sequence by a preset phase difference to obtain the adjusted first locking sequence corresponding to the first buffer and the adjusted second locking sequence corresponding to the second buffer, wherein the phase difference is obtained according to the product of a preset golden ratio and the adjustment wavelength.

[0082] In some possible embodiments of this application, the write rate of the data file is determined based on the video data generated by the vehicle system. A larger volume of video data generates a larger volume of data to write, necessitating adjustments to the sequence length to allow for the writing of more data. Specifically, the increased write rate is calculated based on the increased volume of data to be written. This is achieved by calculating the write speed using the ratio of the generated video data size to the average processing time, and then comparing the write speeds at different stages to obtain the write rate. This write rate is then used to prepare for subsequent calculations to adjust the wavelength.

[0083] The write rate is then added to a preset first parameter to obtain an intermediate value. This preset first parameter is set by professionals based on experience and can be 1, 0.8, etc. The write rate is adjusted using this first parameter to adjust the sequence length based on the amount of data written, thereby adjusting the wavelength. The higher the write rate, the larger the first parameter setting, the larger the adjusted intermediate value, resulting in a longer wavelength. The intermediate value is then multiplied by a preset second parameter to obtain the adjusted wavelength. This second parameter is also set by professionals based on experience and can be 100ms. Over time, the locking level varies for different regions within the first and second buffers. The lengths of the first and second locking sequences are adjusted according to the size of the data file to enable fast writing and prevent data file accumulation.

[0084] Specifically, the phase difference is obtained by multiplying a preset golden ratio by the adjustment wavelength. The preset golden ratio is 0.618. Multiplying 0.618 by the adjustment wavelength yields the phase difference. Then, the first locking sequence is multiplied by the phase difference to obtain the adjusted second locking sequence. The first locking sequence is then extended using the initial Fibonacci sequence method described above to obtain the adjusted first locking sequence. Through this dynamic adjustment, adaptive wavelength adjustment and golden ratio phase difference control can be achieved, realizing intelligent optimization of the dual-buffer locking strategy, ensuring that the dual buffers always operate complementaryly, and reducing memory conflicts.

[0085] Step S240: Lock the DDR encoded memory according to the adjusted first locking sequence and the adjusted second locking sequence.

[0086] In some possible embodiments of this application, the adjusted first locking sequence corresponds to the first buffer of the DDR encoded memory. When data is written to the first buffer, different regions of the first buffer are written according to the locking strength corresponding to the first locking sequence. The adjusted second locking sequence corresponds to the second buffer in the DDR encoded memory. When data is written to the second buffer, different regions of the second buffer are written according to the locking strength corresponding to the second locking sequence. By using the different locking strengths of the adjusted first and second locking sequences, different regions are locked for storage.

[0087] It should be noted that a dual-buffered locking mechanism is used for DDR encoded memory. During data file storage, the urgency of the data file write is first determined. If the urgency is high, the data file is written to the core area of ​​the first buffer. If the urgency is moderate, the data file is written to the transition area of ​​the second buffer. If the urgency is low, the data file is written to the edge area of ​​either the first or second buffer. By writing data to different areas of different transition areas based on its urgency, the system exhibits strong anti-interference capabilities and can dynamically adapt to the writing of different types of data files. The urgency determination can be based on the data file type, setting an urgency level corresponding to the file type. For example, a level of 1 is used for ordinary video download and playback, while a level of 7 is used for emergency recording triggered by a dashcam in a car accident. A higher level indicates higher urgency, allowing for corresponding writing to different buffers. This urgency level corresponds to the locking strength in the first and second locking sequences.

[0088] Step S300: Divide and mark the contiguous memory pages to obtain multiple key memory pages and bitmap markers corresponding to each key memory page, wherein each key memory page is used to store data files.

[0089] In one embodiment, critical memory pages are used to store data files. The size of a critical memory page can be 256KB, and the size of a contiguous memory page is 2MB. The contiguous memory pages are divided into multiple levels to obtain multiple critical memory pages. These critical memory pages facilitate the reading, writing, and releasing of data files, enabling real-time data storage. Each critical memory page is marked to obtain a corresponding bitmap marker. This bitmap marker is used to manage the divided memory pages and can mark the location of the critical memory page, whether it is in an idle state, and the memory page being written to. This allows for efficient memory management and facilitates the reading, writing, and releasing of data files.

[0090] like Figure 3As shown, contiguous memory pages are divided and marked to obtain multiple critical memory pages and their corresponding bitmap labels, including but not limited to the following steps:

[0091] Step S310: Divide the contiguous memory pages into buffers to obtain a first buffer and a second buffer.

[0092] In some possible embodiments of this application, contiguous memory pages are divided into a buffer according to a preset ratio to obtain a first buffer and a second buffer. The preset ratio can be 5:5 or 6:4. When the preset ratio is 6:4, the first buffer occupies 60% and the second buffer occupies 40%, or alternatively, the first buffer occupies 40% and the second buffer occupies 60%. Since data file writing is typically prioritized in the first buffer, when the preset ratio is 6:4, the first buffer occupies 60% and the second buffer occupies 40%. This buffer division facilitates subsequent alternating locking.

[0093] Step S320: The first buffer and the second buffer are divided into fixed pages to obtain multiple critical memory pages.

[0094] In some possible embodiments of this application, a fixed-page partition is performed on the first buffer to obtain multiple critical memory pages in the first buffer, and a fixed-page partition is performed on the second buffer to obtain multiple critical memory pages in the second buffer. The fixed-page partitioning method involves evenly distributing the first buffer. For example, if one contiguous memory page is 2MB in size, and the preset ratio of the first and second buffers is 5:5 (i.e., the contiguous memory page is divided into two equal parts), then the size of the first buffer is 1MB, and the size of the critical memory page is 256KB. Therefore, the first buffer is divided into four equal parts, resulting in four critical memory pages in the first buffer. Similarly, the second buffer is equally distributed in a four-part division, resulting in four critical memory pages in the second buffer. This allocation yields multiple critical memory pages, which facilitate the writing, reading, and releasing of data files, improving storage efficiency.

[0095] It should be noted that when the preset ratio of the first buffer to the second buffer is 6:4, the fixed allocation method for the first and second buffers differs. The goal is to ensure that multiple critical memory pages are of the same size, and the number of critical memory pages in the first buffer can be greater than the number of critical memory pages in the second buffer. When the preset ratio is other, the allocation is still performed in the same way, which will not be elaborated here.

[0096] Step S330: Establish a dynamic window mapping for the first buffer to obtain the mapping window corresponding to the first buffer.

[0097] In some possible embodiments of this application, a mapping window is initialized. The size of the mapping window can be the same as the size of the first buffer or the size of the critical memory page. If the size of the mapping window is the same as the size of the first buffer, a dynamic window mapping is established for the first buffer, that is, a correspondence is established between the first buffer and the mapping window. All critical memory pages in the first buffer are bound to the mapping window so that data files can be written to the critical memory pages subsequently through the mapping window.

[0098] It should be noted that, when the size of the mapping window is the same as that of the critical memory page, a dynamic window mapping is established for the first buffer. That is, a correspondence is established between each critical memory page in the first buffer and a mapping window. The number of mapping windows is the same as the number of critical memory pages, so that data files can be written to the critical memory pages through the mapping windows later.

[0099] Step S340: Mark each critical memory page to obtain the bitmap marker corresponding to each critical memory page, and establish the association between the bitmap marker and the mapping window. The bitmap marker is used to indicate whether the critical memory page belongs to the first buffer or the second buffer, and whether a data file is stored.

[0100] In some possible embodiments of this application, based on the correspondence between the multiple key memory pages obtained in step S320 and the mapping window established in step S330, each key memory page is marked to obtain a bitmap marker corresponding to each key memory page. Specifically, in the initial allocation state, the marker of each key memory page is set to 0, indicating that no data file is stored in the key memory page; when a key memory page stores a data file, the marker corresponding to that key memory page is set to 1, indicating that a data file is stored in the key memory page; when a data file stored in a key memory page is released, the marker corresponding to that key memory page is set to 0.

[0101] The bitmap markers contain multiple distinct bits to indicate different relationships, enabling memory management. These bits indicate whether a critical memory page belongs to a first or second buffer, whether a data file is stored within the critical memory page, and its position within the first or second buffer. An association is established between the bitmap markers and the mapping window, showing the correspondence between critical memory pages and mapping windows. Bits in the bitmap markers indicate the mapping between a critical memory page and a mapping window. When multiple mapping windows exist, the bits in the bitmap markers indicate a one-to-one mapping relationship. When there is only one mapping window, the bits in the bitmap markers indicate that all critical memory pages in the first buffer are set to the same value in the mapping window, indicating that they are mapped to the same window. The mapping relationship for the second buffer is similar to that for the first buffer and will not be elaborated further. Memory management using bitmap markers enables efficient memory management, allowing for real-time storage, retrieval, and release of memory.

[0102] Step S400: Determine whether a mobile storage device is connected so that the data files in the DDR encoded memory can be transferred to the mobile storage device. If no mobile storage device is connected, determine whether there is any remaining space in the DDR encoded memory.

[0103] In one embodiment, the system checks if a device is connected to the configured interface to determine if a mobile storage device is connected. This allows data files in the DDR encoded memory to be transferred to the mobile storage device, which can be a USB flash drive, a TF card, etc. Checking for a mobile storage device ensures sufficient space for data file storage and prevents data loss. If no mobile storage device is connected, it indicates that only the DDR encoded memory can be used for data file storage. The system then checks if there is remaining space in the DDR encoded memory. Specifically, it checks the bitmap markers for bits marked 0. If a bit is marked 0, there is remaining space; if all bitmap markers are 1, there is no remaining space in the DDR encoded memory. This check of remaining space in the DDR encoded memory helps determine if there is enough space to store the data file and whether memory release is necessary.

[0104] like Figure 4 As shown, after determining whether a mobile storage device is connected, the data storage method of the vehicle-mounted built-in DVR also includes, but is not limited to, the following steps:

[0105] In step S600, when a mobile storage device is connected and the DDR encoded memory has no remaining space, the data file in the first buffer is copied to the mobile storage device, and a file with the same name is deleted from the first buffer. The file with the same name has the same filename as the data file.

[0106] In one embodiment, when a mobile storage device is connected and the DDR encoded memory has no remaining space, it indicates that the DDR encoded memory can no longer store data files. The memory of the DDR encoded memory is then released, and the data files are transferred to the mobile storage device to prevent data loss. Specifically, the memory release process involves copying the data files from the first buffer to the mobile storage device. This copying and moving operation can be implemented using a copy function, such as `copy()`. Additionally, files with the same name as the data files are deleted from the first buffer. After deletion, the first buffer has remaining space to store the data files, enabling real-time data storage and improving storage efficiency.

[0107] In step S700, the mapping relationship between the second buffer and the mapping window is released, the first buffer is mapped to the mapping window, and the data file is written to the critical memory page of the first buffer.

[0108] In one embodiment, when there is no remaining space in the DDR encoded memory, indicating that both the first and second buffers have stored data files, the data files in the DDR encoded memory are transferred to the removable storage device. Step S600 releases the data in the first buffer and removes the mapping relationship between the second buffer and the mapping window. Specifically, the corresponding bit in the bitmap marker for the second buffer is modified to set the second buffer and the mapping window to have no mapping relationship. The first buffer is then mapped to the mapping window, meaning the corresponding bit in the bitmap marker for the first buffer is modified to set a mapping relationship. This allows data files to be written to the free critical memory pages of the first buffer. By writing the data files to the DDR encoded memory instead of directly to the removable storage device, interaction with the CPU is reduced, resource consumption is reduced, and storage efficiency is improved.

[0109] In another embodiment, when a mobile storage device is connected and the DDR encoded memory has remaining space, it indicates that the data file can be directly stored in the DDR encoded memory. The system determines whether there are free critical memory pages in the first buffer by querying the bitmap marker corresponding to the first buffer. If there are free critical memory pages in the first buffer, the data file is written to the critical memory pages of the first buffer. When the data volume in the first buffer reaches a preset data threshold, the mapping relationship between the first buffer and the mapping window is released, and the second buffer is mapped to the mapping window. The data file is then written to the critical memory pages of the second buffer. The process of unmapping the window is similar to the above and will not be elaborated here. When the DDR encoded memory is full of data, the data file is moved to the mobile storage device to release the DDR encoded memory and prevent data loss.

[0110] In step S500, if there is remaining space in the DDR encoded memory, the data file is stored in the critical memory page according to the bitmap markings.

[0111] In one embodiment, if there is remaining space in the DDR encoded memory, it indicates that the data file can be directly stored in the DDR encoded memory, and the data file is stored in the critical memory page according to the bitmap marking.

[0112] Specifically, based on the bitmap markers, the data file is stored in the critical memory page, including but not limited to: based on the bitmap markers, finding the corresponding mapping window in the association relationship, determining the first buffer corresponding to the mapping window; writing the data file into the critical memory page of the first buffer; when the data volume in the first buffer reaches a preset data threshold, removing the mapping relationship between the first buffer and the mapping window, mapping the second buffer to the mapping window, and writing the data file into the critical memory page of the second buffer.

[0113] In some possible embodiments of this application, the bit in the bitmap marker corresponding to the association with the mapping window is searched to determine the buffer corresponding to the mapping window. The corresponding mapping window in the association is identified as the first buffer. Data files are written to the free critical memory pages of the first buffer. The free critical memory pages can be determined by the bitmap marker, which will not be elaborated here. When the data volume in the first buffer reaches a preset data threshold, it indicates that the first buffer can no longer write data files. The mapping relationship between the first buffer and the mapping window is released, and the second buffer is mapped to the mapping window. Data files are written to the critical memory pages of the second buffer. The process of unmapping the window is similar to the above and will not be elaborated here.

[0114] In some other possible embodiments of this application, when no mobile storage device is connected and the DDR encoded memory has no remaining space, it indicates that there is no storage space left for data file storage, and the data files in the DDR encoded memory cannot be transferred to the mobile storage device. Therefore, memory release of the DDR encoded memory is required. By searching the bitmap marker, it is checked whether the associated data file with the mapping window is the first buffer. If it is the first buffer, since the memory space of the first buffer needs to be released, the mapping relationship between the first buffer and the mapping window is first broken, and the second buffer is mapped to the mapping window. Data files in the first buffer are deleted, starting from the earliest data file stored in the first buffer. After deletion, the first buffer is mapped back to the mapping window, and data files are written. The process is repeated: it is checked whether the associated data file with the mapping window is the first buffer. If it is the second buffer, the data files in the first buffer are deleted, starting from the earliest data file stored in the first buffer. After deletion, the mapping relationship between the second buffer and the mapping window is broken, and the first buffer is mapped back to the mapping window, and data files are written. Through the above process, real-time storage of data files can be achieved, improving storage efficiency.

[0115] like Figure 5As shown, this application embodiment provides a data storage device 100 for an in-vehicle built-in DVR. This in-vehicle built-in DVR data storage device 100 acquires DVR data through a data acquisition and processing module 110, providing a data foundation for subsequent data storage. It preprocesses the DVR data to generate a data file in a preset format, converting the DVR data into data conforming to a storage format. This ensures data integrity and consistency, removes noise and invalid data, improves data quality, and reduces memory space usage. A first memory processing module 120 allocates memory pages to a preset DDR encoded memory to obtain contiguous memory pages. Using DDR encoded memory allows data to be encoded and written to memory via a hardware channel, enabling real-time data stream processing with high read / write speeds. Allocating contiguous memory pages reduces memory fragmentation and improves memory access efficiency. Locking contiguous memory pages in the DDR encoded memory ensures that the data file exclusively occupies the contiguous memory pages, guaranteeing data file integrity. The storage process is not interfered with by other processes or threads, improving data read and write efficiency. The second memory processing module 130 divides and marks contiguous memory pages, obtaining multiple key memory pages and corresponding bitmap markers for each key memory page. This enables efficient memory management, facilitating the reading, writing, and releasing of data files. Each key memory page is used to store data files. A judgment module 140 determines whether a removable storage device is connected, allowing data files in the DDR encoded memory to be transferred to the removable storage device. If no removable storage device is connected, it checks if there is remaining space in the DDR encoded memory to ensure data has storage space, preventing data loss and storage failure. When there is remaining space in the DDR encoded memory, the data storage module 150 stores the data files in the key memory pages according to the bitmap markers. Management through bitmap markers ensures data is accurately written to the allocated memory pages, improving storage efficiency. By using DDR encoded memory, real-time data writing is achieved, and memory locking and bitmap marker management improve data storage efficiency.

[0116] It should be noted that the data acquisition and processing module 110 is connected to the first memory processing module 120, the first memory processing module 120 is connected to the second memory processing module 130, the second memory processing module 130 is connected to the judgment module 140, and the judgment module 140 is connected to the data storage module 150. The above-mentioned data storage method for an in-vehicle built-in DVR is applied to the data storage device 100 of the in-vehicle built-in DVR. The data storage device 100 acquires DVR data to provide a data foundation for subsequent data storage, performs data preprocessing on the DVR data to generate a data file in a preset format, and converts the DVR data into data conforming to the storage format. This ensures data integrity and consistency, removes noise and invalid data, improves data quality, and reduces memory space usage. Then, memory pages are allocated to the preset DDR encoded memory to obtain contiguous memory pages. Using DDR encoded memory allows data to be encoded and written to memory through hardware channels, enabling real-time processing of the data stream and providing a high read / write speed. Allocating contiguous memory pages reduces memory fragmentation and improves memory access efficiency. Locking the contiguous memory pages in the DDR encoded memory ensures that the data file exclusively occupies the contiguous memory pages. This process ensures that data files are not interfered with by other processes or threads during storage, improving data read and write efficiency. Then, contiguous memory pages are divided and marked to obtain multiple key memory pages and corresponding bitmap markers for each key memory page. This enables efficient memory management, facilitating the reading, writing, and release of data files. Each key memory page is used to store the data file. The system determines whether a removable storage device is connected, allowing data files in the DDR encoded memory to be transferred to the removable storage device. If no removable storage device is connected, it checks if there is remaining space in the DDR encoded memory to ensure that data has storage space and avoids data loss and storage failure. If there is remaining space in the DDR encoded memory, the data file is stored in the key memory pages according to the bitmap markers. Management through bitmap markers ensures that data is accurately written to the allocated memory pages, improving storage efficiency. By using DDR encoded memory, real-time data writing can be achieved, and memory locking and bitmap marker management improve data storage efficiency.

[0117] It should also be noted that the apparatus provided in the above embodiments is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. In addition, the apparatus and method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process can be found in the method embodiments, which will not be repeated here.

[0118] This application also discloses an electronic device. (See reference...) Figure 6, Figure 6 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application. The electronic device 500 may include: at least one processor 501, at least one network interface 504, a user interface 503, a memory 505, and at least one communication bus 502.

[0119] The communication bus 502 is used to enable communication between these components.

[0120] The user interface 503 may include a display screen and a camera. Optionally, the user interface 503 may also include a standard wired interface and a wireless interface.

[0121] The network interface 504 may optionally include a standard wired interface or a wireless interface (such as a Wi-Fi interface).

[0122] The processor 501 may include one or more processing cores. The processor 501 connects to various parts of the server using various interfaces and lines, and performs various server functions and processes data by running or executing instructions, programs, code sets, or instruction sets stored in memory 505, and by calling data stored in memory 505. Optionally, the processor 501 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 501 may integrate one or a combination of several of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the content to be displayed on the screen; and the modem handles wireless communication. It is understood that the modem may also not be integrated into the processor 501 and may be implemented as a separate chip.

[0123] The memory 505 may include random access memory (RAM) or read-only memory. Optionally, the memory 505 may include a non-transitory computer-readable storage medium. The memory 505 may be used to store instructions, programs, code, code sets, or instruction sets. The memory 505 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as touch function, sound playback function, image playback function, etc.), instructions for implementing the above-described method embodiments, etc.; the data storage area may store data involved in the above-described method embodiments, etc. Optionally, the memory 505 may also be at least one storage device located remotely from the aforementioned processor 501. (Refer to...) Figure 6 The memory 505, which serves as a computer storage medium, may include an operating system, a network communication module, a user interface module, and an application program for a data storage method of an in-vehicle built-in DVR.

[0124] exist Figure 6 In the illustrated electronic device 500, the user interface 503 is mainly used to provide an input interface for the user and to acquire user input data; while the processor 501 can be used to call an application program stored in the memory 505 for a data storage method of an in-vehicle built-in DVR. When executed by one or more processors 501, the electronic device 500 performs one or more methods as described in the above embodiments. It should be noted that, for the foregoing method embodiments, for the sake of simplicity, they are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, because according to this application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0125] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0126] In the various embodiments provided in this application, it should be understood that the disclosed apparatus can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some service interface; the indirect coupling or communication connection between apparatuses or units may be electrical or other forms.

[0127] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0128] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0129] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage device (CMD). Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned memory includes various media capable of storing program code, such as USB flash drives, portable hard drives, magnetic disks, or optical disks.

[0130] The above are merely exemplary embodiments of this disclosure and should not be construed as limiting the scope of this disclosure. Any equivalent changes and modifications made in accordance with the teachings of this disclosure shall still fall within the scope of this disclosure. Other embodiments of this disclosure will readily conceive of those skilled in the art upon consideration of the specification and the disclosure of practical truths.

[0131] This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not described in this disclosure. The specification and embodiments are to be considered exemplary only, and the scope and spirit of this disclosure are defined by the claims.

Claims

1. A data storage method for a vehicle-mounted built-in DVR, characterized in that, The method comprises: acquiring DVR data, data preprocessing the DVR data, and generating a data file in a preset format; allocating memory pages to a preset DDR encoding memory to obtain continuous memory pages, locking the continuous memory pages in the DDR encoding memory, so that the data file exclusively occupies the continuous memory pages; dividing and marking the continuous memory pages to obtain a plurality of key memory pages and bitmap markers corresponding to each key memory page, wherein each key memory page is used to store the data file; determining whether a mobile storage device is connected, so as to transfer the data file in the DDR encoding memory to the mobile storage device, and determining whether the DDR encoding memory has remaining space in the case where the mobile storage device is not connected; in the case where the DDR encoding memory has remaining space, storing the data file into the key memory pages according to the bitmap markers.

2. The method of claim 1, wherein, The dividing and marking of the continuous memory pages to obtain a plurality of key memory pages and bitmap markers corresponding to each key memory page comprises: buffering the continuous memory pages to obtain a first buffer area and a second buffer area; fixed page dividing the first buffer area and the second buffer area respectively to obtain a plurality of key memory pages; establishing a dynamic window mapping for the first buffer area to obtain a mapping window corresponding to the first buffer area; marking each key memory page to obtain a bitmap marker corresponding to each key memory page, and establishing an association between the bitmap marker and the mapping window, wherein the bitmap marker is used to indicate the first buffer area or the second buffer area to which the key memory page belongs, and whether the data file is stored.

3. The method of claim 2, wherein, The storing of the data file into the key memory pages according to the bitmap markers comprises: finding the corresponding mapping window in the association according to the bitmap marker, to determine the first buffer area corresponding to the mapping window; writing the data file into the key memory pages of the first buffer area, and in the case where the data amount of the first buffer area reaches a preset data threshold, canceling the mapping relationship between the first buffer area and the mapping window, mapping the second buffer area to the mapping window, and writing the data file into the key memory pages of the second buffer area.

4. The method of claim 2, wherein, After determining whether the mobile storage device is connected, the method further comprises: in the case where the mobile storage device is connected and the DDR encoding memory does not have remaining space, copying the data file in the first buffer area to the mobile storage device, and deleting a same-name file in the first buffer area, the same-name file having the same file name as the data file; canceling the mapping relationship between the second buffer area and the mapping window, mapping the first buffer area to the mapping window, and writing the data file into the key memory pages of the first buffer area.

5. The method of claim 1, wherein, The locking of the continuous memory pages in the DDR encoding memory comprises: Buffer the continuous memory page to obtain a first buffer and a second buffer; Initialize a Fibonacci sequence according to the first buffer, map the Fibonacci sequence to a preset lock level to obtain a first lock sequence corresponding to the first buffer, and perform phase offset on the first lock sequence corresponding to the first buffer to obtain a second lock sequence corresponding to the second buffer; Perform staggered waveform lock adjustment on the first lock sequence and the second lock sequence to obtain an adjusted first lock sequence corresponding to the first buffer and an adjusted second lock sequence corresponding to the second buffer; Lock the DDR encoded memory according to the adjusted first lock sequence and the adjusted second lock sequence.

6. The method of claim 5, wherein, The method further includes: Obtaining a write rate of the data file; Adding a preset first parameter to the write rate and multiplying the result by a preset second parameter to obtain an adjustment wavelength; Setting the second lock sequence to lag the first lock sequence by a preset phase difference to obtain the adjusted first lock sequence corresponding to the first buffer and the adjusted second lock sequence corresponding to the second buffer, wherein the phase difference is obtained according to a product of a preset golden ratio and the adjustment wavelength.

7. The method of claim 1, wherein, The method further includes: Converting the DVR data into NV21 format data; Encoding the NV21 format data using a preset encoder to obtain encoded data; Generating a preset format data file by performing video generation on the encoded data using a preset mixer.

8. A data storage device for a vehicle mounted DVR, characterized by, The apparatus includes: A data acquisition and processing module (110) configured to acquire DVR data, pre-process the DVR data, and generate a preset format data file; A first memory processing module (120) configured to allocate a memory page to a preset DDR encoded memory to obtain a continuous memory page, and lock the continuous memory page in the DDR encoded memory to enable the data file to exclusively use the continuous memory page; A second memory processing module (130) configured to divide and mark the continuous memory page to obtain a plurality of key memory pages and a bitmap mark corresponding to each key memory page, wherein each key memory page is configured to store the data file; A judging module (140) configured to judge whether a mobile storage device is connected, to enable the data file in the DDR encoded memory to be transferred to the mobile storage device, and to judge whether the DDR encoded memory has a remaining space in the case that the mobile storage device is not connected; A data storage module (150) configured to store the data file into the key memory pages according to the bitmap mark in the case that the DDR encoded memory has a remaining space.

9. An electronic device, comprising: The electronic device (500) comprises a processor (501), a memory (505), a user interface (503), a communication bus (502) and a network interface (504), the processor (501), the memory (505), the user interface (503) and the network interface (504) are connected with the communication bus (502) respectively, the memory (505) is used for storing instructions, the user interface (503) and the network interface (504) are used for communicating with other devices, and the processor (501) is used for executing the instructions stored in the memory (505) to make the electronic device (500) execute the method in any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores instructions, when the instructions are executed, the method in any one of claims 1-7 is executed.

Citation Information

Patent Citations

  • Data storage method and device

    CN104281528A

  • Data recording device and method, data reproduction device and method, information recording medium, program-containing medium, and program

    CN1515009A