Cache optimization and intelligent storage management method for automobile data recorder

By adopting data storage priority management in dash recorders, the problems of insufficient storage space and unconsidered data importance are solved, and the effective storage and storage efficiency of important data is improved, ensuring data integrity at critical moments and reliability.

CN119166054AActive Publication Date: 2024-12-20SHENZHEN ZHONGKE XIANCHUANG TRADING CO LTD

Patent Information

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

AI Technical Summary

Technical Problem

The storage space of dash recorders is limited, and the existing storage management methods do not consider the importance of data, which leads to the possibility of overwriting or deleting of important data, and the data reading and writing efficiency is low, affecting the integrity and reliability of the data.

Method used

Adopt the storage priority management method of driving data, divide the data into different priorities, and dynamically adjust the storage priority according to the data type and event situation, and optimize storage space utilization by deleting low-priority data, compressing and migrating high-priority data. and read and write efficiency.

Benefits of technology

Ensure the efficiency of saving and storage of important data, enhance the ability to record accidents and preserve evidence, and improve the utilization and response speed of storage resources, especially under high load conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119166054A_ABST
    Figure CN119166054A_ABST
Patent Text Reader

Abstract

The invention aims to provide an automobile data recorder cache optimization and intelligent storage management method, and relates to the technical field of data processing. The method comprises the following steps: collecting driving data, and dividing the driving data into a first data resource group and a second data resource group; presetting the storage priority of the driving data; the storage priority comprises a first storage priority, a second storage priority and a third storage priority; storing the driving data to a second memory; identifying an abnormal event time period according to the second data resource group, and updating the storage priority of the driving data in the abnormal event time period; and when a preset condition is met, 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. According to the invention, important data is ensured to be stored, and excessive storage space occupied by unimportant data is reduced, so that the overall storage efficiency is optimized, and the accident recording and evidence preservation capabilities of the automobile data recorder are enhanced.
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 in particular to a method for optimizing high-speed cache and intelligent storage management of a driving recorder. Background Art

[0002] As an important device in modern cars, dashcams play multiple key functions, such as real-time driving video recording, collecting and analyzing driving data, and recording and saving detailed information of emergencies. These features make dashcams an indispensable tool for car owners to ensure driving safety, record accident evidence, and monitor driving behavior.

[0003] However, as the amount of driving data continues to increase, the storage space of the dashcam is limited. With the widespread use of high-resolution video, the required storage space is rapidly expanding. The existing storage management method generally manages the stored data through the FIFO (First In First Out) method, without considering the importance of the data, resulting in some important data being overwritten or deleted. In addition, the problem of data reading and writing efficiency also makes it impossible for the dashcam 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 cache memory and intelligently managing storage of a driving recorder to solve at least one of the problems mentioned in the above background technology.

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

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

[0007] 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;

[0008] storing the driving data in a second memory; identifying the abnormal event time period according to the second data resource group, and updating the storage priority of the driving data in the abnormal event time period;

[0009] 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;

[0010] 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:

[0011] Deleting the driving data of the third storage priority;

[0012] storing the driving data of the second storage priority in the first memory after compression processing;

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

[0014] The method of compressing the driving data of the second storage priority level and storing it in the first memory comprises the following steps:

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

[0016] Performing frame division and pre-emphasis processing on the audio time series data to obtain audio data frames;

[0017] 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;

[0018] 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;

[0019] The plurality of second speech frames are spliced ​​into a compressed audio data file and stored in the first memory.

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

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

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

[0023] The driving data is divided into a first data resource group or a second data resource group according to a typical data volume.

[0024] Preferably, the driving data subset includes a video data subset, an audio data subset, a position data subset, an acceleration data subset, a vehicle speed data subset, a driving operation data subset, a vehicle occupant status data subset and battery status data;

[0025] The preset storage priority of driving data is specifically as follows: the storage priority of the video data subset, the audio data subset, the position data subset and the vehicle speed data subset is set to the second storage priority; 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 is set to the third storage priority.

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

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

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

[0029] For each abnormal event, record its type, occurrence time and duration, and generate an abnormal event time period;

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

[0031] Preferably, 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.

[0032] Preferably, 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.

[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 coefficients are expressed as:

[0036] The zero crossing rate is expressed as:

[0037]

[0038] Wherein, 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 mth Mel filter; |X k | 2 represents the power spectrum of the kth frequency component of the frequency domain signal; H mIndicates the value of the mth Mel filter at the frequency index k; k represents the frequency index, corresponding to the frequency component number after FFT transformation; M represents the number of Mel filters; C n Represents the nth Mel-frequency cepstral coefficient value.

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

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

[0041] 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;

[0042] 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.

[0043] Preferably, the method of compressing the driving data of the second storage priority and storing it in the first memory further includes the steps of:

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

[0045] 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;

[0046] Taking the center point position as the reference, obtain the matching errors of the nine search points in the search window;

[0047] 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.

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

[0049] Differential coding is performed on each macroblock of the predicted frame and the current frame. Differential coding only records and compresses the small difference data that are not completely matched, so as to reduce the amount of data that needs to be stored and transmitted.

[0050] The motion vector and differential data of each macroblock are organized into a compressed video data file and stored in the first memory.

[0051] Preferably, 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:

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

[0053] Aligning the motion vector 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, the compressed video data files in the second buffer are written in batches into the first memory, and the second buffer is cleared.

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

[0056] This application sets storage priorities for driving data and selectively stores and deletes data based on the storage priorities, ensuring that important data is preserved and reducing the amount of storage space occupied by unimportant data, thereby optimizing overall storage efficiency and enhancing the ability of the driving recorder in accident recording and evidence preservation. Specifically, by deleting data with the third storage priority, compressing data with the second storage priority, and migrating data with the first storage priority to the first storage device, storage space is effectively managed and utilized, ensuring that important data is preserved more permanently.

[0057] The embodiment of the present application reserves a specific proportion of I / O resources for the first storage area, thereby ensuring the I / O operation priority and response speed of its key tasks, and ensuring that important data operations in the first storage area will not be excessively delayed even under high load conditions, thereby ensuring the optimization and balance of storage resources of this solution; in the actual operation process, it also includes setting upper and lower limits of the block capacity ratio to prevent capacity adjustment from exceeding a reasonable range. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0059] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

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

[0061] Figure 2A schematic diagram of a 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 It is a schematic diagram of a flow chart of storing a subset of audio data of a second storage priority level in a first memory after compression processing according to an embodiment of the present invention;

[0063] Figure 4 The present invention is a flowchart of storing a video data subset with a second storage priority level in a first memory after compression processing according to an embodiment of the present invention. DETAILED DESCRIPTION

[0064] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

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

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

[0067] Please refer to Figure 1 , a method for optimizing the cache and intelligent storage management of a driving recorder, comprising 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] storing the driving data in a second memory; identifying the abnormal event time period according to the second data resource group, and updating the storage priority of the driving data in the abnormal event time period;

[0070] 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;

[0071] 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:

[0072] Deleting the driving data of the third storage priority;

[0073] storing the driving data of the second storage priority in the first memory after compression processing;

[0074] The driving data with a first storage priority is migrated to the first memory.

[0075] This application sets storage priorities for driving data and selectively stores and deletes data based on the storage priorities, ensuring that important data is preserved, reducing the excessive storage space occupied by unimportant data, optimizing overall storage efficiency, and enhancing the ability of the driving recorder in accident recording and evidence preservation. By deleting data with the third storage priority, compressing data with the second storage priority, and migrating data with the first storage priority to the first storage, storage space is effectively managed and utilized, ensuring that important data is preserved more permanently.

[0076] Specifically, each step of the method for optimizing the cache and intelligent storage management of the driving recorder of the present invention is described in detail through the following contents:

[0077] A method for optimizing high-speed cache and intelligent storage management of a driving recorder comprises the following steps:

[0078] S1, collecting driving data, dividing the driving data into a first data resource group and a second data resource group; presetting 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] The storage priority of driving data is preset, including the evaluation of the typical data volume, real-time and storage period of each type of driving data. Real-time refers to the necessity of acquiring and processing data within a short time after it is generated, 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 that data needs to be stored, such as some data may still need to be queried after several months.

[0080] Furthermore, the dividing of the driving data into the first data resource group and the second data resource group comprises the steps of:

[0081] S11, determining a data source of the driving data, and dividing the driving data into a plurality of driving data subsets according to the data source;

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

[0083] S12. Evaluate the typical data volume of each driving data subset. Perform typical data volume evaluation on each driving data subset to clarify the data volume characteristics of different driving data subsets.

[0084] S13. Divide the driving data into the first data resource group or the 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 a preset threshold into the second data resource group.

[0085] In one embodiment, the number of driving data subsets M=7, and the driving data subsets include video data subset D1, audio data subset D2, position data subset D3, acceleration data subset D4, vehicle speed data subset D5, driving operation data subset D6, vehicle occupant status data subset D7, and battery status data D8. In this embodiment, the processor of the driving recorder obtains multiple types of driving data through multiple sensors and specific data acquisition equipment, and the acquisition of driving data specifically includes the following steps:

[0086] The vehicle-mounted camera collects a subset of video data during driving; the video data subset includes the front road video data, the vehicle interior environment video data, etc.

[0087] A subset of video data inside and outside the vehicle is obtained through the vehicle microphone; the video data subset includes engine sound, voice commands, road noise, etc.

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

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

[0090] Acquiring a subset of vehicle speed data through a wheel speed sensor and a magnetic sensor;

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

[0092] The seat pressure data is acquired through a seat sensor (such as a pressure sensor) and processed into a subset of the occupant status data.

[0093] The battery status data such as battery voltage, current, temperature, etc. are monitored by the battery management system (BMS) and processed into a battery status data subset.

[0094] In one embodiment, the driving data is divided into a first data resource group and a second data resource group, specifically: a video data subset and an audio data subset are divided into the first data resource group, and a position data subset, an acceleration data subset, a vehicle speed data subset, a driving operation data subset and an in-vehicle occupant status data subset are divided into the second data resource group.

[0095] This embodiment divides driving data into different data resource groups according to data storage characteristics. The first data resource group is used to represent a video data subset D1 and an audio data subset D2 with large data volumes; the second data resource group is used to represent a position data subset D3, an acceleration data subset D4, a vehicle speed data subset D5, a driving operation data subset D6, an in-vehicle occupant status data subset D7, and a battery status data subset D8 with smaller data volumes.

[0096] Further, the storage priority of the driving data is preset, and the storage priority includes a first storage priority, a second storage priority and a third storage priority. In this embodiment, the first storage priority, the second storage priority and the third storage priority represent the storage priority of the driving data subset from high to low.

[0097] In one embodiment, the storage priority of the preset driving data is specifically: the storage priority of the video data subset D1, the audio data subset D2, the position data subset D3, the vehicle speed data subset D5 and the driving operation data subset D6 is set to the second storage priority, and the storage priority of the acceleration data subset D4, the occupant status data subset D7 and the battery status data subset D8 is set to the third storage priority.

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

[0099] S2, storing the driving data in a second memory; identifying the abnormal event time period according to the second data resource group, and updating the storage priority of the driving data in the abnormal event time period;

[0100] For further information, see Figure 2The step of identifying the abnormal event time period according to the second data resource group and updating the storage priority of the driving data in the abnormal event time period comprises the following steps:

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

[0102] Extracting data features of the driving data subset of the second data resource group, in one embodiment specifically involves extracting data features of a position data subset, an acceleration data subset, a vehicle speed data subset, a driving operation data subset, and an in-vehicle occupant status data subset.

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

[0104] Rapid acceleration / deceleration: When the acceleration exceeds or falls below a certain threshold.

[0105] Abnormal vehicle speed fluctuation: The vehicle speed changes rapidly in a short period of time, exceeding the normal driving range.

[0106] Driving operation errors: The driver's operation (such as sudden steering, sudden braking, etc.) is inconsistent with the normal driving mode.

[0107] Changes in the status of people in the car: The sensors in the car detect significant changes in the status of people 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, the storage priority of the driving data involved in the abnormal event time period is updated to a higher level to ensure that these data can be allocated to higher storage resources.

[0111] S3. 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.

[0112] In one embodiment, the first memory is NAND-Flash (NAND flash memory), and the second memory is FRAM (Ferroelectric Random Access Memory). According to the characteristics of driving data and the management mechanism of the memory, this embodiment determines that the first memory type is NAND-Flash, which is characterized by fast read and write speed and large storage capacity, but is relatively fragile and has a limited number of writes, and is suitable for storing large amounts of data, low real-time performance or long storage cycles. The second memory type is determined to be FRAM (Ferroelectric Random Access Memory), which is characterized by extremely fast read and write speed, frequent erasure and high durability, and is suitable for storing small amounts of data, high real-time performance or short storage cycles that require fast access and frequent updates.

[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 set the preset conditions to trigger the deletion or migration of data to the first memory suitable for long-term storage.

[0114] Based on the first storage priority, the second storage priority and the third storage priority arranged from high to low in the aforementioned storage priority, the second data resource group in the second storage device is deleted or migrated to the first storage device according to the storage priority of the driving data, including the steps of:

[0115] S31, deleting the driving data of the third storage priority;

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

[0117] S32, compressing the driving data of the second storage priority and storing it in the first memory;

[0118] S33, migrating 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. The present application divides the first memory into at least two logical partitions, and the two physical partitions are respectively recorded as the first storage area and the second storage area. The first storage area is used to store driving data of a first storage priority, and the second storage area is used to store driving data of a second storage priority. Different sub-directory partitions can be established in the first storage area and the second storage area to store different subsets of driving data.

[0120] In the above process 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, step S32 and step S33 can be performed simultaneously. During the application process, the capacity and I / O resources of the first storage area and the second storage area in the first memory need to be allocated and managed.

[0121] As a preferred embodiment, 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 steps of:

[0122] S34, allocating block capacities of the first storage area and the second storage area according to the difference between 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 capacity of the first storage area and the second storage area in real time, and calculate the actual usage capacity ratio based on the current usage capacity. 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 between the actual usage capacity ratio of the first storage area and the second storage area with the preset ratio threshold, and dynamically adjust the block capacity of the first storage area and the second storage area.

[0124] In one embodiment, the preset ratio threshold is set to 30%. For example, when 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, the second storage area is executing a write operation of driving data of the second storage priority, and the actual usage capacity ratio of the second storage area rises to 60%, and the difference between the actual usage capacity ratios of the first storage area and the second storage area is greater than the preset ratio threshold, the block capacity of the first storage area is reduced, and the block capacity of the second storage area is increased.

[0125] In actual operation, this embodiment also includes setting upper and lower limits of the block capacity ratio to prevent the capacity adjustment from exceeding a reasonable range. For example, if 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 capacity, such as 30-40%, for the I / O operations of the first storage area in this embodiment. The first storage area is given a higher priority by using the I / O scheduler, and the reserved resource ratio is configured. It is ensured that even when the first storage area and the second storage area are read and written concurrently, the key 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, all reserved I / O operations are completed and there is no task to be executed, the unused reserved I / O resources can be temporarily released to the second storage area for use.

[0129] This embodiment reserves a specific proportion of I / O resources for the first storage area, thereby ensuring the I / O operation priority and response speed of its critical tasks, and ensuring that important data operations in the first storage area will not be excessively delayed even under high load conditions, thereby ensuring the optimization and balance of the storage resources of this solution.

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

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

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

[0133] S3212, performing frame division 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 divided into small segments, for example, each frame is 25 milliseconds long, the frame shift is 10 milliseconds, and the frame shift is used to ensure a certain overlap between adjacent frames. The purpose of framing is to divide the long time series data into manageable small segments, because the speech signal has short-term stability, that is, within a very short time range (such as 10-30 milliseconds), its characteristics can be considered relatively stable. In this way, each frame can be processed separately, and the frame shift ensures the continuity of the signal and avoids mutations between adjacent frames.

[0135] Pre-emphasis is performed on each frame 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 voice signal, because the generating system (such as vocal cords, oral cavity, etc.) will cause the attenuation of high-frequency components, making the low-frequency components too prominent. Through pre-emphasis, the signal spectrum can be balanced to make the high-frequency part of the information clearer.

[0136] S3213, calculating the frame energy of each audio data frame, and dividing the audio data frame into a first speech frame or a first silence frame by comparing a preset energy threshold with the frame energy;

[0137] The frame energy is expressed as:

[0138]

[0139] Wherein, 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 silence 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] Mel spectrum is used to represent the spectral intensity distribution of audio signals 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. Mel frequency cepstrum coefficients are used to capture the short-time power spectral density of audio signals. They provide harmonic structure information of audio signals to simulate the nonlinear response of the human ear to different frequency sensitivities to extract the spectral features of audio. Frame energy represents the overall energy of an audio signal in a frame. It provides the amplitude change of an audio signal over time and can reflect the loudness and intensity changes of an audio signal. Zero crossing rate represents the number of times an audio signal waveform passes through the zero point in a frame. It is used to capture the frequency properties of waveform changes and is an effective feature for distinguishing pitch, tone, and detecting short sounds. A high zero crossing rate usually indicates a high noise or toneless signal.

[0143] Wherein, the Mel spectrum is expressed as:

[0144]

[0145] Among them, S m represents the output of the mth Mel filter; |X k | 2 represents the power spectrum of the kth frequency component of the frequency domain signal; H m Represents the value of the mth Mel filter at frequency index k; k represents the frequency index, corresponding to the frequency component number 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 mth Mel filter; C n Represents the nth Mel-frequency cepstral coefficient value.

[0149] The zero crossing rate is expressed as:

[0150]

[0151]

[0152] Wherein, 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.

[0153] S3215. Splice the plurality of second voice frames into a compressed audio data file and store the compressed audio data file in the first memory.

[0154] The purpose of this step is to splice 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] This embodiment calculates the frame energy of the audio data frame, uses a preset energy threshold to preliminarily classify the audio data frame, divides it into a first voice frame and a first silent frame, filters some silent frames, thereby reducing the amount of data and achieving preliminary data compression; uses an audio classification model to further classify the first voice frame, subdividing it into a second voice frame or a second silent frame, further improving the accuracy of data compression, so that the compressed audio data retains more useful information. This embodiment removes a large number of silent frames and reduces storage space occupancy through dual screening of energy thresholds and classification models.

[0156] In one embodiment, the step of splicing a plurality of second speech frames into a compressed audio data file and storing the compressed audio data file in the first memory specifically comprises the steps of:

[0157] S32151. Create an empty first buffer in the second memory; the first buffer is used to store the second voice frame to be spliced ​​and processed; by creating the first buffer in the second memory, space is reserved for the audio frame to be received and processed. This allows the data processing process to enjoy fast read and write operations, thereby significantly improving temporary storage and processing efficiency.

[0158] S32152. 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; through timestamp alignment, ensure that all audio frames are spliced ​​in the real time sequence, so that the obtained audio data stream is continuous and consistent with the actual recording situation, thereby ensuring the integrity and coherence of the audio stream and avoiding time confusion 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 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, i.e., returns to step S323. If the position of the search point with the smallest matching error is the same as the position of the center point, the step size is halved, and the matching errors of the nine search points in the search window are obtained, and the position of the search point with the smallest matching error is output as the best matching position.

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

[0171] The motion vector indicates the direction and distance of movement of a 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 small difference data that are not completely matched, so as to reduce the amount of data that needs to be stored and transmitted.

[0173] S3227. Arrange 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, the motion vector and differential data of each macroblock are organized into a compressed video data file and stored in a first memory, specifically comprising the steps of:

[0175] S32271. Create an empty second buffer in the second memory; the second buffer is used to store macroblock motion vectors and differential data that need to be sorted and processed. By creating the second buffer in the second memory, space is reserved for the video frame data to be received and processed, thereby improving the read and write efficiency of 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 to ensure the integrity and continuity of the video stream.

[0177] S32273. When the amount of data in the second buffer reaches a preset value, the compressed video data files in the second buffer are batch-written into the first memory, and the second buffer is cleared.

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

[0179] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may 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 the embodiments shown herein, but rather to 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: 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; storing the driving data in a second memory; Identify the abnormal event time period according to the second data resource group, and update the storage priority of the driving data in the abnormal event time period; 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 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 method of dividing the driving data into a first data resource group and a second data resource group comprises the steps of: Determine a data source of the driving data, and divide the driving data into a number of driving data subsets according to the data source; Evaluate the typical data volume for each driving data subset; The driving data is divided into a first data resource group or a second data resource group according to a typical data volume.

3. The method for optimizing cache and intelligent storage management of a driving recorder according to claim 2, characterized in that: The driving data subset includes a video data subset, an audio data subset, a position data subset, an acceleration data subset, a vehicle speed data subset, a driving operation data subset, a vehicle occupant status data subset and battery status data; The preset driving data storage priority is specifically: setting 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; 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 is set to a third storage priority.

4. The method for optimizing cache and intelligent storage management of a driving recorder according to claim 1, characterized in that: The step of identifying the abnormal event time period according to the second data resource group and updating the storage priority of the driving data in the abnormal event time period comprises the following steps: Extracting data features of driving data of the second data resource group; Input data features into the rule engine model to identify abnormal events; For each abnormal event, record its type, occurrence time and duration, and generate an abnormal event time period; The priority of all driving data within the abnormal event time period is set to the first storage priority.

5. 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.

6. 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.

7. The method for optimizing cache and intelligent storage management of a driving recorder according to claim 1, characterized in that: The frame energy is expressed as: The Mel spectrum is expressed as: S m =∑ k |X k | 2 H m (k); The Mel-frequency cepstral coefficients are expressed as: The zero crossing rate is expressed as: Wherein, 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 mth Mel filter; |X k | 2 represents the power spectrum of the kth frequency component of the frequency domain signal; H m Indicates the value of the mth Mel filter at the frequency index k; k represents the frequency index, corresponding to the frequency component number after FFT transformation; M represents the number of Mel filters; C n Represents the nth Mel-frequency cepstral coefficient value.

8. 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.

9. 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.

10. The method for optimizing cache and intelligent storage management of a driving recorder according to claim 9, 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

  • Vehicle-mounted data compression and storage method, electronic equipment and storage medium

    CN116126814A

  • Video automatic segmentation method and device, equipment and storage medium

    CN116801033A

  • Computer file data matching system

    CN117111858A

Cited By

  • Data recording method, device and equipment of event data recorder and storage medium

    CN119964271A

  • Data recording method, device, equipment and storage medium of event data recorder

    CN119964271B