A Method for Optimizing the High-Speed Cache and Intelligent Storage Management of a Dash Cam

By setting storage priority for driving data of driving recorders and selectively storing and deleting them according to the priority, the problem of limited storage space of driving recorders and not effectively considered data importance is solved, and more efficient storage management and data protection is achieved.

CN119166054BActive Publication Date: 2025-05-27SHENZHEN ZHONGKE XIANCHUANG TRADING CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411198011.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-29
Publication Date
2025-05-27
Estimated Expiration
2044-08-29

AI Technical Summary

Technical Problem

The storage space of dash recorders is limited, and the existing storage management methods fail to effectively consider the importance of data, resulting in important data being overwritten or deleted, and the data reading and writing efficiency is low, affecting the integrity and reliability of the data.

Method used

The driving recorder cache optimization and intelligent storage management method are adopted. By dividing driving data into different priorities, identifying the exception event time period to update the priority, and selectively storing and deleting according to the priority, compressing non-important data, and migrating important data to more persistent memory.

Benefits of technology

Ensure that important data is saved, reduce the excessive storage space occupied by non-important data, optimize overall storage efficiency, enhance the driving recorder's ability to record accidents and maintain evidence, and ensure the durability of important data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119166054B_ABST
    Figure CN119166054B_ABST
Patent Text Reader

Abstract

The object of the present invention is to provide a method for optimizing the high-speed cache and intelligent storage management of a driving recorder, which relates to the technical field of data processing. The method includes the steps of: collecting driving data and dividing the driving data into a first data resource group and a second data resource group; presetting the storage priorities of the driving data; the storage priorities include a first storage priority, a second storage priority, and a third storage priority; storing the driving data in a second memory; identifying an abnormal event time period according to the second data resource group and updating the storage priorities of the driving data within the abnormal event time period; when a preset condition is reached, deleting or migrating the second data resource group in the second memory to the first memory according to the storage priorities of the driving data. This application ensures that important data can be preserved, reduces the excessive storage space occupied by unimportant data, thereby optimizing the overall storage efficiency, and enhancing the accident recording and evidence preservation capabilities of the driving recorder.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and particularly relates to a method for optimizing the high-speed cache and intelligent storage management of a driving recorder. Background Art

[0002] As an important device for modern vehicles, a driving recorder performs multiple key functions, such as real-time recording of driving videos, collection and analysis of driving data, and recording and preservation of detailed information on emergencies. These features make the driving recorder an indispensable tool for vehicle owners to ensure driving safety, record accident evidence, and monitor driving behavior.

[0003] However, with the continuous increase in driving data volume, the storage space of the driving recorder is limited. With the widespread application of high-resolution videos, the required storage space has expanded rapidly. The existing storage management methods generally manage the stored data in a FIFO (First In First Out) manner without considering the importance of the data, resulting in some important data being possibly overwritten or deleted. In addition, the problem of data read and write efficiency also makes the driving recorder unable to store information in a timely and accurate manner at critical moments, which easily affects the integrity and reliability of the data. Summary of the Invention

[0004] The present invention provides a method for optimizing the high-speed cache and intelligent storage management of a driving recorder to solve at least one of the problems mentioned in the above background art.

[0005] The specific technical solutions provided by this application are as follows:

[0006] A method for optimizing the high-speed cache and intelligent storage management of a driving recorder, comprising the steps of:

[0007] Collect driving data, and divide the driving data into a first data resource group and a second data resource group; preset the storage priorities of the driving data; the storage priorities include a first storage priority, a second storage priority, and a third storage priority;

[0008] Store the driving data in a second memory; identify an abnormal event time period according to the second data resource group, and update the storage priorities of the driving data within the abnormal event time period;

[0009] When a preset condition is reached, delete or migrate the second data resource group in the second memory to the first memory according to the storage priorities of the driving data;

[0010] The step of deleting or migrating the second data resource group in the second memory to the first memory according to the storage priorities of the driving data includes the steps of:

[0011] Delete the driving data with the third storage priority;

[0012] Store the driving data with the second storage priority into the first memory after compression processing;

[0013] Migrate the driving data with the first storage priority to the first memory;

[0014] The step of storing the driving data with the second storage priority into the first memory after compression processing includes the steps of:

[0015] Collect a subset of audio data according to a preset sampling rate to obtain audio time series data;

[0016] Perform framing and pre-emphasis processing on the audio time series data to obtain audio data frames;

[0017] Calculate the frame energy of each audio data frame, and divide the audio data frames into first speech frames or first silence frames by comparing a preset energy threshold and the frame energy;

[0018] Classify the first speech frames into second speech frames or second silence frames through an audio classification model; the input of the audio classification model is a multi-dimensional feature vector of the first speech frames, including Mel spectrum, Mel frequency cepstral coefficients, frame energy, and zero-crossing rate;

[0019] Concatenate a plurality of second speech frames into a compressed audio data file and store it in the first memory.

[0020] Preferably, the step of dividing the driving data into a first data resource group and a second data resource group includes the steps of:

[0021] Determine the data source of the driving data, and divide the driving data into several subsets of driving data according to the data source;

[0022] Evaluate the typical data volume of each subset of driving data;

[0023] Divide the driving data into a first data resource group or a second data resource group according to the typical data volume.

[0024] Preferably, the subsets of driving data include subsets of video data, subsets of audio data, subsets of location data, subsets of acceleration data, subsets of vehicle speed and rotation speed data, subsets of driving operation data, subsets of in-vehicle personnel status data, and battery status data;

[0025] The preset storage priorities of the driving data are specifically: set the storage priorities of the subsets of video data, subsets of audio data, subsets of location data, and subsets of vehicle speed and rotation speed data to the second storage priority; set the storage priorities of the subsets of acceleration data, subsets of driving operation data, subsets of in-vehicle personnel status data, and subsets of battery status data to the third storage priority.

[0026] Preferably, the step of identifying an abnormal event time period according to the second data resource group and updating the storage priority of driving data within the abnormal event time period includes the steps of:

[0027] Extracting the data features of the driving data of the second data resource group;

[0028] Inputting the data features into a rule engine model to identify abnormal events;

[0029] Recording the type, occurrence time and duration of each abnormal event to generate an abnormal event time period;

[0030] Setting the priority of all driving data within the abnormal event time period to the first storage priority.

[0031] Preferably, the first memory includes a first storage area and a second storage area; the step of deleting or migrating the second data resource group in the second memory to the first memory according to the storage priority of the driving data further includes the step of allocating the block capacities of the first storage area and the second storage area according to the difference in the actual usage capacity ratio between the first storage area and the second storage area.

[0032] Preferably, migrating the driving data with the first storage priority to the first memory specifically means: migrating the driving data with the first storage priority to the first memory according to the reserved I / O resources.

[0033] Preferably, the frame energy is expressed as:

[0034] The Mel spectrum is expressed as: S m = Σ k |X k | 2 H m (k);

[0035] The Mel frequency cepstral coefficient is expressed as:

[0036] The zero-crossing rate is expressed as:

[0037]

[0038] where x[i] represents the audio signal of the i-th sampling point in the audio data frame, N represents the number of sampling points in the audio data frame; S m represents the output of the m-th Mel filter; |X k | 2 represents the power spectrum of the k-th frequency component of the frequency domain signal; H mDenote the value of the m-th Mel filter at the frequency index k; k represents the frequency index, corresponding to the serial number of the frequency component after FFT transformation; M represents the number of Mel filters; C n Denote the value of the n-th Mel-frequency cepstral coefficient.

[0039] Preferably, the step of splicing a plurality of second speech frames into a compressed audio data file and storing it in the first memory includes the steps of:

[0040] Create an empty first buffer in the second memory;

[0041] Align each second speech frame according to the data timestamp in chronological order to obtain a compressed audio data file, and add the compressed audio data file to the first buffer;

[0042] When the data volume in the first buffer reaches a preset value, write the compressed audio data file in the first buffer to the first memory in batches and empty the first buffer.

[0043] Preferably, the step of storing the driving data with the second storage priority in the first memory after compression processing further includes the steps of:

[0044] Divide each video frame into a plurality of macroblocks of a fixed size;

[0045] Set the frame image to be compressed during the processing as the current frame, and the previous frame image of the current frame as the reference frame; for each macroblock in the current frame, set the center point position and step size of the search window;

[0046] Based on the center point position, obtain the matching errors of nine search points in the search window;

[0047] If the position of the search point with the smallest matching error is different from the center point position, update the center point position to the position of the search point with the smallest matching error, and return to the previous step; if the position of the search point with the smallest matching error is the same as the center point position, halve the step size, obtain the matching errors of nine search points in the search window, and output the position of the search point with the smallest matching error as the best matching position;

[0048] Calculate the motion vector based on the final matching point and the initial position, and generate a prediction frame according to the motion vector;

[0049] Perform differential encoding on each macroblock of the prediction frame and the current frame; differential encoding only records and compresses those small difference data that are not completely matched to reduce the data volume to be stored and transmitted;

[0050] Organize the motion vector and differential data of each macroblock into a compressed video data file and store it in the first memory.

[0051] Preferably, the step of organizing the motion vectors and differential data of each macroblock into a compressed video data file and storing it in the first memory specifically includes the following steps:

[0052] Create an empty second buffer in the second memory;

[0053] Align the motion vectors and differential data of each macroblock according to the timestamp and macroblock position to generate a compressed video data file;

[0054] When the amount of data in the second buffer reaches a preset value, batch-write the compressed video data file in the second buffer to the first memory and clear the second buffer.

[0055] The beneficial effects of the present invention are as follows:

[0056] In this application, by setting storage priorities for driving data and selectively storing and deleting according to the storage priorities, important data is ensured to be saved, reducing the excessive storage space occupied by unimportant data, thereby optimizing the overall storage efficiency and enhancing the accident recording and evidence preservation capabilities of the driving recorder. Among them, by deleting the data with the third storage priority, compressing the data with the second storage priority, and migrating the data with the first storage priority to the first memory, the storage space is effectively managed and utilized, ensuring that important data is more persistently saved.

[0057] In the embodiments of this application, by reserving a specific proportion of I / O resources for the first storage area, the I / O operation priorities and response speeds of its key tasks can be guaranteed. Even under high load conditions, it can ensure that the important data operations in the first storage area will not be overly delayed, ensuring the optimization and balance of the storage resources of this solution; in the actual operation process, it also includes setting the upper and lower limits of the block capacity ratio to prevent the capacity adjustment from exceeding a reasonable range. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] The accompanying drawings here are incorporated into the specification and form a part of this specification, indicating the embodiments that conform to the present invention and are used together with the specification to explain the principles of the present invention.

[0059] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the accompanying drawings required for the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0060] Figure 1 It is a flowchart of a method for optimizing the cache and intelligent storage management of a driving recorder according to an embodiment of the present invention;

[0061] Figure 2Schematic flow chart of identifying an abnormal event time period according to a second data resource group and updating the storage priority of driving data within the abnormal event time period according to an embodiment of the present invention;

[0062] Figure 3 Schematic flow chart of storing a subset of audio data with a second storage priority into a first memory after compression processing according to an embodiment of the present invention;

[0063] Figure 4 Schematic flow chart of storing a subset of video data with a second storage priority into a first memory after compression processing according to an embodiment of the present invention. Detailed implementation manners

[0064] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0065] It should be noted that all directional indications (such as up, down, left, right, front, back...) in the embodiments of the present invention are only used to explain the relative position relationship and movement conditions between components in a specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indications will also change accordingly.

[0066] In addition, the descriptions involving "first", "second", etc. in the present invention are only for descriptive purposes, and cannot be understood as indicating or implying their relative importance or implicitly indicating the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include at least one of such features. In addition, the technical solutions between various embodiments can be combined with each other, but it must be based on the fact that those of ordinary skill in the art can implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such a combination of technical solutions does not exist and is not within the protection scope required by the present invention.

[0067] Please refer to Figure 1 , a method for optimizing the high-speed cache and intelligent storage management of a driving recorder, including the steps of:

[0068] Collect driving data, and divide the driving data into a first data resource group and a second data resource group; preset the storage priority of the driving data; the storage priority includes a first storage priority, a second storage priority, and a third storage priority;

[0069] Store driving data in a second memory; identify an abnormal event time period according to a second data resource group, and update the storage priority of the driving data within the abnormal event time period;

[0070] When a preset condition is reached, delete or migrate the second data resource group in the second memory to the first memory according to the storage priority of the driving data;

[0071] The deleting or migrating the second data resource group in the second memory to the first memory according to the storage priority of the driving data includes the steps of:

[0072] Delete the driving data with the third storage priority;

[0073] After compressing the driving data with the second storage priority, store it in the first memory;

[0074] Migrate the driving data with the first storage priority to the first memory.

[0075] This application sets a storage priority for driving data, and performs selective storage and deletion according to the storage priority, ensuring that important data is saved, reducing the excessive storage space occupied by unimportant data, optimizing the overall storage efficiency, and enhancing the accident recording and evidence preservation capabilities of the driving recorder. And by deleting the data with the third storage priority, compressing the data with the second storage priority, and migrating the data with the first storage priority to the first memory, the storage space is effectively managed and utilized, ensuring that important data is saved more persistently.

[0076] Specifically, the following content is used to elaborate on each step of the method for optimizing the cache and intelligent storage management of the driving recorder of the present invention:

[0077] A method for optimizing the cache and intelligent storage management of a driving recorder includes the steps of:

[0078] S1. Collect driving data, and divide the driving data into a first data resource group and a second data resource group; preset the storage priority of the driving data; the storage priority includes a first storage priority, a second storage priority, and a third storage priority;

[0079] Among them, presetting the storage priority of the driving data includes evaluating the typical data volume, real-time performance, and storage period of each type of driving data. Among them, real-time performance refers to the necessity of the data being acquired and processed within a short time after generation, such as real-time monitoring data must be analyzed within a few seconds before and after an accident; storage period: refers to the length of time the data needs to be stored, such as some data may still need to be queried after several months.

[0080] Further, the dividing the driving data into a first data resource group and a second data resource group includes the steps of:

[0081] S11. Determine the data sources of driving data, and divide the driving data into several subsets of driving data according to the data sources;

[0082] The driving data is denoted as D = {D1, D2,..., DM}, where D1, D2,..., DM respectively represent the j-th subset of driving data, j = 1, 2,..., M, and M is the number of subsets of driving data.

[0083] S12. Evaluate the typical data volume of each subset of driving data; evaluating the typical data volume of each subset of driving data can clarify the data volume characteristics of different subsets of driving data.

[0084] S13. Divide the driving data into a first data resource group or a second data resource group according to the typical data volume; divide the driving data with a typical data volume greater than a preset threshold into the first data resource group; divide the driving data with a typical data volume less than the preset threshold into the second data resource group.

[0085] In one embodiment, the number M of subsets of driving data is 7, and the subsets of driving data include a video data subset D1, an audio data subset D2, a position data subset D3, an acceleration data subset D4, a vehicle speed and rotation speed data subset D5, a driving operation data subset D6, an in-vehicle personnel status data subset D7, and a battery status data D8. In this embodiment, the processor of the driving recorder acquires various types of driving data through multiple sensors and specific data acquisition devices. The acquisition of the driving data specifically includes the following steps:

[0086] Acquire the video data subset during driving through an in-vehicle camera; the video data subset includes front road video data, in-vehicle environment video data, etc.

[0087] Acquire the video data subset inside and outside the vehicle through an in-vehicle microphone; the video data subset includes engine sound, voice commands, road noise, etc.

[0088] Acquire the real-time position data of the vehicle through a GPS module to generate a position data subset; the position data subset includes longitude, latitude, and altitude data.

[0089] Acquire the acceleration data subset through several acceleration sensors (such as a three-axis accelerometer and a gyroscope); the acceleration data subset includes accelerations in the longitudinal, lateral, and vertical directions.

[0090] Acquire the vehicle speed and rotation speed data subset through a wheel speed sensor and a magnetic sensor;

[0091] Acquire the driving operation data subset through a steering wheel sensor and a braking force sensor;

[0092] Obtain the pressure data of the seat through a seat sensor (such as a pressure sensor) and process it into a subset of in-vehicle personnel status data.

[0093] Monitor the battery status data such as voltage, current, and temperature of the battery through a battery management system (BMS) and process it into a subset of battery status data.

[0094] In one embodiment, the division of driving data into the first data resource group and the second data resource group is specifically as follows: The video data subset and the audio data subset are divided into the first data resource group, and the position data subset, the acceleration data subset, the vehicle speed and rotation speed data subset, the driving operation data subset, and the in-vehicle personnel status data subset are divided into the second data resource group.

[0095] In this embodiment, the driving data is divided into different data resource groups according to the data storage characteristics. The first data resource group is used to represent the video data subset D1 and the audio data subset D2 with large amounts of data; the second data resource group is used to represent the position data subset D3, the acceleration data subset D4, the vehicle speed and rotation speed data subset D5, the driving operation data subset D6, the in-vehicle personnel status data subset D7, and the battery status data subset D8 with relatively small amounts of data.

[0096] Further, preset the storage priorities of the driving data. The storage priorities include the first storage priority, the second storage priority, and the third storage priority. In this embodiment, the first storage priority, the second storage priority, and the third storage priority represent the storage priorities of the driving data subsets from high to low.

[0097] In one embodiment, the preset storage priorities of the driving data are specifically as follows: Set the storage priorities of the video data subset D1, the audio data subset D2, the position data subset D3, the vehicle speed and rotation speed data subset D5, and the driving operation data subset D6 to the second storage priority, and set the storage priorities of the acceleration data subset D4, the in-vehicle personnel status data subset D7, and the battery status data subset D8 to the third storage priority.

[0098] This embodiment standardizes the data storage management process by clarifying the storage priorities of the driving data, and can allocate storage and processing resources in subsequent steps, avoiding waste of resources and unnecessary overhead, and improving the efficiency of storage resource scheduling.

[0099] S2. Store the driving data in the second memory; identify the abnormal event time period according to the second data resource group, and update the storage priorities of the driving data during the abnormal event time period;

[0100] Further, please refer to Figure 2, identifying an abnormal event time period based on the second data resource group and updating the storage priority of driving data within the abnormal event time period, including the steps of:

[0101] S21. Extract the data features of the driving data of the second data resource group; the data features include peak recognition, trend change analysis, etc.

[0102] Extract the data features of the subset of the driving data of the second data resource group. In one embodiment, specifically extract the data features of the location data subset, acceleration data subset, vehicle speed and rotation speed data subset, driving operation data subset, and in-vehicle personnel status data subset.

[0103] S22. Input the data features into a rule engine model to identify abnormal events; the rule engine model is used to define specific triggering conditions for each type of abnormal event. The triggering conditions are based on the data features in the driving data, for example, including:

[0104] Sudden acceleration / deceleration: When the acceleration exceeds or is lower than a certain threshold.

[0105] Abnormal vehicle speed fluctuation: The vehicle speed changes rapidly within a short time and exceeds the normal driving range.

[0106] Driving operation error: The operations of the driver (such as sudden steering wheel turning, sudden braking, etc.) do not conform to the normal driving mode.

[0107] Change in in-vehicle personnel status: The in-vehicle sensor detects a significant change in the personnel status during driving.

[0108] S23. Record the type, occurrence time, and duration of each matched abnormal event, and generate an abnormal event time period.

[0109] S24. Set the priority of all driving data within the abnormal event time period to the first storage priority.

[0110] According to the identified abnormal events, update the storage priority of the driving data involved within the abnormal event time period to a higher level to ensure that these data can be allocated higher storage resources.

[0111] S3. When a preset condition is reached, delete or migrate the second data resource group in the second memory to the first memory according to the storage priority of the driving data.

[0112] In one embodiment, the first memory is a NAND-Flash, and the second memory is a FRAM (Ferroelectric Random Access Memory). According to the characteristics of driving data and the management mechanism of the memory, this embodiment determines that the type of the first memory is NAND-Flash, which is characterized by fast read / write speed, large storage capacity, but relatively vulnerable and limited write times, and is suitable for storing large amounts of data, low real-time data, or data with a long storage period. The type of the second memory is determined to be FRAM (Ferroelectric Random Access Memory), which is characterized by extremely fast read / write speed, capable of frequent erasing and writing, and high durability, and is suitable for storing small amounts of data, high real-time data, or data with a short storage period that need to be accessed quickly and updated frequently.

[0113] Among them, the preset conditions include reaching a preset time threshold or insufficient remaining space in the second memory. Since the capacity of the second memory is much smaller than that of the first memory, it is necessary to trigger the deletion or migration of data to the first memory suitable for long-term storage by setting preset conditions.

[0114] Based on the first storage priority, the second storage priority, and the third storage priority arranged in descending order of the foregoing storage priorities, deleting or migrating the second data resource group in the second memory to the first memory according to the storage priority of driving data includes the steps:

[0115] S31. Delete the driving data of the third storage priority;

[0116] Scan the driving data in the second memory, and identify the data of the third storage priority according to the predefined priority rules. Perform a deletion operation on the driving data of the third storage priority to release the storage space. The deletion operation processes the identified data by directly deleting or marking it as overwritable.

[0117] S32. Compress the driving data of the second storage priority and then store it in the first memory;

[0118] S33. Migrate the driving data of the first storage priority to the first memory.

[0119] Preferably, the first memory includes a first storage area and a second storage area. In this application, the first memory is divided into at least two logical partitions, and these two physical partitions are respectively denoted as the first storage area and the second storage area. The first storage area is used to store the driving data of the first storage priority, and the second storage area is used to store the driving data of the second storage priority. In the first storage area and the second storage area, different sub-directory partitions can be respectively established to store different subsets of driving data.

[0120] In the process of deleting or migrating the second data resource group in the second memory to the first memory according to the storage priority of driving data above, steps S32 and S33 can be carried out simultaneously, and in the application process, it is necessary to allocate and manage the capacities and I / O resources of the first storage area and the second storage area in the first memory.

[0121] As a preferred embodiment, the deleting or migrating the second data resource group in the second memory to the first memory according to the storage priority of driving data further includes the steps of:

[0122] S34. Allocate the block capacities of the first storage area and the second storage area according to the difference in the actual usage capacity ratios of the first storage area and the second storage area;

[0123] Use a monitoring tool to monitor the current usage capacities of the first storage area and the second storage area in real time, and calculate the actual usage capacity ratios according to the current usage capacities. The actual usage capacity ratio is the ratio of the current usage capacity of the first storage area or the second storage area to the block capacity; compare the difference in the actual usage capacity ratios of the first storage area and the second storage area with a preset ratio threshold, and dynamically adjust the block capacities of the first storage area and the second storage area.

[0124] In one embodiment, the preset ratio threshold is set to 30%. For example, it is monitored that at a certain moment, the actual usage capacity ratio of the first storage area is 30% and no I / O task is currently being executed, and the second storage area is performing a write operation on the driving data with the second storage priority, and the actual usage capacity ratio of the second storage area rises to 60%. If the difference in the actual usage capacity ratios of the first storage area and the second storage area is greater than the preset ratio threshold, then reduce the block capacity of the first storage area and increase the block capacity of the second storage area.

[0125] In the actual operation process of this embodiment, it also includes setting the upper and lower limits of the block capacity ratio to prevent the capacity adjustment from exceeding a reasonable range. For example, when the first storage area or the second storage area is close to the limit value of the total capacity (such as 70%), further adjustment should be prohibited.

[0126] As a preferred embodiment, the migrating the driving data with the first storage priority to the first memory is specifically: migrating the driving data with the first storage priority to the first memory according to the reserved I / O resources.

[0127] Specifically, the reserved I / O resources reserve a certain proportion of I / O bandwidth and processing capabilities for the I / O operations of the first storage area in this embodiment, such as 30 - 40%. Use the I / O scheduler to give the first storage area a higher priority and configure the reserved resource ratio. Ensure that even in the case of concurrent reading and writing of the first storage area and the second storage area, the critical I / O operations of the first storage area will not be affected by the tasks of other storage areas.

[0128] When the first storage area is idle, that is, when all reserved I / O operations are completed and there are no tasks to be executed, the unused reserved I / O resources can be temporarily released for use by the second storage area.

[0129] In this embodiment, by reserving a specific proportion of I / O resources for the first storage area, the priority and response speed of I / O operations for its critical tasks can be guaranteed. Even under high load conditions, it can ensure that important data operations in the first storage area will not be overly delayed, ensuring the optimization and balance of the storage resources in this solution.

[0130] As a preferred embodiment, please refer to Figure 3 , step S32, storing the driving data with the second storage priority into the first memory after compression processing, including the steps:

[0131] Storing the audio data subset with the second storage priority into the first memory after compression processing, specifically:

[0132] S3211. Collect the audio data subset according to a preset sampling rate to obtain audio time series data; the purpose of this step is to convert continuous analog signals into discrete digital signals, which is convenient for computer processing. According to the Nyquist theorem, the sampling frequency must be at least twice the highest frequency of the signal to avoid spectral aliasing. Through sampling, the amplitude value at each instant is recorded, forming discrete time series data, laying the foundation for subsequent processing steps.

[0133] S3212. Perform framing and pre-emphasis processing on the audio time series data to obtain audio data frames;

[0134] After sampling, the audio time series data needs to be segmented into small segments. For example, each frame has a duration of 25 milliseconds and a frame shift of 10 milliseconds. The frame shift is used to ensure a certain overlap between adjacent frames. The purpose of framing is to cut the long-time series data into manageable small segments because the speech signal has short-term stationarity, that is, its characteristics can be considered relatively stable within a very short time range (such as 10 - 30 milliseconds). In this way, each frame can be processed independently, and the frame shift ensures the continuity of the signal and avoids sudden changes between adjacent frames.

[0135] Perform pre-emphasis processing on each frame. The purpose is to suppress low-frequency components through a high-pass filter and highlight high-frequency details. Pre-emphasis is mainly used to enhance the high-frequency components in the speech signal because the occurrence system (such as the vocal cords, oral cavity, etc.) will cause the attenuation of high-frequency components, making the low-frequency components overly prominent. Through pre-emphasis, the signal spectrum can be balanced, making the information in the high-frequency part clearer.

[0136] S3213. Calculate the frame energy of each audio data frame, and divide the audio data frame into a first speech frame or a first silent frame by comparing a preset energy threshold and the frame energy;

[0137] The frame energy is expressed as:

[0138]

[0139] where x[i] represents the audio signal of the i-th sampling point in the audio data frame, and N represents the number of sampling points in the audio data frame.

[0140] S3214. Classify the first speech frame into a second speech frame or a second silent frame through an audio classification model;

[0141] The input of the audio classification model is a multi-dimensional feature vector of the first speech frame, including Mel spectrum, Mel-frequency cepstral coefficients (MFCC), frame energy, and zero-crossing rate.

[0142] The Mel spectrum is used to represent the spectral intensity distribution of the audio signal on the Mel scale. It emphasizes the low-frequency part that the human ear is sensitive to and can directly reflect the energy distribution of frequency components. The Mel-frequency cepstral coefficients are used to capture the short-time power spectral density of the audio signal and extract the spectral features of the audio by providing the harmonic structure information of the audio signal and simulating the non-linear response of the human ear to different frequencies' sensitivities. The frame energy represents the overall energy of the audio signal in a frame, which provides the amplitude change of the audio signal over time and can reflect the loudness and intensity changes of the audio signal. The zero-crossing rate represents the number of times the audio signal waveform passes through zero within a frame and is used to capture the frequency nature of the waveform change. It is an effective feature for distinguishing pitch, tone, and detecting short sounds. A high zero-crossing rate usually indicates high noise or a non-tonal signal.

[0143] where the Mel spectrum is expressed as:

[0144]

[0145] where S m represents the output of the m-th Mel filter; |X k | 2 represents the power spectrum of the k-th frequency component of the frequency-domain signal; H m represents the value of the m-th Mel filter at the frequency index k position; k represents the frequency index, corresponding to the serial number of the frequency component after FFT transformation.

[0146] The Mel-frequency cepstral coefficients are expressed as:

[0147]

[0148] where M represents the number of Mel filters, Sm represents the output of the m-th Mel filter; C n represents the value of the n-th Mel-frequency cepstral coefficient.

[0149] The zero-crossing rate is expressed as:

[0150]

[0151]

[0152] where x[i] represents the audio signal at the i-th sampling point in the audio data frame, and N represents the number of sampling points in the audio data frame.

[0153] S3215. Concatenate a number of second speech frames into a compressed audio data file and store it in the first memory.

[0154] The purpose of this step is to concatenate the second speech frames selected by the audio classification model in chronological order to form a continuous audio data stream and store it in the first memory.

[0155] In this embodiment, the frame energy of the audio data frame is calculated, and the audio data frame is preliminarily classified using a preset energy threshold, and it is divided into a first speech frame and a first silent frame, filtering some of the silent frames, thereby reducing the data volume and achieving preliminary data compression; the first speech frame is further classified using an audio classification model and subdivided into a second speech frame or a second silent frame, further improving the accuracy of data compression and enabling the compressed audio data to retain more useful information. This embodiment removes a large number of silent frames through the dual screening of the energy threshold and the classification model, reducing the storage space occupancy.

[0156] In one embodiment, the step of concatenating a number of second speech frames into a compressed audio data file and storing it in the first memory specifically includes the steps of:

[0157] S32151. Create an empty first buffer in the second memory; the first buffer is used to store the second speech frames that need to be concatenated and processed; by creating the first buffer in the second memory, space is reserved for the audio frames that will be received and processed soon. This enables the data processing process to enjoy fast read and write operations, thereby significantly improving the temporary storage and processing efficiency.

[0158] S32152. Align each second speech frame according to the data timestamp in chronological order to obtain a compressed audio data file, and add the compressed audio data file to the first buffer; by aligning the timestamps, it is ensured that all audio frames are concatenated in the true chronological order, making the obtained audio data stream both continuous and in line with the actual recording situation, ensuring the integrity and coherence of the audio stream and avoiding time disorder or audio breakage.

[0159] During the splicing process, the tail of the previous frame of the adjacent frames can be faded out to make it gradually weakened, and the head of the next frame of the adjacent frames can be faded in to make it gradually strengthened, and then the two processed frames are merged to ensure the continuity and naturalness of the splicing.

[0160] S32153. When the amount of data in the first buffer reaches a preset value, the compressed audio data files in the first buffer are written in batches to the first memory, and the first buffer is cleared.

[0161] The spliced ​​data in the first buffer is written to the first memory at one time, reducing frequent single-frame writing operations. This batch processing can significantly improve writing efficiency, reduce wear and tear on the first memory, and extend its service life.

[0162] As a preferred embodiment, please refer to Figure 4 , step S32, storing the driving data of the second storage priority in the first memory after compression processing, further comprising the steps of:

[0163] The video data subset of the second storage priority is stored in the first memory after being compressed, specifically:

[0164] S3221. Divide each video frame into a number of macroblocks of fixed size (eg, 16x16 pixels).

[0165] Each macroblock will be motion estimated and matched independently.

[0166] S3222. Set the frame image to be compressed during the processing as the current frame, and the frame image before the current frame as the reference frame; for each macroblock in the current frame, set the center point position and step size of the search window; in one embodiment, the step size is 2, and the center point position is the position of the macroblock in the current frame.

[0167] S3223, taking the center point position as a reference, obtaining the matching errors of the nine search points in the search window;

[0168] Among them, assuming the position of the center point is (i,j), the positions of the nine search points are respectively expressed as (i,j), (i+S,j), (iS,j), (i,j+S), (i,jS), (i+S,j+S), (i+S,jS), (iS,j+S), (iS,jS), (iS,j+S), (iS,jS).

[0169] S3224. If the position of the search point with the minimum matching error is different from the center point position, update the center point position to the position of the search point with the minimum matching error, and return to the previous step, that is, return to step S323; if the position of the search point with the minimum matching error is the same as the center point position, halve the step size, obtain the matching errors of the nine search points in the search window, and output the position of the search point with the minimum matching error as the best matching position.

[0170] S3225. Calculate the motion vector according to the final matching point and the initial position, and generate a predicted frame according to the motion vector;

[0171] The motion vector represents the moving direction and distance of the macroblock from the current frame to the reference frame.

[0172] S3226. Perform differential encoding on each macroblock of the predicted frame and the current frame; differential encoding only records and compresses those small difference data that are not fully matched to reduce the amount of data to be stored and transmitted.

[0173] S3227. Organize the motion vector and differential data of each macroblock into a compressed video data file and store it in the first memory.

[0174] In one embodiment, organizing the motion vector and differential data of each macroblock into a compressed video data file and storing it in the first memory specifically includes the steps of:

[0175] S32271. Create an empty second buffer in the second memory; the second buffer is used to store the motion vector and differential data of the macroblocks that need to be organized and processed. By creating the second buffer in the second memory, space is reserved for the video frame data to be received and processed, improving the read and write efficiency during the data processing process.

[0176] S32272. Align the motion vector and differential data of each macroblock according to the timestamp and macroblock position to generate a compressed video data file; the purpose of this step is to ensure that all data is processed in the order of the frame sequence, ensuring the integrity and coherence of the video stream.

[0177] S32273. When the amount of data in the second buffer reaches the preset value, batch-write the compressed video data file in the second buffer into the first memory and empty the second buffer.

[0178] This embodiment can effectively organize the motion vector and differential data of the macroblocks generated during the video encoding process into a compressed video data file and efficiently store it in the first memory, thereby improving the data processing and storage efficiency, enhancing the write efficiency, reducing the wear of the first memory, and extending its service life.

[0179] The above are only specific embodiments of the present invention, enabling those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be obvious to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to these embodiments shown herein, but rather will be accorded the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A method for optimizing cache and intelligent storage management of a driving recorder, characterized in that: Includes steps: Collecting driving data, and dividing the driving data into a first data resource group and a second data resource group; Specifically, the video data subset and the audio data subset are divided into the first data resource group, and the position data subset, the acceleration data subset, the vehicle speed data subset, the driving operation data subset, the vehicle occupant status data subset and the battery status data subset are divided into the second data resource group; Preset the storage priority of driving data; the storage priority includes a first storage priority, a second storage priority and a third storage priority; extract data features of driving data of the second data resource group; input the data features into the rule engine model to identify abnormal events; record the type, occurrence time and duration of each abnormal event, and generate an abnormal event time period; set the priority of all driving data within the abnormal event time period to the first storage priority; set the storage priority of the video data subset, the audio data subset, the position data subset and the vehicle speed data subset to the second storage priority; Setting the storage priority of the acceleration data subset, the driving operation data subset, the vehicle occupant status data subset, and the battery status data subset to a third storage priority; storing the driving data in a second memory; When a preset condition is met, the second data resource group in the second memory is deleted or migrated to the first memory according to the storage priority of the driving data; The first memory is a NAND flash memory, and the second memory is a ferroelectric random access memory; The method of deleting or migrating the second data resource group in the second memory to the first memory according to the storage priority of the driving data comprises the steps of: Deleting the driving data of the third storage priority; storing the driving data of the second storage priority in the first memory after compression processing; Migrating the driving data with a first storage priority to a first memory; The method of compressing the driving data of the second storage priority level and storing it in the first memory comprises the following steps: Collecting a subset of audio data according to a preset sampling rate to obtain audio time series data; Performing frame division and pre-emphasis processing on the audio time series data to obtain audio data frames; Calculating the frame energy of each audio data frame, and classifying the audio data frame into a first speech frame or a first silence frame by comparing a preset energy threshold with the frame energy; The first speech frame is classified into a second speech frame or a second silence frame by an audio classification model; the input of the audio classification model is a multidimensional feature vector of the first speech frame, including Mel spectrum, Mel frequency cepstral coefficient, frame energy and zero crossing rate; The plurality of second speech frames are spliced ​​into a compressed audio data file and stored in the first memory.

2. The method for optimizing cache and intelligent storage management of a driving recorder according to claim 1, characterized in that: The first memory includes a first storage area and a second storage area; the second data resource group in the second storage area is deleted or migrated to the first storage area according to the storage priority of the driving data, and also includes the step of: allocating the block capacity of the first storage area and the second storage area according to the difference in the actual usage capacity ratio of the first storage area and the second storage area.

3. The method for optimizing cache and intelligent storage management of a driving recorder according to claim 1, characterized in that: The migrating the driving data with the first storage priority to the first memory specifically includes: migrating the driving data with the first storage priority to the first memory according to the reserved I / O resources.

4. The method for optimizing cache and intelligent storage management of a driving recorder according to claim 1, characterized in that: The step of splicing a plurality of second speech frames into a compressed audio data file and storing the compressed audio data file in a first memory comprises the following steps: Creating an empty first buffer in the second memory; Align each second voice frame according to the data timestamp in time sequence to obtain a compressed audio data file, and add the compressed audio data file to the first buffer; When the amount of data in the first buffer reaches a preset value, the compressed audio data files in the first buffer are written in batches into the first memory, and the first buffer is cleared.

5. The method for optimizing cache and intelligent storage management of a driving recorder according to claim 1, characterized in that: The step of compressing the driving data of the second storage priority and storing it in the first memory further includes the following steps: Divide each video frame into a number of fixed-size macroblocks; The frame image to be compressed in the processing process is set as the current frame, and the frame image before the current frame is set as the reference frame; for each macroblock in the current frame, the center point position and step size of the search window are set; Taking the center point position as the reference, obtain the matching errors of the nine search points in the search window; If the position of the search point with the smallest matching error is different from the position of the center point, the center point position is updated to the position of the search point with the smallest matching error, and the process returns to the previous step. If the position of the search point with the smallest matching error is the same as the center point position, the step size is halved, and the matching errors of the nine search points in the search window are obtained. The position of the search point with the smallest matching error is output as the best matching position. Calculate the motion vector according to the final matching point and the initial position, and generate a predicted frame according to the motion vector; Differentially encode each macroblock of the predicted frame and the current frame; The motion vector and differential data of each macroblock are organized into a compressed video data file and stored in the first memory.

6. The method for optimizing cache and intelligent storage management of a driving recorder according to claim 5, characterized in that: The step of arranging the motion vector and differential data of each macroblock into a compressed video data file and storing the compressed video data file in the first memory specifically comprises the steps of: creating an empty second buffer in the second memory; Aligning the motion vector and differential data of each macroblock according to the timestamp and macroblock position to generate a compressed video data file; When the amount of data in the second buffer reaches a preset value, the compressed video data files in the second buffer are written in batches into the first memory, and the second buffer is cleared.

Citation Information

Patent Citations

  • Vehicle driving video storing method and system based on rearview mirror

    CN106027934A

  • Video processing method of automobile data recorder and automobile data recorder

    CN115022650A