Data writing method and device, electronic equipment and storage medium

By calculating the wear coefficient of storage devices and selecting appropriate storage units for data writing, the problem of severe wear of storage units is solved, extending the life of the devices, reducing wear, and preventing data loss.

CN122489006APending Publication Date: 2026-07-31LCFC HEFEI ELECTRONICS TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
LCFC HEFEI ELECTRONICS TECH
Filing Date
2026-05-07
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Storage cells in storage devices suffer severe wear and tear during frequent write operations, leading to performance degradation and shortened lifespan, a problem that is difficult to effectively solve with existing technologies.

Method used

By acquiring environmental data of the storage device and usage data of the storage unit, the wear coefficient is calculated, and the target storage unit is selected for data writing based on the wear coefficient. Units with less wear are selected first, and the writing speed is reduced in extreme environments. Data from high-wear units is migrated to the cache area.

Benefits of technology

It extends the lifespan of storage devices, reduces wear and tear on storage units, avoids data loss, and balances user experience and device performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122489006A_ABST
    Figure CN122489006A_ABST
Patent Text Reader

Abstract

This application provides a data writing method, apparatus, electronic device, and storage medium, applied to a storage device comprising multiple storage units. The method includes: acquiring environmental data of the environment in which the storage device is located and usage data of each storage unit; determining the wear coefficient of each storage unit based on the environmental data and the usage data of each storage unit; and determining a target storage unit based on the environmental data and the wear coefficient of each storage unit, the target storage unit being used to write data to be written. This application combines environmental data of the device's location with the usage data of the storage units to determine the target storage unit, which can comprehensively consider environmental factors and the actual wear of the storage units to evenly distribute the data writing across each storage unit, reducing further wear of the storage units and extending the service life of the storage unit device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a data writing method, apparatus, electronic device, and storage medium. Background Technology

[0002] Storage devices such as solid-state drives (SSDs) are widely used in personal computers, servers, and mobile devices due to their advantages such as high-speed read / write speeds, low power consumption, and shock resistance. In these technologies, data is randomly written to the storage cells of the storage device. However, these cells gradually wear down during frequent write operations, leading to performance degradation, shortened lifespan, and even data loss. Therefore, reducing wear on storage cells and extending the lifespan of storage devices during data writing is a pressing technical problem that needs to be solved. Summary of the Invention

[0003] This application provides a data writing method, apparatus, electronic device, and storage medium to at least solve the above-mentioned technical problems existing in the prior art.

[0004] A first aspect of this application provides a data writing method applied to a storage device, the storage device including multiple storage units; the method includes: Acquire environmental data of the storage device's environment and usage data of each storage unit; Based on environmental data and usage data of each storage unit, the wear coefficient of each storage unit is determined. Based on environmental data and the wear coefficient of each storage unit, a target storage unit is determined, which is used to write the data to be written.

[0005] In one possible implementation, environmental data includes ambient temperature and ambient humidity. Based on the environmental data and the wear coefficient of each storage unit, a target storage unit is determined, including: When the temperature data is less than or equal to the first preset threshold and the humidity data is less than or equal to the second preset threshold, the storage unit with the wear coefficient less than the third preset threshold is determined as the target storage unit. When the temperature data is greater than the first preset threshold, or the humidity data is greater than the second preset threshold, the storage unit with the smallest wear coefficient among all storage units is determined as the target storage unit.

[0006] In one possible implementation, the wear factor of each storage unit is determined based on environmental data and usage data of each storage unit, including: For any storage unit, Obtain the weighting coefficients for usage data and environmental data for the storage unit, respectively; The wear factor of the storage unit is determined based on usage data, environmental data, and weighting coefficients for the usage data and environmental data.

[0007] In one possible implementation, when the temperature data is less than or equal to a first preset threshold and the humidity data is less than or equal to a second preset threshold, after determining the target storage unit, the method further includes: Get the data to be written; The data to be written is written to the target storage unit based on the first write speed.

[0008] In one possible implementation, when the temperature data is greater than a first preset threshold, or the humidity data is greater than a second preset threshold, after determining the target storage unit, the method further includes: The data to be written is written to the target storage unit based on the second write speed; the second write speed is less than the first write speed.

[0009] In one possible implementation, the method further includes: When the wear coefficient of each storage unit is greater than or equal to the third preset threshold, the stored data in the storage unit with the highest wear coefficient is migrated to the cache for storage.

[0010] A second aspect of this application provides a data writing apparatus for use in a storage device, the storage device including multiple storage units; the apparatus includes: The first acquisition unit is used to acquire environmental data of the environment in which the storage device is located and usage data of each storage unit. The first determining unit is used to determine the wear coefficient of each storage unit based on environmental data and usage data of each storage unit. The second determining unit is used to determine the target storage unit based on environmental data and the wear coefficient of each storage unit. The target storage unit is used to write the data to be written.

[0011] In one possible implementation, the environmental data includes ambient temperature and ambient humidity. The second determining unit is used to determine the storage unit with a wear coefficient less than a third preset threshold as the target storage unit when the temperature data is less than or equal to a first preset threshold and the humidity data is less than or equal to a second preset threshold; and to determine the storage unit with the smallest wear coefficient among all storage units as the target storage unit when the temperature data is greater than the first preset threshold or the humidity data is greater than the second preset threshold.

[0012] A third aspect of this application provides an electronic device comprising: At least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by at least one processor, which enables the at least one processor to perform the method of this application.

[0013] A fourth aspect of this application provides a non-transitory computer-readable storage medium storing computer instructions for causing a computer to execute the method of this application.

[0014] In this application, environmental data of the storage device's environment and usage data of each storage unit are obtained; based on the environmental data and usage data of each storage unit, the wear coefficient of each storage unit is determined; based on the environmental data and wear coefficient of each storage unit, a target storage unit is determined, which is used to write the data to be written. This application combines environmental data of the device's environment and usage data of the storage units to determine the target storage unit, which can comprehensively consider environmental factors and the actual wear of the storage units to evenly distribute data writing across each storage unit, reducing further wear and tear on the storage units and extending the lifespan of the storage unit device.

[0015] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this application, nor is it intended to limit the scope of this application. Other features of this application will become readily apparent from the following description. Attached Figure Description

[0016] The above and other objects, features, and advantages of exemplary embodiments of this application will become readily apparent from the following detailed description taken in conjunction with the accompanying drawings. Several embodiments of this application are illustrated in the drawings by way of example and not limitation, in which: In the accompanying drawings, the same or corresponding reference numerals indicate the same or corresponding parts.

[0017] Figure 1 A schematic diagram illustrating the implementation flow of the data writing method according to an embodiment of this application is shown; Figure 2 A schematic diagram of the hardware composition of the storage device according to an embodiment of this application is shown; Figure 3 This illustration shows an application diagram of the data writing method according to an embodiment of this application; Figure 4 A schematic diagram of the composition structure of the data writing device according to an embodiment of this application is shown; Figure 5 A schematic diagram of the composition structure of an electronic device according to an embodiment of this application is shown. Detailed Implementation

[0018] To make the objectives, features, and advantages of this application more apparent and understandable, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0019] This application provides a data writing method that can be applied to a storage device or an electronic device containing a storage device. The storage device can be a hard drive, USB flash drive, or other device with storage capabilities. The electronic device can be a PC, laptop computer, or other device that includes any of the aforementioned storage devices. In this embodiment, the storage device includes multiple storage units; such as... Figure 1 As shown, the method includes: S101: The electronic device acquires environmental data of the environment in which the storage device is located and usage data of each storage unit.

[0020] In this step, the storage unit is a unit in the storage device used for storing and modifying data. The usage data of the storage unit includes key usage indicators such as the historical write count, erase count, and usage duration for each storage unit. In this embodiment, refer to... Figure 2 and Figure 3 As shown, Figure 2 This is a schematic diagram of the hardware composition of a storage device. The usage data of each storage unit can be read through the main control chip within the storage device. Environmental data of the environment in which the storage device operates can include ambient temperature, ambient humidity, etc., and this environmental data can be accessed through... Figure 2 The data is detected or read by environmental sensors (temperature sensors, humidity sensors).

[0021] S102: The electronic device determines the wear coefficient of each storage unit based on environmental data and usage data of each storage unit.

[0022] In this embodiment, it is understood that environmental factors can have a certain impact on the wear and tear of the storage cell. For example, the physical wear and tear of data reading and writing at 80°C is equivalent to 1.5 to 2 times that at room temperature. In a high-humidity environment, moisture seeps into the storage cell package and forms an electrolyte pool under the action of an electric field. Dendrite migration occurs in the aluminum pads or copper traces, which may cause word lines to short-circuit and bit lines to leak, increasing the wear and tear of the storage cell. In a low-temperature environment below 0°C, the electron mobility decreases, and the same amount of data needs to be written more times than at room temperature, increasing the wear and tear on the storage cell, etc.

[0023] Based on this, considering the different wear levels of storage units under different environments, this application determines the wear coefficient of each storage unit based on different environmental data and usage data of each storage unit. In this step, the wear coefficient of each storage unit is used to characterize the current wear level of each storage unit. It is determined jointly by environmental data and usage data. In an optional scheme, the wear coefficient of each storage unit can be determined by a pre-set mapping relationship table. The mapping relationship table includes the correspondence between different environmental data, different usage data and wear coefficients. For example, assuming the environmental data is: temperature 60 degrees, humidity 40%; usage data: 20 writes, usage time 0.5 hours, the corresponding wear coefficient is A. Assuming the environmental data is: temperature -3 degrees, humidity 60%; usage data: 40 writes, usage time 2 hours, the corresponding wear coefficient is B. S103: The electronic device determines the target storage unit based on the environmental data and the wear coefficient of each storage unit. The target storage unit is used to write the data to be written.

[0024] In this step, after determining the wear coefficient of each storage cell in step S102, in order to further reduce the wear of the storage cells and extend the service life of the storage device, this embodiment combines environmental data and the wear coefficient of each storage cell to determine the target storage cell for writing the data to be written. In an optional scheme, under the determined environmental data, the storage cell with the lowest wear coefficient is used for the data writing operation. For example, assuming the environmental data indicates that the current environment is a high-temperature environment, the storage cell with the lowest wear coefficient is used as the target storage cell for the data writing operation. This avoids randomly writing to storage cells with higher wear coefficients, thereby preventing further wear on the storage cells.

[0025] In steps S101-S103, environmental data of the storage device's environment and usage data of each storage unit are obtained; based on the environmental data and usage data of each storage unit, the wear coefficient of each storage unit is determined; based on the environmental data and wear coefficient of each storage unit, a target storage unit is determined, and the target storage unit is used to write the data to be written. This application combines the environmental data of the device's environment and the usage data of the storage units to determine the target storage unit, which can comprehensively consider environmental factors and the actual wear of the storage units to evenly distribute the data writing across each storage unit, reducing further wear and tear on the storage units and extending the lifespan of the storage unit device.

[0026] In some alternative solutions, environmental data includes ambient temperature and humidity. Based on this environmental data and the wear coefficient of each storage unit, the target storage unit is determined, including: When the temperature data is less than or equal to the first preset threshold and the humidity data is less than or equal to the second preset threshold, the storage unit with the wear coefficient less than the third preset threshold is determined as the target storage unit. When the temperature data is greater than the first preset threshold, or the humidity data is greater than the second preset threshold, the storage unit with the smallest wear coefficient among all storage units is determined as the target storage unit.

[0027] Furthermore, in some optional schemes, when the temperature data is less than or equal to a first preset threshold and the humidity data is less than or equal to a second preset threshold, after determining the target storage unit, the following steps are also included: Get the data to be written; The data to be written is written to the target storage unit based on the first write speed.

[0028] In some alternative solutions, when the temperature data exceeds a first preset threshold, or the humidity data exceeds a second preset threshold, after determining the target storage unit, the following steps are also included: The data to be written is written to the target storage unit based on the second write speed; the second write speed is less than the first write speed.

[0029] In this application, the first preset threshold and the second preset threshold are the normal reference thresholds for temperature and humidity, respectively. Figure 3 As shown, when both temperature and humidity data do not exceed the corresponding normal baseline thresholds, it indicates that the storage device is under normal temperature and humidity conditions. Storage cells with low wear (wear coefficient less than a third preset threshold, which is an empirical value) are selected from among the storage cells. These selected low-wear cells are then used as target storage cells. Based on a normal write speed (first write speed), the data to be written is randomly written to any of these target storage cells. In an optional embodiment, the data to be written can also be first written to the target storage cell with the lowest wear coefficient. When that target storage cell is full, the data to be written is then written to the target storage cell with the second lowest wear coefficient, and so on.

[0030] This embodiment, by including only storage cells with wear coefficients below a third preset threshold in the candidate pool under normal conditions, can preemptively eliminate obviously aged storage cells, concentrating subsequent writes on younger cells, significantly reducing wear differences between storage cells, and delaying the appearance of the first high-wear storage cell. Furthermore, under normal conditions, data is written at the normal first write speed without frequency reduction or other steps, so the user does not perceive bandwidth fluctuations, thus balancing wear control and user experience.

[0031] When at least one of the temperature and humidity data exceeds the corresponding normal baseline threshold, it indicates that the storage device is in an extreme environment of high temperature, high humidity, or high temperature and high humidity. In this application, it is considered that high temperature and high humidity exponentially accelerate oxide layer breakdown, metal migration, and charge leakage. Any additional write operation at this time may be the last write operation. Only the storage cell with the lowest wear coefficient and minimal physical damage can simultaneously minimize electric field stress, thermal stress, and chemical stress, avoiding immediate failure. Therefore, in extreme environments, this embodiment forces the selection of the storage cell with the lowest wear level for writing, ensuring effective data writing while avoiding further damage to highly worn storage cells. In this application, when performing write operations on the target storage cell in extreme environments, the write speed of the data to be written is reduced, i.e., a second write speed lower than the normal speed is used to write data to the target storage cell. At this time, the programming pulse width is lengthened, the peak current decreases, and the instantaneous impact of the oxide layer field strength is reduced, which can suppress further breakdown of the already degraded gate oxide of the flash memory block under extreme environments such as high temperature and high humidity. In addition, slow writing reduces the instantaneous power consumption of the target storage cell and decreases the channel temperature rise, thus preventing further temperature increases that could lead to accelerated wear of the target storage cell.

[0032] This embodiment is illustrated by... Figure 2 The temperature and humidity sensors in the memory monitor environmental factors such as temperature and humidity in real time, dynamically adjusting the write strategy. This is flexible and convenient, and can effectively reduce the wear and tear of storage units in different environments.

[0033] In some alternative solutions, the wear factor of each storage unit is determined based on environmental data and usage data of each storage unit, including: For any storage unit, Obtain the weighting coefficients for usage data and environmental data for the storage unit, respectively; The wear factor of the storage unit is determined based on usage data, environmental data, and weighting coefficients for the usage data and environmental data.

[0034] In this application, different weighting coefficients are pre-set for usage data and environmental data according to actual needs. The weighting coefficient represents the degree of influence of different data on storage unit wear; a larger weighting coefficient indicates a greater influence of the data on storage unit wear, and a smaller weighting coefficient indicates a smaller influence. The wear coefficient is calculated using formula (1): MS = f1.W + f2.E + f3.T + f4.Temp + f5.Hum (Formula 1) Where MS is the wear coefficient. W is the number of writes to the storage unit. E is the number of erases to the storage unit. T is the usage time of the storage unit. Temp is the ambient temperature. Hum is the humidity. f1, f2, f3, f4, and f5 are the weight coefficients corresponding to W, E, T, Temp, and Hum, respectively, and can be flexibly adjusted. By using formula (1) to put the number of writes, erases, usage time, temperature, and humidity into the same linear model, and using configurable weight coefficients f1~f5 to distinguish the contribution, the originally discrete and heterogeneous five indicators can be normalized into a single wear coefficient MS in the 0-1 range. This expands the calculation dimension of the wear coefficient of the storage unit, avoids the misjudgment caused by the existing technology that only relies on a single indicator to determine the wear coefficient, and more accurately determines the wear degree of the storage unit.

[0035] In some alternative approaches, the method also includes: When the wear coefficient of each storage unit is greater than or equal to the third preset threshold, the stored data in the storage unit with the highest wear coefficient is migrated to the cache for storage.

[0036] In this application, when the wear coefficient of each storage cell is greater than or equal to a third preset threshold, meaning that the wear degree of each storage cell is high, considering that the storage cell with the highest wear coefficient is approaching the physical limit of the device, the next write or read operation may trigger a word line short circuit. Therefore, this embodiment, while the data in the storage cell with the highest wear coefficient can still be read correctly, moves the data stored in it to the cache area (e.g., ...) all at once. Figure 2 Storing data in the cache module (often referred to as a cache module) is equivalent to retrieving data before the storage unit becomes completely unusable, preventing direct data loss due to storage unit failure during subsequent writes or reads. If data migration is delayed until the most worn storage unit reports an error, it often involves multiple read / write retries, introducing additional read / write amplification. Furthermore, migrating data from the most worn storage unit to the cache is equivalent to forcing the most vulnerable storage unit offline, causing the average wear coefficient of the remaining storage units to fall below the threshold again, making them writable again, and naturally extending the overall lifespan.

[0037] This application also provides a data writing device applied to a storage device, the storage device including multiple storage units; such as... Figure 4 As shown, the device includes: The first acquisition unit 401 is used to acquire environmental data of the environment where the storage device is located and usage data of each storage unit. The first determining unit 402 is used to determine the wear coefficient of each storage unit based on environmental data and usage data of each storage unit. The second determining unit 403 is used to determine the target storage unit based on environmental data and the wear coefficient of each storage unit. The target storage unit is used to write the data to be written.

[0038] In some optional schemes, the environmental data includes ambient temperature and ambient humidity. The second determining unit 403 is used to determine the storage unit with a wear coefficient less than a third preset threshold as the target storage unit when the temperature data is less than or equal to a first preset threshold and the humidity data is less than or equal to a second preset threshold; and to determine the storage unit with the smallest wear coefficient among all storage units as the target storage unit when the temperature data is greater than the first preset threshold or the humidity data is greater than the second preset threshold.

[0039] In some alternative schemes, the first determining unit 402 is used to obtain, for any storage unit, the weighting coefficients of the usage data and environmental data of the storage unit respectively; and to determine the wear coefficient of the storage unit based on the usage data, environmental data and the weighting coefficients of the usage data and environmental data.

[0040] In some optional solutions, when the temperature data is less than or equal to a first preset threshold and the humidity data is less than or equal to a second preset threshold, the following is also included: The write unit is used to acquire the data to be written and write the data to be written to the target storage unit based on the first write speed.

[0041] In some alternative solutions, when the temperature data is greater than a first preset threshold or the humidity data is greater than a second preset threshold, the writing unit is used to write the data to be written to the target storage unit based on a second writing speed; the second writing speed is less than the first writing speed.

[0042] In some alternative solutions, the device also includes: The storage unit is used to migrate the stored data in the storage unit with the highest wear coefficient to the cache area for storage when the wear coefficient of each storage unit is greater than or equal to a third preset threshold.

[0043] It should be noted that the data writing device in this application embodiment solves the problem in a similar way to the aforementioned data writing method. Therefore, the implementation process, implementation principle, and beneficial effects of the data writing device can be found in the description of the implementation process, implementation principle, and beneficial effects of the aforementioned method. Repeated descriptions will not be repeated.

[0044] According to embodiments of this application, this application also provides an electronic device and a readable storage medium.

[0045] Figure 5A schematic block diagram of an example electronic device 800 that can be used to implement embodiments of this application is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the application described and / or claimed herein.

[0046] like Figure 5 As shown, device 800 includes a computing unit 801, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 802 or a computer program loaded from storage unit 808 into random access memory (RAM) 803. RAM 803 may also store various programs and data required for the operation of device 800. The computing unit 801, ROM 802, and RAM 803 are interconnected via bus 804. Input / output (I / O) interface 805 is also connected to bus 804.

[0047] Multiple components in device 800 are connected to I / O interface 805, including: input unit 806, such as keyboard, mouse, etc.; output unit 807, such as various types of monitors, speakers, etc.; storage unit 808, such as disk, optical disk, etc.; and communication unit 809, such as network card, modem, wireless transceiver, etc. Communication unit 809 allows device 800 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0048] The computing unit 801 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 801 performs the various methods and processes described above, such as the data writing method. For example, in some embodiments, the data writing method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 808. In some embodiments, part or all of the computer program may be loaded and / or installed on device 800 via ROM 802 and / or communication unit 809. When the computer program is loaded into RAM 803 and executed by the computing unit 801, one or more steps of the data writing method described above may be performed. Alternatively, in other embodiments, the computing unit 801 may be configured to perform the data writing method by any other suitable means (e.g., by means of firmware).

[0049] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transferring data and instructions to the storage system, the at least one input device, and the at least one output device.

[0050] The program code used to implement the methods of this application may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing device, such that when executed by the processor or controller, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0051] In the context of this application, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0052] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0053] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.

[0054] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.

[0055] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this application can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this application can be achieved, and this is not limited herein.

[0056] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "a plurality of" means two or more, unless otherwise explicitly specified.

[0057] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A data writing method, characterized in that, Applied to a storage device, the storage device comprising a plurality of storage units; the method includes: Acquire environmental data of the environment in which the storage device is located and usage data of each storage unit; Based on the environmental data and the usage data of each storage unit, the wear coefficient of each storage unit is determined; Based on environmental data and the wear coefficient of each storage unit, a target storage unit is determined, which is used to write the data to be written.

2. The data writing method according to claim 1, characterized in that, The environmental data includes ambient temperature and ambient humidity. Determining the target storage unit based on the environmental data and the wear coefficient of each storage unit includes: When the temperature data is less than or equal to a first preset threshold and the humidity data is less than or equal to a second preset threshold, the storage unit with a wear coefficient less than a third preset threshold is determined as the target storage unit. When the temperature data is greater than a first preset threshold, or the humidity data is greater than a second preset threshold, the storage unit with the smallest wear coefficient among all storage units is determined as the target storage unit.

3. The data writing method according to claim 1 or 2, characterized in that, The step of determining the wear coefficient of each storage unit based on the environmental data and the usage data of each storage unit includes: For any storage unit, Obtain the weighting coefficients for the usage data and environmental data of the storage unit, respectively; The wear coefficient of the storage unit is determined based on the usage data, environmental data, and weighting coefficients for the usage data and environmental data.

4. The data writing method according to claim 2, characterized in that, When the temperature data is less than or equal to a first preset threshold and the humidity data is less than or equal to a second preset threshold, after determining the target storage unit, the method further includes: Get the data to be written; The data to be written is written to the target storage unit based on the first write speed.

5. The data writing method according to claim 4, characterized in that, When the temperature data is greater than a first preset threshold, or the humidity data is greater than a second preset threshold, after determining the target storage unit, the method further includes: The data to be written is written to the target storage unit based on the second write speed; the second write speed is less than the first write speed.

6. The data writing method according to claim 2, characterized in that, The method further includes: When the wear coefficient of each storage unit is greater than or equal to the third preset threshold, the stored data in the storage unit with the highest wear coefficient is migrated to the cache for storage.

7. A data writing device, characterized in that, Applied to a storage device, the storage device comprising a plurality of storage units; the device includes: The first acquisition unit is used to acquire environmental data of the environment in which the storage device is located and usage data of each storage unit. The first determining unit is used to determine the wear coefficient of each storage unit based on the environmental data and the usage data of each storage unit. The second determining unit is used to determine the target storage unit based on environmental data and the wear coefficient of each storage unit, and the target storage unit is used to write the data to be written.

8. The data writing device according to claim 7, characterized in that, The environmental data includes ambient temperature and ambient humidity. The second determining unit is used to determine the storage unit with a wear coefficient less than a third preset threshold as the target storage unit when the temperature data is less than or equal to a first preset threshold and the humidity data is less than or equal to a second preset threshold; and to determine the storage unit with the smallest wear coefficient among all storage units as the target storage unit when the temperature data is greater than the first preset threshold or the humidity data is greater than the second preset threshold.

9. An electronic device, characterized in that, include: At least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-6.

10. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-6.