Log management method and device, electronic equipment and storage medium

By determining the scene and storage priority of log information in the electronic rearview mirror log system, and determining the storage order based on the data size and reception time, the problem of untimely and effective logging in the prior art is solved, and more efficient logging is achieved Information management and storage.

CN119415028APending Publication Date: 2025-02-11CHONGQING SELIS PHOENIX INTELLIGENT INNOVATION TECH CO LTD
View PDF 0 Cites 5 Cited by

Patent Information

Application Number
CN202411451539.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-17
Publication Date
2025-02-11

AI Technical Summary

Technical Problem

The existing electronic rearview mirror logging system is not timely and efficient enough in data caching and storage, which leads to great challenges in log file management.

Method used

By obtaining the log information to be stored generated by the electronic rearview mirror, the corresponding scene is determined, and the storage priority is determined based on the preset scene priority. When the storage priority is the same, the storage sequence is determined in consideration of the data size and reception time, and then the records are managed.

Benefits of technology

Ensure that log information in important scenarios is stored first, improve the efficiency of log information retention under limited storage resources, improve log processing speed, and reduce delays or resource waste caused by improper processing order.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119415028A_ABST
    Figure CN119415028A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a log management method and device, equipment and a storage medium. The method comprises the steps that multiple pieces of to-be-stored log information generated by the electronic rearview mirror are acquired, and scenes corresponding to the multiple pieces of to-be-stored log information are determined; determining storage priorities corresponding to the multiple pieces of to-be-stored log information based on the scenes corresponding to the multiple pieces of to-be-stored log information and preset scene priorities; if the storage priorities of the multiple pieces of to-be-stored log information are the same, obtaining data sizes and receiving time corresponding to the multiple pieces of to-be-stored log information; and determining a storage sequence of the to-be-stored log information based on the data size and the receiving time, and managing and recording the to-be-stored log information based on the storage sequence. According to the embodiment of the invention, the log information in an important scene can be ensured to be stored preferentially, the importance of the data is considered, the timeliness of the data is also considered, the overall processing speed of the log can be improved, and delay or resource waste caused by an improper processing sequence is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of data management, and in particular to a log management method, device, electronic device, and computer-readable storage medium. Background Art

[0002] With the development of technology, in electronic rearview mirror systems, log systems are usually used to record various data generated during vehicle operation, such as mode switching, fault scenarios, and environmental conditions.

[0003] Moreover, the log information generated in the electronic rearview mirror system is of great significance to the maintenance, safety and performance analysis of the vehicle. In the current driving scenario, the existing electronic rearview mirror log system is not timely and effective in data caching and storage, which makes the management of log files face great challenges. Summary of the invention

[0004] To solve the above technical problems, embodiments of the present application provide a log management method and device, an electronic device, a computer-readable storage medium, and a computer program product.

[0005] According to one aspect of an embodiment of the present application, a log management method is provided, including: obtaining multiple log information to be stored generated by an electronic rearview mirror, and determining the scenes to which the multiple log information to be stored respectively correspond; determining the storage priority corresponding to the multiple log information to be stored based on the scenes to which the multiple log information to be stored respectively correspond and preset scene priorities; if the storage priorities of the multiple log information to be stored are the same, obtaining the data size and receiving time corresponding to the multiple log information to be stored; determining the storage order of the multiple log information to be stored based on the data size and the receiving time, and managing and recording the multiple log information to be stored based on the storage order.

[0006] According to one aspect of an embodiment of the present application, the method also includes: generating tag information of the log information to be stored based on the scenario of the log information to be stored; determining the storage priority of the log information to be stored based on the tag information; and storing the log information to be stored in cache space and / or memory space based on the storage priority.

[0007] According to one aspect of an embodiment of the present application, the method also includes: determining the access frequency and data persistence requirement corresponding to the log information to be stored based on the scenario of the log information to be stored; if the access frequency is greater than a preset access frequency threshold, saving the log information to be stored to the cache space; if the data persistence requirement meets the preset persistence requirement or the access frequency is lower than the preset access frequency threshold, saving the log information to be stored to the memory space.

[0008] According to one aspect of an embodiment of the present application, the cleaning of the amount of cached data in the cache space based on the mark information in the log information includes: determining the storage priority of the cached data based on the mark information; if the storage priorities are the same, obtaining the receiving timestamp and access count corresponding to the cached data; and cleaning the amount of cached data in the cache space based on the cache timestamp and the access count.

[0009] According to one aspect of an embodiment of the present application, the amount of cached data in the cache space is cleaned up based on the mark information in the log information, including: determining the storage priority of the cached data based on the mark information; if the storage priorities are the same, obtaining the receiving timestamp and access count corresponding to the cached data; determining the data to be migrated in the cache space based on the cache timestamp and the access count; and asynchronously writing the data to be migrated and the identification information corresponding to the data to be migrated into the memory space.

[0010] According to one aspect of an embodiment of the present application, the method also includes: obtaining identification information corresponding to the log information to be stored, the identification information being used to identify the source of the log information to be stored; and determining the scenarios corresponding to each of the log information to be stored based on the source of the log information to be stored.

[0011] According to one aspect of an embodiment of the present application, the method also includes: obtaining driver identity information, the driver identity information including driver level and driver habit label; if the driver level is lower than a preset level threshold, using a preset application layer function log as the log information to be stored; if the driver level is not lower than the preset level threshold, determining the log information to be stored based on the driver habit label.

[0012] According to one aspect of an embodiment of the present application, a log management device is provided, including: an acquisition module, used to acquire multiple log information to be stored generated by an electronic rearview mirror, and determine the scenes to which the multiple log information to be stored respectively correspond; a determination module, used to determine the storage priority corresponding to each of the multiple log information to be stored based on the scenes to which the multiple log information to be stored respectively correspond and preset scene priorities; a judgment module, used to acquire the data size and receiving time corresponding to the multiple log information to be stored if the storage priorities of the multiple log information to be stored are the same; a management module, used to determine the storage order of the multiple log information to be stored based on the data size and the receiving time, and manage and record the multiple log information to be stored based on the storage order.

[0013] According to one aspect of an embodiment of the present application, an electronic device is provided, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the electronic device implements the log management method as described above.

[0014] According to one aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which computer-readable instructions are stored. When the computer-readable instructions are executed by a processor of a computer, the computer executes the log management method as described above.

[0015] According to one aspect of an embodiment of the present application, a computer program product is also provided, including a computer program, which implements the steps in the log management method described above when executed by a processor.

[0016] In the technical solution provided in the embodiment of the present application, by obtaining the log information to be stored generated by the electronic rearview mirror during the operation of the vehicle and determining the scenes corresponding to the log information to be stored, the storage priority corresponding to the log information to be stored can be determined according to the preset scene priority. The storage priority of the log information is determined based on the preset scene priority, which can ensure that the log information in important scenes is stored preferentially. In this way, under limited storage resources, the most valuable log information for key tasks such as system analysis and troubleshooting can be more effectively retained, thereby optimizing the utilization of storage resources. When the storage priority is the same, the storage order can be determined by further considering the data size and receiving time of the log information, which can ensure that in the storage process, both the importance and timeliness of the data are taken into account, which can improve the overall processing speed of the log and reduce delays or resource waste caused by improper processing order.

[0017] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0019] Figure 1 is a schematic diagram of an implementation environment for managing logs generated by an electronic rearview mirror according to an exemplary embodiment of the present application;

[0020] Figure 2is a flow chart of a log management method shown in an exemplary embodiment of the present application;

[0021] Figure 3 is a flow chart of a log management method shown in another exemplary embodiment of the present application;

[0022] Figure 4 is a flow chart of a log management method shown in another exemplary embodiment of the present application;

[0023] Figure 5 is a flow chart of a log management method shown in another exemplary embodiment of the present application;

[0024] Figure 6 is a flow chart of a log management method shown in another exemplary embodiment of the present application;

[0025] Figure 7 is a flow chart of a log management method shown in another exemplary embodiment of the present application;

[0026] Figure 8 is a flow chart of a log management method shown in another exemplary embodiment of the present application;

[0027] Fig. 9 is a brief flow chart of log management for an electronic rearview mirror in an exemplary application scenario;

[0028] Fig.10 is a block diagram of a log management device shown in an exemplary embodiment of the present application;

[0029] Fig.11 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION

[0030] Here, exemplary embodiments will be described in detail, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are only examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims.

[0031] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0032] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.

[0033] The term "multiple" as used in this application refers to two or more than two. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the related objects are in an "or" relationship.

[0034] First of all, it should be noted that the electronic rearview mirror (CMS, i.e. Camera Monitor System) does generate a series of log information during the use of the vehicle. These log information mainly comes from the various components of the electronic rearview mirror system, including the camera, electronic control unit (ECU) and display. The following is a detailed analysis of the log information generated by the electronic rearview mirror: The camera will generate a working status log: record the camera's opening and closing time, and whether it is in normal working condition, image quality log: monitor and record the image quality captured by the camera, such as clarity, color reproduction, etc., fault log: when the camera fails, record the fault type, occurrence time and possible causes. The electronic control unit (ECU) will generate a processing log: record the process and results of the ECU processing the image captured by the camera, including image enhancement, distortion correction, etc., communication log: record the communication between the ECU and other vehicle systems (such as navigation system, driver assistance system, etc.), system status log: reflect the operating status of the ECU itself, such as temperature, voltage, etc. The display will generate a display log: recording the content displayed on the display, time, and user interaction (such as touch operations); a fault log: when the display fails, it records the fault type, occurrence time, and possible causes.

[0035] Among them, the log information generated by the electronic rearview mirror can be roughly divided into the following categories: working status log: recording the opening, closing and operating status of each component of the system; performance log: reflecting the performance of the system, such as image quality, processing speed, etc.; fault log: recording the faults that occur in the system and related information; communication log: recording the communication status within the system and between the system and external systems; user interaction log: recording the interaction between the user and the system, such as touch operations, voice commands, etc.

[0036] The log information generated by the electronic rearview mirror needs to be properly stored and managed. Generally speaking, this log information will be stored in the vehicle's ECU or a dedicated storage device, and can be read and exported through the on-board diagnostic system (OBD). At the same time, in order to ensure the integrity and security of the log information, appropriate encryption and backup measures need to be taken.

[0037] Figure 1 FIG. 1 is a schematic diagram of an implementation environment for managing logs generated by an electronic rearview mirror according to an exemplary embodiment of the present application. Figure 1 As shown, during the operation of the vehicle, the electronic rearview mirror 110 will generate a series of log information to be stored, and send the log information to be stored to the server 120. The server 120 determines the scenes corresponding to the log information to be stored, and then determines the storage priority of the log information to be stored according to the scenes corresponding to the log information to be stored and the preset scene priority, and obtains the data size and receiving time corresponding to the log information to be stored when the storage priorities are the same; then the server 120 can determine the storage order of the log information to be stored based on the data size and the receiving time, and manage and record the log information to be stored based on the storage order.

[0038] in, Figure 1 The server 120 shown may be, for example, an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms, and is not limited here. The electronic rearview mirror 110 may communicate with the server 120 via wireless networks such as 3G (third generation mobile information technology), 4G (fourth generation mobile information technology), and 5G (fifth generation mobile information technology), and is not limited here.

[0039] Moreover, the log information generated in the electronic rearview mirror system is of great significance to the maintenance, safety and performance analysis of the vehicle. In the current driving scenario, the existing electronic rearview mirror log system is not timely and effective in data caching and storage, which makes the management of log files face great challenges.

[0040] The problems pointed out above are generally applicable in existing log management. In order to solve these problems, the embodiments of the present application respectively propose a log management method, a log management device, an electronic device, a computer-readable storage medium and a computer program product. These embodiments will be described in detail below.

[0041] See also Figure 2 , Figure 2 is a flow chart of a log management method shown in an exemplary embodiment of the present application. The method can be applied to Figure 1 The implementation environment shown is specifically executed by the server 120 in the implementation environment. It should be understood that the method can also be applied to other exemplary implementation environments and be specifically executed by devices in other implementation environments. This embodiment does not limit the implementation environment to which the method is applicable.

[0042] like Figure 2 As shown, in an exemplary embodiment, the log management method only includes steps S210 to S240, which are described in detail as follows:

[0043] Step S210, obtaining a plurality of log information to be stored generated by the electronic rearview mirror, and determining scenes corresponding to the plurality of log information to be stored.

[0044] Specifically, during the operation of the vehicle, the electronic rearview mirror equipped with the vehicle does generate a series of log information, which mainly comes from various components of the electronic rearview mirror system, including the camera, the electronic control unit (ECU), and the display, etc. The log information generated by the electronic rearview mirror is used as the log information to be stored, and the scenes corresponding to the log information generated by the electronic rearview mirror system are determined.

[0045] Exemplarily, the electronic rearview mirror will generate a variety of log information during operation, and this information mainly comes from the following aspects: Camera video data: Information content: including real-time video images behind the vehicle, and may also include video images of the side and front of the vehicle (if supported by the system), corresponding to scenes: driving, turning, parking, reversing, etc., which require observation of the vehicle's surrounding environment. Sensor data: Information content: such as ultrasonic ranging data, radar detection data, acceleration sensor data, etc., used to perceive the distance and speed between the vehicle and surrounding objects, corresponding to scenes: obstacle avoidance, parking assistance, blind spot monitoring, etc. System status information: Information content: including system startup, shutdown, fault alarm, software update and other status information, corresponding to scenes: system initialization, daily maintenance, troubleshooting, etc. User operation record: Information content: user operation record through the electronic rearview mirror interface, such as adjusting the field of view angle, switching display mode, etc., corresponding to scenes: personalized settings, temporary field of view adjustment, etc. GPS positioning information: Information content: vehicle real-time position, speed, direction and other information, corresponding to scenes: navigation, driving trajectory recording, vehicle tracking, etc.

[0046] Step S220: determining storage priorities corresponding to the plurality of log information to be stored based on the scenarios corresponding to the plurality of log information to be stored and preset scenario priorities.

[0047] Specifically, after determining the scenes corresponding to the log information to be stored generated by the electronic rearview mirror, the storage priority of the log information to be stored can be determined according to the preset scene priority, where the scene priority can be set according to the impact of the scene on driving, the importance of the scene to intelligent driving, etc.

[0048] For example, first of all, it is necessary to clarify the importance of different scenarios for driving safety, system stability and user experience, so as to set the corresponding scenario priority. For example, emergency safety-related scenarios: such as obstacle avoidance, collision warning, etc., these scenarios are directly related to driving safety, so they should be set to the highest priority, daily driving assistance scenarios: such as blind spot monitoring, parking assistance, etc., although these scenarios are not as urgent as emergency safety scenarios, they play an important role in improving driving convenience and safety, so they should be set to the second highest priority. System maintenance and management scenarios: such as system status monitoring, software updates, etc., these scenarios are crucial to maintaining stable system operation and timely repairing problems, but compared with driving assistance scenarios, their priority can be slightly lower, user personalized settings scenarios: such as field of view angle adjustment, display mode switching, etc., these scenarios mainly affect the user experience, and have less direct impact on driving safety and system stability, so they can be set to a lower priority.

[0049] After determining the scene priority, each log information to be stored generated by the electronic rearview mirror can be matched with the corresponding priority according to the preset scene priority. Finally, the log information can be sorted in order from high to low priority to determine its storage priority.

[0050] Step S230: If the storage priorities of the multiple log information to be stored are the same, the data sizes and receiving times corresponding to the multiple log information to be stored are obtained.

[0051] Specifically, when the storage priority of the log information to be stored generated by the electronic rearview mirror is the same, in order to further determine the storage order of these log information, their corresponding data size and reception time can be considered. These two factors are usually used to optimize storage efficiency and data freshness under limited resources. Among them, data size refers to the amount of storage space occupied by each log information to be stored. In the case of limited storage resources, smaller data is usually easier to store because they occupy less space. Therefore, when the storage priority is the same, it can be considered to store log information with smaller data size first to save storage space and optimize storage efficiency. The reception time of the log information refers to the time point when each log information to be stored is received by the system. In application scenarios with high real-time requirements, newer data are usually more valuable because they reflect the current state of the system or vehicle. Therefore, when the storage priority is the same and the data size is similar, we can consider storing log information with a later reception time (i.e., newer) first to ensure the freshness and timeliness of the data.

[0052] Step S240: determining a storage order of the plurality of log information to be stored based on the data size and the receiving time, and managing and recording the plurality of log information to be stored based on the storage order.

[0053] Specifically, all log information to be stored is collected from the electronic rearview mirror system, including the data size (in bytes) of each log, the receiving time (timestamp accurate to seconds or milliseconds), and other necessary information (such as log type, scene identification, etc.). First, if there is a preset storage priority, a preliminary sorting is performed in order from high to low priority. However, in this scenario, we mainly focus on data size and receiving time, so it is assumed that the storage priority of all logs is the same or has been regarded as the same. First, if there is a preset storage priority, a preliminary sorting is performed in order from high to low priority. However, in this scenario, we mainly focus on data size and receiving time, so it is assumed that the storage priority of all logs is the same or has been regarded as the same. If the data size of two or more logs is similar or equal, they are further sorted in descending order according to the receiving time. That is, newer logs will be stored first to ensure the freshness of the data.

[0054] In this embodiment, by obtaining the log information to be stored generated by the electronic rearview mirror during the operation of the vehicle, and determining the scenes corresponding to the log information to be stored, the storage priority corresponding to the log information to be stored can be determined according to the preset scene priority. The storage priority of the log information is determined based on the preset scene priority, which can ensure that the log information in important scenes is stored preferentially. In this way, under limited storage resources, the most valuable log information for key tasks such as system analysis and troubleshooting can be more effectively retained, thereby optimizing the utilization of storage resources. When the storage priority is the same, the storage order can be determined by further considering the data size and receiving time of the log information, which can ensure that in the storage process, both the importance of the data (indirectly reflected by the data size) and the timeliness of the data (directly reflected by the receiving time) are considered, which can improve the overall processing speed of the log and reduce the delay or resource waste caused by improper processing order.

[0055] Further, based on the above embodiments, please refer to Figure 3 In one of the exemplary embodiments provided in the present application, the specific implementation process of the above log management method may further include steps S310 to S330, which are described in detail as follows:

[0056] Step S310, generating tag information of the log information to be stored based on the scenario of the log information to be stored;

[0057] Step S320, determining the storage priority of the log information to be stored based on the tag information;

[0058] Step S330: storing the log information to be stored in the cache space and / or the memory space based on the storage priority.

[0059] Specifically, first, analyze the scenario to which each log information to be stored belongs. These scenarios may include traffic accident warning, driving behavior analysis, vehicle fault diagnosis, system abnormality records, etc. According to the results of scenario identification, generate corresponding tag information for each log information. These tags can be predefined labels, codes or classification identifiers, which are used to uniquely identify the scenario type of the log information. For example, the log of traffic accident warning can be marked as "EMERGENCY", and the log of driving behavior analysis can be marked as "BEHAVIOR", etc. Establish a priority mapping table or rule set to associate different tag information with storage priority. This mapping table or rule set should be formulated based on business requirements, system resources, data importance and other factors. By querying the mapping table or applying the rule set, the tag information of each log information is converted into the corresponding storage priority. The priority can be in numerical form (such as 1 for the highest priority and 10 for the lowest priority) or in level form (such as "CRITICAL", "HIGH", "MEDIUM", "LOW", etc.), and a storage strategy is formulated according to configuration and performance requirements. This includes determining which log information should be stored in the cache, which should be stored in the memory, and the capacity allocation of the cache and memory. Cache storage: For high-priority log information, you can consider storing it in the cache first. The cache usually has a faster access speed, which can ensure that urgent or important data can be processed or retrieved quickly.

[0060] Memory storage: All log information (including logs in the cache) should eventually be stored in memory to ensure data persistence and accessibility. For low-priority log information, if there is insufficient cache space or cache is not required according to the policy, it can be stored directly in memory.

[0061] Storage management: During the storage process, it is necessary to manage the usage of cache and memory to ensure that data loss or system performance degradation does not occur due to insufficient storage space. This includes cache replacement strategies (such as LRU, LFU, etc.), memory allocation and recycling mechanisms, etc.

[0062] In this embodiment, by generating tag information for log information and determining storage priority accordingly, it is possible to intelligently determine which log information is more important or urgent, thereby giving priority to storing these high-priority information. This priority processing mechanism effectively reduces unnecessary storage operations and improves the efficiency of storage resource utilization.

[0063] Further, based on the above embodiments, please refer to Figure 4 In one of the exemplary embodiments provided in the present application, the specific implementation process of the above log management method may also include steps S410 to S430, which are described in detail as follows:

[0064] Step S410, determining the access frequency and data persistence requirement corresponding to the log information to be stored based on the scenario of the log information to be stored;

[0065] Step S420: if the access frequency is greater than the preset access frequency threshold, the log information to be stored is saved in the cache space;

[0066] Step S430: If the data persistence requirement meets the preset persistence requirement or the access frequency is lower than the preset access frequency threshold, the log information to be stored is saved to the memory space.

[0067] Specifically, for multiple log information to be stored generated by the electronic rearview mirror, the scenarios corresponding to the multiple log information to be stored are determined, and then the access frequency and data persistence requirements can be determined according to the scenarios corresponding to the logs to be stored. If the access frequency of the log information is greater than the preset access frequency threshold, the decision is made to save it to the cache space. If the data persistence requirement of the log information meets the preset persistence requirement, or the access frequency is lower than the preset access frequency threshold, the decision is made to save it to the memory space. For the log information saved to the cache space, the system will regularly monitor its access frequency. If the access frequency decreases, it may be migrated to the memory space to release cache resources. For the log information saved to the memory space, the system will ensure the integrity and persistence of its data, and perform backup and recovery operations regularly as needed. In addition, log management functions are provided, including log query, deletion, backup and recovery, etc. Users can query and manage log information through the system interface or API interface as needed.

[0068] In addition, for log information whose access frequency is lower than the preset threshold and whose data persistence requirements meet the preset conditions, or log information whose access frequency is not high but whose data persistence requirements are particularly high, the system will save them to the memory space. The memory space may have a larger storage capacity than the cache space, but the read and write speed may be slightly slower. It is suitable for storing data that is not frequently accessed but needs to be stored for a long time.

[0069] In this embodiment, the storage location can be dynamically selected according to the actual usage and demand of the log information, thereby optimizing the utilization of storage resources and improving the overall performance of the system. By distinguishing the access frequency and data persistence requirements of different log information, the system can allocate storage resources more reasonably, ensuring that high-frequency access data can be responded to quickly while meeting the needs of long-term preservation.

[0070] Further, based on the above embodiments, please refer to Figure 5 In one of the exemplary embodiments provided in the present application, the specific implementation process of the above log management method may further include step S510 and step S520, which are described in detail as follows:

[0071] Step S510, if the cache data volume of the cache space is greater than a preset cache data volume threshold, then obtaining log information in the current cache space;

[0072] Step S520: clearing the cached data in the cache space based on the marking information in the log information.

[0073] Specifically, when cache resources are tight, part of the log information in the resource cache space can be cleared according to the tag information corresponding to the log information to alleviate the resource tension of the cache space and use the released cache space for more important real-time data.

[0074] Exemplarily, the amount of data in the cache space is checked periodically and compared with a preset cache data volume threshold. If the cache data volume is greater than the threshold, the cache cleanup process is triggered. All currently stored log information is read from the cache space, and the log information should contain tag information previously generated based on the scenario. The log information in the cache is traversed and analyzed based on its tag information. Based on business needs and system policies, determine which marked log information can be cleaned up first. For example, log information marked with a "LOW" priority may be easier to clean up than other higher priority log information. You can consider setting different cleanup priorities or weights to make trade-offs during the cleanup process.

[0075] In addition, based on the analysis results, the log information marked as cleanable is deleted or removed from the cache space. During the cleaning process, attention should be paid to maintaining the data consistency and integrity of the cache space to avoid accidental deletion of important data. The cache replacement algorithm can be considered to assist the cleaning process to ensure that the most valuable data is always stored in the cache.

[0076] In this embodiment, by setting a cache data volume threshold and monitoring the usage of the cache space, the risk of cache overflow can be discovered and handled in a timely manner. When the cache data volume approaches or exceeds the threshold, the cleaning mechanism can be automatically triggered to ensure that the cache space will not fail or affect performance due to excessive use. Cleaning the cache space based on the marking information in the log information means that high-priority log information can be intelligently identified and retained, while cleaning or deleting low-priority log information. This targeted cleaning strategy helps to optimize the efficiency of cache usage and ensure that the cache space always stores the most important and useful data.

[0077] Further, based on the above embodiments, please refer to Figure 6 In one of the exemplary embodiments provided in the present application, the specific implementation process of clearing the cache data volume in the cache space based on the marking information in the log information may also include steps S610 to S640, which are described in detail as follows:

[0078] Step S610, determining the storage priority of the cache data based on the tag information;

[0079] Step S620, if the storage priorities are the same, obtaining a receiving timestamp and access count corresponding to the cached data;

[0080] Step S630, determining the data to be migrated in the cache space based on the cache timestamp and the access count;

[0081] Step S640: asynchronously write the data to be migrated and identification information corresponding to the data to be migrated into the memory space.

[0082] In accordance with the above-mentioned embodiment, the storage priority of the cache data can be determined according to the tag information corresponding to the log information. If two or more log information with the same storage priority appear, the receiving timestamps and access times corresponding to the two or more log information can be further obtained, and then the cache data that needs to be cleared in the current cache space can be determined according to the receiving timestamps and access times corresponding to the two or more log information. For example, the cache data with a longer receiving time can be cleared, or the cache data with a smaller access time can be cleared.

[0083] Exemplarily, first, a storage priority is assigned to each data item according to the tag information in the cached data. The priority can be determined based on the business importance, timeliness or other business rules of the data. When it is found that the storage priority of two or more cached data is the same, the receiving timestamp and access count of these data are further obtained. The receiving timestamp refers to the time when the data is cached in the system. Generally, data received earlier may no longer be the latest or less important, and therefore can be a candidate for cleaning. A time threshold can be set, for example, data that has not been accessed in the last week may be considered "old" and therefore has a lower retention value. The number of accesses refers to the frequency with which a data item is accessed. Data with a low number of accesses may indicate that the data is not so important in the current business scenario or no longer needs to be frequently accessed. Similarly, a threshold for the number of accesses can be set, and data below the threshold may be considered "inactive" and should be given priority for cleaning. A comprehensive evaluation is performed in combination with the receiving timestamp and the number of accesses. For example, an algorithm can be set up that takes into account both the age of the data (based on the receipt timestamp) and its popularity (based on the number of accesses), and based on the comprehensive evaluation results, selects the lowest priority and oldest or least active data for cleaning.

[0084] In this embodiment, by combining the tag information and the actual usage of the cached data (such as the receiving timestamp and the number of accesses), the storage priority of the cached data can be controlled more finely. This multi-dimensional priority evaluation method helps to more accurately reflect the value and importance of the data, thereby making more reasonable cache decisions. In the case of limited cache resources, the allocation of cache resources can be optimized based on more comprehensive priority information.

[0085] Following the above embodiment, the data to be migrated in the cache space can be determined according to the cache timestamp and access count corresponding to the log information in the cache space, and the data to be migrated and the identification information corresponding to the data to be migrated can be asynchronously written into the memory space.

[0086] Exemplarily, first, traverse all data items in the cache space and check the cache timestamp of each data item. This timestamp records the specific time when the data item is added to the cache. At the same time, check the number of accesses for each data item. This indicator reflects the frequency with which the data item is read or used. According to business needs, set one or more migration criteria, such as "data items that have not been accessed for more than X hours and have been accessed less than Y times will be considered to be migrated." For each data item to be migrated, in addition to its actual data content, it is also necessary to collect and prepare its corresponding identification information (such as a unique ID, a key in a key-value pair, etc.).

[0087] The identification information is crucial for quickly locating and accessing these data items in the memory space. Use the asynchronous write mechanism to send the data to be migrated and its identification information to the memory space. The benefit of asynchronous writing is that it does not block the current main thread or operation, allowing the system to continue processing other tasks, such as responding to user requests, continuing to read and write other cached data, etc. In the memory space, assign a suitable storage location to each data item to be migrated, and ensure that its identification information is correctly associated with the data content.

[0088] In this embodiment, by migrating part of the data in the cache space to the memory space, the access speed to the data can be significantly improved. This data migration strategy based on cache timestamp and access count makes it easier to adapt to different workloads and data volume changes. When more data needs to be processed, it can optimize storage efficiency by increasing memory space or adjusting migration strategies; when the load is low, memory usage can be reduced to save resources. This flexibility helps to improve the scalability and maintainability of log storage.

[0089] Further, based on the above embodiments, please refer to Figure 7 In one of the exemplary embodiments provided in the present application, the specific implementation process of the above log management method may further include step S710 and step S720, which are described in detail as follows:

[0090] Step S710, obtaining identification information corresponding to the log information to be stored, where the identification information is used to identify the source of the log information to be stored;

[0091] Step S720: determining the scenarios corresponding to the log information to be stored based on the sources of the log information to be stored.

[0092] Specifically, first of all, the specific content and format of the identification information need to be clarified. The identification information is usually a combination of one or more fields, which is used to uniquely identify the source of the log information. For example, it may contain device ID, system name, user ID, log level, etc. When the log information to be stored is received, the identification information is extracted from the log information itself or its accompanying metadata. This may require parsing the format of the log information and looking for specific fields or tags. After determining the source of the log information, each source is mapped to the corresponding scenario according to the business logic and system architecture. This mapping relationship may be predefined or may need to be dynamically adjusted according to actual conditions. Through the mapping relationship, the scenario to which each log information to be stored belongs is identified. The scenario may represent aspects such as the generation environment, purpose of use, processing flow, or business logic of the log information.

[0093] In this embodiment, by assigning unique identification information to each log information to be stored and clarifying its source, the generation path and background of specific log information can be easily tracked and queried, and by clarifying the source and scenario of the log information, the meaning behind the data can be more accurately interpreted, thereby extracting more valuable information for performance optimization, user behavior analysis and other purposes.

[0094] Further, based on the above embodiments, please refer to Figure 8 In one of the exemplary embodiments provided in the present application, the specific implementation process of the above log management method may also include steps S810 to S830, which are described in detail as follows:

[0095] Step S810, obtaining driver identity information, the driver identity information including driver grade and driver habit label;

[0096] Step S820, if the driver level is lower than the preset level threshold, the preset application layer function log is used as the log information to be stored;

[0097] Step S830: If the driver level is not lower than the preset level threshold, the log information to be stored is determined based on the driver's habit tag.

[0098] Specifically, the driver level and driver habit label can be determined based on the identity information input by the driver, wherein the driver level can determine the driver's driving experience, whether he is familiar with the operation of the vehicle, etc., and then a personalized log record label can be provided according to the driver level and driver habit label. For example, if the driver level is a novice driver, all data can be recorded in real time and stored, providing more detailed records to help novice drivers become familiar with and understand the relevant vehicle operations of intelligent driving. If the driving level determines that the driver is a senior driver, the data can be stored according to the normal priority, reducing the recording of redundant application layer data (mainly including some data on users' familiarity with intelligent driving functions and behavioral analysis data, which are all for novice drivers), thereby optimizing the use of cache resources.

[0099] Exemplary, driver level: This usually refers to the driver's driving skill level or qualification certification level, which may be issued by the traffic management department or relevant agency. The level may be divided into beginners, skilled drivers, advanced drivers, etc. These tags are automatically or manually generated based on the driver's driving behavior, preferences and habits. They may include acceleration habits (such as sudden acceleration, smooth acceleration), braking habits, turning speed, night driving preferences, frequent lane changes, etc. By analyzing the driver's habit tags, the driver's behavior patterns and preferences in specific situations can be understood. These tags help predict the driver's next move and adjust the vehicle configuration and log recording strategy accordingly. For beginners, the electronic rearview mirror may need to record more basic driving data of the preset application layer functions, such as vehicle speed, lane keeping, distance from the vehicle in front, etc., to help the driver improve driving skills and ensure safety. Advanced drivers may pay more attention to the use and performance of the advanced driving assistance system, and can determine personalized log information to be stored based on the driver's corresponding driver habit tags. For example, if the driver has the habit of driving at night, the electronic rearview mirror may need to increase the recording and analysis of night driving vision to optimize the night driving assistance function later. If the driver frequently drives long distances, one might be concerned about the driver's fatigue level and adjust the logging strategy accordingly to monitor the driver's attention state.

[0100] In addition, the type and frequency of log information to be stored can be adjusted in real time according to the driver's actual driving behavior and vehicle operation. For example, if the system detects that the driver's driving behavior suddenly becomes abnormal (such as sudden braking, sharp turns, etc.), the recording and analysis of relevant data may be increased.

[0101] In this embodiment, by considering the driver's level and habit tags, more personalized log information can be generated. For drivers of different levels and habits, more relevant and useful data can be recorded to better meet the driver's needs and expectations. The driver's level and habit tags can be used as a basis for screening and filtering log information, helping to exclude irrelevant or redundant log data and retaining only information that is valuable to the driver or analysis, which helps to improve the quality and accuracy of the log information.

[0102] Fig. 9 It is a brief flowchart of log management of an electronic rearview mirror in an exemplary application scenario. In the application scenario shown in 9, the log information to be stored generated by the electronic rearview mirror is obtained, and the scenes corresponding to the log information to be stored are determined; the tag information of the log information to be stored is generated based on the scenes of the log information to be stored; the storage priority of the log information to be stored is determined based on the tag information; and the log information to be stored is stored in the cache space and / or the memory space based on the storage priority. If the amount of cached data in the cache space is greater than the preset cache data amount threshold, the log information in the current cache space is obtained; the storage priority of the cache data is determined based on the tag information corresponding to the log information; if the storage priorities are the same, the receiving timestamp and access count corresponding to the cache data are obtained; the data to be migrated in the cache space is determined based on the cache timestamp and access count; the data to be migrated and the identification information corresponding to the data to be migrated are asynchronously written into the memory space. For the detailed implementation process, please refer to the records in the aforementioned embodiments, which will not be repeated here.

[0103] Fig.10 is a block diagram of a log management device shown in an exemplary embodiment of the present application. The device can be applied to Figure 1 The implementation environment shown in the figure is specifically configured in the server 120. The device can also be applied to other exemplary implementation environments and specifically configured in other devices. This embodiment does not limit the implementation environment to which the device is applied.

[0104] like Fig.10 As shown, the exemplary log management device 1000 includes: an acquisition module 1010, used to acquire multiple log information to be stored generated by the electronic rearview mirror, and determine the scenes to which the multiple log information to be stored respectively correspond; a determination module 1020, used to determine the storage priority corresponding to each of the multiple log information to be stored based on the scenes to which the multiple log information to be stored respectively correspond and the preset scene priority; a judgment module 1030, used to acquire the data size and receiving time corresponding to the multiple log information to be stored if the storage priority of the multiple log information to be stored is the same; a management module 1040, used to determine the storage order of the multiple log information to be stored based on the data size and the receiving time, and manage and record the multiple log information to be stored based on the storage order.

[0105] According to one aspect of an embodiment of the present application, the above-mentioned management module 1040 is also used to generate tag information of the log information to be stored based on the scenario of the log information to be stored; determine the storage priority of the log information to be stored based on the tag information; and store the log information to be stored in the cache space and / or memory space based on the storage priority.

[0106] According to one aspect of an embodiment of the present application, the above-mentioned management module 1040 is also used to determine the access frequency and data persistence requirements corresponding to the log information to be stored based on the scenario of the log information to be stored; if the access frequency is greater than the preset access frequency threshold, the log information to be stored is saved to the cache space; if the data persistence requirement meets the preset persistence requirement or the access frequency is lower than the preset access frequency threshold, the log information to be stored is saved to the memory space.

[0107] According to one aspect of an embodiment of the present application, the above-mentioned management module 1040 is also used to obtain log information in the current cache space if the amount of cache data in the cache space is greater than a preset cache data amount threshold; and clean up the amount of cache data in the cache space based on the mark information in the log information.

[0108] According to one aspect of an embodiment of the present application, the above-mentioned management module 1040 is also used to determine the storage priority of cached data based on tag information; if the storage priorities are the same, obtain the receiving timestamp and access count corresponding to the cached data; determine the data to be migrated in the cache space based on the cache timestamp and access count; and asynchronously write the data to be migrated and the identification information corresponding to the data to be migrated into the memory space.

[0109] According to one aspect of an embodiment of the present application, the above-mentioned log management device also includes: an identification acquisition module, used to obtain identification information corresponding to the log information to be stored, and the identification information is used to identify the source of the log information to be stored; a scene determination module, used to determine the scene corresponding to each log information to be stored based on the source of the log information to be stored.

[0110] According to one aspect of an embodiment of the present application, the above-mentioned log management device also includes: a driver module, used to obtain driver identity information, the driver identity information includes driver level and driver habit label; if the driver level is lower than the preset level threshold, the preset application layer function log is used as the log information to be stored; if the driver level is not lower than the preset level threshold, the log information to be stored is determined based on the driver habit label.

[0111] It should be noted that the log management device provided in the above embodiment and the log management method provided in the above embodiment belong to the same concept, wherein the specific manner in which each module and unit performs operations has been described in detail in the method embodiment, and will not be repeated here. In actual application, the log management device provided in the above embodiment can distribute the above functions to different functional modules as needed, that is, divide the internal structure of the device into different functional modules to complete all or part of the functions described above, and this is not limited here.

[0112] An embodiment of the present application also provides an electronic device, including: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by one or more processors, the electronic device implements the log management method provided in the above-mentioned embodiments.

[0113] Fig.11 The structure diagram of the computer system suitable for implementing the electronic device of the embodiment of the present application is shown. It should be noted that: Fig.11 The computer system 1100 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0114] like Fig.11 As shown, the computer system 1100 includes a central processing unit (CPU) 1101, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1102 or the program loaded from the storage part 1108 to the random access memory (RAM) 1103, such as executing the method in the above embodiment. In the RAM 1103, various programs and data required for system operation are also stored. The CPU 1101, the ROM 1102 and the RAM 1103 are connected to each other through the bus 1104. The input / output (I / O) interface 1105 is also connected to the bus 1104.

[0115] The following components are connected to the I / O interface 1105: an input section 1106 including a keyboard, a mouse, etc.; an output section 1107 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1108 including a hard disk, etc.; and a communication section 1109 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 1109 performs communication processing via a network such as the Internet. A drive 1110 is also connected to the I / O interface 1105 as needed. A removable medium 1111, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1110 as needed so that a computer program read therefrom is installed into the storage section 1108 as needed.

[0116] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 1109, and / or installed from a removable medium 1111. When the computer program is executed by a central processing unit (CPU) 1101, various functions defined in the system of the present application are executed.

[0117] It should be noted that the computer-readable medium shown in the embodiment of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable computer program is carried. This propagated data signal can take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. A computer program contained on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0118] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0119] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not constitute limitations on the units themselves in some cases.

[0120] Another aspect of the present application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the log management method as described above is implemented. The computer-readable storage medium can be included in the electronic device described in the above embodiment, or it can exist independently without being assembled into the electronic device.

[0121] Another aspect of the present application also provides a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the log management method provided in each of the above embodiments.

[0122] The above content is only a preferred exemplary embodiment of the present application and is not intended to limit the implementation scheme of the present application. A person skilled in the art can easily make corresponding changes or modifications based on the main concept and spirit of the present application. Therefore, the scope of protection of the present application shall be based on the scope of protection required by the claims.

Claims

1. A log management method, characterized in that: include: Acquire multiple log information to be stored generated by the electronic rearview mirror, and determine the scenes corresponding to the multiple log information to be stored; Determine the storage priority corresponding to each of the plurality of log information to be stored based on the scenes corresponding to each of the plurality of log information to be stored and the preset scene priority; If the storage priorities of the multiple log information to be stored are the same, obtaining the data size and receiving time corresponding to the multiple log information to be stored; The storage order of the plurality of log information to be stored is determined based on the data size and the receiving time, and the plurality of log information to be stored is managed and recorded based on the storage order.

2. The method according to claim 1, characterized in that The method further comprises: Generate tag information of the log information to be stored based on the scenario of the log information to be stored; Determining the storage priority of the log information to be stored based on the tag information; The log information to be stored is stored in a cache space and / or a memory space based on the storage priority.

3. The method according to claim 2, characterized in that The method further comprises: Determining the access frequency and data persistence requirement corresponding to the log information to be stored based on the scenario of the log information to be stored; If the access frequency is greater than a preset access frequency threshold, the log information to be stored is saved in the cache space; If the data persistence requirement meets the preset persistence requirement or the access frequency is lower than the preset access frequency threshold, the log information to be stored is saved in the memory space.

4. The method according to claim 3, characterized in that The method further comprises: If the cache data volume of the cache space is greater than a preset cache data volume threshold, then obtaining the log information currently in the cache space; The amount of cached data in the cache space is cleared based on the marking information in the log information.

5. The method according to claim 4, characterized in that The clearing of the amount of cached data in the cache space based on the marking information in the log information includes: Determining a storage priority of the cache data based on the tag information; If the storage priorities are the same, obtaining a receiving timestamp and access count corresponding to the cached data; Determine the data to be migrated in the cache space based on the cache timestamp and the access count; The data to be migrated and identification information corresponding to the data to be migrated are asynchronously written into the memory space.

6. The method according to claim 1, characterized in that The method further comprises: Obtaining identification information corresponding to the log information to be stored, where the identification information is used to identify the source of the log information to be stored; The scenarios corresponding to the log information to be stored are determined based on the sources of the log information to be stored.

7. The method according to claim 1, characterized in that The method further comprises: Acquiring driver identity information, wherein the driver identity information includes a driver grade and a driver habit label; If the driver level is lower than a preset level threshold, the preset application layer function log is used as the log information to be stored; If the driver level is not lower than a preset level threshold, log information to be stored is determined based on the driver habit tag.

8. A log management device, characterized in that: The device comprises: An acquisition module, used for acquiring a plurality of log information to be stored generated by the electronic rearview mirror, and determining scenes corresponding to the plurality of log information to be stored; A determination module, configured to determine the storage priority corresponding to each of the plurality of log information to be stored based on the scenarios corresponding to each of the plurality of log information to be stored and the preset scenario priority; A judgment module, configured to obtain data sizes and receiving times corresponding to the multiple log information to be stored if the storage priorities of the multiple log information to be stored are the same; The management module is used to determine the storage order of the multiple log information to be stored based on the data size and the receiving time, and manage and record the multiple log information to be stored based on the storage order.

9. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, enables the electronic device to implement the log management method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: Computer-readable instructions are stored thereon, and when the computer-readable instructions are executed by a processor of a computer, the computer is caused to execute the log management method according to any one of claims 1 to 7.

Citation Information

Cited By

  • A data asset modeling method and system

    CN119759297A

  • A data asset modeling method and system

    CN119759297B

  • Data processing method and device, electronic equipment, chip and medium

    CN120743176A

  • Log collection method and electronic equipment

    CN120780575A

  • Data storage request classification method and device, data storage request processing method and device and electronic equipment

    CN120910723A