Memory optimization method, model training method, device, equipment and vehicle

By combining the combined characteristics of memory operating status and health status data, optimization strategies are determined, solving the problem of inaccurate memory lifespan prediction and achieving efficient memory management and extended lifespan.

CN120233957BActive Publication Date: 2026-01-23DEEPAL AUTOMOBILE TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510712924.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-30
Publication Date
2026-01-23
Estimated Expiration
2045-05-30

AI Technical Summary

Technical Problem

In the current technology, the memory lifespan prediction results are inaccurate, which affects the stability of device operation.

Method used

By acquiring memory's operational and health status data and combining them with combined features to analyze the memory's working state, we can determine target optimization strategies, including data hierarchical management, dynamic writing, storage mode switching, and external factor adjustment.

Benefits of technology

It improves the accuracy and efficiency of memory operating status prediction, enables real-time monitoring and dynamic management of memory, extends memory lifespan, and ensures system stability and data integrity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120233957B_ABST
    Figure CN120233957B_ABST
Patent Text Reader

Abstract

The application relates to a memory optimization method, a model training method and device, equipment and a vehicle, relates to the technical field of memory, and aims to solve the technical problem of inaccurate memory working state prediction results. The method comprises the following steps: obtaining memory state data of a target device, wherein the memory state data comprises memory running state data and memory health state data of the target device; determining the working state of the memory according to the combined features of the memory state data; the combined features are used to indicate the correlation between the memory state data; a target optimization strategy of the memory is determined based on the working state of the memory, and the target optimization strategy is executed, so that the accuracy of the memory working state prediction result is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of memory, in particular to a memory optimization method, a model training method, device, equipment and vehicle. BACKGROUND

[0002] As a consumable device, the life of the memory will be shortened during continuous use. When the life of the memory is exhausted, it will not be able to work normally, thereby affecting the overall operation of the device. Therefore, it is crucial to detect the life of the memory.

[0003] In related technologies, one method can input the memory temperature value, voltage value, power consumption value and usage data into the memory life prediction model to obtain the predicted life of the memory, and generate a fault log when a fault is detected, and maintain the memory according to the fault type. Another method can also obtain the threshold values of various electrical characteristics affecting the performance of the chip, such as the threshold values of temperature, voltage and current, according to the chip specification, and compare the periodically collected electrical characteristics of the chip with the set threshold values to determine whether the chip is running normally, and give a warning when an abnormality occurs.

[0004] However, when predicting the life (working state) of the memory, these methods only predict according to the running data of the memory, and the results obtained are not accurate. SUMMARY

[0005] The purpose of the present application is to provide a memory optimization method, a model training method, device, equipment and vehicle, which aims to solve the technical problem of inaccurate prediction of memory working state.

[0006] In order to achieve the above purpose, the technical solutions adopted by the embodiments of the present application are as follows:

[0007] In a first aspect, the embodiments of the present application provide a memory optimization method, which comprises: obtaining memory state data of a target device, the memory state data comprising memory running state data and memory health state data of the target device; determining the working state of the memory according to the combination features of the memory state data; the combination features are used to indicate the correlation between the memory state data; determining the target optimization strategy of the memory based on the working state of the memory, and executing the target optimization strategy.

[0008] The application has the beneficial effects that: by obtaining the memory running state data and the memory health state data of the target device, the working state of the memory is determined according to the combination features of the memory state data. Then, the target optimization strategy is determined according to the working state of the memory. The memory optimization method of the application obtains the memory state data based on the running state and the health state of the memory, which reflects the working state of the memory from different angles. The memory running state data and the memory health state data are combined and analyzed, which can provide more accurate basis for predicting the working state of the memory. In addition, since the combination features can reveal the correlation between the memory state data, the working state of the memory is determined based on the combination features of the memory state data, which can comprehensively understand the working state of the memory from multiple dimensions, avoid the one-sidedness of determining the working state of the memory according to a single indicator, and thus more accurately grasp the actual working state of the memory.

[0009] In a possible implementation, the combination features of the memory state data are determined by: determining a target candidate group from the plurality of candidate data of the memory state data, the target candidate group including at least two candidate data, and the correlation between the candidate data in the target candidate group being greater than a first preset threshold; and determining the target candidate group as the combination features of the memory state data.

[0010] It can be understood that, by preliminarily screening the memory state data to obtain the candidate data, and then analyzing the correlation between the candidate data, the data with strong correlation is retained and the data with weak correlation is filtered out. In this way, the irrelevant data can be removed while the key data that really affects the prediction result is retained, thereby improving the accuracy and efficiency of the model in predicting the working state of the memory.

[0011] In a possible implementation, the working state of the memory is determined according to the combination features of the memory state data, including: inputting the combination features of the memory state data into a memory working state prediction model to determine the working state of the memory.

[0012] It can be understood that, using the memory working state prediction model can quickly process a large amount of memory state data and give accurate results in time, thereby improving the working efficiency. The model can monitor the working state of the memory in real time and obtain the latest working state, which is helpful to realize real-time monitoring and dynamic management of the memory.

[0013] In a possible implementation, the target optimization strategy includes at least one of the following: a data hierarchical management strategy, which indicates a strategy of managing data according to importance of the data; a data dynamic writing strategy, which is used to instruct adjustment of a data writing manner; a storage mode switching strategy, which is used to instruct a user to switch a storage mode of the memory between a multi-layer cell storage mode and a single-layer cell storage mode; and an external factor adjustment strategy, which is used to instruct adjustment of running state data of the memory.

[0014] It can be understood that each optimization strategy optimizes different aspects of the memory, the data hierarchical management strategy mainly optimizes data access efficiency and storage resource allocation, the data dynamic writing strategy focuses on improving data writing reliability, the storage mode switching strategy strives to balance storage capacity and performance, and the external factor adjustment strategy focuses on optimizing memory performance. The combination of multiple strategies can simultaneously improve multiple performance indicators of the system and achieve more comprehensive optimization of the system.

[0015] In a possible implementation, the data hierarchical management strategy includes at least one of the following: not saving temporary data, not saving important data, setting the memory to a read-only mode, uploading data to the cloud for backup and saving, and performing hardware replacement warning. The data dynamic writing strategy includes at least one of the following: adjusting a data writing rate and adjusting a data writing amount. The external factor adjustment strategy includes at least one of the following: adjusting a temperature of the memory, adjusting a voltage of the memory, adjusting a humidity of the memory, and adjusting a power consumption of the memory.

[0016] It can be understood that not saving temporary data and not saving important data can save space of the memory, and setting the memory to a read-only mode can prevent data from being accidentally modified or deleted, thereby guaranteeing data integrity and security. Uploading data to the cloud for backup and saving provides an additional storage copy for the data, effectively preventing data loss. Performing hardware replacement warning can enable a system administrator to know in advance possible problems of the memory and other hardware, so as to timely arrange hardware replacement and avoid data loss or system crash caused by hardware failure, thereby improving memory performance.

[0017] Adjusting the writing rate and the writing amount of the data enables the writing rate to match an actual processing capability of the memory, which can avoid depletion of memory resources caused by writing too much data at one time, thereby improving memory performance.

[0018] Stable temperature, voltage, humidity, and power consumption are helpful to guarantee performance stability of the memory. Adjusting the temperature, the voltage, the humidity, and the power consumption can avoid performance degradation of the memory, so that the memory always maintains a good working state and improves performance stability of the entire system.

[0019] In a possible implementation, in a case where the target optimization strategy comprises adjusting the data write amount, executing the target optimization strategy comprises: determining, according to a correspondence between the working state of the memory and the adjustment amount of the data write amount, the adjustment amount of the data write amount corresponding to the working state of the current memory; and adjusting the data write amount of the memory based on the adjustment amount of the data write amount.

[0020] It can be understood that the method can adjust the data write amount in real time according to the working state of the memory, so that the memory resources are fully and reasonably utilized. Neither the memory is overburdened due to too large write amount, nor the memory resources are idle due to too small write amount, thereby improving the utilization rate of the memory resources.

[0021] In a second aspect, an embodiment of the present application provides a training method of a memory working state prediction model, comprising: obtaining a training data set, the training data set comprising: combined features of memory state sample data and target working states corresponding to the combined features of the memory state sample data; the combined features being used to indicate the correlation between the memory state sample data in the memory state data; inputting the combined features of the memory state sample data into an initial memory working state prediction model, the initial memory working state prediction model being used for the combined features of the memory state sample data to determine a predicted working state of the memory; and training the initial memory working state prediction model according to the predicted working state and the target working state to obtain the memory working state prediction model.

[0022] The present application has the following beneficial effects: by obtaining the training data set and inputting the training data set into the initial memory working state prediction model, the predicted working state of the memory is determined according to the combined features of the memory state sample data. Then, the initial memory working state prediction model is trained according to the predicted working state of the memory and the target working state to obtain the trained memory working state prediction model. The training method of the memory working state prediction model of the present application can reveal the correlation between the memory state data when determining the predicted working state of the memory based on the combined features of the memory state sample data, can comprehensively understand the working condition of the memory from multiple dimensions, and can mine the interaction between the memory state sample data, thereby improving the result accuracy of the predicted working state of the memory.

[0023] In a possible implementation, the combined features of the memory state sample data are determined by: determining a target sample candidate group from a plurality of candidate sample data of the memory state sample data, the target sample candidate group comprising at least two candidate sample data, and the correlation between the candidate sample data in the target sample candidate group being greater than a first preset threshold; and determining the target sample candidate group as the combined features of the memory state sample data.

[0024] It can be understood that, by preliminarily screening the memory state sample data to obtain candidate sample data, then analyzing the correlation of any two data in the candidate sample, and retaining the data with strong correlation and filtering out the data with weak correlation, the irrelevant data can be removed while the key data that really has an impact on the prediction result is retained, thereby improving the accuracy and efficiency of the model in determining the working state of the memory.

[0025] In a third aspect, the embodiments of the present application provide a memory optimization device, comprising: an acquisition module configured to acquire memory state data of a target device, the memory state data comprising memory running state data and memory health state data of the target device; a processing module configured to determine a working state of the memory according to a combination feature of the memory state data, the combination feature being used to indicate a correlation degree between the memory state data; determine a target optimization strategy of the memory based on the working state of the memory, and execute the target optimization strategy.

[0026] In a possible implementation, the processing module is specifically configured to determine a target candidate group from a plurality of candidate data of the memory state data, the target candidate group comprising at least two candidate data, and the correlation degree between the candidate data in the target candidate group being greater than a first preset threshold; and determine the combination feature of the memory state data as the target candidate group.

[0027] In a possible implementation, the processing module is specifically configured to input the combination feature of the memory state data into a memory working state prediction model to determine the working state of the memory.

[0028] In a possible implementation, the target optimization strategy comprises at least one of the following: a data hierarchical management strategy, the data hierarchical management strategy being used to indicate a strategy of performing hierarchical management on data according to the importance of the data; a data dynamic writing strategy, the data dynamic writing strategy being used to indicate an adjustment of a data writing mode; a storage mode switching strategy, the storage mode switching strategy being used to indicate that a user switches a storage mode of the memory between a multi-layer cell storage mode and a single-layer cell storage mode; and an external factor adjustment strategy, the external factor adjustment strategy being used to indicate an adjustment of the running state data of the memory.

[0029] In a possible implementation, the data hierarchical management strategy comprises at least one of the following: not saving temporary data, not saving important data, setting the memory to a read-only mode, uploading data to the cloud for backup and saving, and performing a hardware replacement warning; and / or, the data dynamic writing strategy comprises at least one of the following: adjusting a data writing rate and adjusting a data writing amount. The external factor adjustment strategy comprises at least one of the following: adjusting a temperature of the memory, adjusting a voltage of the memory, adjusting a humidity of the memory, and adjusting a power consumption of the memory.

[0030] In a possible implementation, in a case where the target optimization strategy comprises adjusting the data write amount, the processing module is specifically configured to determine, according to a correspondence between the working state of the memory and the adjustment amount of the data write amount, the adjustment amount of the data write amount corresponding to the working state of the current memory; and adjust the data write amount of the memory based on the adjustment amount of the data write amount.

[0031] In a fourth aspect, an embodiment of the present application provides a training device of a memory working state prediction model, comprising: an acquisition module configured to acquire a training data set, the training data set comprising: combined features of memory state sample data and a target working state corresponding to the combined features of the memory state sample data; the combined features being used to indicate a correlation between memory state data samples in the memory state data; and a processing module configured to input the combined features of the memory state sample data into an initial memory working state prediction model, the initial memory working state prediction model being used to determine a predicted working state of the memory based on the combined features of the memory state sample data; and train the initial memory working state prediction model according to the predicted working state and the target working state to obtain the memory working state prediction model.

[0032] In a possible implementation, the processing module is specifically configured to determine a target sample candidate group from a plurality of candidate sample data of the memory state sample data, the target sample candidate group comprising at least two candidate sample data, and a correlation between the candidate sample data in the target sample candidate group being greater than a first preset threshold; and determine the target sample candidate group as the combined features of the memory state sample data.

[0033] According to the fifth aspect provided by the present application, an electronic device is provided, comprising: a processor and a memory; the memory is used to store processor executable instructions; and the processor is configured to execute the instructions to implement the method of the first aspect or the second aspect and any possible implementation thereof.

[0034] According to the sixth aspect provided by the present application, a vehicle is provided, comprising the electronic device of the fifth aspect.

[0035] According to the seventh aspect provided by the present application, a computer readable storage medium is provided, when instructions in the computer readable storage medium are executed by a processor of an electronic device, the electronic device can execute the method of the first aspect or the second aspect and any possible implementation thereof.

[0036] According to the eighth aspect provided by the present application, a computer program product is provided, the computer program product comprising computer instructions, when the computer instructions are executed on an electronic device, the electronic device executes the method of the first aspect or the second aspect and any possible implementation thereof.

[0037] It should be noted that the technical effects brought by any one of the implementation manners of the third aspect to the eighth aspect can refer to the technical effects brought by the corresponding implementation manners in the first aspect or the second aspect, which will not be repeated here.

[0038] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present application. BRIEF DESCRIPTION OF DRAWINGS

[0039] The accompanying drawings incorporated in and forming a part of the specification illustrate embodiments consistent with the present application and serve to explain the principles of the present application, and are not intended to limit the present application.

[0040] Figure 1 A flowchart of a memory optimization method provided by an embodiment of the present application is shown in the figure;

[0041] Figure 2 A flowchart of a process of obtaining the number of erasing times and the internal bad block rate of the memory provided by an embodiment of the present application is shown in the figure;

[0042] Figure 3 A flowchart of a process of determining a target optimization strategy provided by an embodiment of the present application is shown in the figure;

[0043] Figure 4 A flowchart of another memory optimization method provided by an embodiment of the present application is shown in the figure;

[0044] Figure 5 A flowchart of a training method of a memory working state prediction model provided by an embodiment of the present application is shown in the figure;

[0045] Figure 6 A schematic diagram of a training process of a memory working state prediction model provided by an embodiment of the present application is shown in the figure;

[0046] Figure 7 A schematic diagram of a training process of a target optimization strategy determination model provided by an embodiment of the present application is shown in the figure;

[0047] Figure 8 A structural schematic diagram of a memory optimization device provided by an embodiment of the present application is shown in the figure;

[0048] Figure 9 A structural schematic diagram of a training device of a memory working state prediction model provided by an embodiment of the present application is shown in the figure;

[0049] Figure 10 A structural schematic diagram of an electronic device provided by an embodiment of the present application is shown in the figure. DETAILED DESCRIPTION

[0050] In order for the ordinary person in the art to better understand the technical solutions of the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings.

[0051] It should be noted that the terms "first", "second" and the like in the description and claims of the present application and the above drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all the embodiments consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0052] In the embodiments of the present application, the terms "comprise", "contain" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, article or device comprising a series of elements not only includes those elements, but also includes other elements not explicitly listed, or includes elements inherent to such process, article or device. Without more limitations, the element defined by the sentence "comprises a" does not exclude the presence of another identical element in the process, article or device comprising the element.

[0053] In the embodiments of the present application, the words "exemplary" or "for example" are used to mean serving as an example, instance or illustration. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be construed as being more preferred or advantageous than other embodiments or designs. Rather, the use of the words "exemplary" or "for example" is intended to present concepts in a concrete manner.

[0054] In the related art, the life (working state) of the memory can be predicted by the memory temperature value, voltage value, power consumption value and usage data, but the result obtained by prediction only according to the running data of the memory is not accurate.

[0055] For ease of understanding, the memory optimization method, the training method of the memory working state prediction model and the equipment provided by the present application are specifically introduced below in conjunction with the drawings.

[0056] In some embodiments, the execution subject of the memory optimization method provided by the embodiments of the present application can be a server cluster composed of multiple servers, or a single server, or a computer, or a processor or processing chip in the server or computer, etc. Any one of the devices or equipment with memory optimization function, and the embodiments of the present application do not limit this.

[0057] As Figure 1As shown, the memory optimization method provided by the embodiments of the present application includes the following steps:

[0058] S101, obtaining memory state data of the target device.

[0059] The memory state data includes memory running state data and memory health state data of the target device.

[0060] In some embodiments, the memory running state data includes temperature, voltage, power consumption, environmental humidity, and load of the memory.

[0061] It should be understood that when the memory temperature is too high, the electronic migration phenomenon inside the chip will be intensified. Electronic migration refers to the phenomenon that metal atoms move under the action of current, which will cause the wires inside the chip to gradually deteriorate and shorten the service life of the memory.

[0062] Excessive voltage will cause the memory chip to bear excessive electrical stress, accelerate chip aging, and even directly damage the chip.

[0063] Power consumption reflects the electrical energy consumed by the memory when it is working. High power consumption means that the memory chip generates more heat in a unit of time, further intensifying temperature rise and accelerating memory aging. At the same time, high power consumption may also indicate that the memory is in an abnormal working state, such as internal short circuit or some module failure, which will have a negative impact on the service life of the memory.

[0064] Excessive environmental humidity of the environment in which the memory is located will cause water vapor to condense on the surface of the memory chip, which may cause short circuit and damage the chip. In addition, a humid environment will accelerate the corrosion of metal parts, affect the electrical connection performance of the memory, cause unstable signal transmission, and reduce the reliability and life of the memory.

[0065] The memory is in a high load state, which means that the memory needs to perform a large number of data read and write operations. Frequent read and write will fatigue the memory chip storage unit, reduce its read and write performance, and shorten the service life of the storage unit.

[0066] In some embodiments, the memory health state data includes the number of erase and write operations of the memory and the internal bad block rate.

[0067] The write and erase operations of the data will cause certain wear and tear to the storage unit. Each erase and write process will cause electronic migration in the storage unit, and as the number of erase and write operations increases, the performance of the memory will gradually decrease.

[0068] During the use of the memory, due to various reasons, some storage units cannot work normally, and these storage units that cannot work normally form bad blocks. The appearance of the bad blocks means that the effective storage capacity of the memory is reduced, and at the same time, the stability and performance of the entire memory system can be affected. With the increase of the use time, the number of bad blocks can gradually increase. When the number of bad blocks reaches a certain proportion, it can cause the memory to not work normally.

[0069] It should be understood that by analyzing the number of erase-write times and the number of internal bad blocks, the wear degree and health status of the memory can be accurately mastered, so as to effectively predict the service life of the memory.

[0070] It can be understood that the present application reflects the working state of the memory from different angles based on different parameters. By comprehensively considering these parameters, the working state of the memory can be more comprehensively and accurately evaluated.

[0071] In some embodiments, as shown in Figure 2 The number of erase-write times and the internal bad block rate of the memory can be determined in the following manner:

[0072] The number of erase-write times and the internal bad block rate of the memory are obtained by interacting with the application layer, the application layer initiates a request for obtaining self-monitoring, analysis and reporting technology (S.M.A.R.T.) data, sends the request to the kernel layer through the uniform interface of the encapsulated system of the standard library layer, the kernel layer transmits a data request command (S.M.A.R.T. data request command), the data acquisition command is sent to the hardware layer through the device driver of the driver layer; the hardware layer executes the data acquisition command and returns the S.M.A.R.T. data, the data is transmitted back to the application layer through the driver layer and the kernel layer, the application layer parses the number of erase-write times and the number of bad blocks, and calculates the usage rate and the bad block rate of the memory. The usage rate of the memory is obtained by dividing the number of erase-write times by the maximum number of erase-write times, the bad block rate of the memory is obtained by dividing the number of bad blocks by the total number of blocks, and the usage and remaining life of the memory can be judged through the usage rate and the bad block rate, and corresponding logic is triggered to transmit the data to the cloud platform for monitoring and management. Since there are differences in data acquisition mechanisms for various memory chips, in order to ensure that the data can be accurately acquired, adaptation work must be carried out for different memory chips. Therefore, after receiving the command for obtaining S.M.A.R.T. data, the driver layer needs to first obtain hardware information, and then select a corresponding way to obtain S.M.A.R.T. data according to the hardware information.

[0073] S102, determine the working state of the memory according to the combination characteristics of the memory state data.

[0074] As a possible implementation manner, the combined features of the memory state data are input into the memory working state prediction model to determine the working state of the memory.

[0075] The combined features are used to indicate the correlation between the memory state data.

[0076] In an implementation manner, the memory state data includes temperature, voltage, ambient humidity, power consumption, load, erase-write times, and internal bad block rate, and the combined features of the memory state data include voltage and temperature, temperature and humidity, voltage and load, erase-write times and bad block rate, and the like, any two types of memory state data combinations. For the combined features, the product, ratio, or weighted sum of the two types of memory state data can be obtained.

[0077] In some embodiments, the memory working state prediction model can be a random forest model + survival analysis model. The risk score corresponding to each memory state data and the risk score corresponding to the combined features are obtained through the random forest model. The memory state data, the risk score corresponding to each memory state data, and the risk score corresponding to the combined features are input into the survival analysis model. The working state of the memory is determined by analyzing the relationship between the risk function and the memory state data and the risk score.

[0078] It should be understood that a single state data can reflect the working state of the memory, but can only reflect one aspect of the working state of the memory, while the combined features can reflect the interaction and influence between different factors, thereby more comprehensively and accurately describing the actual working state of the memory.

[0079] S103, determining the target optimization strategy of the memory based on the working state of the memory, and executing the target optimization strategy to optimize the memory of the target device.

[0080] As a possible implementation manner, the target optimization strategy of the memory can be determined according to the target optimization strategy determination model. The initial target optimization strategy determination model is trained according to the existing working state of the memory and the corresponding target optimization strategy, to obtain a trained target optimization strategy determination model. The working state of the memory is input into the trained target optimization strategy determination model to obtain the target optimization strategy of the memory.

[0081] The target optimization strategy determination model can be a rule recommendation system model. The working state of the memory is matched and inferred with the rules in the rule base. The rule base is traversed to determine the rules matched with the working state of the memory and the corresponding target optimization strategy. The rule base can be continuously updated and expanded according to actual needs and experience. If a new optimization method is found, the corresponding rule can be added to the rule base, which has high flexibility.

[0082] AsFigure 3 As shown, the process of determining the target optimization strategy of the memory optimization method provided in the present application includes: inputting temperature, voltage, power consumption, environmental humidity, load, number of erasing times, and internal bad block rate and other raw data into a memory working state prediction model to obtain the working state of the memory, and then inputting the working state of the memory into a target optimization strategy determination model to obtain the target optimization strategy through optimization strategy matching and execute the target optimization strategy.

[0083] Therefore, by obtaining memory state data based on the running state and the health state of the memory, inputting the memory state data into a memory working state prediction model, and determining the working state of the memory according to the memory state data and the combination features of the memory state data, the target optimization strategy is determined according to the working state of the memory. The memory optimization method of the present application obtains memory state data based on the running state and the health state of the memory, which reflects the working state of the memory from different angles. The combination of the running state and the health state of the memory can provide more accurate basis for predicting the working state of the memory. In addition, since the combination features can reveal the correlation between the memory state data, the working state of the memory is determined based on the memory state data and the combination features of the memory state data, which can comprehensively understand the working state of the memory from multiple dimensions, avoiding the one-sidedness of determining the working state of the memory according to a single indicator, so as to more accurately grasp the actual working state of the memory.

[0084] In some embodiments, the target optimization strategy includes at least one of the following: a data hierarchical management strategy, which indicates a strategy for hierarchical management of data according to the importance of the data; a data dynamic writing strategy, which is used to indicate adjustment of data writing mode; a storage mode switching strategy, which is used to switch the storage mode of the memory between multi-layer cell storage mode and single-layer cell storage mode; and an external factor adjustment strategy, which is used to indicate adjustment of the running state data of the memory.

[0085] For example, when the temperature is too high or too low, the memory is optimized by adjusting the environmental temperature through the "external factor adjustment strategy" and reducing the data writing amount and writing rate through the "data dynamic writing strategy".

[0086] When the voltage is too high or too low, the memory is optimized by adjusting the memory voltage through the "external factor adjustment strategy" and reducing the data writing amount and writing rate through the "data dynamic writing strategy".

[0087] When the humidity is too high or too low, the memory is optimized by adjusting the external temperature through the "external factor adjustment strategy" and reducing the data writing amount and writing rate through the "data dynamic writing strategy".

[0088] When the load is too high, the memory is optimized by reducing the amount and rate of data writing through the "data dynamic writing strategy".

[0089] When the number of erase-write times is too high, the memory is optimized by reducing data saving through the "data hierarchical management strategy" and reducing the amount and rate of data writing through the "data dynamic writing strategy".

[0090] When the number of bad blocks is too high, the memory is optimized by reducing data saving through the "data hierarchical management strategy" and reducing the amount and rate of data writing through the "data dynamic writing strategy".

[0091] It should be understood that different levels of data have different importance and frequency of use for the system. Critical data that will affect the normal operation of the system is set to level one to ensure that it has sufficient memory resources and can be quickly accessed and processed, ensuring the stable operation of the core functions of the system. For system logs and other important data that do not affect system operation, set to level two, allocate appropriate memory to ensure that it can be processed in time and not overuse resources. Unimportant temporary data is set to level three and only a small amount of memory is allocated. In the case of memory shortage, it can be cleaned or replaced first to avoid occupying too many resources and achieve a reasonable allocation of memory resources among different types of data. Data classification makes memory management more targeted and organized. The system can use different management strategies for different levels of data, which can reduce the complexity of memory management, reduce errors and performance problems caused by improper memory management, and thus prolong the service life of the memory.

[0092] In some embodiments, the data hierarchical management strategy includes at least one of the following: not saving temporary data, not saving important data, setting the memory to read-only mode, uploading data to the cloud for backup and saving, and performing hardware replacement warning.

[0093] In one implementation, temporary data is not saved: temporary data is usually generated temporarily during system operation, such as intermediate results generated by application programs during runtime, cached temporary files, etc. If these data are saved in memory all the time, they will occupy a large amount of space. Not saving temporary data means that the system releases the memory occupied by these data in time after using them, so that the memory can be used by more important data or processes, thereby improving the efficiency of memory use and avoiding the situation of insufficient memory due to the accumulation of a large amount of temporary data.

[0094] In one implementation, important data is not saved: when the memory resources are extremely scarce, choosing not to save some important data can free up more memory space for critical data. This can ensure that the core functions of the system can continue to run and avoid system crashes due to memory depletion, thereby achieving optimized use of memory to some extent and ensuring the basic operational needs of the system.

[0095] In an implementation, the memory is set to a read-only mode: when the memory region is set to read-only, the program cannot write data in it, which can effectively prevent data from being tampered with or destroyed due to program errors, malware attacks or other unexpected situations. Because the integrity of the data is guaranteed, a series of problems that may be caused by data errors, such as data reloading, system error handling and other additional memory overheads, are avoided, thereby indirectly realizing the optimization of the memory.

[0096] In an implementation, the data is uploaded to the cloud for backup: uploading the data to the cloud for backup can delete or transfer the copies of these data in the local memory to a more space-saving storage medium, thereby releasing a large amount of local memory space. In this way, the local memory can be used to store real-time data currently being processed or programs that require more memory resources, thereby improving the utilization rate of the memory. At the same time, the cloud backup also provides redundant storage of data, which can quickly recover data from the cloud when needed, without worrying about the risk of data loss in the local memory, thereby realizing the rational allocation and optimized use of memory resources.

[0097] In an implementation, a hardware replacement warning is given: by monitoring the working state of the memory, a warning is given when potential signs of memory failure are found. By replacing the hardware in a timely manner, the stability of the system and the integrity of the data can be ensured, and memory abnormalities caused by hardware failure can be avoided, thereby realizing the optimized management of the memory and ensuring that the system can run efficiently and stably, reducing the memory performance degradation and resource waste caused by hardware problems.

[0098] In some embodiments, the data dynamic writing strategy includes at least one of the following: adjusting the data writing rate, adjusting the data writing amount.

[0099] In an implementation, when the working state of the memory is poor, if the data writing rate is too fast, the buffer in the memory can be quickly filled, thereby causing the performance of the memory to decline. By monitoring the working state of the memory, the adjustment amount of the data writing rate is determined according to the working state of the memory, and the data writing rate is adjusted to the target writing rate, so that the data writing rate matches the current working state of the memory.

[0100] In an implementation, when the target optimization strategy includes adjusting the data writing amount, executing the target optimization strategy includes: determining the adjustment amount of the data writing amount corresponding to the current working state of the memory according to the corresponding relationship between the working state of the memory and the adjustment amount of the data writing amount; and adjusting the data writing amount of the memory based on the adjustment amount of the data writing amount.

[0101] The adjustment amount of the data write amount can be determined according to the memory adjustment amplitude, and the memory adjustment amplitude has a linear relationship with the working state of the memory. The relationship between the adjustment amount of the data write amount and the working state of the memory can be determined by the following formula:

[0102]

[0103] wherein x is the working state of the memory, y is the memory adjustment amplitude, and represents the degree of adjustment of the data write amount according to the working state of the memory, and is a constant estimated by the least square method, represents the error amount.

[0104] In some embodiments, when the working state of the memory is poor, the storage mode switching strategy is to switch the storage mode of the memory from the multi-layer cell storage mode to the single-layer cell storage mode. When the working state of the memory is poor,

[0105] In one implementation, before switching the storage mode of the memory from the multi-layer cell storage mode to the single-layer cell storage mode, all data is copied to the backup area to ensure data security. The storage mode is converted from the multi-layer cell (MLC) mode to the single-layer cell (SLC) mode, and after switching, the data of the backup area is copied back to the original storage area according to the priority of the data (critical data, important data, temporary data). SLC has faster read and write speed and better durability than MLC, thereby improving the performance of the memory.

[0106] In some embodiments, the external factor adjustment strategy includes at least one of the following: adjusting the temperature of the memory, adjusting the voltage of the memory, adjusting the humidity of the memory, and adjusting the power consumption of the memory.

[0107] The execution mode of the external factor adjustment strategy includes multiple modes, such as opening the air cooling device to reduce the temperature, adjusting the voltage through the voltage regulator, reducing the data write to reduce the power consumption of the memory, and opening the dehumidification module to reduce the environmental humidity. Here, they will not be introduced one by one.

[0108] In some embodiments, the memory state data can contain a large amount of data, and too much data not only makes the model complex and increases the calculation cost of the model, but also some data is not helpful for determining the working state of the memory. By filtering out unimportant data, the model can pay more attention to key data that really affect the prediction result, thereby improving the accuracy of the prediction result of the model. As shown in Figure 4 The determination process of the combination feature of the above memory state data includes the following steps:

[0109] S401. Determine a target candidate group from a plurality of candidate data of the memory state data.

[0110] The target candidate group includes at least two candidate data, and the correlation between the candidate data in the target candidate group is greater than a first preset threshold.

[0111] As a possible implementation, for each memory state data, determine the variance corresponding to each data in the memory state data, and take the data with variance greater than or equal to a preset threshold as the candidate data corresponding to the memory state data. Determine the correlation between any two candidate data, and take the candidate data with correlation greater than a first preset threshold as the target candidate group.

[0112] It should be understood that the variance is used to measure the dispersion degree of the data. For the memory state data, the variance of the data is calculated, and the features with variance less than the threshold are filtered out. Because the small variance means that the values of the features are relatively stable and change little, the contribution to the prediction result may be small.

[0113] As a possible implementation, the correlation between the candidate data can be determined by calculating the Pearson correlation coefficient of any two data in the candidate data.

[0114] In an implementation, the Pearson correlation coefficient is calculated according to the following formula:

[0115]

[0116] Wherein, r represents the Pearson correlation coefficient, y represents a memory state data, represents the mean value of a memory state data, x represents a memory state data, represents the mean value of another memory state data.

[0117] It should be understood that the Pearson correlation coefficient is used to measure the linear correlation degree between two variables, and the value range is between [-1, 1]. The Pearson correlation coefficient between two data is calculated, and the absolute value is closer to 1, which means that the linear correlation between the two data is stronger, and the influence on the prediction result may be greater; the absolute value is closer to 0, which means that the linear correlation is weaker, and the influence on the prediction result may be smaller.

[0118] S402. Determine the target candidate group as a combination feature of the memory state data.

[0119] Therefore, by preliminarily screening the memory state data to obtain the candidate data, and then analyzing the correlation between any two data in the candidate data, the data with strong correlation is retained and the data with weak correlation is filtered out. In this way, the irrelevant data can be removed while retaining the key data that really affects the prediction result, thereby improving the accuracy and efficiency of the model.

[0120] As Figure 5 indicated, the training method of the memory working state prediction model provided by the embodiments of the present application includes:

[0121] S501, obtaining a training data set.

[0122] The training data set includes: combined features of memory state sample data and target working states corresponding to the combined features of the memory state sample data. The memory state sample data includes a plurality of memory state data samples.

[0123] In an implementation manner, for some memory devices supporting sensor functions, memory state sample data can be obtained through a special hardware interface and a driving program, so as to obtain combined features of the memory state sample data and corresponding target working states.

[0124] In an implementation manner, the memory device can be modeled and simulated. Different memory state data, such as different temperatures, voltages, loads, etc., are set to simulate various running states of the memory, so as to obtain corresponding memory state sample data.

[0125] S502, inputting the combined features of the memory state sample data into an initial memory working state prediction model, the initial memory working state prediction model being used to determine a predicted working state of the memory based on the combined features of the memory state sample data.

[0126] The combined features are used to indicate the correlation between the memory state data samples in the memory state data.

[0127] As a possible implementation manner, a risk score corresponding to each combined feature of the memory state sample data is determined, and the predicted working state of the memory is determined according to the risk score corresponding to each combined feature of the memory state sample data.

[0128] As a possible implementation manner, a risk score corresponding to each memory state sample data and a risk score corresponding to each combined feature of the memory state sample data are determined; and the predicted working state of the memory is determined based on the risk score corresponding to each memory state sample data and the risk score corresponding to each combined feature of the memory state sample data.

[0129] In an implementation manner, the risk scores corresponding to the memory state sample data and the combined features of the memory state sample data are determined by the following formula:

[0130]

[0131] wherein, represents the risk score of the input sample X in the random forest model, and B represents the number of decision trees in the random forest model, represents the prediction result of the bth tree in the random forest model on the input sample X.

[0132] In some embodiments, the combined feature of the memory state sample data is determined by: determining a target sample candidate group from a plurality of candidate sample data of the memory state sample data, the target sample candidate group including at least two candidate sample data, and the correlation between the candidate sample data in the target sample candidate group being greater than a first preset threshold; and determining the target sample candidate group as the combined feature of the memory state sample data.

[0133] It should be noted that the combined feature of the memory state sample data can refer to the description of the above embodiments, which will not be repeated here.

[0134] S503, training the initial memory working state prediction model according to the predicted working state and the target working state to obtain a memory working state prediction model.

[0135] As a possible implementation, by comparing the predicted working state and the target working state, the parameters in the initial memory working state prediction model can be adjusted based on an optimization algorithm (such as a gradient descent optimization algorithm) to make the predicted working state of the initial memory working state prediction model as close as possible to the target working state, thereby continuously optimizing the performance of the model.

[0136] In some embodiments, the memory working state prediction model of the present application is a combination of a random forest model and a survival analysis model, and when training the initial memory working state prediction model, only the parameters of the random forest model are adjusted to optimize the model.

[0137] In one implementation, the model can be optimized by adjusting the number of trees: the more the number of trees, the better the overall performance of the random forest, but the calculation cost and training time will also increase. If the number of trees is too small, the model may not be able to fully capture the complex patterns in the data, resulting in underfitting; and if the number of trees is too large, overfitting may occur, and the efficiency of training and prediction will be reduced. Therefore, the number of trees needs to be adjusted to balance the accuracy and efficiency of the model.

[0138] In another implementation, the model can be optimized by adjusting the maximum depth of the node: the maximum depth of the node limits the growth depth of the decision tree. If the depth is too small, the decision tree may be too simple and cannot learn the complex relationships in the data, resulting in insufficient expression ability of the model and underfitting; if the depth is too large, the decision tree may overfit the training data and have poor generalization ability for new data. By adjusting the maximum depth of the node, the complexity of the decision tree can be controlled, the generalization performance of the random forest can be improved, and the accuracy of the risk score can be improved.

[0139] Thus, by obtaining the training data set, the training data set is input into the initial memory working state prediction model, so as to determine the predicted working state of the memory according to the combined features of the memory state sample data. Then, the initial memory working state prediction model is trained according to the predicted working state of the memory and the target working state, and a trained memory working state prediction model is obtained. The training method of the memory working state prediction model of the present application can reveal the correlation between the memory state data when determining the predicted working state of the memory based on the combined features of the memory state sample data, can comprehensively understand the working condition of the memory from multiple dimensions, and can mine the interaction between the memory state sample data, thereby improving the result accuracy of the predicted working state of the memory.

[0140] The process of the training method of the memory working state prediction model will be described below. Figure 6

[0141] First, the memory state sample data is obtained. The temperature data can be obtained by a temperature acquisition module, the voltage data can be acquired by a voltage detection module, the power consumption data can be obtained by a power consumption calculation module, the humidity data can be acquired by a humidity detection module, the load data can be obtained by a load calculation module, and the number of erasing and writing times and the bad block rate can be obtained by a memory data module.

[0142] Data preprocessing is performed, including data screening and data standardization.

[0143] Data screening: abnormal values in the memory state sample data are screened out, and missing values therein are processed to ensure data quality.

[0144] Data standardization: the data is converted according to a unified format to ensure data standardization.

[0145] Data feature construction is performed, including feature extraction and combination and feature selection.

[0146] Feature extraction and combination: combined features between data are obtained, including voltage and temperature, temperature and humidity, voltage and load, number of erasing and writing times and bad block rate, etc.

[0147] Feature selection: the features with small influence on the prediction result and the key features are filtered by combining the variance threshold method and the Pearson correlation coefficient method, the risk of data fitting is reduced, and the reliability and stability of the model are improved.

[0148] Model construction is performed: data segmentation, model selection and parameter optimization.

[0149] ​Data partitioning: temperature, voltage, ambient humidity, load, number of erase-write cycles, and bad block rate and various combination feature data are divided into training set (70%), validation set (15%), and test set (15%).

[0150] Model selection and parameter tuning: input the data samples into the random forest model to generate a risk score for each sample, and input the risk score generated by the random forest model into the survival analysis model to obtain a predicted working state.

[0151] Model training: training data set and model fitting, model fitting refers to adjusting the parameters of the memory working state prediction model using the training data set.

[0152] Model evaluation: index evaluation and parameter optimization, index evaluation is to measure the performance and prediction ability of the model using some specific indicators. After obtaining the evaluation results of the model, if the performance of the model does not meet the expected, parameter optimization is needed.

[0153] The following will be combined Figure 7 to explain the training process of the target optimization strategy determination model.

[0154] By training the memory working state output by the memory working state prediction model, the memory working state is associated with the optimization strategy using the rule recommendation system model, and then the optimal memory optimization strategy, the execution mode of the strategy and the combination execution of the strategy are selected. The specific steps of the training process include: establishing the correspondence between the memory working state and the data hierarchical management strategy: after inputting the working state of the memory, the working state of the memory is analyzed, and it is matched with the established data hierarchical management strategy, and the applicable data hierarchical management mode under different memory states is determined.

[0155] Linear modeling of data dynamic write strategy: using linear modeling method, the data dynamic write strategy is quantitatively analyzed, the linear model is constructed, and the relationship between data write quantity and memory working state is described.

[0156] Storage mode switching strategy matching: according to the working state of the memory, the corresponding storage mode switching strategy is combined to determine how to perform the storage mode switching operation under different memory states.

[0157] External factor adjustment strategy matching: according to the working state of the memory, the external factor adjustment strategy is matched to realize the adjustment of the external related factors according to the memory state.

[0158] Data classification management strategy: the data stored in memory needs to be classified during model training, the classification standard is the influence degree of the data, and the specific execution strategy is determined according to the target optimization strategy, including but not limited to: not saving temporary data, not saving important data, setting memory to read-only mode, uploading data to the cloud for backup, and performing hardware replacement warning.

[0159] Data dynamic writing strategy: dynamically adjust the writing rate and size of data according to the working state of the memory, when the working state is good, do not limit the data writing, when the working state is poor, increase the cache size of the data, reduce the number of writing memory, at the same time judge the necessity of data writing, reduce the amount of data writing, the cache size and the amount of data writing are dynamically adjusted with the working state of the memory. The relationship between the adjustment amount of data writing and the working state of the memory can be determined according to formula (1), in the training stage, get and After that, according to the following formula, correct and , the optimal value can be obtained.

[0160]

[0161] Where n is the number of training samples; is the i-th observation, is the working state of the memory. Residual Sum of Squares (RSS) represents the sum of squares of the difference between and . By minimizing RSS, the optimal parameters and can be found, so that the target optimization strategy determines the model to fit the data as much as possible in the training stage. Storage mode switching strategy: since writing MLC as SLC will cause the storage capacity to be halved, therefore, when executing this strategy, it needs to be combined with the data classification management strategy, and the key data is saved first, then the important data, and finally the temporary data. In specific implementation, first copy all data to the standby area, then run the mode switching strategy to write MLC as SLC, and after completion, copy the data in the standby area back according to the data priority order.

[0162] External factor adjustment strategy: mainly adjusts the temperature, voltage, power consumption and environmental humidity of the memory, including turning on the air cooling device to reduce the temperature, adjusting the voltage through the voltage regulator, reducing the memory power consumption by reducing the data writing, turning on the dehumidification module to reduce the environmental humidity, etc.

[0163]

[0164] ​The above describes the solutions provided by the embodiments of the present application mainly from the method aspect. In order to implement the above functions, the memory optimization apparatus or the electronic device comprises hardware structures and / or software modules corresponding to the respective functions. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of the examples described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is implemented in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0165] The embodiments of the present application can divide the memory optimization apparatus or the electronic device into functional modules according to the above method. For example, the memory optimization apparatus or the electronic device can comprise functional modules corresponding to the respective functions, or two or more functions can be integrated into one processing module. The integrated module can be implemented in the form of hardware or software functional module. It should be noted that the division of modules in the embodiments of the present application is illustrative, and is only a logical functional division. Actual implementation can have another division manner.

[0166] With reference to Figure 8 The memory optimization apparatus 800 provided by the embodiments of the present application comprises an acquisition module 801 and a processing module 802.

[0167] The acquisition module 801 is configured to acquire memory state data of a target device, wherein the memory state data comprises memory running state data and memory health state data of the target device.

[0168] The processing module 802 is configured to determine a working state of the memory according to a combination feature of the memory state data, wherein the combination feature is used to indicate a correlation degree between the memory state data; determine a target optimization strategy of the memory based on the working state of the memory, and execute the target optimization strategy.

[0169] In a possible implementation, the processing module 802 is specifically configured to determine a target candidate group from a plurality of candidate data of the memory state data, wherein the target candidate group comprises at least two candidate data, and the correlation degree between the candidate data in the target candidate group is greater than a first preset threshold; and determine the target candidate group as the combination feature of the memory state data.

[0170] In a possible implementation, the processing module 802 is specifically configured to input the combination feature of the memory state data into a memory working state prediction model, and determine the working state of the memory.

[0171] In a possible implementation, the target optimization strategy includes at least one of the following: a data hierarchical management strategy, the data hierarchical management strategy indicating a strategy of managing data according to importance of the data; a data dynamic writing strategy, the data dynamic writing strategy being used to indicate adjustment of a data writing manner; a storage mode switching strategy, the storage mode switching strategy being used to indicate switching, by a user, of a storage mode of the memory between a multi-layer cell storage mode and a single-layer cell storage mode; and an external factor adjustment strategy, the external factor adjustment strategy being used to indicate adjustment of running state data of the memory.

[0172] In a possible implementation, the data hierarchical management strategy includes at least one of the following: no temporary data is saved, no important data is saved, the memory is set to a read-only mode, data is uploaded to a cloud for backup and saving, and a hardware replacement warning is given; and / or, the data dynamic writing strategy includes at least one of the following: adjustment of a data writing rate and adjustment of a data writing amount. The external factor adjustment strategy includes at least one of the following: adjustment of a temperature of the memory, adjustment of a voltage of the memory, adjustment of a humidity of the memory, and adjustment of power consumption of the memory.

[0173] In a possible implementation, in a case where the target optimization strategy includes adjustment of the data writing amount, the processing module 802 is specifically configured to: determine, according to a corresponding relationship between a working state of the memory and an adjustment amount of the data writing amount, an adjustment amount of the data writing amount corresponding to the working state of the current memory; and adjust the data writing amount of the memory based on the adjustment amount of the data writing amount.

[0174] With reference to Figure 9 The training apparatus 900 of the memory working state prediction model provided in this embodiment of the present application includes:

[0175] The obtaining module 901 is configured to obtain a training data set, the training data set including: combined features of memory state sample data and target working states corresponding to the combined features of the memory state sample data; and the combined features are used to indicate a correlation degree between memory state data samples in the memory state data.

[0176] The processing module 902 is configured to input the combined features of the memory state sample data into an initial memory working state prediction model, the initial memory working state prediction model being used to determine a predicted working state of the memory based on the combined features of the memory state sample data; and train the initial memory working state prediction model according to the predicted working state and the target working state, to obtain the memory working state prediction model.

[0177] In a possible implementation, the processing module 902 is specifically configured to determine a target sample candidate group from the plurality of candidate sample data of the memory state sample data, the target sample candidate group including at least two candidate sample data, and a correlation between the candidate sample data in the target sample candidate group being greater than a first preset threshold; and determine the target sample candidate group as a combination feature of the memory state sample data.

[0178] As shown in Figure 10 The electronic device 1000 provided by the embodiments of the present application includes but is not limited to a processor 1001 and a memory 1002.

[0179] The memory 1002 is configured to store executable instructions of the processor 1001. It can be understood that the processor 1001 is configured to execute the instructions to implement the memory optimization method or the training method of the memory working state prediction model in the above embodiments.

[0180] It should be noted that those skilled in the art can understand that the electronic device structure shown in Figure 10 does not constitute a limitation on the electronic device. The electronic device can include more or fewer components than those shown in Figure 10 , or combine certain components, or arrange different components.

[0181] The processor 1001 is the control center of the electronic device, connects all parts of the electronic device through various interfaces and lines, executes the software programs and / or modules stored in the memory 1002 and calls the data stored in the memory 1002, performs various functions and processes data of the electronic device, and thus monitors the whole electronic device. The processor 1001 can include one or more processing units. Optionally, the processor 1001 can integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface and application programs, etc., and the modem processor mainly processes wireless communication. It can be understood that the modem processor can also not be integrated into the processor 1001.

[0182] The memory 1002 can be used to store software programs and various data. The memory 1002 can mainly include a program storage area and a data storage area, wherein the program storage area can store the operating system, the application programs (such as the determining unit, the processing unit, etc.) required by at least one functional module, etc. In addition, the memory 1002 can include a high-speed random access memory, and can also include a non-volatile memory, for example, at least one magnetic disk storage device, a flash memory device, or other volatile solid-state memory device.

[0183] In the exemplary embodiments, a vehicle is also provided, including the above-mentioned electronic device or the above-mentioned target device.

[0184] In an example embodiment, a computer readable storage medium including instructions, such as the memory 1002 including instructions, is also provided, which can be executed by the processor 1001 of the electronic device 1000 to implement the method in the above embodiments.

[0185] In actual implementation, Figure 8 and Figure 9 The functions of each module in the above embodiments can be implemented by the processor 1001 in the above embodiments calling the computer program stored in the memory 1002. The specific execution process can refer to the description of the method part in the above embodiments, which will not be described here. Figure 10

[0186] Optionally, the computer readable storage medium can be a non-transitory computer readable storage medium, for example, the non-transitory computer readable storage medium can be a read-only memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device, etc.

[0187] In an example embodiment, the embodiments of the present application also provide a computer program product including one or more instructions, which can be executed by the processor 1001 of the electronic device to complete the method in the above embodiments.

[0188] It should be noted that the instructions in the above computer readable storage medium or the one or more instructions in the computer program product are executed by the processor of the electronic device to realize each process of the above method embodiments, and can achieve the same technical effects as the above method. To avoid repetition, it will not be described here.

[0189] Through the description of the above embodiments, those skilled in the art can clearly understand that, for the convenience and brevity of description, only the above division of functional modules is taken as an example for illustration. In actual application, the above functions can be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the above described functions.

[0190] ​In several embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented by other manners. For example, the apparatus embodiments described above are merely illustrative, for example, the division of the modules or units is merely a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another apparatus, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units or components shown or discussed can be indirect coupling or communication connection through some interfaces, apparatuses or units, and can be electrical, mechanical or other forms.

[0191] The units described as separate components can or can not be physically separate, and the components shown as units can be one physical unit or a plurality of physical units, that is, can be located in one place, or can be distributed to a plurality of different places. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment scheme.

[0192] In addition, the functional units in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.

[0193] If the integrated unit is realized in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of the present application essentially or the parts that make contributions to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product, which is stored in a storage medium and includes a plurality of instructions for making a device (which can be a single chip, a chip, etc.) or a processor execute all or part of the steps of the method of the embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a ROM, a RAM, a magnetic disk or an optical disk, and various storage medium that can store program codes. The above is merely a specific embodiment of the present application, but the protection scope of the present application is not limited thereto, and any change or replacement within the technical scope disclosed in the present application should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A memory optimization method, characterized in that, include: Acquire memory status data of the target device, the memory status data including memory operating status data and memory health status data of the target device; The memory operating status data includes: memory temperature, voltage, power consumption, ambient humidity, and load; the memory health status data includes: the number of erase / write cycles and the internal bad block rate of the memory. A target candidate group is determined from multiple candidate data of the memory state data, the target candidate group includes at least two candidate data, and the correlation between the candidate data in the target candidate group is greater than a first preset threshold. The target candidate group is determined as a combination feature of the memory state data; The combined features of the memory state data are input into the memory operating state prediction model to determine the operating state of the memory; the combined features are used to indicate the correlation between the memory state data. The target optimization strategy for the memory is determined based on the memory's working state, and the target optimization strategy is executed. The memory operating state prediction model includes a random forest model and a survival analysis model; the step of inputting the combined features of the memory state data into the memory operating state prediction model to determine the memory operating state includes: The risk score corresponding to each type of memory state data and the risk score corresponding to the combined features are obtained through the random forest model. Each type of memory state data, the risk score corresponding to each type of memory state data, and the risk score corresponding to the combined features are input into the survival analysis model to determine the working state of the memory.

2. The memory optimization method according to claim 1, characterized in that, The target optimization strategy includes at least one of the following: A data hierarchical management strategy, which refers to a strategy of hierarchically managing data according to its importance; A dynamic data writing strategy, wherein the dynamic data writing strategy is used to indicate the adjustment of the data writing method; A storage mode switching strategy, wherein the storage mode switching strategy is used to indicate switching the memory storage mode between a multi-level cell storage mode and a single-level cell storage mode; An external factor adjustment strategy is used to instruct adjustments to the memory's operating state data.

3. The memory optimization method according to claim 2, characterized in that, The data hierarchical management strategy includes at least one of the following: not saving temporary data, not saving important data, setting memory to read-only mode, uploading data to the cloud for backup and storage, and issuing hardware replacement warnings. And / or, The dynamic data writing strategy includes at least one of the following: adjusting the data writing rate and adjusting the data writing volume; The external factor adjustment strategy includes at least one of the following: adjusting the memory temperature, adjusting the memory voltage, adjusting the memory humidity, and adjusting the memory power consumption.

4. The memory optimization method according to claim 3, characterized in that, When the target optimization strategy includes adjusting the amount of data written; The execution of the target optimization strategy includes: Based on the correspondence between the memory's working state and the adjustment amount of the data write volume, determine the adjustment amount of the data write volume corresponding to the current memory's working state; Adjust the amount of data written to memory based on the adjustment amount of the data written amount.

5. A training method for a memory operating state prediction model, characterized in that, include: Obtain a training dataset, which includes: combined features of memory state sample data and target working states corresponding to the combined features of the memory state sample data; the combined features are used to indicate the correlation between the memory state sample data. A target sample candidate group is determined from multiple candidate sample data of the memory state sample data, wherein the target sample candidate group includes at least two candidate sample data, and the correlation between the candidate sample data in the target sample candidate group is greater than a first preset threshold. The target sample candidate group is determined as a combination feature of the memory state sample data; The combined features of the memory state sample data are input into an initial memory working state prediction model, which is used to determine the predicted working state of the memory based on the combined features of the memory state sample data. The initial memory working state prediction model is trained based on the predicted working state and the target working state to obtain the memory working state prediction model. The memory operating state prediction model includes a random forest model and a survival analysis model; the step of inputting the combined features of the memory state sample data into the initial memory operating state prediction model, the initial memory operating state prediction model being used to determine the predicted operating state of the memory based on the combined features of the memory state sample data, includes: The risk score corresponding to each memory state sample data and the risk score corresponding to the combined features of each memory state sample data are determined by the random forest model. The predicted working state of the memory is determined by the survival analysis model based on the risk score corresponding to each memory state sample data and the risk score corresponding to the combined features of each memory state sample data.

6. A memory optimization device, characterized in that, include: The acquisition module is used to acquire memory status data of the target device, the memory status data including memory running status data and memory health status data of the target device; The memory operating status data includes: memory temperature, voltage, power consumption, ambient humidity, and load; the memory health status data includes: the number of erase / write cycles and the internal bad block rate of the memory. A processing module is configured to: determine a target candidate group from multiple candidate data of the memory state data, wherein the target candidate group includes at least two candidate data, and the correlation between the candidate data in the target candidate group is greater than a first preset threshold; determine the target candidate group as a combined feature of the memory state data; input the combined feature of the memory state data into a memory working state prediction model to determine the working state of the memory; the combined feature is used to indicate the correlation between the memory state data; determine a target optimization strategy for the memory based on the working state of the memory, and execute the target optimization strategy; The memory operating state prediction model includes a random forest model and a survival analysis model; the processing module is used to obtain the risk score corresponding to each type of memory state data and the risk score corresponding to the combined feature through the random forest model; and input each type of memory state data, the risk score corresponding to each type of memory state data, and the risk score corresponding to the combined feature into the survival analysis model to determine the operating state of the memory.

7. A training device for a memory operating state prediction model, characterized in that, include: The acquisition module is used to acquire a training dataset, which includes: combined features of memory state sample data and target working states corresponding to the combined features of the memory state sample data; the combined features are used to indicate the correlation between the memory state sample data. A processing module is configured to: determine a target sample candidate group from multiple candidate sample data of the memory state sample data, wherein the target sample candidate group includes at least two candidate sample data, and the correlation between the candidate sample data in the target sample candidate group is greater than a first preset threshold; determine the target sample candidate group as a combined feature of the memory state sample data; input the combined feature of the memory state sample data into an initial memory working state prediction model, wherein the initial memory working state prediction model is used to determine the predicted working state of the memory based on the combined feature of the memory state sample data; and train the initial memory working state prediction model according to the predicted working state and the target working state to obtain the memory working state prediction model. The memory operating state prediction model includes a random forest model and a survival analysis model. The processing module is used to determine the risk score corresponding to each memory state sample data and the risk score corresponding to the combined features of each memory state sample data through the random forest model; and to determine the predicted operating state of the memory based on the risk score corresponding to each memory state sample data and the risk score corresponding to the combined features of each memory state sample data through the survival analysis model.

8. An electronic device, characterized in that, include: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the instructions to implement the memory optimization method as described in any one of claims 1 to 4, or the training method for the memory working state prediction model as described in claim 5.

9. A vehicle, characterized in that, include: The electronic device as described in claim 8.

Citation Information

Patent Citations

  • Memory state detection method and device, communication equipment and storage medium

    CN116680112A

  • Working frequency adjustment method of memory, intelligent terminal and storage medium

    CN118051333A

  • Micro-service memory allocation method and device, equipment, medium and product

    CN118916161A