Data storage method, device and equipment
By filling data strips based on data storage requests and current status, the problem of low storage space utilization in data storage process is solved, the utilization rate of storage space and data storage efficiency are improved, and the flexibility and reliability of data storage are enhanced.
Patent Information
- Application Number
- CN202510355643.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-25
- Publication Date
- 2025-07-18
AI Technical Summary
In the prior art, there is a problem of low storage space utilization in the data storage process, especially when the data length is not equal to the total length of data stripes that can be stored, it is necessary to zero-complease the data stripes, resulting in low storage space utilization.
By acquiring the data storage request, the data slicing is filled according to the current state, so that the length of the effective data it stores is greater than or equal to the preset length, including filling according to the waiting time or the preset value in the waiting state, and filling directly based on the preset value in the non-wait state.
It improves the utilization rate of storage space in the data storage process, avoids the low data storage efficiency caused by excessive waiting time, and enhances the flexibility and reliability of data storage.
Smart Images

Figure CN120335716A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present application relate to the technical field of data processing, and in particular, to a data storage method, apparatus, and device. Background Art
[0002] At least one piece of data is stored in a storage medium to make the at least one piece of data available for a long time and avoid data loss.
[0003] In the related art, data can be stored in the following manner: according to a data storage request, a server stores at least one piece of data in at least one data strip in sequence. In the above process, if the data length of the at least one piece of data is not equal to the total length that can be stored in the at least one data strip, zero-padding processing needs to be performed on the data strip that is not fully stored. In this way, there is a data strip that does not store valid data, resulting in low utilization of the storage space during the data storage process. Summary of the Invention
[0004] Embodiments of the present application provide a data storage method, apparatus, and device to solve the problem of low utilization of the storage space during the data storage process.
[0005] In a first aspect, an embodiment of the present application provides a data acquisition method, including:
[0006] Obtain a data storage request, where the data storage request includes at least one first piece of data and the length of the at least one first piece of data;
[0007] According to the data storage request, store the at least one piece of data in at least one first data strip, where the at least one first data strip is set in the storage space of a data storage device;
[0008] Obtain the current state corresponding to the data storage;
[0009] According to the current state, perform padding processing on the at least one first data strip so that the length of the valid data stored in each first data strip is greater than or equal to a preset length.
[0010] In a possible implementation manner, performing padding processing on the at least one first data strip according to the current state includes:
[0011] If the current state is a waiting state, obtain the first duration for which the waiting state lasts, and perform padding processing on the at least one first data strip according to the first duration;
[0012] If the current state is a non-waiting state, obtain a preset value, and perform padding processing on the at least one first data strip according to the preset value.
[0013] In the embodiments of the present application, during the waiting state, filling processing can be performed through data so that the length of the valid data stored in each first data strip is greater than or equal to a preset length, which improves the utilization rate of the storage space during the data storage process. Meanwhile, during the non-waiting state, filling can be directly performed according to the preset value, avoiding too long waiting time and improving the data storage efficiency.
[0014] In a possible implementation manner, performing filling processing on the at least one first data strip according to the first duration includes:
[0015] Determine whether the first duration is less than a first preset duration;
[0016] If so, obtain indication information and perform filling processing on the at least one first data strip according to the indication information;
[0017] If not, perform filling processing on the at least one first data strip according to the preset value.
[0018] In the embodiments of the present application, it is possible to determine whether to wait for new data to be filled or directly perform filling according to the preset value based on the first preset duration. While avoiding a large amount of invalid data stored in data strips, it also avoids the situation where the data storage efficiency is low due to too long waiting time, improving the flexibility of data storage.
[0019] In a possible implementation manner, performing filling processing on the at least one first data strip according to the indication information includes:
[0020] If the indication information indicates the existence of a target instruction, perform filling processing on the at least one data strip according to the target instruction;
[0021] If the indication information indicates the non-existence of a target instruction, perform filling processing on the at least one first data strip according to the preset value.
[0022] In the embodiments of the present application, if indication information is received within the first duration, corresponding filling processing can be performed according to the indication information. While improving the utilization rate of the storage space, it also avoids the situation where the data storage efficiency is low due to too long waiting time, improving the flexibility of data storage.
[0023] In a possible implementation manner, performing filling processing on the at least one data strip according to the target instruction includes:
[0024] If the target instruction is a data storage instruction, store at least one data in the data storage instruction into at least one target data strip until the at least one target data strip is full of data;
[0025] If the target instruction is a filling instruction, perform filling processing on at least one target data sub - strip according to the preset value until the at least one target data sub - strip is full of data;
[0026] Among them, the target data sub - strip is a data sub - strip in the at least one first data sub - strip that is not full of data.
[0027] In the embodiment of the present application, when a target instruction is received within the first time period, corresponding filling processing can be performed according to the preset instruction. While improving the storage space utilization rate, it avoids the situation that the data storage efficiency is low due to too long waiting time. The flexibility of data storage is improved.
[0028] In a possible implementation manner, storing the at least one data into at least one first data sub - strip according to the data storage request includes:
[0029] Judge whether there is a historical data storage request during the historical period, where the end time of the historical period is the time when the data storage request is obtained, and the duration corresponding to the historical period is the second preset duration;
[0030] If so, determine at least one first data sub - strip in the storage space of the data storage device according to the historical data storage request, and store the at least one data into at least one first data sub - strip;
[0031] If not, determine at least one first data sub - strip in the storage space of the data storage device, and store the at least one data into at least one first data sub - strip, where no data is stored in the at least one first data sub - strip.
[0032] In the embodiment of the present application, according to whether there is a historical data storage request during the historical period, it is determined whether there is a data storage request of the same batch before the data storage request. That is, whether the data storage request is a non - first data storage request among at least one data storage request sent by the user at one time. In this way, it can be determined whether it is necessary to first store at least one first data into at least one data sub - strip corresponding to the historical data storage request.
[0033] In a possible implementation manner, determining at least one first data sub - strip in the storage space of the data storage device according to the historical data storage request includes:
[0034] In the storage space of the data storage device, determine at least one second data sub - strip, where at least one data in the historical data storage request is stored in the at least one second data sub - strip;
[0035] Determine at least one candidate data strip in the at least one second data strip, where the candidate data strip is not fully stored with data;
[0036] Determine that at least one first data strip includes the at least one candidate data strip and at least one third data strip, and the total length of the data stored in the at least one candidate data strip and the at least one third data strip is greater than or equal to the length of the at least one first data.
[0037] In a possible implementation manner, obtaining the current state of data storage includes:
[0038] Determine a second duration for storing the at least one data into the at least one first data strip;
[0039] Determine whether the second duration is less than a third preset duration;
[0040] If so, determine that the current state is a waiting state;
[0041] If not, determine that the current state is a non-waiting state.
[0042] In the embodiments of the present application, when performing data storage, if the duration of data storage is too long, it indicates that there may be an abnormality in data storage. Or, the duration of data storage is greater than the duration of waiting for a target instruction during the data storage process. At this time, directly fill to end the data storage. In this way, it is possible to avoid the situation where data storage continues even when there is an abnormality in data storage, improving the reliability of data storage. And it is possible to avoid the situation where the data storage efficiency is low due to too long waiting duration.
[0043] In a second aspect, an embodiment of the present application provides a data storage device, and the device includes:
[0044] A first acquisition module, configured to acquire a data storage request, where the data storage request includes at least one first data and the length of the at least one first data;
[0045] A storage module, configured to store the at least one data into at least one first data strip according to the data storage request, where the at least one data strip is set in the storage space of the data storage device;
[0046] A second acquisition module, configured to acquire the current state corresponding to the data storage;
[0047] A processing module, configured to perform a filling process on the at least one first data strip according to the current state, so that the length of the valid data stored in each first data strip is greater than or equal to a preset length.
[0048] In a possible implementation manner, the processing module is specifically configured to:
[0049] If the current state is the waiting state, obtain a first duration for which the waiting state persists, and perform a filling process on the at least one first data strip according to the first duration;
[0050] If the current state is a non-waiting state, obtain a preset value, and perform a filling process on the at least one first data strip according to the preset value.
[0051] In a possible implementation manner, the processing module is specifically configured to:
[0052] Determine whether the first duration is less than a first preset duration;
[0053] If so, obtain indication information, and perform a filling process on the at least one first data strip according to the indication information;
[0054] If not, perform a filling process on the at least one first data strip according to the preset value.
[0055] In a possible implementation manner, the processing module is specifically configured to:
[0056] If the indication information indicates the existence of a target instruction, perform a filling process on the at least one data strip according to the target instruction;
[0057] If the indication information indicates the non-existence of a target instruction, perform a filling process on the at least one first data strip according to the preset value.
[0058] In a possible implementation manner, the processing module is specifically configured to:
[0059] If the target instruction is a data storage instruction, store at least one data in the data storage instruction into at least one target data strip until the at least one target data strip is full of data;
[0060] If the target instruction is a filling instruction, perform a filling process on the at least one target data strip according to the preset value until the at least one target data strip is full of data;
[0061] Wherein, the target data strip is a data strip among the at least one first data strips that is not full of data.
[0062] In a possible implementation manner, the storage module is specifically configured to:
[0063] Determine whether there is a historical data storage request within a historical period, where the end time of the historical period is the time when the data storage request is obtained, and the duration corresponding to the historical period is a second preset duration;
[0064] If so, determine at least one first data strip in the storage space of the data storage device according to the historical data storage request, and store the at least one data in the at least one first data strip;
[0065] If not, determine at least one first data strip in the storage space of the data storage device, and store the at least one data in the at least one first data strip, where no data is stored in the at least one first data strip.
[0066] In a possible implementation manner, the storage module is specifically configured to:
[0067] Determine at least one second data strip in the storage space of the data storage device, where the at least one second data strip stores at least one data in the historical data storage request;
[0068] Determine at least one candidate data strip among the at least one second data strip, where the candidate data strip is not full of data;
[0069] Determine that at least one first data strip includes the at least one candidate data strip and at least one third data strip, and the total length of the data stored in the at least one candidate data strip and the at least one third data strip is greater than or equal to the length of the at least one first data.
[0070] In a possible implementation manner, the second acquisition module is specifically configured to:
[0071] Determine a second duration for storing the at least one data in the at least one first data strip;
[0072] Judge whether the second duration is less than a third preset duration;
[0073] If so, determine that the current state is a waiting state;
[0074] If not, determine that the current state is a non-waiting state.
[0075] In a third aspect, an embodiment of the present application provides a data storage device, including:
[0076] At least one processor; and
[0077] A memory communicatively connected to the at least one processor; wherein,
[0078] The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method according to any one of the first aspect.
[0079] In a fourth aspect, an embodiment of the present application provides a non-transitory computer-readable storage medium storing computer instructions, where the computer instructions are used to cause the computer to execute the method according to any one of the first aspect.
[0080] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, where the computer program implements the method according to any one of the first aspect when executed by a processor.
[0081] The data storage method, apparatus, and device provided by the embodiments of the present application, after processing at least one first data in a data storage request, perform a filling process on at least one first data strip according to the current state corresponding to the data storage, so that the length of the valid data stored in each first data strip is greater than or equal to a preset length. Instead of directly filling with zeros when it is determined that the data strip is not full of data. This reduces the possibility that there is no valid data stored in the data strip. The utilization rate of the storage space during the data storage process is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0082] The drawings herein are incorporated into the specification and form a part of the specification, showing embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application.
[0083] Figure 1 It is a schematic diagram of an application scenario provided by an embodiment of the present application;
[0084] Figure 2 It is a schematic flowchart of a data storage method provided by an embodiment of the present application;
[0085] Figure 3 It is a schematic diagram of the process of obtaining a data storage request provided by an embodiment of the present application;
[0086] Figure 4 It is a schematic flowchart of another data storage method provided by an embodiment of the present application;
[0087] Figure 5 It is a schematic diagram of the process of determining at least one first data strip provided by an embodiment of the present application;
[0088] Figure 6 It is a schematic diagram of the data storage process provided by an embodiment of the present application;
[0089] Figure 7 It is a schematic diagram of the structure of a data storage device provided by an embodiment of the present application;
[0090] Figure 8 This is a schematic structural diagram of the data storage device provided by the embodiment of the present application.
[0091] Through the above-mentioned drawings, specific embodiments of the present application have been shown, and more detailed descriptions will be given later. These drawings and textual descriptions are not intended to limit the scope of the concept of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. Detailed implementation manners
[0092] Here, the exemplary embodiments will be described in detail, and the examples are shown in the drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation manners described in the following exemplary embodiments do not represent all implementation manners consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0093] It should be noted that in this document, the term "including", "comprising" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements but also includes other elements not explicitly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of additional identical elements in the process, method, article or device including that element.
[0094] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards, and corresponding operation entrances are provided for the user to select authorization or rejection.
[0095] To facilitate a clear description of the technical solutions of the embodiments of the present application, the following briefly introduces some terms and technologies involved in the embodiments of the present application:
[0096] 1. Data persistence
[0097] Data persistence is to save data to a storage medium so that these data can still be accessed and used after the application is closed or the system is restarted. The purpose of persistence is to ensure the long-term availability and consistency of data.
[0098] Common data persistence methods include:
[0099] (1) Database: Use a relational database (e.g., MySQL, PostgreSQL) or a non-relational database (e.g., MongoDB, Cassandra) to store data. These databases provide powerful query and transaction support.
[0100] (2) File system: Store data in files, which can be text files, binary files, or other formats. This method is simple and straightforward but lacks the advanced features of a database.
[0101] (3) Object storage: Use object storage provided by cloud services (e.g., Amazon S3, Google Cloud Storage) to save large amounts of unstructured data.
[0102] (4) Cache system: Although cache systems are mainly used to improve data reading speed, some cache systems (e.g., Redis, Memcached) also support persistence, writing cache data to disk to prevent data loss.
[0103] (5) Log storage: Store data in the form of logs. Log storage is often used for event sourcing and auditing.
[0104] 2. Redundant Array of Independent Disks (RAID)
[0105] RAID improves the performance, reliability, and capacity of a storage system by combining multiple disks into a logical unit. Its core principles include data distribution and redundancy mechanisms.
[0106] (1) Data distribution
[0107] Striping: Divide data into chunks and store them alternately on multiple disks to improve read and write performance.
[0108] Mirroring: Copy data completely to multiple disks to provide redundancy.
[0109] (2) Redundancy mechanism
[0110] Parity check: Calculate parity check information and store it on multiple disks for data recovery.
[0111] (3) Application scenarios
[0112] Common RAID levels are RAID 0, RAID 1, RAID 5, RAID 10, etc. Among them,
[0113] RAID 0: Suitable for scenarios that require high performance but have low requirements for data security, such as video editing.
[0114] RAID 1: Suitable for scenarios with high requirements for data security, such as financial systems.
[0115] RAID 5: Suitable for scenarios that require a balance of performance, capacity, and redundancy, such as file servers.
[0116] RAID 6: Suitable for scenarios with extremely high requirements for data security, such as data centers.
[0117] RAID 10: Suitable for scenarios that emphasize both high performance and high reliability, such as database servers.
[0118] 3. Erasure Coding (EC)
[0119] Erasure coding is a data protection technology that encodes data into multiple segments and adds redundancy to ensure the original data can still be recovered when some data is lost. It is widely used in distributed storage systems and has high storage efficiency and strong fault tolerance.
[0120] (1) Basic principle of erasure coding
[0121] Data chunking and encoding: The original data is divided into k data chunks. Through a mathematical algorithm, m parity chunks are generated. Finally, k + m data chunks and parity chunks are stored.
[0122] Fault tolerance: The system can tolerate the loss of up to m chunks (data chunks or parity chunks) and still recover the original data from the remaining k chunks. For example, if k = 4 and m = 2, then up to 2 chunks can be lost.
[0123] Data recovery: When some data is lost, the original data is decoded from the remaining k chunks through a mathematical algorithm.
[0124] (2) Application scenarios
[0125] Distributed storage systems: Such as Hadoop HDFS, Ceph, GlusterFS, etc., use erasure coding to improve storage efficiency and fault tolerance.
[0126] Cloud storage: Cloud service providers (such as AWS, Azure) use erasure coding to reduce storage costs and ensure data reliability.
[0127] Video streaming: Erasure coding is used in video transmission to prevent packet loss from affecting playback quality.
[0128] Cold data storage: Suitable for storing cold data that is not frequently accessed, taking into account both cost and data security.
[0129] (3) The differences between erasure coding and RAID can be specifically shown in Table 1 as follows:
[0130] Table 1
[0131]
[0132]
[0133] 4. Data Stripping
[0134] Data stripping is a technique that divides data into multiple chunks and distributes them for storage on different disks or storage devices, aiming to improve the performance and throughput of the storage system. It is a core component of many storage technologies such as RAID 0 and RAID 5.
[0135] (1) Basic Principle
[0136] Data Division: Data is divided into fixed - sized chunks (referred to as "stripes" or "blocks"). Each chunk is distributed to different disks in sequence.
[0137] Parallel Reading and Writing: Multiple disks can read and write data simultaneously, thus improving performance. For example, when reading a large file, data chunks can be read in parallel from multiple disks, significantly accelerating the speed.
[0138] Stripe Size: The stripe size refers to the size of each data chunk and is usually configurable (such as 64KB, 128KB). The choice of stripe size affects performance and needs to be optimized according to specific application scenarios.
[0139] (2) Application Scenarios
[0140] RAID 0 (Striping): RAID 0 uses data stripping technology to evenly distribute data across multiple disks to improve performance. The disadvantage is that there is no redundancy, and disk failures can lead to data loss.
[0141] RAID 5 (Striping with Parity): On the basis of data stripping, parity information is added to achieve redundancy. It allows data recovery in case of a single disk failure.
[0142] Distributed File Systems: Such as Hadoop HDFS, Ceph, etc., use data stripping technology to distribute files across multiple nodes to improve read - write performance.
[0143] High - Performance Computing: In large - scale computing tasks, data stripping can accelerate data reading and writing.
[0144] For example, RAID 0 consists of 4 disks, and the specific data stripping in each disk can be shown in Table 2 as follows:
[0145] Table 2
[0146]
[0147] When reading a file, data stripes can be read in parallel from 4 disks simultaneously, significantly improving the speed.
[0148] For ease of understanding, hereinafter, in conjunction with Figure 1 , the application scenarios applicable to the embodiments of the present application will be described.
[0149] Figure 1 FIG. is a schematic diagram of the application scenario provided by the embodiment of the present application. Please refer to Figure 1 , including disk 101. Disk 101 is disposed in the data storage device. Disk 101 includes y data stripes, namely data stripe 1, data stripe 2,..., data stripe y. Wherein, the length of data that each data stripe can store is x. Assume that the length of the data to be stored in the data storage request obtained by the data storage device is a, and a is less than x. The data storage device stores at least one data with a length of a into data stripe 1. After the storage is completed, if no new data storage request is received, 0 is directly written into the storage space in data stripe 1 where no data is stored, and the written length of 0 is x - a. In this way, it can be ensured that data stripe 1 is full of data.
[0150] In the above process, there is a data stripe that does not store valid data, resulting in a low utilization rate of the storage space during the data storage process.
[0151] In the embodiment of the present application, after processing at least one first data in the data storage request, according to the current state corresponding to the data storage, at least one first data stripe is filled, so that the length of the valid data stored in each first data stripe is greater than or equal to a preset length. Instead of directly filling with zeros when it is determined that the data stripe is not full of data. This reduces the possibility that there is a data stripe that does not store valid data. The utilization rate of the storage space during the data storage process is improved.
[0152] Hereinafter, the method shown in the present application will be described through specific embodiments. It should be noted that the following several embodiments can exist independently or be combined with each other. For the same or similar content, it will not be repeated in different embodiments.
[0153] Figure 2 FIG. is a schematic flowchart of a data storage method provided by an embodiment of the present application. Please refer to Figure 2 , the method may include:
[0154] S201. Obtain a data storage request.
[0155] The execution subject of the embodiments of the present application can be a data storage device or a data storage device provided in the data storage device. The data storage device can be implemented by software or by a combination of software and hardware. The data storage device can be a server. A storage space is provided in the data storage device, and the storage space includes a plurality of data stripes.
[0156] The data storage request includes at least one first data and the length of at least one first data.
[0157] The user can determine at least one first data to be stored in the terminal device. The terminal device determines at least one first data and the length of at least one first data in response to the user's operation, thereby generating a data storage request. The terminal device sends the data storage request to the data storage device. The terminal device can be a mobile phone, a tablet computer, a computer, etc.
[0158] The at least one first data can be in the form of a file, an image, a table, etc. The present application does not make any restrictions.
[0159] Next, in conjunction with Figure 3 , the process of obtaining the data storage request will be described. Figure 3 FIG. is a schematic diagram of the process of obtaining a data storage request provided by an embodiment of the present application. Please refer to Figure 3 , including interfaces 301 to 302. The interfaces 301 to 302 can be pages provided by the terminal device. Please refer to interface 301. The user clicks on the data storage application in the main page of the terminal device. The terminal device displays an operation page in response to the user's click operation. The operation page includes a drop-down selection menu corresponding to at least one data file and a text input box.
[0160] Please refer to interface 302. The user selects file A from the drop-down selection menu of data file 1 and clicks the OK icon. The terminal device determines that file A includes data A1 to data A10 in response to the user's input and selection operation, and determines that the lengths of data A1 to data A10 are 10. The terminal device generates a data storage request and sends the data storage request to the data storage device. The data storage request includes data A1 to data A10 and the lengths of data A1 to data A10 are 10.
[0161] Optionally, the user can send at least one data storage request at a time, and the data storage device can sequentially obtain at least one data storage request and store the data.
[0162] S202. According to the data storage request, store at least one data in at least one first data stripe.
[0163] At least one data stripe is provided in the storage space of the data storage device.
[0164] At least one piece of data can be stored into at least one first data stripe according to a data storage request in the following manner: Determine whether there is a historical data storage request within a historical period, where the end time of the historical period is the time when the data storage request is obtained, and the duration corresponding to the historical period is a second preset duration; if so, determine at least one first data stripe in the storage space of the data storage device according to the historical data storage request, and store at least one piece of data into at least one first data stripe; if not, determine at least one first data stripe in the storage space of the data storage device, and store at least one piece of data into at least one first data stripe, and there is no data stored in at least one first data stripe.
[0165] According to whether there is a historical data storage request within the historical period, determine whether there is a data storage request of the same batch before the data storage request. That is, whether the data storage request is not the first data storage request among at least one data storage request sent by the user at one time. In this way, it can be determined whether it is necessary to first store at least one first piece of data into at least one data stripe corresponding to the historical data storage request.
[0166] The second preset duration can be set in advance and stored in the preset storage space of the data storage device.
[0167] For example, assume that the second preset duration is 0.5 s. After the data storage device obtains the data storage request shown in the above example, it determines that the time when the data storage request is obtained is 2024 / 03 / 17 14:58:55. The data storage device determines the historical period as 2024 / 03 / 17 14:58:50 - 2024 / 03 / 17 14:58:55 according to the second preset duration. The data storage device determines that there is no historical data storage request within the historical period, then determines at least one first data stripe in the storage space of the data storage device as data stripe 1, and the length of data stripe 1 is 15. The data storage device stores data A1 to data A10 into data stripe 1.
[0168] According to whether there is a historical data storage request within the historical period, determine whether it is necessary to first store at least one first piece of data into at least one data stripe corresponding to the historical data storage request. In this way, the possibility that the data stripe is not fully stored with data can be reduced, and the utilization rate of the storage space is improved.
[0169] S203. Obtain the current state corresponding to the data storage.
[0170] The current state corresponding to data storage can be obtained in the following manner: Determine the second duration for storing at least one piece of data into at least one first data strip; Determine whether the second duration is less than a third preset duration; If so, determine the current state as the waiting state; If not, determine the current state as the non-waiting state.
[0171] The third preset duration can be set in advance and stored in the preset storage space of the data storage device.
[0172] For example, assume the third preset duration is 2s. The determined second duration for storing data A1 to data A10 into data strip 1 is 0.8s. The data storage device determines that the second duration is less than the third preset duration, then it can determine that the current state corresponding to data storage is the waiting state.
[0173] When performing data storage, if the duration of data storage is too long, it indicates that there may be an abnormality in data storage. Or, the duration of data storage is greater than the duration of waiting for a target instruction during the data storage process. At this time, directly fill to end the data storage. In this way, it is possible to avoid the situation where data storage continues even when there is an abnormality in data storage, improving the reliability of data storage. And it can avoid the situation where the waiting duration is too long resulting in low data storage efficiency.
[0174] S204. According to the current state, perform a filling process on at least one first data strip so that the length of the valid data stored in each first data strip is greater than or equal to a preset length.
[0175] The filling process on at least one first data strip can be performed according to the current state in the following manner: If the current state is the waiting state, obtain the first duration for which the waiting state persists, and perform a filling process on at least one first data strip according to the first duration; If the current state is the non-waiting state, obtain a preset value, and perform a filling process on at least one first data strip according to the preset value.
[0176] The preset length can be set in advance and stored in the preset storage space of the data storage device. The preset length can be determined according to the data length that the data strip can store.
[0177] For example, if the data length that the first data strip can store is 15, the preset length can be set to 12.
[0178] If the current state is the waiting state, the filling can be determined according to the first duration, either according to a preset value or according to data. If the current state is not the waiting state, the filling is directly performed according to the preset value. In this way, during the waiting state, the filling process can be carried out through data, so that the length of the valid data stored in each first data strip is greater than or equal to the preset length. This improves the utilization rate of the storage space during the data storage process. At the same time, in the non-waiting state, the filling can be directly performed according to the preset value, avoiding too long waiting time and improving the data storage efficiency.
[0179] The data storage method provided by the embodiments of the present application obtains a data storage request. According to the data storage request, at least one piece of data is stored in at least one first data strip. If at least one first data strip is not full of data, the current state corresponding to the data storage is obtained. According to the current state, at least one first data strip is filled, so that the length of the valid data stored in each first data strip is greater than or equal to the preset length. In this way, the possibility of a data strip not storing valid data is reduced. The utilization rate of the storage space during the data storage process is improved.
[0180] Based on any of the above embodiments, below, in combination with Figure 4 , the detailed process of data storage will be described.
[0181] Figure 4 It is a schematic flowchart of another data storage method provided by the embodiments of the present application. Please refer to Figure 4 , this method includes:
[0182] S401. Obtain a data storage request.
[0183] It should be noted that the execution process of S401 can refer to S201, which will not be elaborated here.
[0184] S402. Determine whether there is a historical data storage request during the historical period.
[0185] If yes, execute S403.
[0186] If no, execute S404.
[0187] S403. Determine at least one first data strip in the storage space of the data storage device according to the historical data storage request.
[0188] At least one first data stripe can be determined in the storage space of a data storage device according to a historical data storage request in the following manner: In the storage space of the data storage device, determine at least one second data stripe, where at least one second data stripe stores at least one data in the historical data storage request; determine at least one candidate data stripe in the at least one second data stripe, where the candidate data stripe is not fully stored with data; determine that at least one first data stripe includes at least one candidate data stripe and at least one third data stripe, and the total length of the data stored in the at least one candidate data stripe and the at least one third data stripe is greater than or equal to the length of at least one first data.
[0189] The third data stripe is a data stripe in the storage space of the data storage device that does not store data.
[0190] Next, in conjunction with Figure 5 , the process of determining at least one first data stripe in the storage space of a data storage device according to a historical data storage request will be described. Figure 5 FIG. is a schematic diagram of the process of determining at least one first data stripe provided by an embodiment of the present application. Please refer to Figure 5 , which includes a disk 501. The disk 501 is provided in the data storage device, and the disk 501 includes at least one data stripe. The length of data that each data stripe can store is 15. After the data storage device obtains a data storage request, it determines that there is a historical data storage request during a historical period. The data storage device determines, in the disk 501, that the data stripes storing at least one data in the historical data storage request are data stripe 1, data stripe 2, and data stripe 3. Therefore, it is determined that at least one second data stripe includes data stripe 1, data stripe 2, and data stripe 3.
[0191] In the at least one second data stripe, it is determined that data stripe 3 is not fully stored with data, so the candidate data stripe can be determined as data stripe 3. The remaining data length in data stripe 3 is 12. Assuming that the length of at least one first data in the data storage request is 20. The remaining data length in the data storage device's data stripe 3 is less than the length of at least one first data. Therefore, a new data stripe is also required to store at least one first data. The data storage device determines that at least one first data stripe includes data stripe 3 and data stripe 4.
[0192] After S403, S405 is executed.
[0193] S404. Determine at least one first data stripe in the storage space of the data storage device.
[0194] If there is no historical data storage request within the historical period, it can be determined that the data storage request is the first data storage request, or there is no data strip in the storage space of the data storage device that is not fully stored with data (when each batch of data storage requests is processed, zero filling needs to be performed on the data strip). Therefore, at least one first data strip is determined in the storage space of the data storage device. At least one first data strip is a data strip without stored data.
[0195] S405. Store at least one piece of data into at least one first data strip.
[0196] For example, as shown in the above example, store at least one piece of data in the data storage request into data strips 3 and 4 of disk 501.
[0197] S406. Obtain the current state of data storage.
[0198] Optionally, if all at least one first data strips are fully stored with data, when a new data storage request is obtained, directly determine at least one first data strip in the storage space of the data storage device for storage.
[0199] S407. If the current state is the waiting state, obtain the first duration for which the waiting state lasts.
[0200] The data storage device can start a timer to obtain the first duration for which the waiting state lasts when it determines that the current state is the waiting state.
[0201] S408. Perform a filling process on at least one first data strip according to the first duration.
[0202] The filling process on at least one first data strip can be performed according to the first duration in the following way: determine whether the first duration is less than the first preset duration; if so, obtain the indication information and perform a filling process on at least one first data strip according to the indication information; if not, perform a filling process on at least one first data strip according to the preset value.
[0203] The preset value can be 0. The first preset duration and the preset value can be set in advance and stored in the preset storage space of the data storage device.
[0204] The indication information is used to indicate whether there is a new data storage request or to indicate whether to directly perform the filling process.
[0205] For example, after storing at least one piece of data in the data stripes 3 and 4 of the disk 501 in the data storage request, the current state is determined to be the waiting state. The data storage device obtains that the first duration for which the waiting state persists is 10 s. Assuming that the first preset duration is 10 s, it can be determined that the first duration is equal to the first preset duration. The data storage device determines that the total length of at least one first piece of data is 20, the remaining data length of the data stripe 3 is 12, and the length of the data stripe 4 is 15. Then it can be determined that the data stripe 4 is not fully stored with data and the remaining data length is 7. Therefore, the data storage device performs a filling process on the data stripe 4, filling it with the preset value 0, and the filling length is 7.
[0206] It is possible to determine whether to wait for new data to be filled according to the first preset duration or directly fill according to the preset value. While avoiding a large amount of invalid data stored in the data stripes, it also avoids the situation where the data storage efficiency is low due to too long a waiting duration. The flexibility of data storage is improved.
[0207] The following method can be used to perform a filling process on at least one first data stripe according to the indication information: if the indication information indicates the existence of a target instruction, then according to the target instruction, perform a filling process on at least one data stripe; if the indication information indicates the non - existence of a target instruction, then according to the preset value, perform a filling process on at least one first data stripe.
[0208] For example, after storing at least one piece of data in the data stripes 3 and 4 of the disk 501 in the data storage request, the current state is determined to be the waiting state. The data storage device obtains that the first duration for which the waiting state persists is 2 s. Assuming that the first preset duration is 10 s, it can be determined that the first duration is less than the first preset duration. The data storage device obtains the indication information and determines that the indication information indicates the non - existence of a target instruction. The data storage device determines that the data length to be filled is 7, and then performs a filling process on the data stripe 4, filling it with the preset value 0, and the filling length is 7.
[0209] If the indication information is received within the first duration, corresponding filling processing can be performed according to the indication information. While improving the storage space utilization rate, it also avoids the situation where the data storage efficiency is low due to too long a waiting duration. The flexibility of data storage is improved.
[0210] The at least one data strip can be filled according to the target instruction in the following manner: If the target instruction is a data storage instruction, at least one piece of data in the data storage instruction is stored into at least one target data strip until the at least one target data strip is full of data; if the target instruction is a filling instruction, the at least one target data strip is filled according to a preset value until the at least one target data strip is full of data; wherein, the target data strip is a data strip in the at least one first data strip that is not full of data.
[0211] If the target instruction is a data storage instruction, it can be determined that there is a new data storage request after this data storage request. If the target instruction is a filling instruction, it can be determined that the processing of this batch of data storage requests is completed, and zero filling is directly performed.
[0212] After the data storage device obtains at least one data storage request of the same batch, it generates a filling instruction. And sends at least one data storage request and a filling instruction to the data storage module at one time.
[0213] For example, the data storage device obtains 3 data storage requests, namely data storage request 1, data storage request 2, and data storage request 3. When the data storage device determines that the 3 data storage requests are at least one data storage request of the same batch, it generates a filling instruction. And sequentially sends storage request 1, data storage request 2, data storage request 3, and a filling instruction to the data storage module.
[0214] For example, after storing at least one piece of data in the data storage request into data strips 3 and 4 of disk 501, the current state is determined to be the waiting state. The data storage device obtains that the first duration of the waiting state lasts for 2s. Assuming that the first preset duration is 10s, it can be determined that the first duration is less than the first preset duration. The data storage device obtains the indication information and determines that the indication information indicates the existence of a target instruction. If the data storage device determines that the target instruction is a data storage instruction, the data storage device determines that the target data strip is data strip 4, and the remaining length of data strip 4 is 7. The data storage device stores at least one piece of data with a length of 7 in the data storage instruction into data strip 4.
[0215] Receiving the target instruction within the first duration, corresponding filling processing can be performed according to the preset instruction. While improving the storage space utilization rate, it avoids the situation where the data storage efficiency is low due to too long waiting duration. The flexibility of data storage is improved.
[0216] S409. If the current state is a non-waiting state, obtain the preset value.
[0217] If the current state is a non-waiting state, it indicates that this data storage needs to be ended as soon as possible.
[0218] S410. Fill at least one first data strip according to a preset value.
[0219] It should be noted that the execution process of S410 can refer to the process of filling at least one first data strip according to a preset value described in any of the above embodiments, and will not be elaborated here.
[0220] After filling, the stored data can be processed such as verified and written to disk.
[0221] In the data storage method provided by the embodiments of the present application, if at least one first data strip is not fully stored with data, obtain the current state corresponding to the data storage. According to the current state, fill at least one first data strip so that the length of the valid data stored in each first data strip is greater than or equal to the preset length. In this way, the possibility of a data strip not storing valid data is reduced. The utilization rate of the storage space during the data storage process is improved. And when it is determined that the waiting time-out or processing time-out occurs, zero-padding can be performed directly to avoid the situation that the data storage efficiency is low due to too long waiting time. The flexibility of data storage is improved.
[0222] Based on any of the above embodiments, below, in combination with Figure 6 , an example of the data storage process will be described.
[0223] Figure 6 FIG. is a schematic diagram of the data storage process provided by the embodiments of the present application. Please refer to Figure 6 , which includes a terminal device 601 and a data storage device 602. The terminal device 601 can be a mobile phone, a tablet computer, a computer, etc. The data storage device 602 can be a server. A control module, a storage module, and a storage space are provided in the data storage device 602. Among them, the control module is used to send a data storage request and an instruction to the storage module, the storage module is used to process the data storage request and the instruction, and the storage space is used to store data. The storage space can be a disk. The user can determine at least one first data to be stored in the application of the terminal device 601. The application of the terminal device 601 responds to the user's operation, determines at least one first data and the length of at least one first data, so as to generate at least one data storage request. The application of the terminal device 601 sends at least one data storage request to the data storage device 602. The at least one data storage request can be specifically as shown in Table 3:
[0224] Table 3
[0225]
[0226]
[0227] The control module of the data storage device 602 determines, according to Table 3, that there are two data storage requests. Therefore, the control module of the data storage device 602 sends Data Storage 1, Data Storage Request 2, and a padding instruction to the storage module at one time. When the storage module of the data storage device 602 receives Data Storage Request 1, it determines that there is no historical data storage request within the historical period. The storage module of the data storage device 602 determines that the length of the data striping in the storage space is 5. Therefore, the storage module of the data storage device 602 obtains Data Strip B1 in the storage space, and no data is stored in Data Strip B1. The storage module of the data storage device 602 stores Data B1 to Data B5 in Data Strip B1.
[0228] The storage module of the data storage device 602 determines that the duration for storing Data B1 to Data B5 is 1 s. The storage module of the data storage device 602 obtains the third preset duration as 3 s. Therefore, the storage module of the data storage device 602 determines that the current state is the waiting state. The storage module of the data storage device 602 obtains the first preset duration as 10 s. Within 10 s, the storage module of the data storage device 602 obtains Data Storage Request 2. That is, there is indication information within the first preset duration, and the indication information indicates the existence of a target instruction, and the target instruction is a data storage instruction. Since Data Strip B1 has been filled with data, the length of at least one first data in Data Storage Request 2 is 8. Therefore, the storage module of the data storage device 602 obtains Data Strip B2 and Data Strip B3. The storage module of the data storage device 602 stores Data C1 to Data C5 in Data Strip B2 and stores Data C6 and Data C8 in Data Strip B3. The storage module of the data storage device 602 determines that the remaining length of Data Strip B3 is 2.
[0229] If the storage module of the data storage device 602 determines that the duration for storing Data B1 to Data B5 is 1.2 s, it can be determined that the duration for storing Data B1 to Data B5 is less than the third preset duration. Therefore, the storage module of the data storage device 602 determines that the current state is the waiting state. Within 10 s, the storage module of the data storage device 602 obtains a padding instruction. That is, there is indication information within the first preset duration, and the indication information indicates the existence of a target instruction, and the target instruction is a padding instruction. Therefore, the storage module of the data storage device 602 performs a padding process on Data Strip B3, fills it with the preset value 0, and the padding length is 2. After the storage module of the data storage device 602 determines that it has processed the data storage requests shown in Table 3 above, it continues to perform processes such as verification and disk writing on the stored data.
[0230] In the data storage process provided by the embodiment of the present application, if at least one first data strip is not full of data, the current state corresponding to the data storage is obtained. According to the current state, at least one first data strip is filled so that the length of the valid data stored in each first data strip is greater than or equal to a preset length. In this way, the possibility that there is a data strip without stored valid data is reduced. The utilization rate of the storage space in the data storage process is improved. And when it is determined that the waiting time-out or processing time-out occurs, zero-padding can be performed directly to avoid the situation that the data storage efficiency is low due to too long waiting time. The flexibility of data storage is improved.
[0231] Figure 7 It is a schematic structural diagram of the data storage device provided by the embodiment of the present application. Please refer to Figure 7 , the data storage device 10 may include:
[0232] A first acquisition module 11, configured to acquire a data storage request, where the data storage request includes at least one first data and the length of the at least one first data;
[0233] A storage module 12, configured to store the at least one data into at least one first data strip according to the data storage request, where the at least one first data strip is set in the storage space of the data storage device;
[0234] A second acquisition module 13, configured to acquire the current state corresponding to the data storage;
[0235] A processing module 14, configured to perform a filling process on the at least one first data strip according to the current state, so that the length of the valid data stored in each first data strip is greater than or equal to a preset length.
[0236] In a possible implementation manner, the processing module 14 is specifically configured to:
[0237] If the current state is a waiting state, obtain a first duration for which the waiting state lasts, and perform a filling process on the at least one first data strip according to the first duration;
[0238] If the current state is a non-waiting state, obtain a preset value, and perform a filling process on the at least one first data strip according to the preset value.
[0239] In a possible implementation manner, the processing module 14 is specifically configured to:
[0240] Judge whether the first duration is less than a first preset duration;
[0241] If so, obtain indication information, and perform a filling process on the at least one first data strip according to the indication information;
[0242] If not, perform a filling process on the at least one first data strip according to the preset value.
[0243] In a possible implementation manner, the processing module 14 is specifically configured to:
[0244] If the indication information indicates the existence of a target instruction, perform a filling process on the at least one data strip according to the target instruction;
[0245] If the indication information indicates the non - existence of a target instruction, perform a filling process on the at least one first data strip according to the preset value.
[0246] In a possible implementation manner, the processing module 14 is specifically configured to:
[0247] If the target instruction is a data storage instruction, store at least one data in the data storage instruction into at least one target data strip until the at least one target data strip is full of data;
[0248] If the target instruction is a filling instruction, perform a filling process on the at least one target data strip according to the preset value until the at least one target data strip is full of data;
[0249] Wherein, the target data strip is a data strip in the at least one first data strip that is not full of data.
[0250] In a possible implementation manner, the storage module 12 is specifically configured to:
[0251] Determine whether there is a historical data storage request within a historical period, where the end time of the historical period is the time when the data storage request is obtained, and the duration corresponding to the historical period is a second preset duration;
[0252] If so, determine at least one first data strip in the storage space of the data storage device according to the historical data storage request, and store the at least one data into the at least one first data strip;
[0253] If not, determine at least one first data strip in the storage space of the data storage device, and store the at least one data into the at least one first data strip, where no data is stored in the at least one first data strip.
[0254] In a possible implementation manner, the storage module 12 is specifically configured to:
[0255] In the storage space of the data storage device, determine at least one second data strip, where at least one of the at least one second data strips stores at least one piece of data in the historical data storage request;
[0256] In the at least one second data strip, determine at least one candidate data strip that is not fully stored with data;
[0257] Determine that at least one first data strip includes the at least one candidate data strip and at least one third data strip, and the total length of the data stored in the at least one candidate data strip and the at least one third data strip is greater than or equal to the length of the at least one first data.
[0258] In a possible implementation manner, the second obtaining module 13 is specifically configured to:
[0259] Determine a second duration for storing the at least one piece of data into the at least one first data strip;
[0260] Determine whether the second duration is less than a third preset duration;
[0261] If so, determine that the current state is a waiting state;
[0262] If not, determine that the current state is a non-waiting state.
[0263] The data storage device provided in the embodiments of the present application can execute the technical solutions shown in the above method embodiments, and its implementation principle and beneficial effects are similar, and will not be elaborated here.
[0264] Figure 8 It is a schematic structural diagram of the data storage device provided in the embodiments of the present application. Please refer to Figure 8 , the data storage device 20 may include: a memory 21 and a processor 22. Exemplarily, the memory 21 and the processor 22 are interconnected with each other through a bus 23.
[0265] The memory 21 is used to store program instructions;
[0266] The processor 22 is used to execute the program instructions stored in the memory, so that the data storage device 20 executes the method shown in the above method embodiments.
[0267] The data storage device provided in the embodiments of the present application can execute the technical solutions shown in the above method embodiments, and its implementation principle and beneficial effects are similar, and will not be elaborated here.
[0268] An embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored, and when the computer-executable instructions are executed by a processor, the above method is implemented.
[0269] An embodiment of the present application may also provide a computer program product, including a computer program, and when the computer program is executed by a processor, the above method can be implemented.
[0270] All or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions. The foregoing program can be stored in a readable memory. When the program is executed, it executes the steps including the above method embodiments; and the foregoing memory (storage medium) includes: read-only memory (ROM), random access memory (Random Access Memory, RAM), flash memory, hard disk, solid state drive, magnetic tape, floppy disk, optical disc, and any combination thereof.
[0271] Embodiments of the present application are described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, and the combination of processes and / or blocks in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to the processing unit of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processing unit of the computer or other programmable data processing devices generate a device for implementing the specified functions in one process Figure 1 one process or multiple processes and / or blocks Figure 1 or multiple blocks.
[0272] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory generate a manufactured product including an instruction device, and the instruction device implements the specified functions in one process Figure 1 one process or multiple processes and / or blocks Figure 1 or multiple blocks.
[0273] These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide for implementing the specified functions in one process Figure 1One process or multiple processes and / or boxes Figure 1 Steps of functions specified in one box or multiple boxes.
[0274] Obviously, those skilled in the art can make various changes and modifications to the embodiments of the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the embodiments of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application also intends to include these changes and modifications.
[0275] In the present application, the term "including" and its variations may refer to non-limiting inclusion; the term "or" and its variations may refer to "and / or". In the present application, terms such as "first", "second", etc. are used to distinguish similar objects and do not necessarily need to describe a specific order or sequence. In the present application, "multiple" means two or more. "And / or" describes the relationship between related objects and indicates that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally indicates that the related objects before and after are in an "or" relationship.
Claims
1. A data storage method, characterized in that, Including: Obtain a data storage request, where the data storage request includes at least one first data and the length of the at least one first data; According to the data storage request, store the at least one data into at least one first data strip, and the at least one data strip is set in the storage space of the data storage device; Obtain the current state corresponding to the data storage; According to the current state, perform a filling process on the at least one first data strip so that the length of the valid data stored in each first data strip is greater than or equal to a preset length.
2. The method according to claim 1, wherein According to the current state, performing a filling process on the at least one first data strip includes: If the current state is a waiting state, obtain the first duration for which the waiting state persists, and according to the first duration, perform a filling process on the at least one first data strip; If the current state is a non-waiting state, obtain a preset value, and according to the preset value, perform a filling process on the at least one first data strip.
3. The method according to claim 2, wherein According to the first duration, performing a filling process on the at least one first data strip includes: Judge whether the first duration is less than a first preset duration; If so, obtain indication information, and according to the indication information, perform a filling process on the at least one first data strip; If not, perform a filling process on the at least one first data strip according to the preset value.
4. The method according to claim 3, wherein According to the indication information, performing a filling process on the at least one first data strip includes: If the indication information indicates the existence of a target instruction, according to the target instruction, perform a filling process on the at least one data strip; If the indication information indicates the non-existence of a target instruction, perform a filling process on the at least one first data strip according to the preset value.
5. The method according to claim 4, characterized in that According to the target instruction, performing a filling process on the at least one data strip includes: If the target instruction is a data storage instruction, store at least one data in the data storage instruction into at least one target data strip until the at least one target data strip is full of data; If the target instruction is a filling instruction, perform a filling process on the at least one target data strip according to the preset value until the at least one target data strip is full of data; Wherein, the target data strip is a data strip among the at least one first data strip that is not full of data.
6. The method according to any one of claims 1 to 5, characterized in that, According to the data storage request, storing the at least one data into at least one first data strip includes: Judge whether there is a historical data storage request during a historical period, the end time of the historical period is the time when the data storage request is obtained, and the duration corresponding to the historical period is a second preset duration; If so, according to the historical data storage request, determine at least one first data strip in the storage space of the data storage device, and store the at least one data into at least one first data strip; Otherwise, determine at least one first data strip in the storage space of the data storage device, and store the at least one data in the at least one first data strip, where no data is stored in the at least one first data strip.
7. The method according to claim 6, characterized in that, Determining at least one first data strip in the storage space of the data storage device according to the historical data storage request includes: In the storage space of the data storage device, determine at least one second data strip that stores at least one data in the historical data storage request; Determine at least one candidate data strip in the at least one second data strip, where the candidate data strip is not full of data; Determine that at least one first data strip includes the at least one candidate data strip and at least one third data strip, and the total length of the data stored in the at least one candidate data strip and the at least one third data strip is greater than or equal to the length of the at least one first data.
8. The method according to any one of claims 1-7, characterized in that, Obtain the current state of data storage, including: Determine a second duration for storing the at least one data in the at least one first data strip; Determine whether the second duration is less than a third preset duration; If so, determine that the current state is a waiting state; Otherwise, determine that the current state is a non-waiting state.
9. A data storage device, characterized in that, The device includes: A first acquisition module, configured to acquire a data storage request, where the data storage request includes at least one first data and the length of the at least one first data; A storage module, configured to store the at least one data in at least one first data strip according to the data storage request, where the at least one data strip is set in the storage space of the data storage device; A second acquisition module, configured to acquire the current state corresponding to data storage; A processing module, configured to perform a filling process on the at least one first data strip according to the current state, so that the length of the valid data stored in each first data strip is greater than or equal to a preset length.
10. A data storage device, characterized in that, Includes: At least one processor; And A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can execute the method according to any one of claims 1 to 8.
11. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, Wherein, The computer instructions are used to cause a computer to execute the method according to any one of claims 1 to 8.
12. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method according to any one of claims 1 to 8.