A data processing method and device

By responding to preset conditions in the solid-state drive and storing data in the data high-reserved area, the problem of data loss in the solid-state drive in the long-term out-of-power or high-temperature environment is solved, ensuring long-term storage of data and normal starting of the device.

CN114153643BActive Publication Date: 2025-03-21LENOVO (BEIJING) LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111443717.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-30
Publication Date
2025-03-21
Estimated Expiration
2041-11-30

AI Technical Summary

Technical Problem

Operating system data in solid-state drives are easily lost in long-term power-on or in high-temperature environments, resulting in startup errors.

Method used

A data processing method is provided, in which data is stored in a data high reservation area of ​​the storage device in response to preset conditions, and the capacity of a single data storage unit of the data high reservation area is smaller than that of the data low reservation area. Preset conditions include the factory status, data operation instructions, preset data identification, power outage time and number of erases.

Benefits of technology

Ensure that in the long-term power-on or harsh environment of electronic devices, the write data in the storage device will not be lost, and avoid affecting the normal startup of the electronic device.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114153643B_ABST
    Figure CN114153643B_ABST
Patent Text Reader

Abstract

The present application provides a data processing method, which is applied to a storage device, comprising: in response to a preset condition, storing data in a data high retention area of ​​the storage device, wherein the capacity of a single data storage unit in the data high retention area is smaller than the capacity of a single data storage unit in the data low retention area; the preset condition includes at least one of the storage device being in a ready-to-ship state, a data operation instruction, a preset data identifier, a power-off duration of the storage device, and the number of erasures and writes of the storage device. At the same time, the present application also provides an electronic device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to data storage technology, and more particularly to a data processing method and device. Background Art

[0002] With the popularity and use of Quad Level Cell (QLC) SSDs, the operating system data in the SSD may be at risk of data loss when it is not powered on for a long time or in high temperature and other external environments, resulting in startup errors and other problems in the operating system during later use. Summary of the invention

[0003] In view of this, embodiments of the present application hope to provide a data processing method and an electronic device.

[0004] The technical solution of this application is implemented as follows:

[0005] According to one aspect of the present application, a data processing method is provided, the method being applied to a storage device, the method comprising:

[0006] In response to a preset condition, storing the data in a data high retention area of ​​the storage device,

[0007] Wherein, the capacity of a single data storage unit in the data high retention area is smaller than the capacity of a single data storage unit in the data low retention area;

[0008] The preset condition includes at least one of the storage device being in a ready-to-ship state, a data operation instruction, a preset data identifier, a power-off duration of the storage device, and the number of erase and write times of the storage device.

[0009] In the above solution, the data high retention area storing data in the storage device includes:

[0010] If the data corresponds to a data migration to data high retention area instruction, in response to the data migration to data high retention area instruction, the data in the data low retention area is migrated to the data high retention area;

[0011] Alternatively, if the data corresponds to a command to write data into a data high reserved area, in response to the command to write data into a data high reserved area, the data is directly stored in the data high reserved area.

[0012] The above scheme also includes:

[0013] If the migration of the data in the data low retention area to the data high retention area is completed, a feedback instruction indicating the completion of the data migration is sent and recorded.

[0014] In the above solution, when the preset condition includes a preset data identifier, the method further includes:

[0015] If the data carries the preset data identifier, the data carrying the preset data identifier is stored in the data high retention area.

[0016] In the above solution, when the preset condition includes the power-off duration of the storage device, the method further includes:

[0017] If the power-off duration of the storage device in the ready-to-ship state does not exceed a first preset duration, storing the data in a data high retention area of ​​the storage device;

[0018] Alternatively, if the power-off duration of the storage device in the factory-delivered state exceeds a second preset duration, the data is stored in a data high retention area of ​​the storage device.

[0019] In the above solution, when the preset condition includes the number of erasure and writing times of the storage device, the method further includes:

[0020] If the number of erasure and writing times of the storage device is detected, storing the data in a data high retention area of ​​the storage device;

[0021] Alternatively, if it is detected that the erasure and writing times of the storage device do not exceed the preset erasure and writing times, the data are stored in the data high retention area of ​​the storage device;

[0022] Alternatively, if it is detected that the erasure and writing times of the storage device exceeds the preset erasure and writing times, the data in the data low retention area is migrated to the data high retention area.

[0023] In the above scheme, the method further includes:

[0024] If the data has corresponding write parameters, the storage capacity of the data high retention area and the data low retention area is dynamically adjusted according to the write parameters, wherein the write parameters at least characterize the data capacity of the data.

[0025] The above scheme also includes:

[0026] When the storage device is in a shipped state, if a data migration to data low retention area instruction is received, the data in the data high retention area is migrated to the data low retention area in response to the data migration to data low retention area instruction.

[0027] The above scheme also includes:

[0028] If the storage device is switched from a power-off state to a power-on state, the data in the data high retention area is migrated to the data low retention area.

[0029] According to another aspect of the present application, there is provided an electronic device, including:

[0030] A storage device for storing data;

[0031] The processing unit is used to store the data into the storage device by using the above data processing method.

[0032] The present application provides a data processing method and device, which stores data in a high data retention area of ​​a storage device in response to a preset condition, wherein the capacity of a single data storage unit in the high data retention area is smaller than the capacity of a single data storage unit in the low data retention area; in this way, when the electronic device is not powered on for a long time or in a harsh external environment, it can be ensured that there will be no problems with the writing of data in the storage device, thereby not affecting the normal startup of the electronic device. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 This is a schematic diagram of the process implementation of the data processing method in this application Figure 1 ;

[0034] Figure 2 This is a schematic diagram of the process implementation of the data processing method in this application Figure 2 ;

[0035] Figure 3 This is a schematic diagram of the process implementation of the data processing method in this application Figure 3 ;

[0036] Figure 4 The structure of the electronic device in this application is shown in FIG. Figure 1 ;

[0037] Figure 5 This is a schematic diagram of the structure of the electronic device in this application. Figure 2 . DETAILED DESCRIPTION

[0038] The technical solution of the present application is further elaborated in detail below in conjunction with the accompanying drawings and specific embodiments of the specification.

[0039] Figure 1 This is a schematic diagram of the process implementation of the data processing method in this application Figure 1 ,like Figure 1 As shown, the method includes:

[0040] Step 101 , in response to a preset condition, storing data in a data high retention area of ​​the storage device.

[0041] The capacity of a single data storage unit in the high data retention area is smaller than that of a single data storage unit in the low data retention area. For example, the low data retention area is a four-bit storage unit (QLC) or a five-bit storage unit (PLC), and the high data retention area is a single-bit storage unit (SLC).

[0042] The preset condition includes at least one of the storage device being in a ready-to-ship state, a data operation instruction, a preset data identifier, a power-off duration of the storage device, and the number of erase and write times of the storage device.

[0043] In the present application, the method can be applied to a storage device, for example, the storage device is a solid state hard disk, and the storage device has a low data retention area and a high data retention area. When a user writes data to the storage device, the write data can usually be randomly stored in the low data retention area and the high data retention area. It can also be determined according to the user's operation instruction whether to store the write data in the low data retention area or the high data retention area.

[0044] Specifically, when a user writes data to a storage device, the data may have a corresponding data operation instruction. When the storage device meets a preset condition, if the data operation instruction corresponding to the data is a data migration to data high retention area instruction, the data in the data low retention area is migrated to the data high retention area in response to the data migration to data high retention area instruction. Alternatively, if the data operation instruction corresponding to the data is a data write to data high retention area instruction, the data is directly stored in the data high retention area in response to the data write to data high retention area instruction. In this way, the write data can be stored in the data high retention area in different ways to achieve long-term storage of data in the solid-state hard disk.

[0045] In the present application, if the data in the low data retention area is migrated to the high data retention area by data migration, then after the migration is completed, the storage device can also send and record the feedback instruction of the completion of the data migration to the electronic device where the storage device is located. Here, the electronic device where the storage device is located can be a server or a computer terminal. Specifically, the storage device can send a feedback instruction of the completion of the data migration to the central processing unit (CPU) of the electronic device. So that the electronic device records the data storage status of the storage device according to the feedback instruction.

[0046] In one implementation, if the preset condition includes that the storage device is in a state ready for shipment, the storage device may store all data in a high data retention area of ​​the storage device. In this way, the storage device can ensure data integrity in the state ready for shipment, and the electronic device can be started normally after it leaves the factory and reaches the user.

[0047] For example, if it is detected that the storage device has been in a power-off state and has never been powered on, it can be determined that the storage device is in a factory-ready state. When data is written for the first time after the storage device is powered on, the written data is stored in the data high retention area.

[0048] In another implementation, if the preset condition includes a data operation instruction, then if the storage device detects a data operation instruction representing the migration of data to the high data retention area, all or part of the data in the low data retention area will be migrated to the high data retention area in response to the data operation instruction for the migration of data to the high data retention area; or, if the storage device detects a data operation instruction representing the writing of data to the high data retention area, the write data will be directly stored in the high data retention area in response to the data operation instruction for writing data to the high data retention area. In this way, data preservation in the high data retention area can be achieved in different ways, so that data randomly stored in the low data retention area and the high data retention area can also be stored in the high data retention area, so that the data preservation time in the storage device can be increased, and the storage device can be prevented from being affected by long-term power failure and causing data loss or abnormality.

[0049] In another implementation, if the preset condition includes a preset data identifier, the storage device can detect whether the data in the storage device or the current write data carries the preset data identifier. If it is detected that the data stored in the storage device or the current write data carries the preset data identifier, the data carrying the preset data identifier is stored in the data high retention area. In this way, long-term storage of partial data or specific data can be guaranteed. For example, system data can carry a preset data identifier that indicates that it is to be stored in the data high retention area to ensure that the electronic device can be started normally without being affected by environmental factors or long-term power outages.

[0050] In another implementation, if the preset condition includes the power-off duration of the storage device, the storage device can also detect the current power-on record of the storage device. If it is found that the current power-on record of the storage device is zero, it is determined that the current storage device is in a waiting-to-ship state, and it is further confirmed whether the power-off duration of the storage device in the waiting-to-ship state exceeds the first preset duration (for example, 7 years). If the power-off duration of the storage device in the waiting-to-ship state does not exceed the first preset duration (or is within the first preset duration), all data in the storage device (including data in the low data retention area and the high data retention area) are stored in the high data retention area of ​​the storage device. In this way, it can be ensured that the data in the storage device is not affected by external environmental factors and long-term power-off factors, and it can be ensured that the electronic device can be started normally when it reaches the user, and the integrity of the data in the storage device is ensured.

[0051] Here, the first preset duration is usually the duration estimated by the technician, and can also be set based on actual needs.

[0052] In the present application, the storage device can also receive an access request for the data within the first preset time period, and successfully access the data from the data high retention area based on the access request. In this way, the data can be preserved for a long time, so that the user can successfully access the data.

[0053] In the present application, the storage device may also include a low-power temperature control chip, through which the ambient temperature of the storage device can be detected within the first preset time when the storage device is not powered on, and if the ambient temperature is detected to be greater than the preset temperature, the current temperature of the storage device is reduced so that the current temperature of the storage device is always maintained at a state less than or equal to the preset temperature. In this way, the situation where the storage device is affected by environmental factors and causes data anomalies can be reduced.

[0054] Here, the preset temperature is, for example, 43 degrees.

[0055] In the present application, the storage device can also detect the power-on state of the storage device within the first preset time. If the storage device is detected to be in the power-on state, when the storage device switches from the power-on state to the power-off state, the power-off time of the storage device in the factory-ready state is recalculated from the current power-off time to see whether it exceeds the first preset time. In this way, the storage time of data in the high data retention area can be guaranteed.

[0056] In another implementation, if the electronic device including the storage device has been shipped from the factory to the user, or there is a power-on record, the storage device can also detect whether the power-off duration of the storage device in the factory state exceeds a second preset duration. If the power-off duration of the storage device in the factory state exceeds the second preset duration, all data in the storage device (including data in the low data retention area and the high data retention area) are stored in the high data retention area of ​​the storage device.

[0057] Here, the second preset time period can usually be a time period set by the user. For example, if the user does not need to use the electronic device (such as a computer) including the storage device for a period of time, the user can manually set a second preset time period, and when it is confirmed that the power-off time of the storage device will exceed the second preset time period, all data will be saved in the data high retention area, so as to avoid the risk of data loss caused by the user not using the electronic device for a long time or the electronic device not being powered on for a long time.

[0058] In the present application, if the preset condition includes the erasure and writing times of the storage device, the storage device can also detect the erasure and writing times of the storage device. If the erasure and writing times of the storage device are detected to be greater than zero, all the data in the storage device (including the data in the low data retention area and the high data retention area) and the current write data are stored in the high data retention area. This ensures that the data in the storage device is stored for a long time without being affected by environmental factors or long-term power failures and causing data anomalies.

[0059] In the present application, the storage device can also directly store the current write data in the data high retention area when it is detected that the number of erasures and writes to the storage device is greater than zero, but the number of erasures and writes does not exceed the preset number of erasures and writes. This ensures that the data is preserved for a long time without causing data anomalies due to environmental factors or long-term power outages.

[0060] In the present application, the storage device can also move all the data in the low data retention area to the high data retention area when it is detected that the number of erasures and writes to the storage device is greater than zero, but the number of erasures and writes exceeds the preset number of erasures and writes. In this way, it can be ensured that the data in the storage device will not be affected by environmental factors and long-term power failure factors, and can be preserved for a long time.

[0061] In the present application, if the storage device receives a data operation instruction triggered by a user to migrate the characterizing data to the low data retention area in a factory-ready state, it can also respond to the data operation instruction to migrate the characterizing data to the low data retention area to migrate the data in the high data retention area to the low data retention area. Since the capacity of a single data storage unit in the low data retention area is greater than the capacity of a single data storage unit in the high data retention area, migrating data from the high data retention area to the low data retention area can expand the storage capacity of the storage device. For example, the storage capacity of a low data retention area is four times that of a high data retention area. If the storage capacity of the low data retention area is 4G, when the low data retention area is virtualized into the high data retention area, the storage device will have a storage capacity of only 1G. However, the data storage time in the high data retention area will be much higher than the storage time in the low data retention area.

[0062] In the present application, if the current write data corresponds to a write parameter, the storage device may also dynamically adjust the storage capacity of the data high retention area and the data low retention area according to the write parameter.

[0063] Here, the write parameter at least represents the data capacity of the write data.

[0064] For example, the storage capacity of the data high-reservation area of ​​the storage device is 50 megabytes, and the data capacity of the current write data is 100 megabytes. If you want to write all the write data in the data high-reservation area for storage, it is obvious that the storage capacity of the current data high-reservation area cannot load the write data. In this case, the storage device can dynamically adjust a virtual data high-reservation area from the data low-reservation area according to the data capacity of the current write data of 100 megabytes. For example, if the current data low-reservation area is 4G, 800 megabytes of the storage capacity therein are virtualized into the data high-reservation area, so that the 800 megabytes of the data low-reservation area becomes a 200 megabyte data high-reservation area, and then add the previous 50 megabytes of storage capacity, the total storage capacity of the current data high-reservation area is 250 megabytes, so that there is enough storage space to store the current write data.

[0065] In the present application, the storage device can also detect the power-on state of the storage device. If it is detected that the storage device switches from the power-off state to the power-on state, the data in the high data retention area is migrated to the low data retention area. In this way, the storage capacity of the storage device can be expanded, so that the high data retention area only stores the current write data, and the historical data can be transferred to the low data retention area.

[0066] Here, when migrating data from the high data retention area to the low data retention area, part of the storage space in the high data retention area can be virtualized into the low data retention area. For example, after the storage space of the 100 megabyte high data retention area is virtualized into the low data retention area, the storage capacity of the low data retention area is 400 megabytes, so that the data capacity that can originally store 100 megabytes can now store 400 megabytes of data. The storage capacity of the storage device is greatly expanded.

[0067] By storing data in the high data retention area, the present application can reduce the risk of data corruption of the operating system data when the computer is not powered on for a long time. In the factory state, by storing data in the low data retention area, the storage capacity of the storage device can be expanded to store more data.

[0068] Figure 2 This is a schematic diagram of the process implementation of the data processing method in this application Figure 2 ,like Figure 2 As shown, including:

[0069] Step 201, preloading the operating system;

[0070] Step 202, whether the data is written to the storage device;

[0071] Here, when writing data into the storage device, the data is written in the data low retention area and the data high retention area of ​​the storage device in a random manner. If the data writing is completed, step 203 is executed, and if the data writing is not completed, step 201 is executed.

[0072] Step 203, triggering an instruction to migrate data to a high data retention area;

[0073] Step 204, migrating the data in the low data retention area to the high data retention area;

[0074] Step 205, determining whether the migration is completed;

[0075] If the migration of data from the low data retention area to the high data retention area is completed, step 206 is executed; if the migration is not completed, step 204 is executed;

[0076] Step 206: Send a migration completion instruction to the host where the storage device is located, and record corresponding information of data migration completion to a designated page.

[0077] Here, the corresponding information may be, for example, the storage location of the current data, the data storage capacity, and the like.

[0078] Step 207: After receiving the migration completion instruction, the host ends the entire preloading process of the operating system.

[0079] Figure 3 This is a schematic diagram of the process implementation of the data processing method in this application Figure 3 ,like Figure 3 As shown, including:

[0080] Step 301, preloading the operating system;

[0081] Step 302, detecting whether the number of erase and write times of the storage device reaches a threshold;

[0082] Here, a threshold of the number of times the P / E (program / erase) is consumed can be set, such as 100 P / E cycles, and the storage capacity of the data high retention area can be set to ensure that the storage capacity of the data high retention area is much larger than the data capacity of the operating system of the computer where the storage device is located. When the computer where the storage device is located downloads the operating system, the storage device automatically confirms whether the current number of times the storage device is erased is within the set threshold. If it is detected that the number of erases reaches the threshold (or exceeds the threshold), step 308 is executed. If it is detected that the number of erases does not reach the threshold (or is within the threshold), step 303 is executed;

[0083] Step 303, all data are preferentially written into the data high-retention area;

[0084] This means that the write data is directly stored in the data high retention area.

[0085] Step 304, checking whether the operating system has been downloaded.

[0086] If the operating system has completed downloading, execute step 305; if the operating system has not completed downloading, execute step 303;

[0087] Step 305, check to ensure that all data is stored in the data high retention area;

[0088] If all the current data is stored in the data high retention area, execute step 306 ; if part of the current data is stored in the data high retention area and part of the current data is stored in the data low retention area, execute step 309 .

[0089] Step 306, sending a completion instruction to the host where the storage device is located;

[0090] Step 307: After receiving the completion instruction, the host ends the entire preloading process of the operating system.

[0091] Step 308, whether the data is written to the storage device;

[0092] Here, it means that the write data is randomly written in the data low retention area and the data high retention area of ​​the storage device in a random manner. If the data writing is completed, step 309 is executed, and if the data writing is not completed, step 301 is executed.

[0093] Step 309, triggering the instruction of data migration to the data high retention area;

[0094] Step 310, migrating data in the low data retention area to the high data retention area;

[0095] Step 311, determining whether the migration is completed;

[0096] If the migration of data from the low data retention area to the high data retention area is completed, step 312 is executed; if the migration is not completed, step 310 is executed;

[0097] Step 312: Send a migration completion instruction to the host where the storage device is located, and record corresponding information of data migration completion to a designated page.

[0098] Here, the corresponding information may be, for example, the storage location of the current data, the data storage capacity, and the like.

[0099] Step 313: After receiving the migration completion instruction, the host ends the entire preloading process of the operating system.

[0100] Through the data processing method provided in the present application, it can be ensured that the data high retention area has sufficient storage capacity to store the data of the entire operating system, and in the factory-ready state it can be ensured that all data is in the data high retention area, reducing the risk of data corruption due to environmental factors and long-term power outages.

[0101] In addition, the present application can also dynamically convert the data low retention area into a virtual data high retention area, so as to reduce costs, and at the same time, the data can be retained in the data high retention area to increase the storage time of the data.

[0102] Figure 4 The structure of the electronic device in this application is shown in FIG. Figure 1 ,like Figure 4 As shown, the electronic device includes:

[0103] Storage device 401, used for storing data;

[0104] The processing unit 402 is used to store data in the data high retention area of ​​the storage device 401 in response to a preset condition.

[0105] Among them, the capacity of a single data storage unit in the data high retention area is smaller than the capacity of a single data storage unit in the data low retention area; the preset conditions include at least one of the storage device being in a ready-to-ship state, data operation instructions, preset data identifiers, power-off duration of the storage device, and the number of erase and write times of the storage device.

[0106] Here, the processing unit 402 may specifically be a processor, such as a central processing unit (CPU). The electronic device may be a desktop computer, a laptop computer, a mobile phone, a smart watch, and the like.

[0107] In a preferred embodiment, when the processing unit 402 stores data in the storage device 401, if the data corresponds to an instruction to migrate data to a high data retention area, the processing unit 402 may migrate the data in the low data retention area to the high data retention area in response to the instruction to migrate data to a high data retention area; or, if the data corresponds to an instruction to write data to a high data retention area, the processing unit 402 may directly store the data in the high data retention area in response to the instruction to write data to a high data retention area.

[0108] In a preferred solution, if the processing unit 402 completes the migration of the data in the data low retention area to the data high retention area, the processing unit 402 is further configured to send and record a feedback instruction of the completion of the data migration to the electronic device.

[0109] In a preferred solution, if the data carries the preset data identifier, the processing unit 402 may store the data carrying the preset data identifier in a data high-retention area of ​​the storage device 401 .

[0110] In a preferred solution, the processing unit 402 can also detect the factory state of the electronic device. If it is detected that the power-on record of the electronic device is zero, it is determined that the electronic device is in the waiting-to-ship state. Further, the processing unit 402 can also detect the power-off duration of the electronic device in the waiting-to-ship state. If the power-off duration of the electronic device in the waiting-to-ship state does not exceed the first preset duration, the data is stored in the data high retention area of ​​the storage device 401; or, if the power-off duration of the electronic device in the factory state exceeds the second preset duration, the data is stored in the data high retention area of ​​the storage device 401.

[0111] The first preset time length may be a time length estimated by a technician, and the second preset time length may be a time length set by a user.

[0112] In a preferred solution, the processing unit 402 can also detect the number of erasures and writes of the storage device 401 . If the processing unit 402 detects that the number of erasures and writes of the storage device 401 is greater than zero, the data is stored in a data high retention area of ​​the storage device 401 .

[0113] Alternatively, if the processing unit 402 detects that the erasure and writing times of the storage device 401 do not exceed the preset erasure and writing times, the data is directly stored in the data high retention area of ​​the storage device 401;

[0114] Alternatively, if the processing unit 402 detects that the erasure and writing times of the storage device exceeds the preset erasure and writing times, the data in the data low retention area is migrated to the data high retention area of ​​the storage device 401 .

[0115] In a preferred embodiment, the processing unit 402 is also used to detect whether the data in the storage device 401 and the current write data carry corresponding write parameters. If the processing unit 402 detects that the data corresponds to write parameters, the storage capacity of the data high retention area and the data low retention area of ​​the storage device 401 is dynamically adjusted according to the write parameters, wherein the write parameters at least characterize the data capacity of the data.

[0116] In a preferred embodiment, when the storage device 401 is in a factory-ready state, if the processing unit 402 receives an instruction to migrate data to a low data retention area, the data in the high data retention area is migrated to the low data retention area of ​​the storage device 401 in response to the instruction to migrate data to a low data retention area.

[0117] In a preferred solution, the processing unit 402 can also detect the power-on state of the storage device 401 , and if it is detected that the storage device 401 switches from a power-off state to a power-on state, the data in the data high retention area is migrated to the data low retention area of ​​the storage device 401 .

[0118] It should be noted that: when the electronic device provided in the above embodiment performs data storage, only the division of the above program modules is used as an example. In actual applications, the above processing can be assigned to different program modules as needed, that is, the internal structure of the electronic device is divided into different program modules to complete all or part of the processing described above. In addition, the electronic device provided in the above embodiment and the data processing method embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0119] An embodiment of the present application further provides an electronic device, the electronic device comprising: a processor and a memory for storing a computer program that can be run on the processor,

[0120] Wherein, when the processor is used to run the computer program, it executes the steps of any one of the above-mentioned data processing methods.

[0121] Figure 5 This is a schematic diagram of the structure of the electronic device in this application. Figure 2 The electronic device 500 may be a mobile phone, a computer, a digital broadcast terminal, an information transceiver device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc. Figure 5 The electronic device 500 shown includes: at least one processor 501, a memory 502, at least one network interface 504 and a user interface 503. The various components in the electronic device 500 are coupled together via a bus system 505. It is understood that the bus system 505 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 505 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the bus system 505 is not shown in FIG. Figure 5 Various buses are labeled as bus system 505 .

[0122] The user interface 503 may include a display, a keyboard, a mouse, a trackball, a click wheel, keys, buttons, a touch pad or a touch screen.

[0123] It can be understood that the memory 502 can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disk, or a compact disc read-only memory (CD-ROM); the magnetic surface memory can be a disk memory or a tape memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM, SyncLink Dynamic Random Access Memory), and direct RAM bus random access memory (DRRAM, Direct Rambus Random Access Memory).The memory 502 described in the embodiments of the present application is intended to include but is not limited to these and any other suitable types of memories.

[0124] The memory 502 in the embodiment of the present application is used to store various types of data to support the operation of the electronic device 500. Examples of these data include: any computer program for operating on the electronic device 500, such as an operating system 5021 and an application 5022; contact data; phone book data; messages; pictures; videos, etc. Among them, the operating system 5021 includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., which are used to implement various basic services and process hardware-based tasks. The application 5022 can include various applications, such as a media player (Media Player), a browser (Browser), etc., for implementing various application services. The program that implements the method of the embodiment of the present application can be included in the application 5022.

[0125] The method disclosed in the above embodiment of the present application can be applied to the processor 501, or implemented by the processor 501. The processor 501 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 501. The above processor 501 may be a general processor, a digital signal processor (DSP, Digital Signal Processor), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The processor 501 can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application. The general processor can be a microprocessor or any conventional processor, etc. In combination with the steps of the method disclosed in the embodiment of the present application, it can be directly embodied as a hardware decoding processor to execute, or it can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium, which is located in the memory 502, and the processor 501 reads the information in the memory 502 and completes the steps of the above method in combination with its hardware.

[0126] In an exemplary embodiment, the electronic device 500 can be implemented by one or more application specific integrated circuits (ASIC), DSP, programmable logic device (PLD), complex programmable logic device (CPLD), field programmable gate array (FPGA), general processor, controller, microcontroller (MCU), microprocessor, or other electronic components to execute the aforementioned method.

[0127] In an exemplary embodiment, the present application also provides a computer-readable storage medium, such as a memory 502 including a computer program, and the computer program can be executed by a processor 501 of an electronic device 500 to complete the steps of the aforementioned method. The computer-readable storage medium can be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface memory, optical disk, or CD-ROM; or it can be various devices including one or any combination of the above memories, such as a mobile phone, a computer, a tablet device, a personal digital assistant, etc.

[0128] A computer-readable storage medium stores a computer program, which can execute any step of the above data processing method when executed by a processor.

[0129] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0130] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0131] The methods disclosed in several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.

[0132] The features disclosed in several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.

[0133] The features disclosed in several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.

[0134] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A data processing method, the method being applied to a storage device, the method comprising: In response to a preset condition, storing the data in a data high retention area of ​​the storage device; Wherein, the capacity of a single data storage unit in the data high retention area is smaller than the capacity of a single data storage unit in the data low retention area; The preset condition includes at least one of the storage device being in a ready-to-ship state and the power-off duration of the storage device meeting a preset duration.

2. The method according to claim 1, wherein storing the data in the data high retention area of ​​the storage device comprises: If the data corresponds to the data migration to data high reservation area instruction, in response to the data migration to data high reservation area instruction, migrate the data in the data low reservation area to the data high reservation area; Alternatively, if the data corresponds to a command to write data into a data high reserved area, in response to the command to write data into a data high reserved area, the data is directly stored in the data high reserved area.

3. The method according to claim 2, further comprising: If the migration of the data in the data low retention area to the data high retention area is completed, a feedback instruction indicating the completion of the data migration is sent and recorded.

4. The method according to claim 1, wherein when the preset condition includes a preset data identifier, the method further comprises: If the data carries the preset data identifier, the data carrying the preset data identifier is stored in the data high retention area.

5. The method according to claim 1, wherein when the preset condition includes a power-off duration of the storage device, the method further comprises: If the power-off duration of the storage device in the ready-to-ship state does not exceed a first preset duration, storing the data in a data high retention area of ​​the storage device; Alternatively, if the power-off duration of the storage device in the factory-delivered state exceeds a second preset duration, the data is stored in a data high retention area of ​​the storage device.

6. The method according to claim 1, wherein when the preset condition includes the number of times the storage device is erased and written, the method further comprises: If it is detected that the erasure number of the storage device is greater than zero, storing the data in a data high retention area of ​​the storage device; Alternatively, if it is detected that the erasure and writing times of the storage device do not exceed the preset erasure and writing times, the data are stored in the data high retention area of ​​the storage device; Alternatively, if it is detected that the erasure and writing times of the storage device exceeds the preset erasure and writing times, the data in the data low retention area is migrated to the data high retention area.

7. The method according to claim 1, further comprising: If the data has corresponding write parameters, the storage capacity of the data high retention area and the data low retention area is dynamically adjusted according to the write parameters, wherein the write parameters at least characterize the data capacity of the data.

8. The method according to claim 1, further comprising: When the storage device is in a shipped state, if a data migration to data low retention area instruction is received, the data in the data high retention area is migrated to the data low retention area in response to the data migration to data low retention area instruction.

9. The method according to claim 1, further comprising: If the storage device is switched from a power-off state to a power-on state, the data in the data high retention area is migrated to the data low retention area.

10. An electronic device, comprising: A storage device for storing data; A processing unit, configured to store data into the storage device using the data processing method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Storage control method, device, equipment and computer storage medium

    CN111104045A

  • Data storage method and related equipment

    CN113590501A