A voltage control method, a voltage control device, and an electronic device.

By detecting and adjusting the offset voltage of the flash memory control unit in voltage control mode, the problem of data read errors caused by wear and temperature is solved, reread operations are reduced, and the read and write performance of flash memory is improved.

CN115985368BActive Publication Date: 2026-04-03ZHONGSHAN JIANGBOLONG ELECTRONICS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-15
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

During use, wear and abnormal temperatures can cause electron misalignment in flash memory, resulting in read commands failing to read data correctly. Excessive reread operations can lead to performance degradation.

Method used

In voltage control mode, the read command execution result of the flash memory control unit is detected. If an error is found, the offset voltage is changed and a reread operation is initiated. If the error is found, the current offset voltage is maintained and the reread table is updated.

Benefits of technology

Reduce the number of reread operations to ensure the correctness of flash memory execution results, optimize the reread table to quickly find the appropriate offset voltage, and improve the smoothness of flash memory read and write operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115985368B_ABST
    Figure CN115985368B_ABST
Patent Text Reader

Abstract

This application discloses a voltage control method, apparatus, electronic device, and computer-readable storage medium. The method includes: in voltage control mode, if a read command is received for any control unit of the flash memory, the read command is executed; the execution result is checked for correctness; if the execution result is incorrect, the offset voltage of the control unit is changed based on a target reread table, and a reread operation is initiated to obtain a new execution result; for the new execution result, the step of checking the correctness of the execution result and subsequent steps are returned to the execution process. The target reread table is the reread table corresponding to the control unit, and the reread table stores at least two expected voltage values; if the execution result is correct, the current offset voltage of the control unit is maintained, and the reread table is updated according to the current offset voltage of the control unit. This solution can reduce the number of reread operations to a certain extent, reducing the likelihood of severe performance degradation of the flash memory.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of control technology, and in particular relates to a voltage control method, a voltage control device, an electronic device, and a computer-readable storage medium. Background Technology

[0002] As flash memory ages, internal wear and / or abnormal temperatures can cause significant electron shift. In such cases, directly executing a read command may fail to retrieve the correct data. Applying an offset voltage to the flash memory before initiating a reread operation is necessary to obtain the correct data. Excessive reread operations can severely degrade flash memory performance, slowing down its response time and resulting in a poor user experience. Summary of the Invention

[0003] This application provides a voltage control method, a voltage control device, an electronic device, and a computer-readable storage medium, which can reduce the number of read operations to a certain extent, reduce the occurrence of severe flash memory performance degradation, and ensure the smoothness of users' read and write operations on flash memory.

[0004] In a first aspect, this application provides a voltage control method, including:

[0005] In voltage control mode, if a read command is received for any control unit of the flash memory, the read command is executed.

[0006] Check if the execution result is correct;

[0007] If the above execution result is incorrect, the offset voltage of the control unit is changed based on the target reread table, and a reread operation is initiated to obtain a new execution result. For the new execution result, the step of checking whether the execution result is correct and subsequent steps are returned. The target reread table is the reread table corresponding to the control unit, and the reread table stores at least two expected voltage values.

[0008] If the above execution result is correct, then maintain the current offset voltage of the control unit and update the target reread table according to the current offset voltage of the control unit.

[0009] Secondly, this application provides a voltage control device, comprising:

[0010] The execution module is used to execute the read command if a read command is received for any control unit of the flash memory in voltage control mode.

[0011] The first detection module is used to check whether the execution result is correct.

[0012] The first control module is used to change the offset voltage of the control unit based on the target reread table if the above execution result is incorrect. The target reread table is the reread table corresponding to the control unit, and the reread table stores at least two expected voltage values.

[0013] The reread module is used to initiate a reread operation after the first control module has finished running to obtain a new execution result, and to trigger the first detection module to run based on the new execution result.

[0014] The second control module is used to maintain the current offset voltage of the control unit if the above execution result is correct.

[0015] The update module is used to update the target reread table based on the current offset voltage of the control unit if the above execution result is correct.

[0016] Thirdly, this application provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the method described in the first aspect.

[0017] Fourthly, this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method described in the first aspect above.

[0018] Fifthly, this application provides a computer program product comprising a computer program that, when executed by one or more processors, implements the steps of the method described in the first aspect.

[0019] The beneficial effects of this application compared to the prior art are as follows: In voltage control mode, if a read command is received for any control unit of the flash memory, the read command is executed, and the execution result is checked for correctness. If the execution result is incorrect, the offset voltage of the control unit is changed based on the target reread table, and a reread operation is initiated to obtain a new execution result. For the new execution result, the step of checking whether the execution result is correct and subsequent steps are returned to be executed. The target reread table is the reread table corresponding to the control unit, and the reread table stores at least two expected voltage values. If the execution result is correct, the current offset voltage of the control unit is maintained, and the target reread table is updated according to the current offset voltage of the control unit. This application proposes a new voltage control mode, which enables the control unit of the flash memory to maintain its offset voltage when the execution result is correct when the electronic device is operating in this voltage control mode. This allows the next read command for the control unit to be executed using the offset voltage, reducing the number of reread operations. Furthermore, the reread table is also updated when the execution result is correct, thereby optimizing the reread table and enabling the subsequent use of the optimized reread table to quickly find the appropriate offset voltage for the control unit.

[0020] It is understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here. Attached Figure Description

[0021] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0022] Figure 1 This is a schematic diagram illustrating the implementation process of the voltage control mode provided in the embodiments of this application;

[0023] Figure 2 This is a schematic diagram illustrating the specific implementation process of step 102 provided in the embodiments of this application;

[0024] Figure 3 This is a schematic diagram of the process for entering the voltage control mode provided in an embodiment of this application;

[0025] Figure 4 This is a schematic diagram of the process for exiting the voltage control mode provided in the embodiments of this application;

[0026] Figure 5 This is a structural block diagram of the voltage control device provided in the embodiments of this application;

[0027] Figure 6 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0028] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.

[0029] To illustrate the technical solution proposed in this application, specific embodiments are described below.

[0030] The voltage control method proposed in the embodiments of this application will be described below. This voltage control method proposes a new operating mode, namely the voltage control mode. Please refer to... Figure 1 The working process of this voltage control mode is detailed below:

[0031] Step 101: If a read command is received for any control unit of the flash memory, then execute the read command.

[0032] In this embodiment, the electronic device is equipped with flash memory. The host of the electronic device can issue read commands, write commands, and erase commands to the flash memory. It can be understood that a flash memory chip can be divided into one or more control units (dies), which are the smallest units of executable code. When a command is received from the host targeting any control unit of the flash memory, it can first determine whether the command is a read command. If it is a read command, the read command can be executed directly.

[0033] Step 102: Check if the execution result is correct. If the execution result is incorrect, proceed to step 103. If the execution result is correct, proceed to step 105.

[0034] In this embodiment, after the read command is executed, a corresponding execution result can be obtained. The electronic device can detect whether the execution result is correct, specifically considering the following two aspects: whether data was read; and whether the data is accurate when it is read. Figure 2 As shown, step 102 can be specifically manifested as follows:

[0035] Step 1021: Check whether the read command has read data. If the read command has not read data, proceed to step 1023. If the read command has read data, proceed to step 1022.

[0036] Step 1022: Determine whether the metadata verification of the data is successful. If the metadata verification is successful, proceed to step 1024. If the metadata verification fails, proceed to step 1023.

[0037] Step 1023: The execution result is determined to be incorrect.

[0038] Step 1024: Determine if the execution result is correct.

[0039] It's understandable that a read command, if executed correctly, should retrieve data. Therefore, if a read command fails to retrieve data, the execution result can be immediately determined to be incorrect. However, even when a read command retrieves data, considering the possibility of reading the wrong page, further metadata verification is needed to confirm the data's correctness, i.e., to confirm that no wrong page was read. Only when data is retrieved and the metadata verification of that data is successful can the execution result be considered correct.

[0040] Specifically, for data retrieved using a read command, the metadata verification process is as follows:

[0041] A1. Compare the metadata of the data with the expected metadata carried by the read command.

[0042] A2. If the metadata of the data matches the expected metadata, then the metadata verification is successful.

[0043] A3. If the metadata of the data does not match the expected metadata, then the metadata verification is deemed to have failed.

[0044] In this embodiment, metadata specifically refers to physical address information. It can be understood that a read command carries expected metadata, which is the physical address information of the data to be read. Under normal circumstances, such as reading the wrong page, this expected metadata should match the metadata of the read data. Therefore, when the data's metadata matches the expected metadata, the metadata verification is considered successful; otherwise, the metadata verification is considered to have failed.

[0045] Step 103: Change the offset voltage of the control unit based on the target reread table.

[0046] In this embodiment, when the execution result is incorrect, it means a reread operation is required. At this time, the electronic device can change the offset voltage of the control unit based on the target reread table before initiating the reread operation. It is understood that each control unit has its own pre-set reread table, and each reread table stores at least two expected voltage values. Typically, the reread table is initially provided by the flash memory manufacturer, and the electronic device manufacturer can subsequently add or delete values ​​from the reread table based on the specific performance of the flash memory. The target reread table refers to the reread table corresponding to the control unit targeted by the read command with the current incorrect execution result.

[0047] Step 104: Initiate a reread operation to obtain a new execution result, and then execute step 102 based on this new execution result.

[0048] In this embodiment, after changing the offset voltage of the control unit based on the target reread table, a reread operation can be initiated, that is, the read command can be executed again. Since the offset voltage of the control unit has been changed, the reread operation can obtain a new execution result, and the electronic device can then perform step 102 based on the new execution result.

[0049] It is understandable that if more than one read operation is performed for the same read command, the electronic device can change the offset voltage of the control unit before each read operation, based on the order of the desired voltage values ​​stored in the target read table. For example, suppose the target read table of a certain control unit 1 is shown in Table 1 below:

[0050] order Desired voltage value 1 U1 2 U2 3 U3 4 U4

[0051] Table 1

[0052] Initially, no offset voltage is applied to control unit 1. Assuming a read command is received for control unit 1, and an error is detected after execution, an offset voltage is applied to control unit 1 based on the expected voltage value U1, and a first reread operation is initiated. If the first reread operation still results in an error, an offset voltage is applied to control unit 1 based on the expected voltage value U2, and a second reread operation is initiated. If the second reread operation still results in an error, an offset voltage is applied to control unit 1 based on the expected voltage value U3, and a third reread operation is initiated. This process continues until a correct result is obtained.

[0053] Step 105: Maintain the current offset voltage of the control unit and update the target reread table based on the current offset voltage of the control unit.

[0054] In this embodiment, when the execution result is correct, the current offset voltage of the control unit can be maintained, and the target reread table can be updated according to the current offset voltage of the control unit. It should be noted that if the correct execution result is obtained on the first execution of the read command, steps 103 and 104 will not be entered, that is, the offset voltage of the control unit will not be changed; in this case, the target reread table will not be updated.

[0055] Initially, no offset voltage is applied to control unit 1. Taking Table 1 as an example:

[0056] In one scenario, assuming a read command is received for control unit 1 and the execution result is found to be correct after executing the read command, then the offset voltage is still not applied to control unit 1, and there is no need to update the target reread table.

[0057] In another scenario, assuming a read command is received for control unit 1, and an error is detected after executing the read command, an offset voltage is applied to control unit 1 based on the expected voltage value U1, and a first reread operation is initiated. If the first reread operation still results in an error, an offset voltage is applied to control unit 1 based on the expected voltage value U2, and a second reread operation is initiated. If the second reread operation results in a correct result, the offset voltage is maintained on control unit 1 based on the expected voltage value U2, so that the next read command for control unit 1 can be executed under this offset voltage. Simultaneously, the target reread table can be updated based on the current offset voltage of the control unit. Specifically, the target expected voltage value is adjusted to the first position in the target reread table. This target expected voltage value refers to the expected voltage value corresponding to the current offset voltage of the control unit; in this example, it is the expected voltage value U2. The updated target reread table in this example is shown in Table 2 below:

[0058] order Desired voltage value 1 U2 2 U1 3 U3 4 U4

[0059] Table 2

[0060] In some embodiments, the need to apply an offset voltage to the control unit typically only exists when a read command is executed. Therefore, in this voltage control mode, if a non-read command is received for any control unit of the flash memory, the current offset voltage of that control unit needs to be cleared to prevent the applied offset voltage from affecting the execution of the non-read command. These non-read commands include write commands, erase commands, and other commands that are not read commands, which will not be elaborated here.

[0061] In some embodiments, the electronic device may automatically switch to this voltage control mode based on its operating conditions. See also Figure 3 The process by which electronic devices enter this voltage control mode is as follows:

[0062] Step 201: In modes other than voltage control mode, if for all control units of flash memory, more than a preset first number threshold number of read commands are received within a continuous period of time during which no non-read commands are received, then the number of times the reread operation is initiated within the preset period of time is detected.

[0063] This can be understood as follows: when the electronic device is not in this voltage control mode, the initial number of read commands is 0. Subsequently, upon receiving the first read command, regardless of which control unit of the flash memory it targets, the count of read commands is immediately updated, thus counting consecutive read commands. During this process, if a non-read command is received, the consecutive read commands are interrupted, and the count of read commands is reset to 0, waiting for the next read command to be received before resuming the count. In other words, the counted number of read commands is specifically the number of read commands within the continuous time period during which no non-read commands are received, i.e., the number of consecutive read commands. When the counted number of read commands exceeds a preset first threshold, the number of times a reread operation is initiated within a preset time period can be detected. This preset time period falls within the continuous time period during which no non-read commands are received.

[0064] In some embodiments, the continuous time period, that is, the time period in which continuous read commands are received, can be divided into several preset time periods. Specifically, the division is based on n consecutive read commands, wherein the execution start time of the first read command and the execution end time of the nth read command constitute a preset time period.

[0065] As an example, assuming the first threshold is 1000, when there are 1000 consecutive read commands, the number of times a reread operation is initiated within a preset time period can be detected. Assuming n is 100, there can be 10 preset time periods: the first preset time period is from the start time of the first read command to the end time of the 100th read command; the second preset time period is from the start time of the 101st read command to the end time of the 200th read command; the third preset time period is from the start time of the 201st read command to the end time of the 300th read command; and so on. Further details are omitted here.

[0066] Step 202: If the number of times the reread operation is initiated within a preset time period exceeds a preset second quantity threshold, then enter the voltage control mode.

[0067] When there are two or more preset time periods, the electronic device can perform the detection operation of the number of times the reread operation is initiated in the order from early to late based on these two or more preset time periods. When it is detected that the number of times the reread operation is initiated in a preset time period exceeds the preset second quantity threshold, the electronic device can be triggered to enter the voltage control mode.

[0068] In some embodiments, when an electronic device is in voltage control mode, it can also automatically exit the voltage control mode based on its operating conditions. See also... Figure 4 The procedure for an electronic device to exit this voltage control mode is as follows:

[0069] Step 301: In voltage control mode, count the number of times metadata verification fails and count the duration of idle time.

[0070] Once this voltage control mode is entered, the number of times metadata verification failures can be counted for all control units of the flash memory. At the same time, the idle time duration can also be counted. The idle time duration refers to the time elapsed from the moment the last read command for any control unit of the flash memory was received to the current moment.

[0071] Step 302: If the number of occurrences exceeds a preset third threshold, or if the idle time exceeds a preset duration, then clear the current offset voltage of all control units and exit the voltage control mode.

[0072] From the perspective of the number of metadata verification failures, if the number of failures exceeds a preset third threshold, the electronic device can be triggered to exit the voltage control mode. From the perspective of idle time duration, if the idle time duration exceeds a preset duration, the electronic device can be triggered to exit the voltage control mode. Conversely, if the number of metadata verification failures has not yet exceeded the preset third threshold, the electronic device will remain in the voltage control mode as long as the idle time duration does not exceed the preset duration.

[0073] It should be noted that before exiting this voltage control mode, the electronic device will first clear the current offset voltage of all control units.

[0074] In some embodiments, if the new execution result obtained from the reread operation is still incorrect, the target reread table can also be updated according to the current offset voltage of the control unit, specifically by adjusting the target expected voltage value to the last position of the target reread table.

[0075] As an example only, in the initial state, no offset voltage is applied to control unit 1. Using Table 1 as an example: assuming a read command is received for control unit 1, and an error is detected after executing the read command, an offset voltage is applied to control unit 1 based on the desired voltage value U1, and a first reread operation is initiated. If the result of the first reread operation is still incorrect, the desired voltage value U1 (i.e., the current target desired voltage value) can be adjusted to the end of the target reread table. The updated target reread table in this example is shown in Table 3 below:

[0076] order Desired voltage value 1 U2 2 U3 3 U4 4 U1

[0077] Table 3

[0078] Subsequently, an offset voltage is applied to control unit 1 based on the expected voltage value U2, and a second reread operation is initiated. If the second reread operation is successful, the offset voltage is maintained on control unit 1 based on the expected voltage value U2, ensuring that the next read command for control unit 1 can be executed under this offset voltage. At this point, the expected voltage value U2 is already at the beginning of the target reread table, guaranteeing that even if the offset voltage of a subsequent control unit is cleared due to a non-read command, a reread operation can still be initiated immediately based on the offset voltage corresponding to the expected voltage value U2 through the target reread table if the read command execution result is incorrect. In other words, this operation ensures that each time a reread operation is initiated, the expected voltage value corresponding to the first offset voltage applied to the control unit (i.e., the expected voltage value at the beginning of the target reread table) is necessarily the expected voltage value that yielded the correct execution result in the previous operation.

[0079] As can be seen from the above, this application provides a new voltage control mode, which enables the flash memory control unit to maintain its offset voltage when the execution result is correct when the electronic device is operating in this voltage control mode. This allows the next read command for the control unit to be executed using the offset voltage, reducing the number of reread operations. Furthermore, the reread table is updated when the execution result is correct, thereby optimizing the reread table. This allows the optimized reread table to quickly find the appropriate offset voltage for the control unit when entering the voltage control mode again.

[0080] Corresponding to the voltage control method provided above, this application also provides a voltage control device. For example... Figure 5 As shown, the voltage control device 500 includes:

[0081] The execution module 501 is used to execute the read command if a read command is received for any control unit of the flash memory in voltage control mode.

[0082] The first detection module 502 is used to detect whether the execution result is correct;

[0083] The first control module 503 is used to change the offset voltage of the control unit based on the target reread table if the above execution result is incorrect. The target reread table is the reread table corresponding to the control unit, and the reread table stores at least two expected voltage values.

[0084] The reread module 504 is used to initiate a reread operation to obtain a new execution result after the first control module has finished running, and to trigger the first detection module to run based on the new execution result.

[0085] The second control module 505 is used to maintain the current offset voltage of the control unit if the above execution result is correct.

[0086] The update module 506 is used to update the target reread table based on the current offset voltage of the control unit if the above execution result is correct.

[0087] Optionally, the voltage control device 500 further includes:

[0088] The second detection module is used to detect the number of times the reread operation is initiated within a preset time period if, in any mode other than the voltage control mode, more than a preset first quantity threshold is received for all control units of the flash memory within a continuous time period during which no non-read command is received. The preset time period is within the continuous time period during which no non-read command is received.

[0089] The mode entry module is used to enter the voltage control mode if the number of times the above rereading operation is initiated within the above preset time period exceeds a preset second quantity threshold.

[0090] Optionally, the voltage control device 500 further includes:

[0091] The first clearing module is used to clear the current offset voltage of the control unit if a non-read command is received for any control unit of the flash memory in the voltage control mode described above.

[0092] Optionally, the first detection module 502 mentioned above includes:

[0093] The data read detection unit is used to detect whether data has been read when the above read command is executed;

[0094] The first determination unit is used to determine that the above execution result is incorrect if the above data is not read.

[0095] Metadata verification unit, used to perform metadata verification on the above data if the above data is read;

[0096] The second determination unit is used to determine that the above execution result is correct if the metadata verification is successful.

[0097] The third determination unit is used to determine that the above execution result is incorrect if the metadata verification fails.

[0098] Optionally, the aforementioned metadata verification unit includes:

[0099] The comparison subunit is used to compare the metadata of the above data with the expected metadata carried by the above read command;

[0100] The first verification result determination sub-unit is used to determine that the metadata verification is successful if the metadata of the above data matches the expected metadata.

[0101] The second verification result determination subunit is used to determine that the metadata verification fails if the metadata of the above data does not match the expected metadata.

[0102] Optionally, the voltage control device 500 further includes:

[0103] The statistics module is used to count the number of times metadata verification failures occur under the voltage control mode described above, and to count the idle time duration, wherein the idle time duration is the time elapsed from the moment the last read command for any control unit of the flash memory was received to the current moment.

[0104] The second clearing module is used to clear the current offset voltage of all control units if the number of occurrences exceeds a preset third quantity threshold, or if the idle time exceeds a preset duration.

[0105] The mode exit module is used to exit the voltage control mode if the number of occurrences exceeds a preset third threshold, or if the idle time exceeds a preset duration.

[0106] Optionally, the update module 506 is specifically used to adjust the target expected voltage value to the first position in the target reread table, wherein the target expected voltage value is the expected voltage value corresponding to the current offset voltage of the control unit.

[0107] As can be seen from the above, this application provides a new voltage control mode, which enables the flash memory control unit to maintain its offset voltage when the execution result is correct when the electronic device is operating in this voltage control mode. This allows the next read command for the control unit to be executed using the offset voltage, reducing the number of reread operations. Furthermore, the reread table is updated when the execution result is correct, thereby optimizing the reread table. This allows the optimized reread table to quickly find the appropriate offset voltage for the control unit when entering the voltage control mode again.

[0108] Corresponding to the voltage control method provided above, this application also provides an electronic device. Please refer to... Figure 6 The electronic device 6 in this embodiment includes: a memory 601, and one or more processors 602. Figure 6 (Only one is shown) and a computer program stored in memory 601 and executable on the processor. Memory 601 stores software programs and units. The processor 602 executes various functional applications and diagnostics by running the software programs and units stored in memory 601 to obtain resources corresponding to the aforementioned preset events. Specifically, the processor 602 performs the following steps when running the aforementioned computer program stored in memory 601:

[0109] In voltage control mode, if a read command is received for any control unit of the flash memory, the read command is executed.

[0110] Check if the execution result is correct;

[0111] If the above execution result is incorrect, the offset voltage of the control unit is changed based on the target reread table, and a reread operation is initiated to obtain a new execution result. For the new execution result, the step of checking whether the execution result is correct and subsequent steps are returned. The target reread table is the reread table corresponding to the control unit, and the reread table stores at least two expected voltage values.

[0112] If the above execution result is correct, then maintain the current offset voltage of the control unit and update the target reread table according to the current offset voltage of the control unit.

[0113] Assuming the above is the first possible implementation, in the second possible implementation based on the first possible implementation, the processor 602 further performs the following steps when running the computer program stored in the memory 601:

[0114] In modes other than the voltage control mode mentioned above, if for all control units of the flash memory, more than a preset first number threshold is received within a continuous period of time during which no non-read command is received, the number of times the reread operation is initiated within the preset period of time is detected, wherein the preset period of time is within the continuous period of time during which no non-read command is received.

[0115] If the number of times the above rereading operation is initiated within the above preset time period exceeds the preset second quantity threshold, then the voltage control mode is entered.

[0116] In a third possible implementation based on the first possible implementation described above, the processor 602 further performs the following steps when running the computer program stored in the memory 601:

[0117] In the voltage control mode described above, if a non-read command is received for any control unit of the flash memory, the current offset voltage of the control unit is cleared.

[0118] In a fourth possible implementation provided based on the first, second, or third possible implementation described above, the detection of whether the execution result is correct includes:

[0119] Check whether the above read command has retrieved any data;

[0120] If the above data is not read, the above execution result is determined to be incorrect;

[0121] If the above data is read, then perform metadata verification on the above data;

[0122] If the metadata verification is successful, the above execution result is considered correct;

[0123] If metadata verification fails, the above execution result is considered incorrect.

[0124] In the fifth possible implementation provided based on the fourth possible implementation described above, the metadata verification of the data includes:

[0125] Compare the metadata of the above data with the expected metadata carried by the above read command;

[0126] If the metadata of the above data matches the expected metadata, then the metadata verification is successful.

[0127] If the metadata of the above data does not match the expected metadata, then the metadata verification is deemed to have failed.

[0128] In a sixth possible implementation based on the fourth possible implementation described above, the processor 602 further performs the following steps when running the computer program stored in the memory 601:

[0129] Under the voltage control mode described above, the number of times metadata verification fails is counted, and the idle time duration is counted. The idle time duration is the time elapsed from the moment the last read command for any control unit of the flash memory was received to the current moment.

[0130] If the number of occurrences exceeds a preset third threshold, or if the idle time exceeds a preset duration, then clear the current offset voltage of all control units and exit the voltage control mode.

[0131] In a seventh possible implementation provided based on the first, second, or third possible implementation described above, the updating of the target reread table based on the current offset voltage of the control unit includes:

[0132] In the aforementioned target reread table, the target expected voltage value is adjusted to the first position of the aforementioned target reread table, wherein the aforementioned target expected voltage value is the expected voltage value corresponding to the current offset voltage of the aforementioned control unit.

[0133] It should be understood that, in the embodiments of this application, the processor 602 may be a central processing unit (CPU), but it may also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.

[0134] Memory 601 may include read-only memory and random access memory, and provides instructions and data to processor 602. Some or all of memory 601 may also include non-volatile random access memory. For example, memory 601 may also store device category information.

[0135] As can be seen from the above, this application provides a new voltage control mode, which enables the flash memory control unit to maintain its offset voltage when the execution result is correct when the electronic device is operating in this voltage control mode. This allows the next read command for the control unit to be executed using the offset voltage, reducing the number of reread operations. Furthermore, the reread table is updated when the execution result is correct, thereby optimizing the reread table. This allows the optimized reread table to quickly find the appropriate offset voltage for the control unit when entering the voltage control mode again.

[0136] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the above device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0137] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0138] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of external device software and electronic hardware. Whether these functions are implemented in hardware or software 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 this application.

[0139] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the system embodiments described above are merely illustrative. For instance, the division of modules or units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between devices or units through some interfaces, and may be electrical, mechanical, or other forms.

[0140] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0141] If the integrated units described above are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can also be implemented by a computer program instructing associated hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable storage medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer-readable storage device, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium, etc. It should be noted that the contents of the aforementioned computer-readable storage media may be appropriately added to or subtracted from the contents according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable storage media may not include electrical carrier signals and telecommunication signals.

[0142] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. A voltage control method, characterized in that, include: In voltage control mode, if a read command is received for any control unit of the flash memory, the read command is executed; Check if the execution result is correct; If the execution result is incorrect, the offset voltage of the control unit is changed based on the target reread table, and a reread operation is initiated to obtain a new execution result. For the new execution result, the step of checking whether the execution result is correct and subsequent steps are returned to be executed. The target reread table is the reread table corresponding to the control unit, and the reread table stores at least two expected voltage values. If the execution result is correct, the current offset voltage of the control unit is maintained, and the target reread table is updated according to the current offset voltage of the control unit.

2. The voltage control method as described in claim 1, characterized in that, The voltage control method further includes: In modes other than the voltage control mode, if for all control units of the flash memory, more than a preset first number threshold of read commands are received within a continuous period of time during which no non-read commands are received, the number of times the reread operation is initiated within a preset period of time is detected, wherein the preset period of time is within the continuous period of time during which no non-read commands are received. If the number of times the reread operation is initiated within the preset time period exceeds a preset second threshold, then the voltage control mode is entered.

3. The voltage control method as described in claim 1, characterized in that, The voltage control method further includes: In the voltage control mode, if a non-read command is received for any control unit of the flash memory, the current offset voltage of the control unit is cleared.

4. The voltage control method according to any one of claims 1 to 3, characterized in that, Whether the detection execution result is correct includes: Check whether the read command has been executed and whether data has been read. If the data is not read, the execution result is determined to be incorrect. If the data is read, then perform metadata verification on the data; If the metadata verification is successful, the execution result is considered correct. If metadata verification fails, the execution result is deemed incorrect.

5. The voltage control method as described in claim 4, characterized in that, The metadata verification of the data includes: The metadata of the data is compared with the expected metadata carried by the read command; If the metadata of the data matches the expected metadata, then the metadata verification is successful. If the metadata of the data does not match the expected metadata, then the metadata verification is determined to have failed.

6. The voltage control method as described in claim 4, characterized in that, The voltage control method further includes: In the voltage control mode, the number of times metadata verification fails is counted, and the idle time duration is counted, wherein the idle time duration is the time elapsed from the moment the last read command for any control unit of the flash memory was received to the current moment; If the number of occurrences exceeds a preset third threshold, or if the idle time exceeds a preset duration, then clear the current offset voltage of all control units and exit the voltage control mode.

7. The voltage control method according to any one of claims 1 to 3, characterized in that, The step of updating the target reread table based on the current offset voltage of the control unit includes: In the target reread table, the target expected voltage value is adjusted to the first position of the target reread table, wherein the target expected voltage value is the expected voltage value corresponding to the current offset voltage of the control unit.

8. A voltage control device, characterized in that, include: An execution module is configured to execute a read command if a read command is received for any control unit of the flash memory in voltage control mode. The first detection module is used to check whether the execution result is correct. The first control module is used to change the offset voltage of the control unit based on the target reread table if the execution result is incorrect, wherein the target reread table is the reread table corresponding to the control unit, and the reread table stores at least two expected voltage values. The reread module is used to initiate a reread operation after the first control module has finished running to obtain a new execution result, and to trigger the first detection module to run based on the new execution result; The second control module is used to maintain the current offset voltage of the control unit if the execution result is correct. An update module is used to update the target reread table based on the current offset voltage of the control unit if the execution result is correct.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Techniques to a set voltage level for a data access

    US20190042356A1

  • Memory management method and storage controller

    US20190303239A1