CN-121996631-A - Circulation coverage storage method of embedded system log
Abstract
The invention discloses a cyclic coverage storage method of an embedded system log, which belongs to the technical field of computer data processing and comprises the steps of starting a coverage process and determining old log data to be covered in response to the fact that a log writing space of a nonvolatile memory meets a trigger condition, utilizing a dynamic characteristic extraction model to extract core semantic characteristics of the old log data, generating a structured value abstract, embedding the abstract into new log data to form composite log data, writing the composite log data into the memory to cover the old log, carrying out information reconstruction based on the current log data and the embedded abstract after receiving a query request, generating a query response result, generating feedback information according to the response result, and carrying out self-adaptive adjustment on characteristic weight parameters of the dynamic characteristic extraction model by utilizing the feedback information. The invention adopts a dynamic feature extraction and value abstract embedding mechanism, combines query feedback optimization in the coverage process, and can realize the cyclic coverage storage of log data in a limited storage space.
Inventors
- LIU XIAOHUI
- SUN XIAORONG
- WANG SHUAI
Assignees
- 威海天拓合创电子工程有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20260225
Claims (10)
- 1. A method for circularly overlaying storage of an embedded system log, the method comprising: responding to the fact that the log writing space of the nonvolatile memory meets a triggering condition, starting an overlay flow, and determining old log data to be overlaid from the nonvolatile memory; Acquiring a dynamic feature extraction model for evaluating the value of log data, and carrying out feature extraction on the old log data to be covered by utilizing the dynamic feature extraction model to generate a structured value abstract corresponding to the core semantics of the old log data; Embedding the structured value abstract into new log data to be written to form composite log data carrying history value information, and writing the composite log data into the nonvolatile memory to cover the old log data; Receiving a query request aiming at a history log, and reconstructing information based on the log data currently stored in the nonvolatile memory and the embedded structured value abstract thereof to generate a query response result; And generating feedback information for model optimization according to the query response result, and carrying out self-adaptive adjustment on the internal feature weight parameters of the dynamic feature extraction model by utilizing the feedback information.
- 2. The method for circularly overlaying and storing an embedded system log according to claim 1, wherein the step of performing feature extraction on the old log data to be overlaid by using the dynamic feature extraction model, and generating a structured value digest corresponding to the core semantics of the old log data comprises: Analyzing the old log data to be covered, and obtaining the log grade and event type of the old log data; calculating the occurrence frequency of the event type in a time window defined by a system, and identifying an associated module set associated with the old log data; acquiring historical query times associated with the old log data, and combining the log level, the event type, the occurrence frequency, the scale of the associated module set and the historical query times to form a multidimensional feature vector; and inputting the multidimensional feature vector into the dynamic feature extraction model, and generating a structured value abstract through weighted calculation of the model.
- 3. The method for circularly overlaying storage of an embedded system log of claim 2, wherein generating the structured value digest further comprises: determining a summary type through a function of carrying out combined mapping on the log grade and the event type; And carrying out coding operation on the occurrence frequency, the scale of the association module set and the historical query times by the dynamic feature extraction model to generate a key feature vector.
- 4. The method for circularly overlaying the embedded system log according to claim 1, wherein embedding the structured value summary into new log data to be written to form composite log data carrying historical value information comprises: distributing an expansion data area for storing metadata for the new log data to be written; Analyzing the loaded inheritance value abstract from the extended data area of the old log data to be covered; Merging the latest generated structured value abstract with the inheritance value abstract to form a current value abstract chain containing historical information; and packaging the current value abstract chain into a metadata packet, and writing the metadata packet into the extended data area to form composite log data carrying historical value information.
- 5. The method for circularly overlaying the log of the embedded system according to claim 4, wherein the reconstructing information based on the log data currently stored in the nonvolatile memory and the embedded structured value abstract thereof comprises: extracting the current value abstract chains in the respective extended data areas in batches from a plurality of pieces of composite log data related to the time range of the query request; Performing reverse backtracking and association analysis on the extracted current value abstract chains to reconstruct a high-value event association map representing the association relation of the historical events; And generating a final response result for responding to the query request based on the high-value event association map and the acquired complete log content stored currently.
- 6. The method for circularly overlaying the log of the embedded system according to claim 1, wherein generating feedback information for model optimization according to the query response result, and adaptively adjusting the internal feature weight parameters of the dynamic feature extraction model by using the feedback information comprises: Evaluating the validity of the query response result, and acquiring a query success rate index and a positioning efficiency index of the quantized query effect; comparing the query success rate index with the positioning efficiency index and a preset performance expected threshold value to generate a model optimization signal; and adjusting the internal feature weight parameters corresponding to the relevant features which lead to the success or failure of the query in the dynamic feature extraction model according to the polarity and the intensity of the model optimization signal.
- 7. The method for circularly overwriting a log in an embedded system according to claim 1, wherein said determining old log data to be overwritten from said nonvolatile memory comprises: scanning a log storage area of the nonvolatile memory, and identifying all complete log entries; Acquiring and applying a primary screening rule containing a storage duration condition, and screening a primary log set from the log entries; And obtaining the historical value scores corresponding to the log entries in the new generation log set, and selecting the log entries with lower historical value scores as the old log data to be covered.
- 8. The method for circularly overlay storage of an embedded system log according to claim 7, wherein prior to selecting the log entry having the lower historical value score as the old log data to be overlaid further comprises: Acquiring a physical block erasing frequency distribution map for recording the erasing frequency of each physical block of the nonvolatile memory; Mapping the log entries in the new generation log set to the stored physical blocks, and screening the log entries stored on the physical blocks with lower current erasing times based on the physical block erasing times distribution diagram to form a candidate coverage set; and performing operations of acquiring the historical value scores and selecting log entries with lower historical value scores within the range of the candidate coverage set.
- 9. The method for circularly overlaying the log of the embedded system according to claim 1, wherein the log writing space satisfies a trigger condition comprises: continuously monitoring remaining continuously available space of the non-volatile memory; obtaining the estimated size of new log data to be written; And when the residual continuous available space is smaller than the product of the estimated size and the safety coefficient defined by the system, judging that the triggering condition is met.
- 10. A loop coverage storage system of an embedded system log, applied to the loop coverage storage method of an embedded system log according to any one of claims 1 to 9, wherein the system comprises: the system comprises an overlay trigger and old log determining module, a log writing module and a log writing module, wherein the overlay trigger and old log determining module is used for starting an overlay process and determining old log data to be overlaid from a nonvolatile memory in response to the fact that a log writing space of the nonvolatile memory meets a trigger condition; The value abstract generation module is used for acquiring a dynamic feature extraction model for evaluating the value of log data, and carrying out feature extraction on the old log data to be covered by utilizing the dynamic feature extraction model to generate a structured value abstract corresponding to the core semantics of the old log data; the composite log writing and overlaying module is used for embedding the structured value abstract into new log data to be written to form composite log data bearing history value information, and writing the composite log data into the nonvolatile memory to overlay the old log data; The query processing and information reconstruction module is used for receiving a query request aiming at the history log, reconstructing information based on the log data currently stored in the nonvolatile memory and the embedded structured value abstract thereof, and generating a query response result; and the model feedback and self-adaptive optimization module is used for generating feedback information for model optimization according to the query response result and carrying out self-adaptive adjustment on the internal feature weight parameters of the dynamic feature extraction model by utilizing the feedback information.
Description
Circulation coverage storage method of embedded system log Technical Field The invention relates to the technical field of computer data processing, in particular to a cyclic coverage storage method of an embedded system log. Background An embedded system is a computer system for executing specific special functions, and hardware and software resources thereof are generally strictly limited, so that the embedded system is widely applied to the fields of communication, automobile electronics, industrial control and the like. The system log is an indispensable part of the embedded system, records state information, key events and abnormal errors in the running process of the system in a time sequence mode, and is a key basis for fault diagnosis, performance analysis and post-tracing of developers. Such systems typically employ non-volatile memory, such as flash memory, as a persistent carrier for the log. In the related art, china patent publication No. CN112685373B discloses an embedded system log processing method, device, system and medium, which comprises the steps of obtaining a log record request, wherein the log record request comprises a to-be-recorded file number of a source code file in which a to-be-recorded log record is located, a to-be-recorded line number in the to-be-recorded source code file in which the to-be-recorded log record is located and a log parameter, extracting the to-be-recorded file number, the to-be-recorded line number and the log parameter in the log record request, storing the to-be-recorded file number, the to-be-recorded line number and the log parameter in an SRAM, and generating log information corresponding to the log record request based on the to-be-recorded file number, the to-be-recorded line number, the log parameter and a pre-generated formatted file when a log read request corresponding to the log record request is obtained. Therefore, the method can perform quick log processing in the embedded system, reduce the influence of log records on normal data processing, and ensure the data processing efficiency of the embedded system. However, the above prior art scheme has the following technical drawbacks. The storage space management is extensive, and a long-term operation scene cannot be effectively treated, wherein the existing scheme focuses on fast recording and formatting of logs, but does not relate to a recycling mechanism of the log storage space. In an embedded device with limited storage space, as the system runs for a long time, log data can continue to accumulate until the storage space is full, so that subsequent key logs cannot be written in, and continuity of fault diagnosis is seriously affected. The log coverage strategy is simple, high-value historical information is easy to lose, and when the storage space is exhausted and old logs need to be covered, the prior art generally adopts simple static strategies such as first-in first-out and the like, and the value difference of log contents cannot be distinguished. This may result in the log of critical system anomalies or critical events being prematurely overlaid, while a large amount of redundant, conventional information is retained, such that historical information with high diagnostic value is permanently lost, impairing the post-hoc analysis capability of the log system. The existing scheme lacks the capability of retaining and reconstructing historical information, and the information contained in the existing scheme completely disappears after the log is covered. The method has no capability of extracting and retaining core semantic features from the covered logs, and can not reconstruct a historical event chain based on limited information in the subsequent inquiry, so that the method is difficult to support the root analysis of complex intermittent faults in a cross-time period. The log retention strategy is stiff and cannot be optimized adaptively, namely the log management strategy in the prior art is static and cannot be adjusted automatically according to actual query feedback and system running state. It cannot learn which types of log information are more valuable for subsequent diagnosis, and thus cannot dynamically optimize the reservation priority of the log, resulting in low storage space utilization efficiency. Disclosure of Invention In order to solve the problems, the invention provides a method for circularly overlaying and storing the log of an embedded system, which adopts a dynamic feature extraction and value abstract embedding mechanism and combines query feedback optimization in the overlaying process to realize circularly overlaying and storing the log data in a limited storage space. The above object can be achieved by the following scheme: A cyclic coverage storage method for embedded system logs includes the steps of responding to the fact that log writing space of a nonvolatile memory meets triggering conditions, starting a coverage process, determining old log data