Method of managing data, related apparatus and computer program product

By splitting data into file blocks and combining the storage methods of mechanical hard drives and solid-state drives, the problem of balancing storage capacity and response speed in existing technologies is solved, and the efficiency and quality of data management are improved.

CN120596005APending Publication Date: 2025-09-05SHANGHAI BILIBILI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510570937.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-30
Publication Date
2025-09-05

AI Technical Summary

Technical Problem

Existing technologies make it difficult to efficiently balance the requirements of data storage capacity and response speed, especially in the process of storing and reading large amounts of data, where the combination of mechanical hard drives and solid-state drives has the problem of low efficiency.

Method used

The data to be stored is split into multiple file blocks, and stored using a combination of mechanical hard drives and solid-state drives. The mechanical hard drive is used to store complete files, and the solid-state drive is used to store file blocks. The data is provided after the solid-state drive completes the storage, thereby improving the reading speed.

Benefits of technology

In this way, data storage and reading performance is improved, more efficient data management is achieved, and the requirements of storage capacity and response speed are taken into account.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120596005A_ABST
    Figure CN120596005A_ABST
Patent Text Reader

Abstract

The invention provides a data management method, a related device and a computer program product, and the method comprises the steps: splitting to-be-stored data into a plurality of file blocks in response to the situation that the data size of the to-be-stored data is greater than a management threshold value; based on an original complete file of the to-be-stored data, the to-be-stored data is written into a first storage, and based on the multiple file blocks, the to-be-stored data is written into a second storage, the first storage is provided based on a mechanical hard disk, and the second storage is provided based on a solid state disk; and in response to the situation that an acquisition request of the target equipment for the to-be-stored data is received in the process of writing the to-be-stored data into the first storage and the to-be-stored data is completely stored in the second storage, providing the to-be-stored data for the target equipment by utilizing the second storage. Therefore, the data storage and reading performance can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method and apparatus for managing data, an electronic device, a computer-readable medium, and a computer program product. Background Art

[0002] Data management technology is a vital component in the fields of computer science and information technology. It usually involves multiple technical aspects such as how to efficiently and securely store, read, manage and protect data.

[0003] In this context, with the continuous development of information technology, the requirements for data generation speed, storage capacity and processing are constantly increasing. Therefore, how to manage data with high quality and high efficiency is worthy of attention and urgent need. Summary of the Invention

[0004] Various aspects of the present application provide a method, apparatus, electronic device, computer-readable storage medium, and computer program product for managing data. In the process of managing data, a "storage system" that combines a mechanical hard disk drive (HDD) and a solid-state drive (SSD) is selected to store and provide data. In this way, the solid-state drive and the mechanical hard disk can support each other to take into account both data storage capacity and response speed requirements, thereby improving the overall storage and reading performance of the "storage system" for data, thereby achieving more efficient and high-quality data management.

[0005] In one aspect of the present application, a method for managing data is provided, comprising: in response to a data size of the data to be stored being greater than a management threshold, splitting the data to be stored into multiple file blocks; writing the data to be stored into a first storage based on the original complete file of the data to be stored, and writing the data to be stored into a second storage based on the multiple file blocks, wherein the first storage is provided based on a mechanical hard disk and the second storage is provided based on a solid-state hard disk; in response to receiving a request from a target device to obtain the data to be stored during the process of writing the data to be stored to the first storage, and the second storage has completely stored the data to be stored, using the second storage to provide the data to be stored to the target device.

[0006] Another aspect of the present application provides an apparatus for managing data, comprising: a data splitting module, configured to split the data to be stored into multiple file blocks in response to the data size of the data to be stored being greater than a management threshold; a first data storage module, configured to write the data to be stored into a first storage based on the original complete file of the data to be stored, and to write the data to be stored into a second storage based on the multiple file blocks, wherein the first storage is provided based on a mechanical hard disk and the second storage is provided based on a solid-state hard disk; a first data providing module, configured to provide the data to be stored to the target device using the second storage in response to receiving a request from the target device to obtain the data to be stored during the process of writing the data to be stored to the first storage, and the second storage has already completely stored the data to be stored.

[0007] Another aspect of the present 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 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 for managing data provided above.

[0008] In another aspect of the present application, a computer-readable storage medium is provided, on which computer program instructions are stored. The computer program instructions can be executed by a processor to implement the method for managing data provided above.

[0009] In another aspect of the present application, a computer program product includes a computer program having computer program instructions stored thereon. When the computer program is executed by a processor, the method for managing data as provided above can be implemented.

[0010] In the solution provided by the embodiment of the present application, first, in response to the data size of the data to be stored being greater than a management threshold, the data to be stored is split into multiple file blocks; then, based on the original complete file of the data to be stored, the data to be stored is written to the first storage, and based on the multiple file blocks, the data to be stored is written to the second storage, wherein the first storage is provided based on a mechanical hard disk and the second storage is provided based on a solid-state drive; finally, in response to receiving a request from the target device for the data to be stored during the process of writing the data to be stored to the first storage, and the second storage has already completely stored the data to be stored, the second storage is used to provide the data to be stored to the target device. In this way, the storage and reading performance of data can be improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] In order to more clearly illustrate the technical solutions in the embodiments of the present application, a brief introduction will be given below to the drawings required for use in the embodiments or descriptions of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0012] Other features, objects and advantages of the present application will become more apparent upon reading the detailed description of non-limiting embodiments made with reference to the following drawings:

[0013] Figure 1 A flowchart of a data management process provided in an embodiment of the present application;

[0014] Figure 2 A flowchart of another data management process provided in an embodiment of the present application;

[0015] Figure 3 A flowchart illustrating a specific implementation process of data management in a specific application scenario provided by an embodiment of the present application;

[0016] Figure 4 A schematic diagram of the structure of a device for managing data provided in an embodiment of the present application;

[0017] Figure 5 The figure is a schematic diagram of the structure of an electronic device suitable for implementing the solution in the embodiment of the present application.

[0018] The same or similar reference numerals in the drawings represent the same or similar components. DETAILED DESCRIPTION

[0019] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0020] In a typical configuration of the present application, the terminal and the equipment of the service network each include one or more processors (CPUs), input / output interfaces, network interfaces and memories.

[0021] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.

[0022] Computer-readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology for information storage. The information can be computer program instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc-read only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission medium that can be used to store information that can be accessed by a computing device.

[0023] As discussed above, how to manage data with high quality and efficiency is worthy of attention and an urgent need.

[0024] To this end, an embodiment of the present application provides a method for managing data. The method first splits the data to be stored into multiple file blocks in response to the data size of the data to be stored being greater than a management threshold. Then, based on the original complete file of the data to be stored, the data to be stored is written to a first storage, and based on the multiple file blocks, the data to be stored is written to a second storage, wherein the first storage is provided based on a mechanical hard disk and the second storage is provided based on a solid-state drive. Finally, in response to receiving a request from a target device for the data to be stored during the process of writing the data to be stored to the first storage, and the second storage has already completely stored the data to be stored, the second storage is used to provide the data to be stored to the target device. In this way, the storage and reading performance of the data can be improved.

[0025] In practical scenarios, the execution subject of this method can be a user device, or a device formed by integrating a user device and a network device via a network, or an application running on such a device. User devices include but are not limited to computers, mobile phones, tablets, smart watches, wristbands, and other terminal devices. Network devices include but are not limited to network hosts, single network servers, multiple network server clusters, or cloud computing-based computer clusters. Here, the cloud is composed of a large number of hosts or network servers based on cloud computing. Cloud computing is a type of distributed computing, consisting of a group of loosely coupled computers forming a virtual computer.

[0026] When the execution subject is software, it can be installed in the electronic devices listed above. It can be implemented as multiple software or software modules, or as a single software or software module, and is not specifically limited here.

[0027] Figure 1 A data management process 100 provided in an embodiment of the present application is shown. The process 100 includes at least the following processing steps:

[0028] (Step) S101, in response to the data size of the data to be stored being greater than a management threshold, splitting the data to be stored into a plurality of file blocks;

[0029] In an embodiment of the present application, the execution entity of the above-mentioned method (or process) for implementing data management can, after determining the data to be stored, first read the data size of the data to be stored (for example, read out the specific data size of the data to be stored in KB, MB or G, etc.).

[0030] If the size of the data to be stored exceeds the management threshold, the execution entity can choose to split the "complete file" of the data to be stored into (multiple) file blocks that constitute the "complete file." Thus, by splitting the entire "complete file" of the data to be stored into file blocks, the data to be stored can be stored in a "fragmented" manner using the "file blocks" to store the data.

[0031] The management threshold can usually be predetermined in combination with specific needs. In some embodiments, the specific value of the management threshold can be determined based on whether a mechanical hard disk or a solid-state drive is preferred for storing the data to be stored.

[0032] For example, in a scenario where it is more desirable or preferred to use a mechanical hard disk to store the data to be stored (for example, the data to be stored is "large volume data"), the management threshold can be determined according to the data size standard of the "large volume data." Thus, the management threshold is used to manage the storage method of the data to be stored (especially the long-term storage method, such as whether to use a mechanical hard disk for long-term storage or a solid-state drive for long-term storage).

[0033] In some embodiments, if the data size of the data to be stored is greater than the management threshold in this step, the execution entity may further split the data to be stored into multiple file blocks based on the numerical value of the management threshold in response thereto.

[0034] For example, if the "management threshold" is 5M, the execution entity can choose to split the stored data according to the 5M standard.

[0035] Accordingly, the split data blocks may include a first file block having a data size equal to the management threshold value and a second file block having a data size less than the management threshold value. For example, in the above 5M example, the data size of the first file block may be 5M, while the data size of the second file block may be less than 5M.

[0036] For example, the execution entity can choose to divide the size of the data to be stored by the "management threshold" and use the resulting "quotient" as the number of first file blocks, while the remainder is the data size of the second file block. For example, if 31MB of data to be stored is required, the execution entity can choose to split it into six 5MB first file blocks and one 1MB second file block.

[0037] Therefore, by using the "management threshold", the file blocks split by the execution entity can meet the standards of the "management threshold", while avoiding the occurrence of file blocks larger than the management threshold, and avoiding file blocks being too small to cause data to be too fragmented.

[0038] S102, writing the data to be stored into a first storage based on an original complete file of the data to be stored, and writing the data to be stored into a second storage based on multiple file blocks;

[0039] In an embodiment of the present application, after splitting multiple file blocks based on the above-mentioned step S101, the execution entity can simultaneously write the data to be stored to the first storage provided by the mechanical hard disk and the second storage provided by the solid state drive.

[0040] During the writing process, for the first storage, since it is provided based on a mechanical hard disk, based on its inherent performance, the execution entity can choose to write the data to be stored into the first storage in the form of an "original complete file".

[0041] As for the second storage, since it is provided based on a solid-state hard disk, the execution subject can write the data to be stored therein in the form of file blocks.

[0042] For example, the execution entity can write file blocks to different storage slices in the secondary storage, leveraging the inherent performance of solid-state drives to improve the efficiency of writing data to be stored. This allows the execution entity to simultaneously utilize both mechanical hard drives and solid-state drives to provide storage services for "large data volumes."

[0043] Accordingly, in this process, the secondary storage, i.e., the data to be stored in the SSD, can actually be simply understood as a "cache" for the first storage process. Accordingly, by leveraging the SSD's faster write and read speeds, the data to be stored can be "prepared" more quickly through this "cache," allowing the execution entity to expose stronger and more superior data storage performance to the outside world.

[0044] In some embodiments, in an actual physical environment, multiple mechanical hard disks may be used to form a hard disk array to improve storage capacity. In such a case, the execution entity can choose to configure a solid-state drive corresponding to each mechanical hard disk to provide such a "cache", or can use the method of "partitioning" and "blocking" in a solid-state drive to correspond each "partition" and "block" (for ease of understanding, the following discussion will only use the term "partition") to correspond to a mechanical hard disk, so that one solid-state drive can provide "cache" for multiple mechanical hard disks to save computing resources.

[0045] For example, if the number of mechanical hard disks is N (N is a positive integer), the execution entity can divide the area for storing metadata and the data size in the solid-state drive, and then use the remaining portion to provide "cache" for the mechanical hard disk. For example, the execution entity can divide the "remaining portion" that can be used by N. Then, based on the result of rounding down the quotient, the data size of each area used for providing cache is determined.

[0046] In some embodiments, after completing the partitioning, the execution entity can also create a placeholder file in each partition for placeholder use. This not only allows the "placeholder file" to fix the partition size, but also allows the execution entity to use these partitions by updating these "placeholder files", thereby reducing the generation of fragments in the solid-state hard drive.

[0047] In some embodiments, when writing data to be stored into the second storage based on multiple file blocks, the execution entity may first determine the storage position of each file block in the second storage in sequence based on the arrangement order of the multiple file blocks in the data to be stored.

[0048] Specifically, the execution entity may continuously determine the storage location for storing each file block (e.g., which "partition" is used to store the file block, and which location in the "partition") based on the order in which the file blocks are arranged in the data to be stored. For example, for file block A that is ranked first in the order, its storage location may be the first storage location in "partition A", while for file block B that is ranked second, its storage location may be the second storage location in "partition A".

[0049] Then, the execution entity can generate index information for each file block based on the storage location. The index information is actually used to locate and indicate the specific storage location of the corresponding file block, which can correspond to the specific location in the partition or block used to store the file block. For example, when the space size of each "storage location" is comparable, the execution entity can number each "storage location" based on the size of the partition or block and the size corresponding to each "storage location" so as to determine the "index information" and establish an index through the "number". For example, in the case where a partition is 20G, if each "storage location" can store 5M of data, then these storage locations can be identified by (20G / 5M=4096) numbers to establish an index.

[0050] Then, after generating the index information and determining the storage location, the execution entity may choose to concurrently store each file block into the corresponding storage location.

[0051] Therefore, by splitting the "file blocks" and storing the "file blocks" in parallel, the execution entity can more efficiently store the input to be stored into the second storage, so as to provide the status of the data to be stored being "ready" to the outside earlier.

[0052] In some embodiments, as discussed above, in the second storage provided by the solid-state drive, due to relationships such as "placeholder files", before the data to be stored is stored, the original map (Map) provided in the metadata of the solid-state drive may record a "placeholder file".

[0053] In such a case, if the second storage has completely stored the data to be stored, the execution entity can respond thereto by updating the original mapping of the second storage using the storage location range determined based on each storage location, so that the updated original mapping can correctly correspond to and point to the data to be stored.

[0054] For example, if the storage locations are "contiguous," the execution entity can determine the storage location range involved based on the first and last storage locations used to store the file block. The execution entity then uses this storage location range to update the original mapping of the second storage (e.g., updating the content stored in the storage location range in the original mapping) to avoid mapping errors caused by untimely updates, which could result in the inability to successfully read and retrieve the stored data.

[0055] Furthermore, in some embodiments, because the data to be stored is actually stored in the second storage in the form of file blocks, the execution entity may also add, in a more granular manner, file block mappings corresponding to each file block in the original mapping in association with the data to be stored, to more specifically and granularly indicate the location of each file block and whether a file block has been "overwritten." For example, in the original mapping, the execution entity may also add and establish a file block mapping corresponding to each file block based on the name of the file block (e.g., file block 1...file block N) and the storage location corresponding to the file block.

[0056] In some embodiments, if the original mapping is “empty” (for example, the original mapping is cleared due to restart), the execution entity may also update the “original mapping” in a similar manner.

[0057] In addition, in some scenarios, "mapping" may not be required by executing the steps in memory, etc. In such a case, the execution entity may also respond to this and no longer update the original mapping to save computing resources (that is, the execution entity only performs the actions related to the update of the original mapping discussed above in the embodiment when it is necessary to use metadata to record the original mapping).

[0058] S103: In response to receiving a request from a target device for obtaining data to be stored during writing the data to be stored to the first storage, and the second storage has completely stored the data to be stored, using the second storage to provide the data to be stored to the target device.

[0059] In an embodiment of the present application, a user may interact with an execution subject through, for example, a target device used by the user to request the execution subject to provide data to be stored. Accordingly, if the execution subject receives a request from the target device to obtain data to be stored, the execution subject may first read the write and storage status of the first storage and the second storage for the data to be stored.

[0060] If the data to be stored is being written to the first storage at this time, but the second storage has already completely stored the data to be stored, then in order to respond to the acquisition request, the execution entity can choose to use the second storage to provide the target device with the data to be stored, so as to provide the data to be stored to the outside faster and earlier than using the data management method of the first storage alone.

[0061] Then, the data management method provided by the present application first splits the data to be stored into multiple file blocks in response to the data size of the data to be stored being greater than a management threshold; then, based on the original complete file of the data to be stored, the data to be stored is written to a first storage, and based on the multiple file blocks, the data to be stored is written to a second storage, wherein the first storage is provided based on a mechanical hard disk and the second storage is provided based on a solid-state drive; finally, in response to receiving a request from a target device for the data to be stored during the process of writing the data to be stored to the first storage, and the second storage has already completely stored the data to be stored, the second storage is used to provide the data to be stored to the target device. In this way, the storage and reading performance of the data can be improved.

[0062] Furthermore, as discussed above, the second storage may be used as a “cache” for the first storage, so that “large volume data” can be provided to the outside earlier and faster.

[0063] However, after the storage of "large volume data" has been completed in the first storage and the first storage has the ability to provide the data to be stored, the data to be stored stored in the second storage can be selected for deletion or retention based on different strategies to meet different needs, such as serving as redundant backup, improving provision efficiency, or freeing up storage space.

[0064] For this, please refer to Figure 2 , Figure 2 Another data management process 200 provided by an embodiment of the present application is shown. The process 200 includes at least the following processing steps:

[0065] S201, in response to a data size of the data to be stored being greater than a management threshold, splitting the data to be stored into a plurality of file blocks;

[0066] S202, writing the data to be stored into a first storage based on an original complete file of the data to be stored, and writing the data to be stored into a second storage based on multiple file blocks;

[0067] The above S201 and S202 are Figure 1 The implementation methods discussed in S101 and S102 shown are equivalent, and the same contents can refer to the contents discussed above, which will not be repeated here.

[0068] S203, in response to the first storage and the second storage having completely stored the data to be stored, reading the remaining data storage space in the second storage;

[0069] Specifically, if both the first storage and the second storage have completely stored the data to be stored, the execution subject may choose to read the remaining storage space in the second storage after the storage of the data to be stored is completed.

[0070] S204, comparing the data storage space with the space threshold;

[0071] In practice, the space threshold may be preset based on actual criteria for allowing the data to be stored to be “retained” in the second storage.

[0072] Next, if the data storage space is less than the space threshold, the execution subject may continue to execute S205 to release the storage space of the second storage.

[0073] S205, deleting the data to be stored in the second storage;

[0074] Accordingly, if the target device subsequently sends an acquisition request to the execution subject for the data to be stored, the execution subject may choose to use the first storage to provide the target device with the data to be stored by executing S206.

[0075] S206: Use the first storage to provide the target device with data to be stored.

[0076] In some optional implementations of this embodiment, as discussed above, if the data storage space is greater than or equal to the space threshold, the execution entity may choose to retain the data to be stored. Accordingly, if the target device subsequently sends a request to the execution entity for the data to be stored, the execution entity may choose to use the second storage to provide the data to be stored to the target device by executing S207.

[0077] S207: Use the second storage to provide the target device with data to be stored.

[0078] Therefore, the external response and data provision speed of the entire storage system are improved by utilizing the better reading performance provided by the second storage.

[0079] Based on any of the above embodiments, if in the process of writing data to the first storage and the second storage at the same time, the execution entity detects that the first storage has completely stored the data to be stored, but the second storage has not completely stored the data to be stored, then in this case, because the first storage already has the ability to provide the data to be stored, the execution entity can delete the part of the data to be stored that has been written in the second storage to free up space in the second storage.

[0080] Accordingly, in such a case, if an acquisition request for the data to be stored is received from the target device, the execution subject may respond thereto by using the first storage to provide the data to be stored to the target device.

[0081] Therefore, when, for example, the second storage writes data to be stored slower than the first storage, the second storage is no longer used to provide "cache" and the storage resources of the second storage are released to avoid wasting the storage resources of the second storage.

[0082] Based on any of the above embodiments, if the size of the stored data is less than or equal to the management threshold, for example, the data to be stored is not actually "large-volume data," then in this case, the execution entity can directly select the original complete file of the data to be stored and write the data to the secondary storage. Thus, for "small-volume data," the execution entity can directly use the solid-state drive for storage, thereby balancing storage cost and storage efficiency.

[0083] Accordingly, in such a case, if an acquisition request for the data to be stored is received from the target device, then in such a case, the execution subject can respond thereto and use the second storage to provide the target device with the data to be stored.

[0084] In addition, because in different embodiments, the execution subject may use the first storage or the second storage to respond to the target device's request for data to be stored and provide the data to be stored, in such a case, in order to improve the response efficiency of the execution subject, the execution subject may also choose to use the original mapping of the second storage (the updated original mapping) to search whether the second storage can provide the data to be stored. If not, directly choose to try to use the first storage to provide the data to be stored. In this way, the effect of choosing to use the first storage or the second storage to provide the data to be stored in the above-mentioned embodiments can be objectively achieved.

[0085] In order to deepen the understanding, this application also combines a specific application scenario. Figure 3 A flowchart of the process of implementing data management in this specific application scenario is given. Figure 3 Process 300 is shown.

[0086] In process 300 , for the purpose of easy understanding, a mechanical hard disk and a solid state disk are directly selected to replace the first storage and the second storage.

[0087] In the process 300 , for the data to be stored 310 , the execution subject may first determine the data size of the data to be stored 310 by executing S301 .

[0088] If the data size of the data to be stored 310 is greater than the management threshold, the execution entity may further execute S302 to split the data to be stored 310 into file blocks 321, 322...32N (where N is a positive integer).

[0089] Then, the execution body continues to execute S304-1 and S304-2 to use the mechanical hard disk 335 to store the data to be stored 310 (the original complete file) and at the same time use the solid state disk 330 to store the data file blocks 321, 322...32N to be stored (to achieve the purpose of storing the data to be stored 310).

[0090] Subsequently, if the execution subject receives an acquisition request for the data to be stored 310 , the execution subject may read the writing and storage status of the mechanical hard disk 335 and the solid-state disk 330 for the data to be stored 310 by executing S305 .

[0091] Accordingly, if the mechanical hard disk 335 is storing the data to be stored 310 and the solid state disk 330 has completed the storage of the data to be stored 310 , the execution subject may choose to execute S306 to select the solid state disk 330 to provide the data to be stored 310 .

[0092] If the size of the data to be stored 310 is less than or equal to the aforementioned management threshold, the execution entity may further execute S303 and use the solid-state drive 330 (or, in other words, the "second storage" provided by the solid-state drive 330) to store the data to be stored 310. Subsequently, when the data to be stored 310 is requested, the solid-state drive 330 is directly used to provide the data to be stored 310. This will not be further described here (not shown in the figure).

[0093] The embodiment of the present application also provides a device for managing data, the structure of which is as follows: Figure 4 The device 400 shown. The device 400 includes: a data splitting module 410, configured to split the data to be stored into multiple file blocks in response to the data size of the data to be stored being greater than a management threshold; a first data storage module 420, configured to write the data to be stored into a first storage based on the original complete file of the data to be stored, and write the data to be stored into a second storage based on the multiple file blocks, wherein the first storage is provided based on a mechanical hard disk and the second storage is provided based on a solid-state drive; a first data providing module 430, configured to provide the data to be stored to the target device using the second storage in response to receiving a request for obtaining the data to be stored from the target device during the process of writing the data to be stored to the first storage, and the second storage has already completely stored the data to be stored.

[0094] In some embodiments, the data splitting module 410 is further configured to, in response to the data size of the data to be stored being greater than a management threshold, split the data to be stored into multiple file blocks based on the numerical value of the management threshold, wherein the file blocks include: a first file block whose data size is equal to the numerical value of the management threshold and a second file block whose data size is less than the numerical value of the management threshold.

[0095] In some embodiments, data to be stored is written to a second storage based on multiple file blocks, including: determining the storage position of each file block in the second storage in sequence based on the arrangement order of the multiple file blocks in the data to be stored; generating index information of each file block based on the storage position; and concurrently storing each file block in a corresponding storage position.

[0096] In some embodiments, the apparatus 400 further includes: an original mapping update module configured to update the original mapping of the second storage using a storage location range determined based on each storage location in response to the second storage having completely stored the data to be stored.

[0097] In some embodiments, the device 400 further includes: a file block mapping adding module configured to add the file block mapping corresponding to each file block in association with the data to be stored in the updated original mapping, wherein the file block mapping is determined based on the storage location corresponding to the file block.

[0098] In some embodiments, the device 400 also includes: a storage space reading module, configured to read the remaining data storage space in the second storage in response to the first storage and the second storage having completely stored the data to be stored; a second storage update module, configured to delete the data to be stored in the second storage in response to the data storage space being less than a space threshold; and a second data providing module, configured to use the first storage to provide the target device with the data to be stored in response to receiving a request from the target device to obtain the data to be stored.

[0099] In some embodiments, the device 400 also includes: a third data providing module, configured to use the second storage to provide the target device with the data to be stored in response to the data storage space being greater than or equal to the space threshold and receiving a request from the target device to obtain the data to be stored.

[0100] In some embodiments, the device 400 also includes: a write management module, configured to delete part of the data to be stored that has been written in the second storage in response to the first storage having completely stored the data to be stored and the second storage not completely storing the data to be stored; and a fourth data providing module, configured to provide the target device with the data to be stored using the first storage in response to receiving a request from the target device to obtain the data to be stored.

[0101] In some embodiments, the device 400 also includes: a second data storage module, configured to write the data to be stored into the second storage based on the original complete file of the data to be stored in response to the data size of the data to be stored being less than or equal to the management threshold; and a fourth data providing module, configured to provide the data to be stored to the target device using the second storage in response to receiving a request from the target device to obtain the data to be stored.

[0102] The embodiment of this device corresponds to the method embodiment shown in the above figures. First, in response to the data size of the data to be stored being greater than the management threshold, the data to be stored is split into multiple file blocks. Then, based on the original complete file of the data to be stored, the data to be stored is written to the first storage, and based on the multiple file blocks, the data to be stored is written to the second storage, wherein the first storage is provided based on a mechanical hard disk and the second storage is provided based on a solid-state drive. Finally, in response to receiving a request from the target device for the data to be stored during the process of writing the data to be stored to the first storage, and the second storage has completely stored the data to be stored, the second storage is used to provide the data to be stored to the target device. In this way, the storage and reading performance of the data can be improved.

[0103] Based on the same inventive concept, an electronic device, a readable storage medium, and a computer program product are also provided in an embodiment of the present application. The method corresponding to the electronic device can be the method for managing data in the aforementioned embodiment, and its principle of solving the problem is similar to that of the method. The electronic device provided in an embodiment of the present application 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 to enable the at least one processor to execute the methods and / or technical solutions of the aforementioned multiple embodiments of the present application.

[0104] An electronic device can be a user device, or a device formed by integrating a user device and a network device via a network, or an application running on any of the above devices. User devices include, but are not limited to, computers, mobile phones, tablets, smart watches, wristbands, and other terminal devices. Network devices include, but are not limited to, network hosts, single network servers, multiple network server clusters, or cloud computing-based computer clusters, and can be used to implement some of the processing functions required for setting an alarm. Here, the cloud is composed of a large number of hosts or network servers based on cloud computing. Cloud computing is a type of distributed computing, consisting of a virtual computer composed of a group of loosely coupled computers.

[0105] Figure 5The structure of an electronic device suitable for implementing the method and / or technical solution in the embodiment of the present application is shown, and the electronic device 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 502 or the program loaded from the storage part 508 into the random access memory (RAM) 503. In RAM 503, various programs and data required for system operation are also stored. CPU 501, ROM 502 and RAM 503 are connected to each other through bus 505. Input / output (I / O) interface 504 is also connected to bus 505.

[0106] The following components are connected to the I / O interface 504: an input section 506 including a keyboard, a mouse, a touch screen, a microphone, an infrared sensor, etc.; an output section 507 including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), an LED display, an OLED display, etc., and a speaker; a storage section 508 including one or more computer-readable media such as a hard disk, an optical disk, a magnetic disk, a semiconductor memory, etc.; and a communication section 509 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet.

[0107] In particular, the methods and / or embodiments in the embodiments of the present application can be implemented as computer software programs. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes program code for executing the method shown in the flowchart. When the computer program is executed by the central processing unit (CPU) 501, the above-mentioned functions defined in the method of the present application are performed.

[0108] Another embodiment of the present application further provides a computer-readable storage medium and a computer program product, on which computer program instructions are stored. The computer program instructions can be executed by a processor to implement the methods and / or technical solutions of any one or more embodiments of the present application.

[0109] Specifically, the present embodiment can adopt any combination of one or more computer-readable media.Computer-readable media can be computer-readable signal media or computer-readable storage media.Computer-readable storage media can be, for example, systems, devices or components including but not limited to electricity, magnetism, light, electromagnetic, infrared, or semiconductors, or any combination thereof.More specific examples (non-exhaustive list) of computer-readable storage media include: electrical connections with one or more wires, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROMs), optical storage devices, magnetic storage devices, or any suitable combination thereof.In this document, computer-readable storage media can be any tangible medium containing or storing a program that can be used by an instruction execution system, device or device or used in combination with it.

[0110] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transfer a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0111] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0112] The computer program code for performing the operations of the present application can be written in one or more programming languages, or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0113] The flow chart or block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the equipment, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, program segment or a part of code, and the module, program segment or a part of code include one or more executable instructions for realizing the logical function of the specification. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a sequence different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented with a dedicated system for hardware that performs the function or operation of the specification, or can be implemented with a combination of dedicated hardware and computer instructions.

[0114] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0115] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of modules and units is only a logical function division. There may be other division methods in actual implementation. For example, with units as an example, for example, multiple units or page components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

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

[0117] In addition, the functional modules and units in the various embodiments of the present application may be integrated into a single processing module or unit, or each module or unit may exist physically separately, or two or more units may be integrated into a single module or unit. The aforementioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional modules or units.

[0118] The above-mentioned integrated modules and units implemented in the form of software functional modules and units can be stored in a computer-readable storage medium. The above-mentioned software functional modules and units are stored in a storage medium, including a number of instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) or a processor to execute some steps of the methods of each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store program code.

[0119] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

[0120] Furthermore, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices recited in a device claim may also be implemented by a single unit or device through software or hardware. Terms such as "first" and "second" are used to indicate names and do not imply any particular order.

Claims

1. A method for managing data, comprising: In response to a data size of the data to be stored being greater than a management threshold, splitting the data to be stored into a plurality of file blocks; Based on the original complete file of the data to be stored, the data to be stored is written into a first storage, and based on the plurality of file blocks, the data to be stored is written into a second storage, wherein the first storage is provided by a mechanical hard disk and the second storage is provided by a solid-state drive; In response to receiving a request from a target device to obtain the data to be stored during the process of writing the data to be stored to the first storage, and the second storage has completely stored the data to be stored, the second storage is used to provide the target device with the data to be stored.

2. The method according to claim 1, wherein In response to the data size of the data to be stored being greater than the management threshold, splitting the data to be stored into a plurality of file blocks includes: In response to a data size of the data to be stored being greater than a management threshold, the data to be stored is split into multiple file blocks based on the numerical value of the management threshold, wherein the file blocks include: a first file block whose data size is equal to the numerical value of the management threshold and a second file block whose data size is less than the numerical value of the management threshold.

3. The method according to claim 1, wherein Writing the data to be stored into the second storage based on the plurality of file blocks includes: determining, in sequence, a storage position of each of the file blocks in the second storage based on an arrangement order of the plurality of file blocks in the data to be stored; generating index information of each of the file blocks based on the storage location; Concurrently storing each of the file blocks into a corresponding storage location.

4. The method according to claim 3, further comprising: In response to the second storage having completely stored the data to be stored, the original mapping of the second storage is updated using the storage location range determined based on each of the storage locations.

5. The method according to claim 4, further comprising: The file block mapping corresponding to each of the file blocks is added in association with the data to be stored in the updated original mapping, wherein the file block mapping is determined based on the storage location corresponding to the file block.

6. The method according to claim 1, further comprising: In response to the first storage and the second storage having completely stored the data to be stored, reading the remaining data storage space in the second storage; In response to the data storage space being less than a space threshold, deleting the data to be stored in the second storage; In response to receiving an acquisition request from the target device for the data to be stored, the first storage is used to provide the target device with the data to be stored.

7. The method according to claim 6, further comprising: In response to the data storage space being greater than or equal to the space threshold and receiving a request from the target device to obtain the data to be stored, the second storage is used to provide the target device with the data to be stored.

8. The method according to claim 1, further comprising: In response to the first storage having completely stored the data to be stored and the second storage not having completely stored the data to be stored, deleting a portion of the data to be stored that has been written in the second storage; In response to receiving an acquisition request from the target device for the data to be stored, the first storage is used to provide the target device with the data to be stored.

9. The method according to any one of claims 1 to 8, further comprising: In response to a data size of the data to be stored being less than or equal to the management threshold, writing the data to be stored into the second storage based on an original complete file of the data to be stored; In response to receiving an acquisition request from the target device for the data to be stored, the second storage is used to provide the target device with the data to be stored.

10. A device for managing data, comprising: a data splitting module configured to split the data to be stored into a plurality of file blocks in response to a data size of the data to be stored being greater than a management threshold; a first data storage module configured to write the data to be stored into a first storage based on an original complete file of the data to be stored, and to write the data to be stored into a second storage based on a plurality of the file blocks, wherein the first storage is provided based on a mechanical hard disk and the second storage is provided based on a solid-state drive; The first data providing module is configured to, in response to receiving a request from a target device to obtain the data to be stored during the process of writing the data to be stored to the first storage, and the second storage has completely stored the data to be stored, use the second storage to provide the data to be stored to the target device.

11. An electronic device, characterized in that: The electronic device comprises: 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, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 9.

12. A computer-readable medium, characterized in that Computer program instructions are stored thereon, and the computer program instructions can be executed by a processor to implement the method according to any one of claims 1 to 9.

13. A computer program product, characterized in that The invention comprises a computer program which, when executed by a processor, implements the method according to any one of claims 1 to 9.