Flash data writing method and system and storage medium
By obtaining the operating voltage and temperature of the Flash memory, the write rate can be determined to adapt to its working state and environment, thus solving the problem of inflexible data writing in Flash memory and improving the performance and stability of the memory.
Patent Information
- Application Number
- CN202511276347.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-08
- Publication Date
- 2025-12-19
AI Technical Summary
Existing flash memory lacks flexibility when writing data, which affects its performance.
By acquiring the operating voltage and temperature of the Flash memory within a preset time period, it is determined whether the maximum and minimum temperature values are within the preset range. The target Flash data write rate is determined based on the operating voltage, and a write operation is performed when the conditions are met.
It improves the flexibility and performance of Flash data writing, adapts to different working environments, and ensures stable operation of the memory within the normal temperature range.
Smart Images

Figure CN121166033A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, specifically to a Flash data writing method, system, and storage medium. Background Technology
[0002] In practical applications, Flash memory is a non-volatile semiconductor memory that combines the advantages of ROM (Read-Only Memory) and RAM (Random Access Memory), namely, it is electronically erasable and programmable, retaining data even when power is off; in short, it does not lose data due to power failure. Therefore, Flash memory is widely used in various electronic devices (such as mobile phones and tablets). However, currently, Flash memory lacks flexibility in writing data, which reduces its performance. Therefore, improving the flexibility of Flash data writing to enhance its performance is a pressing issue that needs to be addressed. Summary of the Invention
[0003] This application provides a Flash data writing method, system, and storage medium, which can improve the flexibility of Flash data writing and thus enhance the performance of Flash memory.
[0004] In a first aspect, embodiments of this application provide a Flash data writing method, applied to an electronic device, the electronic device including a Flash memory, the method comprising:
[0005] When writing target Flash data, the operating voltage of the Flash memory within a preset time period is obtained, resulting in multiple operating voltages; the preset time period is a time period of a first time length prior to the current moment.
[0006] The operating temperature within the preset time period is obtained, resulting in multiple operating temperatures;
[0007] Determine the maximum and minimum temperature values among the plurality of operating temperatures;
[0008] Detect whether both the maximum and minimum temperature values are within a preset temperature range;
[0009] When both the maximum and minimum temperature values are within the preset temperature range, the first target Flash data write rate is determined based on the multiple operating voltages.
[0010] The target Flash data is written to the Flash memory at the first target Flash data write rate.
[0011] Secondly, embodiments of this application provide a Flash data writing system applied to an electronic device, the electronic device including a Flash memory, and the Flash data writing system including: an acquisition unit, a determination unit, a detection unit, and a writing unit, wherein...
[0012] The acquisition unit is used to acquire the operating voltage of the Flash memory within a preset time period during the writing operation of the target Flash data, and obtain multiple operating voltages; the preset time period is a time period of a first time length before the current time; and to acquire the operating temperature within the preset time period, and obtain multiple operating temperatures.
[0013] The determining unit is used to determine the maximum and minimum temperature values among the plurality of operating temperatures;
[0014] The detection unit is used to detect whether the maximum temperature value and the minimum temperature value are both within a preset temperature range;
[0015] The determining unit is further configured to determine a first target Flash data write rate based on the plurality of operating voltages when both the maximum temperature value and the minimum temperature value are within the preset temperature range.
[0016] The writing unit is used to perform a writing operation on the target Flash data according to the first target Flash data writing rate, so as to write the target Flash data into the Flash memory.
[0017] Thirdly, embodiments of this application provide an electronic device, including a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, and the programs include instructions for performing the steps in the first aspect of embodiments of this application.
[0018] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program for electronic data interchange, wherein the computer program causes a computer to perform some or all of the steps described in the first aspect of embodiments of this application.
[0019] Fifthly, embodiments of this application provide a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps described in the first aspect of embodiments of this application. The computer program product may be a software installation package.
[0020] Implementing the embodiments of this application has the following beneficial effects:
[0021] As can be seen, the Flash data writing method, system, and storage medium described in the embodiments of this application are applied to electronic devices, including Flash memory. When performing a write operation on target Flash data, the operating voltage of the Flash memory within a preset time period is obtained, resulting in multiple operating voltages. The preset time period is a time period of a first time length before the current moment. The operating temperature within the preset time period is obtained, resulting in multiple operating temperatures. The maximum and minimum temperature values among the multiple operating temperatures are determined. It is detected whether the maximum and minimum temperature values are both within a preset temperature range. When both the maximum and minimum temperature values are within the preset temperature range, a first target Flash data writing rate is determined based on the multiple operating voltages. The first target Flash data is then written according to the specified voltage. The data write rate is used to write target Flash data into the Flash memory. Firstly, multiple operating voltages reflect the operating state and stability of the Flash memory within a preset time period. Secondly, multiple operating temperatures reflect changes in the operating environment of the Flash memory. Based on these changes, low-temperature and high-temperature environments can be excluded to ensure that the Flash memory is operating within a normal operating environment (preset temperature range). Thirdly, the corresponding Flash data write rate can be adapted based on the operating state or stability of the Flash memory, thereby improving the flexibility of Flash data writing and enhancing the performance of the Flash memory. Attached Figure Description
[0022] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, 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.
[0023] Figure 1 This is a flowchart illustrating a Flash data writing method provided in an embodiment of this application;
[0024] Figure 2 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;
[0025] Figure 3 This is a schematic diagram of the structure of another electronic device provided in an embodiment of this application;
[0026] Figure 4 This is a block diagram of the functional units of a Flash data writing system provided in an embodiment of this application. Detailed Implementation
[0027] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.
[0028] The terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses.
[0029] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0030] In this application embodiment, the electronic device involved can be a Flash memory device, which can be at least one of the following: smart glasses, smart bracelets, Internet of Things devices (such as smart refrigerators, smart washing machines, smart TVs, smartwatches, etc.), servers, handheld devices, vehicle devices (driving recorders, car speakers, etc.), computing devices or other processing devices connected to a wireless modem, as well as various forms of user equipment (UE), mobile station (MS), terminal device, etc.
[0031] In this embodiment of the application, Flash data can be understood as data stored in Flash memory.
[0032] The embodiments of this application will be described in detail below.
[0033] Please see Figure 1 , Figure 1This is a flowchart illustrating a Flash data writing method provided in an embodiment of this application. The Flash data writing method is applied to an electronic device, which includes a Flash memory. The Flash data writing method includes:
[0034] 101. When performing a write operation on the target Flash data, the operating voltage of the Flash memory within a preset time period is obtained, resulting in multiple operating voltages; the preset time period is a time period of a first time length before the current moment.
[0035] The preset time period can be set in advance or set by the system default. The preset time period is a time interval preceding the current time.
[0036] Among them, such as Figure 2 As shown, the electronic device may include a Flash memory, which is used to write Flash data.
[0037] Of course, the preset time period can also be the time between the current moment and the end of the last Flash data write. The preset time period is a time interval of the first time length before the current moment. The preset time period may or may not include the current moment.
[0038] The first time length can be preset or set by the system default. The first time length can be related to the attribute information of the Flash memory. The attribute information can include at least one of the following: the model of the Flash memory, the material of the Flash memory, the structure of the Flash memory, etc., which are not limited here.
[0039] In a specific implementation, the target Flash data may include data that needs to be written to the Flash memory. When performing a write operation on the target Flash data, the operating voltage of the Flash memory within a preset time period can be obtained to obtain multiple operating voltages. For example, the operating voltage of the Flash memory can be collected according to a first preset time interval to obtain multiple operating voltages. The first preset time interval can be preset or be a system default.
[0040] 102. Obtain the operating temperature within the preset time period to obtain multiple operating temperatures.
[0041] In practice, the operating temperature of the Flash memory can be collected at a second preset time interval, and then stored to obtain multiple operating temperatures within a preset time period. The second preset time interval can be preset or set by system default. The first preset time interval and the second preset time interval can be the same or different.
[0042] 103. Determine the maximum and minimum temperature values among the multiple operating temperatures.
[0043] In practice, the maximum value can be selected from multiple operating temperatures to obtain the maximum temperature value, and the minimum value can be selected from multiple operating temperatures to obtain the minimum temperature value.
[0044] 104. Check whether the maximum temperature value and the minimum temperature value are both within the preset temperature range.
[0045] The preset temperature range can be set in advance or left as a system default. The preset temperature range can be understood as the normal operating temperature range of the Flash memory. Conversely, if the preset temperature range is not set, it indicates that the Flash memory is not operating within its normal operating temperature range.
[0046] The preset temperature range can include an upper temperature threshold and a lower temperature threshold. Both the upper and lower temperature thresholds can be preset or set by system default. The upper temperature threshold is greater than the lower temperature threshold.
[0047] 105. When both the maximum temperature value and the minimum temperature value are within the preset temperature range, determine the first target Flash data write rate based on the multiple operating voltages.
[0048] In practice, when both the maximum and minimum temperature values are within the preset temperature range, it indicates that the temperature is normal and the temperature has little impact on Flash writing. The first target Flash data writing rate can be determined based on multiple operating voltages. Since multiple operating voltages reflect the working state or working stability of the Flash memory, the Flash data writing rate corresponding to its working state or working stability can be obtained.
[0049] Of course, if at least one of the maximum temperature value and / or the minimum temperature value is not within the preset temperature range, it indicates that the Flash memory is not within the normal operating temperature range. For example, the default Flash data write rate can be obtained, and the target Flash data can be written to the Flash memory according to the default Flash data write rate.
[0050] Optionally, each of the plurality of operating voltages corresponds to a first recording time; step 105 above, determining the first target Flash data write rate based on the plurality of operating voltages, can be implemented as follows:
[0051] A first voltage change line is determined based on the plurality of working voltages and a first recording time corresponding to each of the plurality of working voltages; the horizontal axis of the first voltage change line is time, and the vertical axis is voltage;
[0052] Determine the first absolute value of the first slope of the first voltage change line;
[0053] Obtain the first data size of the target Flash data;
[0054] The average value of the multiple operating voltages is determined to obtain a first average value;
[0055] Obtain the first reference Flash data write rate corresponding to the first average value;
[0056] The first write duration is estimated based on the first reference Flash data write rate and the first data size;
[0057] Based on the first writing duration, the first voltage change line is truncated to obtain the first voltage change line segment;
[0058] Obtain the first average voltage within the first voltage change linear segment;
[0059] The second reference Flash data write rate is determined based on the first average voltage.
[0060] Obtain the first adjustment parameter corresponding to the first absolute value;
[0061] The second reference Flash data write rate is adjusted according to the first adjustment parameter to obtain the first target Flash data write rate.
[0062] In specific implementation, a first voltage change line can be determined based on multiple working voltages and a first recording time corresponding to each working voltage. The horizontal axis of the first voltage change line is time, and the vertical axis is voltage. That is, multiple working voltages and a first recording time corresponding to each working voltage can be regarded as multiple coordinate points. Each coordinate point corresponds to a working voltage and a recording time. The horizontal axis of the coordinate system corresponding to these multiple coordinate points is time, and the vertical axis is voltage. That is, a straight line can be fitted based on these multiple coordinate points to obtain the first voltage change line. Then, the slope of the first voltage change line is determined to obtain the first slope. The absolute value of the first slope is obtained to obtain the first absolute value.
[0063] Next, the first data size of the target Flash data can be obtained, and then the average of multiple operating voltages can be determined to obtain the first average value. The first average value reflects the average operating state of the Flash memory within a preset time period. A preset mapping relationship between voltage and Flash data write rate can be stored in advance. Then, the first reference Flash data write rate corresponding to the first average value can be obtained based on the mapping relationship. In this way, the Flash data write rate corresponding to the average operating state can be obtained. Then, the first write duration can be estimated based on the first reference Flash data write rate and the first data size. For example, the first write duration = first data size / first reference Flash data write rate.
[0064] Next, the first voltage change line can be truncated according to the first write duration to obtain the first voltage change line segment. The first voltage change line segment reflects the voltage change over a period of time corresponding to the first write duration. Then, the first average voltage within the first voltage change line segment is obtained, that is, the voltage corresponding to the midpoint of the first voltage change line segment, to obtain the first average voltage.
[0065] Furthermore, according to the preset mapping relationship between voltage and Flash data write rate, the first average voltage can be determined to determine the second reference Flash data write rate. The second reference Flash data write rate can be understood as the Flash data write rate within the time period corresponding to the first write duration.
[0066] Finally, a pre-stored mapping relationship between preset absolute values and adjustment parameters can be used to obtain the first adjustment parameter corresponding to the first absolute value. Since the first absolute value reflects the working stability of the Flash memory, the smaller the absolute value, the higher the working stability, and vice versa. The second reference Flash data write rate is then adjusted according to the first adjustment parameter to obtain the first target Flash data write rate, i.e., the first target Flash data write rate = (1 + first adjustment parameter) × second reference Flash data write rate. This dynamically optimizes the Flash data write rate based on the working stability of the Flash memory.
[0067] In this example, firstly, multiple operating voltages reflect the operating state of the Flash memory within a preset time period, and also reflect the operating stability of the Flash memory. By fitting multiple operating voltages in a fitting manner, a first voltage change line is obtained. The absolute value of the slope of the first voltage change line reflects the operating stability of the Flash memory. Secondly, the first mean reflects the average operating state of the Flash memory within the preset time period. The data size of the target Flash data and the first mean can be used to estimate the time period that needs to be written to the Flash in the future, and predict the average voltage within that time period. Based on the average voltage, the corresponding Flash data write rate is adapted. Thirdly, the Flash data write rate is dynamically optimized based on the operating stability of the Flash memory, so that the optimized Flash data write rate is more in line with the actual situation, which helps to ensure the efficiency and effectiveness of Flash data writing.
[0068] 106. Perform a write operation on the target Flash data according to the first target Flash data write rate to write the target Flash data into the Flash memory.
[0069] In practice, the target Flash data can be written to the Flash memory according to the first target Flash data write rate. The corresponding Flash data write rate can be adapted based on the working state or stability of the Flash memory, thereby improving the flexibility of Flash data writing and thus improving the performance of the Flash memory.
[0070] Optionally, each of the plurality of operating temperatures corresponds to a second recording time; the preset temperature range includes an upper temperature threshold and a lower temperature threshold; it may also include the following steps:
[0071] A first temperature change line is determined based on the plurality of operating temperatures and a second recording time corresponding to each of the plurality of operating temperatures; the horizontal axis of the first temperature change line is time, and the vertical axis is temperature.
[0072] Obtain the second slope of the first temperature change line;
[0073] The average of the multiple operating temperatures is determined to obtain a second average value;
[0074] When the second slope is less than the first preset threshold and the second mean is less than the lower limit temperature threshold, a first deviation between the lower limit temperature threshold and the second mean is determined; the first preset threshold is less than 0.
[0075] Determine the second target Flash data write rate corresponding to the first deviation;
[0076] The target Flash data is written according to the second target Flash data write rate.
[0077] The first preset threshold can be set in advance or be the system default. The preset temperature range includes an upper temperature threshold and a lower temperature threshold. The first preset threshold is less than 0.
[0078] In the specific implementation, each of the multiple operating temperatures corresponds to a second recording time. That is, the first temperature change line can be determined based on the multiple operating temperatures and the second recording time corresponding to each of the multiple operating temperatures. The horizontal axis of the first temperature change line is time, and the vertical axis is temperature. Specifically, the multiple operating temperatures and the second recording time corresponding to each of the multiple operating temperatures can correspond to multiple coordinate points. Each coordinate point corresponds to one operating temperature and one recording time. Then, the slope of the first temperature change line is obtained to get the second slope. Then, the average value of the multiple operating temperatures is determined to get the second average value. When the second slope is less than the first preset threshold and the second average value is less than the lower limit temperature threshold, it indicates that the Flash memory is in a low-temperature operating environment. The first deviation between the lower limit temperature threshold and the second average value can be determined. The first deviation value = (lower limit temperature threshold - second average value) / second average value.
[0079] In practical implementation, since the activity of Flash memory decreases in low-temperature environments, a first mapping relationship between a preset deviation and the Flash data write rate can be pre-stored. Based on this first mapping relationship, a second target Flash data write rate corresponding to the first deviation is determined, and then the target Flash data is written according to the second target Flash data write rate. That is, in low-temperature environments, the corresponding Flash data write rate can be dynamically adapted based on the deviation between the actual temperature and the lower limit temperature threshold. In this way, the Flash data write rate can be adapted to the actual situation, thereby improving the intelligence of the Flash memory.
[0080] Optionally, the following steps may also be included:
[0081] When the second slope is greater than the second preset threshold and the second mean is greater than the upper limit temperature threshold, a second deviation between the second mean and the upper limit temperature threshold is determined; the second preset threshold is greater than 0.
[0082] Determine the third target Flash data write rate corresponding to the second deviation;
[0083] The target Flash data is written according to the third target Flash data write rate.
[0084] The second preset threshold can be pre-stored or set by system default, and the second preset threshold is greater than 0.
[0085] In specific implementation, when the second slope is greater than the second preset threshold and the second average value is greater than the upper limit temperature threshold, it indicates that the Flash memory is operating in a high-temperature environment. Therefore, a second deviation between the second average value and the upper limit temperature threshold can be determined: second deviation = (second average value - upper limit temperature threshold) / upper limit temperature threshold. A preset second mapping relationship between the deviation and the Flash data write rate can also be pre-stored. Based on this second mapping relationship, a third target Flash data write rate corresponding to the second deviation is determined. Finally, the target Flash data can be written according to the third target Flash data write rate. That is, in a high-temperature environment, the corresponding Flash data write rate can be dynamically adapted based on the deviation between the actual temperature and the upper limit temperature threshold. This ensures that the Flash data write rate adapts to the actual situation, thereby improving the intelligence of the Flash memory.
[0086] The first mapping relationship and the second mapping relationship can be the same or different.
[0087] Optionally, the following steps may also be included:
[0088] When the second slope is greater than or equal to the first preset threshold and less than or equal to the second preset threshold, a fourth target Flash data write rate corresponding to the first average value is determined, and the target Flash data is written according to the fourth target Flash data write rate.
[0089] or,
[0090] When the second slope is less than the first preset threshold and the second mean is greater than or equal to the lower limit temperature threshold, the step of determining the fourth target Flash data write rate corresponding to the first mean and performing a write operation on the target Flash data according to the fourth target Flash data write rate is executed.
[0091] or,
[0092] When the second slope is greater than the second preset threshold and the second average is less than or equal to the upper limit temperature threshold, the step of determining the fourth target Flash data write rate corresponding to the first average and performing a write operation on the target Flash data according to the fourth target Flash data write rate is executed.
[0093] In specific implementation, when the second slope is greater than or equal to the first preset threshold and less than or equal to the second preset threshold, the fourth target Flash data write rate corresponding to the first average value can be determined according to the pre-stored mapping relationship between the preset voltage and the Flash data write rate. The target Flash data is written according to the fourth target Flash data write rate. In this way, the Flash data write rate can be adapted to the actual situation, thereby improving the intelligence of the Flash memory.
[0094] In specific implementation, when the second slope is less than the first preset threshold and the second average value is greater than or equal to the lower limit temperature threshold, the step of determining the fourth target Flash data write rate corresponding to the first average value and performing the write operation on the target Flash data according to the fourth target Flash data write rate is executed. In this way, the Flash data write rate can be adapted to the actual situation, thereby improving the intelligence of the Flash memory.
[0095] In specific implementation, when the second slope is greater than the second preset threshold and the second average value is less than or equal to the upper limit temperature threshold, the step of determining the fourth target Flash data write rate corresponding to the first average value and performing the write operation on the target Flash data according to the fourth target Flash data write rate is executed. In this way, the Flash data write rate can be adapted to the actual situation, thereby improving the intelligence of the Flash memory.
[0096] As can be seen, the Flash data writing method described in this application embodiment is applied to an electronic device, which includes a Flash memory. When performing a write operation on target Flash data, the operating voltage of the Flash memory within a preset time period is obtained, resulting in multiple operating voltages. The preset time period is a time period of a first time length before the current moment. The operating temperature within the preset time period is obtained, resulting in multiple operating temperatures. The maximum and minimum temperature values among the multiple operating temperatures are determined. It is detected whether the maximum and minimum temperature values are both within a preset temperature range. When both the maximum and minimum temperature values are within the preset temperature range, a first target Flash data writing rate is determined based on the multiple operating voltages, and the first target Flash data is written according to the specified method. The write rate is used to write the target Flash data into the Flash memory. Firstly, multiple operating voltages reflect the operating state of the Flash memory within a preset time period, as well as its operational stability. Secondly, multiple operating temperatures reflect changes in the operating environment of the Flash memory. Based on these changes, low-temperature and high-temperature environments can be excluded to ensure that the Flash memory operates within a normal operating environment (preset temperature range). Thirdly, the corresponding Flash data write rate can be adapted based on the operating state or stability of the Flash memory, thereby improving the flexibility of Flash data writing and enhancing the performance of the Flash memory.
[0097] Consistent with the above embodiments, please refer to Figure 3 , Figure 3 This is a schematic diagram of another electronic device provided in an embodiment of this application. The electronic device includes a processor, a memory, a communication interface, and one or more programs. The one or more programs are stored in the memory and configured to be executed by the processor. In this embodiment, the memory includes a Flash memory, or the electronic device may include a Flash memory. The Flash memory and the memory are different storage devices. The program includes instructions for performing the following steps:
[0098] When writing target Flash data, the operating voltage of the Flash memory within a preset time period is obtained, resulting in multiple operating voltages; the preset time period is a time period of a first time length prior to the current moment.
[0099] The operating temperature within the preset time period is obtained, resulting in multiple operating temperatures;
[0100] Determine the maximum and minimum temperature values among the plurality of operating temperatures;
[0101] Detect whether both the maximum and minimum temperature values are within a preset temperature range;
[0102] When both the maximum and minimum temperature values are within the preset temperature range, the first target Flash data write rate is determined based on the multiple operating voltages.
[0103] The target Flash data is written to the Flash memory at the first target Flash data write rate.
[0104] Optionally, each of the plurality of operating voltages corresponds to a first recording time; in determining the first target Flash data write rate based on the plurality of operating voltages, the above program includes instructions for performing the following steps:
[0105] A first voltage change line is determined based on the plurality of working voltages and a first recording time corresponding to each of the plurality of working voltages; the horizontal axis of the first voltage change line is time, and the vertical axis is voltage;
[0106] Determine the first absolute value of the first slope of the first voltage change line;
[0107] Obtain the first data size of the target Flash data;
[0108] The average value of the multiple operating voltages is determined to obtain a first average value;
[0109] Obtain the first reference Flash data write rate corresponding to the first average value;
[0110] The first write duration is estimated based on the first reference Flash data write rate and the first data size;
[0111] Based on the first writing duration, the first voltage change line is truncated to obtain the first voltage change line segment;
[0112] Obtain the first average voltage within the first voltage change linear segment;
[0113] The second reference Flash data write rate is determined based on the first average voltage.
[0114] Obtain the first adjustment parameter corresponding to the first absolute value;
[0115] The second reference Flash data write rate is adjusted according to the first adjustment parameter to obtain the first target Flash data write rate.
[0116] Optionally, each of the plurality of operating temperatures corresponds to a second recording time; the preset temperature range includes an upper temperature threshold and a lower temperature threshold; the above program also includes instructions for performing the following steps:
[0117] A first temperature change line is determined based on the plurality of operating temperatures and a second recording time corresponding to each of the plurality of operating temperatures; the horizontal axis of the first temperature change line is time, and the vertical axis is temperature.
[0118] Obtain the second slope of the first temperature change line;
[0119] The average of the multiple operating temperatures is determined to obtain a second average value;
[0120] When the second slope is less than the first preset threshold and the second mean is less than the lower limit temperature threshold, a first deviation between the lower limit temperature threshold and the second mean is determined; the first preset threshold is less than 0.
[0121] Determine the second target Flash data write rate corresponding to the first deviation;
[0122] The target Flash data is written according to the second target Flash data write rate.
[0123] Optionally, the above procedure may also include instructions for performing the following steps:
[0124] When the second slope is greater than the second preset threshold and the second mean is greater than the upper limit temperature threshold, a second deviation between the second mean and the upper limit temperature threshold is determined; the second preset threshold is greater than 0.
[0125] Determine the third target Flash data write rate corresponding to the second deviation;
[0126] The target Flash data is written according to the third target Flash data write rate.
[0127] Optionally, the above procedure may also include instructions for performing the following steps:
[0128] When the second slope is greater than or equal to the first preset threshold and less than or equal to the second preset threshold, a fourth target Flash data write rate corresponding to the first average value is determined, and the target Flash data is written according to the fourth target Flash data write rate.
[0129] or,
[0130] When the second slope is less than the first preset threshold and the second mean is greater than or equal to the lower limit temperature threshold, the step of determining the fourth target Flash data write rate corresponding to the first mean and performing a write operation on the target Flash data according to the fourth target Flash data write rate is executed.
[0131] or,
[0132] When the second slope is greater than the second preset threshold and the second average is less than or equal to the upper limit temperature threshold, the step of determining the fourth target Flash data write rate corresponding to the first average and performing a write operation on the target Flash data according to the fourth target Flash data write rate is executed.
[0133] As can be seen, the electronic device described in this application embodiment includes a Flash memory. When performing a write operation on target Flash data, it acquires the operating voltage of the Flash memory within a preset time period, obtaining multiple operating voltages. The preset time period is a time period of a first time length before the current moment. It acquires the operating temperature within the preset time period, obtaining multiple operating temperatures. It determines the maximum and minimum temperature values among the multiple operating temperatures, detects whether the maximum and minimum temperature values are both within a preset temperature range, and when both the maximum and minimum temperature values are within the preset temperature range, it determines a first target Flash data write rate based on the multiple operating voltages, and writes the target Flash data according to the first target Flash data write rate. The ASH data is written to the Flash memory. Firstly, multiple operating voltages reflect the operating state and stability of the Flash memory within a preset time period. Secondly, multiple operating temperatures reflect changes in the operating environment of the Flash memory. Based on these changes, low-temperature and high-temperature environments can be excluded to ensure that the Flash memory is operating within a normal operating environment (preset temperature range). Thirdly, the corresponding Flash data write rate can be adapted based on the operating state or stability of the Flash memory, thereby improving the flexibility of Flash data writing and enhancing the performance of the Flash memory.
[0134] Figure 4 This is a functional unit block diagram of a Flash data writing system 400 according to an embodiment of this application. The Flash data writing system 400 is applied to an electronic device, which includes a Flash memory. The Flash data writing system 400 includes: an acquisition unit 401, a determination unit 402, a detection unit 403, and a writing unit 404.
[0135] The acquisition unit 401 is used to acquire the operating voltage of the Flash memory within a preset time period when writing target Flash data, and obtain multiple operating voltages; the preset time period is a time period of a first time length before the current time; and to acquire the operating temperature within the preset time period, and obtain multiple operating temperatures.
[0136] The determining unit 402 is used to determine the maximum and minimum temperature values among the plurality of operating temperatures;
[0137] The detection unit 403 is used to detect whether the maximum temperature value and the minimum temperature value are both within a preset temperature range;
[0138] The determining unit 402 is further configured to determine a first target Flash data write rate based on the plurality of working voltages when both the maximum temperature value and the minimum temperature value are within the preset temperature range.
[0139] The writing unit 404 is used to perform a writing operation on the target Flash data according to the first target Flash data writing rate, so as to write the target Flash data into the Flash memory.
[0140] Optionally, each of the plurality of operating voltages corresponds to a first recording time; in determining the first target Flash data write rate based on the plurality of operating voltages, the determining unit 402 is specifically used for:
[0141] A first voltage change line is determined based on the plurality of working voltages and a first recording time corresponding to each of the plurality of working voltages; the horizontal axis of the first voltage change line is time, and the vertical axis is voltage;
[0142] Determine the first absolute value of the first slope of the first voltage change line;
[0143] Obtain the first data size of the target Flash data;
[0144] The average value of the multiple operating voltages is determined to obtain a first average value;
[0145] Obtain the first reference Flash data write rate corresponding to the first average value;
[0146] The first write duration is estimated based on the first reference Flash data write rate and the first data size;
[0147] Based on the first writing duration, the first voltage change line is truncated to obtain the first voltage change line segment;
[0148] Obtain the first average voltage within the first voltage change linear segment;
[0149] The second reference Flash data write rate is determined based on the first average voltage.
[0150] Obtain the first adjustment parameter corresponding to the first absolute value;
[0151] The second reference Flash data write rate is adjusted according to the first adjustment parameter to obtain the first target Flash data write rate.
[0152] Optionally, each of the plurality of operating temperatures corresponds to a second recording time; the preset temperature range includes an upper temperature threshold and a lower temperature threshold; the Flash data writing system 400 is further specifically used for:
[0153] A first temperature change line is determined based on the plurality of operating temperatures and a second recording time corresponding to each of the plurality of operating temperatures; the horizontal axis of the first temperature change line is time, and the vertical axis is temperature.
[0154] Obtain the second slope of the first temperature change line;
[0155] The average of the multiple operating temperatures is determined to obtain a second average value;
[0156] When the second slope is less than the first preset threshold and the second mean is less than the lower limit temperature threshold, a first deviation between the lower limit temperature threshold and the second mean is determined; the first preset threshold is less than 0.
[0157] Determine the second target Flash data write rate corresponding to the first deviation;
[0158] The target Flash data is written according to the second target Flash data write rate.
[0159] Optionally, the Flash data writing system 400 is further specifically used for:
[0160] When the second slope is greater than the second preset threshold and the second mean is greater than the upper limit temperature threshold, a second deviation between the second mean and the upper limit temperature threshold is determined; the second preset threshold is greater than 0.
[0161] Determine the third target Flash data write rate corresponding to the second deviation;
[0162] The target Flash data is written according to the third target Flash data write rate.
[0163] Optionally, the Flash data writing system 400 is further specifically used for:
[0164] When the second slope is greater than or equal to the first preset threshold and less than or equal to the second preset threshold, a fourth target Flash data write rate corresponding to the first average value is determined, and the target Flash data is written according to the fourth target Flash data write rate.
[0165] or,
[0166] When the second slope is less than the first preset threshold and the second mean is greater than or equal to the lower limit temperature threshold, the step of determining the fourth target Flash data write rate corresponding to the first mean and performing a write operation on the target Flash data according to the fourth target Flash data write rate is executed.
[0167] or,
[0168] When the second slope is greater than the second preset threshold and the second average is less than or equal to the upper limit temperature threshold, the step of determining the fourth target Flash data write rate corresponding to the first average and performing a write operation on the target Flash data according to the fourth target Flash data write rate is executed.
[0169] As can be seen, the Flash data writing system described in this application embodiment is applied to an electronic device, which includes a Flash memory. When performing a write operation on target Flash data, the system acquires the operating voltage of the Flash memory within a preset time period, obtaining multiple operating voltages. The preset time period is a time period of a first time length before the current moment. The system acquires the operating temperature within the preset time period, obtaining multiple operating temperatures. The system determines the maximum and minimum temperature values among the multiple operating temperatures, and detects whether the maximum and minimum temperature values are both within a preset temperature range. When both the maximum and minimum temperature values are within the preset temperature range, the system determines the first target Flash data write rate based on the multiple operating voltages, and writes the first target Flash data according to the specified parameters. The write rate is used to write the target Flash data into the Flash memory. Firstly, multiple operating voltages reflect the operating state of the Flash memory within a preset time period, as well as its operational stability. Secondly, multiple operating temperatures reflect changes in the operating environment of the Flash memory. Based on these changes, low-temperature and high-temperature environments can be excluded to ensure that the Flash memory operates within a normal operating environment (preset temperature range). Thirdly, the corresponding Flash data write rate can be adapted based on the operating state or stability of the Flash memory, thereby improving the flexibility of Flash data writing and enhancing the performance of the Flash memory.
[0170] It is understood that the functions of each program module of the Flash data writing system in this embodiment can be specifically implemented according to the methods in the above method embodiments. The specific implementation process can be referred to the relevant descriptions in the above method embodiments, which will not be repeated here.
[0171] This application also provides a computer storage medium storing a computer program for electronic data interchange, which causes a computer to perform some or all of the steps of any of the methods described in the above method embodiments.
[0172] This application also provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps of any of the methods described in the above method embodiments. This computer program product can be a software installation package.
[0173] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0174] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.
[0175] In the several embodiments provided in this application, it should be understood that the disclosed apparatus can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the 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 through some interfaces; the indirect coupling or communication connection between devices or units may be electrical or other forms.
[0176] 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.
[0177] Furthermore, the functional units in the various embodiments of this application 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.
[0178] 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 device (CMD). Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned memory includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0179] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0180] The embodiments of this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method for writing Flash data, characterized in that, Applied to an electronic device, the electronic device including a Flash memory, the method includes: When writing target Flash data, the operating voltage of the Flash memory within a preset time period is obtained, resulting in multiple operating voltages; the preset time period is a time period of a first time length prior to the current moment. The operating temperature within the preset time period is obtained, resulting in multiple operating temperatures; Determine the maximum and minimum temperature values among the plurality of operating temperatures; Detect whether both the maximum and minimum temperature values are within a preset temperature range; When both the maximum and minimum temperature values are within the preset temperature range, the first target Flash data write rate is determined based on the multiple operating voltages. The target Flash data is written to the Flash memory at the first target Flash data write rate.
2. The Flash data writing method according to claim 1, characterized in that, Each of the plurality of operating voltages corresponds to a first recording time; determining the first target Flash data write rate based on the plurality of operating voltages includes: A first voltage change line is determined based on the plurality of working voltages and a first recording time corresponding to each of the plurality of working voltages; the horizontal axis of the first voltage change line is time, and the vertical axis is voltage; Determine the first absolute value of the first slope of the first voltage change line; Obtain the first data size of the target Flash data; The average value of the multiple operating voltages is determined to obtain a first average value; Obtain the first reference Flash data write rate corresponding to the first average value; The first write duration is estimated based on the first reference Flash data write rate and the first data size; Based on the first writing duration, the first voltage change line is truncated to obtain the first voltage change line segment; Obtain the first average voltage within the first voltage change linear segment; The second reference Flash data write rate is determined based on the first average voltage. Obtain the first adjustment parameter corresponding to the first absolute value; The second reference Flash data write rate is adjusted according to the first adjustment parameter to obtain the first target Flash data write rate.
3. The Flash data writing method according to claim 2, characterized in that, Each of the plurality of operating temperatures corresponds to a second recording time; the preset temperature range includes an upper temperature threshold and a lower temperature threshold. The Flash data writing method further includes: A first temperature change line is determined based on the plurality of operating temperatures and a second recording time corresponding to each of the plurality of operating temperatures; the horizontal axis of the first temperature change line is time, and the vertical axis is temperature. Obtain the second slope of the first temperature change line; The average of the multiple operating temperatures is determined to obtain a second average value; When the second slope is less than the first preset threshold and the second mean is less than the lower limit temperature threshold, a first deviation between the lower limit temperature threshold and the second mean is determined; the first preset threshold is less than 0. Determine the second target Flash data write rate corresponding to the first deviation; The target Flash data is written according to the second target Flash data write rate.
4. The Flash data writing method according to claim 2 or 3, characterized in that, The Flash data writing method further includes: When the second slope is greater than the second preset threshold and the second mean is greater than the upper limit temperature threshold, a second deviation between the second mean and the upper limit temperature threshold is determined; the second preset threshold is greater than 0. Determine the third target Flash data write rate corresponding to the second deviation; The target Flash data is written according to the third target Flash data write rate.
5. The Flash data writing method according to claim 4, characterized in that, The Flash data writing method further includes: When the second slope is greater than or equal to the first preset threshold and less than or equal to the second preset threshold, a fourth target Flash data write rate corresponding to the first average value is determined, and the target Flash data is written according to the fourth target Flash data write rate. or, When the second slope is less than the first preset threshold and the second mean is greater than or equal to the lower limit temperature threshold, the step of determining the fourth target Flash data write rate corresponding to the first mean and performing a write operation on the target Flash data according to the fourth target Flash data write rate is executed. or, When the second slope is greater than the second preset threshold and the second average is less than or equal to the upper limit temperature threshold, the step of determining the fourth target Flash data write rate corresponding to the first average and performing a write operation on the target Flash data according to the fourth target Flash data write rate is executed.
6. A Flash data writing system, characterized in that, Applied to electronic devices, the electronic devices include Flash memory, and the Flash data writing system includes: an acquisition unit, a determination unit, a detection unit, and a writing unit, wherein... The acquisition unit is used to acquire the operating voltage of the Flash memory within a preset time period during the writing operation of the target Flash data, and obtain multiple operating voltages; the preset time period is a time period of a first time length before the current time; and to acquire the operating temperature within the preset time period, and obtain multiple operating temperatures. The determining unit is used to determine the maximum and minimum temperature values among the plurality of operating temperatures; The detection unit is used to detect whether the maximum temperature value and the minimum temperature value are both within a preset temperature range; The determining unit is further configured to determine a first target Flash data write rate based on the plurality of operating voltages when both the maximum temperature value and the minimum temperature value are within the preset temperature range. The writing unit is used to perform a writing operation on the target Flash data according to the first target Flash data writing rate, so as to write the target Flash data into the Flash memory.
7. The Flash data writing system according to claim 6, characterized in that, Each of the plurality of operating voltages corresponds to a first recording time; in determining the first target Flash data write rate based on the plurality of operating voltages, the determining unit is specifically used for: A first voltage change line is determined based on the plurality of working voltages and a first recording time corresponding to each of the plurality of working voltages; the horizontal axis of the first voltage change line is time, and the vertical axis is voltage; Determine the first absolute value of the first slope of the first voltage change line; Obtain the first data size of the target Flash data; The average value of the multiple operating voltages is determined to obtain a first average value; Obtain the first reference Flash data write rate corresponding to the first average value; The first write duration is estimated based on the first reference Flash data write rate and the first data size; Based on the first writing duration, the first voltage change line is truncated to obtain the first voltage change line segment; Obtain the first average voltage within the first voltage change linear segment; The second reference Flash data write rate is determined based on the first average voltage. Obtain the first adjustment parameter corresponding to the first absolute value; The second reference Flash data write rate is adjusted according to the first adjustment parameter to obtain the first target Flash data write rate.
8. The Flash data writing system according to claim 7, characterized in that, Each of the plurality of operating temperatures corresponds to a second recording time; the preset temperature range includes an upper temperature threshold and a lower temperature threshold; the Flash data writing system is also specifically used for: A first temperature change line is determined based on the plurality of operating temperatures and a second recording time corresponding to each of the plurality of operating temperatures; the horizontal axis of the first temperature change line is time, and the vertical axis is temperature. Obtain the second slope of the first temperature change line; The average of the multiple operating temperatures is determined to obtain a second average value; When the second slope is less than the first preset threshold and the second mean is less than the lower limit temperature threshold, a first deviation between the lower limit temperature threshold and the second mean is determined; The first preset threshold is less than 0; Determine the second target Flash data write rate corresponding to the first deviation; The target Flash data is written according to the second target Flash data write rate.
9. The Flash data writing system according to claim 7 or 8, characterized in that, The Flash data writing system is also specifically used for: When the second slope is greater than the second preset threshold and the second mean is greater than the upper limit temperature threshold, a second deviation between the second mean and the upper limit temperature threshold is determined. The second preset threshold is greater than 0; Determine the third target Flash data write rate corresponding to the second deviation; The target Flash data is written according to the third target Flash data write rate.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that is executed by a processor to implement the method of any one of claims 1 to 5.