Data access method, apparatus, device, medium, and program product

By setting a one-time write flag during hard disk write operations and deleting the data after reading, the problem of low hard disk resource utilization is solved, and efficient use of hard disk resources is achieved.

CN123047890APending Publication Date: 2026-11-06SPREADTRUM COMMUNICATION (SHANGHAI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611379872.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-04
Publication Date
2026-11-06

AI Technical Summary

Technical Problem

In existing technologies, hard drives still need to consume storage resources to store data after it has been read back into memory, resulting in low resource utilization.

Method used

By setting a one-time write flag, the driver can be controlled to delete the data stored on the hard drive after the data is read, thus avoiding data occupying storage resources.

Benefits of technology

It improves hard drive resource utilization, reduces the long-term occupation of storage space by invalid data, and enhances resource utilization efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123047890A_ABST
    Figure CN123047890A_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a data access method, device, equipment, medium and program product, relating to the technical field of storage, the method comprising: a first file system sets a mark of to-be-accessed data as a one-time write mark in response to a hard disk write operation request; the hard disk write operation request indicates the to-be-accessed data; the first file system sends the hard disk write operation request to a driver, so that the driver writes the to-be-accessed data from a memory to a hard disk based on the hard disk write operation request; the first file system sends a hard disk read operation request to the driver in response to the hard disk read operation request, so that the driver stores the to-be-accessed data stored in the hard disk to the memory based on the hard disk read operation request; and the first file system controls the driver to delete the to-be-accessed data stored in the hard disk based on the mark of the to-be-accessed data being the one-time write mark. In the above manner, the storage resource utilization rate of the hard disk is improved, and the data access efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] By dumping data from memory to the hard drive, more storage space can be freed up for programs that actually need it. When memory needs to use the data that has been moved to the hard drive again, the data can be read back from the hard drive into memory.

[0003] However, in related technologies, for data that is read and written only once, after the data is read back from the hard drive to memory, the hard drive still needs to consume storage resources to store the data, resulting in low hard drive resource utilization in the methods of related technologies. Summary of the Invention

[0004] This application provides a data access method, apparatus, device, medium, and program product that improves the resource utilization of hard disks.

[0005] In a first aspect, embodiments of this application provide a data access method, including:

[0006] In response to a disk write operation request, the first file system sets the marker of the data to be accessed to a one-time write marker; wherein, the disk write operation request indicates the data to be accessed;

[0007] The first file system sends a disk write operation request to the driver, so that the driver can write the data to be accessed from memory to the disk based on the disk write operation request;

[0008] In response to a hard disk read operation request, the first file system sends a hard disk read operation request to the driver, so that the driver can store the data to be accessed on the hard disk into memory based on the hard disk read operation request;

[0009] The first file system uses a one-time write flag to mark the data to be accessed, and controls the driver to delete the data to be accessed stored on the hard drive.

[0010] In one implementation, the first file system, based on the marker of the data to be accessed being marked as a one-time write, controls the driver to delete the data to be accessed stored on the hard disk, including:

[0011] The first file system changes the marker for the data to be accessed from a one-time write marker to an invalid marker;

[0012] The first file system responds to the fact that the data to be accessed is marked as invalid, and controls the driver to delete the data to be accessed from the hard disk.

[0013] In one implementation, the first file system, in response to the tag of the data to be accessed being invalidated, controls the driver to delete the data to be accessed from the hard disk, including:

[0014] The first file system, in response to the invalidation of the data to be accessed, sends a deletion command to the driver. The driver then generates an unmapping command in response to the deletion command and deletes the data to be accessed from the hard disk based on the unmapping command.

[0015] In one implementation, the first file system, in response to a disk write operation request, sets the marker of the data to be accessed as a one-time write marker, including:

[0016] The first file system responds to a hard disk write operation request and obtains hard disk capacity information;

[0017] The first file system determines whether the hard disk capacity information meets the first preset condition;

[0018] If the hard disk capacity information meets the first preset condition, the first file system will set the mark of the data to be accessed as a one-time write mark.

[0019] In one implementation, the first file system, in response to a disk write operation request, sets the marker of the data to be accessed as a one-time write marker, including:

[0020] The first file system responds to the hard disk write operation request and obtains the business information corresponding to the data to be accessed.

[0021] The first file system determines whether the business information meets the second preset condition;

[0022] When the business information meets the second preset condition, the first file system sets the tag of the data to be accessed to a one-time write tag.

[0023] In one implementation, the first file system determines whether the business information meets a second preset condition, including:

[0024] If the business type in the business information of the first file system is a preset business type, then the business information is determined to meet the second preset condition.

[0025] Alternatively, if the first file system has a preset priority in the business information, it determines that the business information meets the second preset condition.

[0026] Secondly, embodiments of this application provide a data access device, including:

[0027] The processing module is used to respond to a hard disk write operation request by setting the tag of the data to be accessed as a one-time write tag; wherein the hard disk write operation request indicates the data to be accessed;

[0028] The processing module is also used to send a hard disk write operation request to the driver, so that the driver can write the data to be accessed from memory to the hard disk based on the hard disk write operation request;

[0029] The processing module is also used to respond to a hard disk read operation request by sending a hard disk read operation request to the driver so that the driver can store the data to be accessed in the hard disk into memory based on the hard disk read operation request;

[0030] The control module is used to control the driver to delete the data to be accessed from the hard drive based on the tagging of the data to be accessed as a one-time write tag.

[0031] In one implementation, the control module is specifically used for:

[0032] Change the tag of the data to be accessed from a one-time write tag to an invalid tag;

[0033] In response to the data to be accessed being marked as invalid, the control driver deletes the data to be accessed from the hard drive.

[0034] In one implementation, the control module is specifically used for:

[0035] In response to the data to be accessed being marked as invalid, a delete command is sent to the driver, which then generates an unmapping command and deletes the data to be accessed from the hard disk based on the unmapping command.

[0036] In one implementation, the processing module is specifically used for:

[0037] In response to a hard disk write operation request, obtain hard disk capacity information;

[0038] Determine whether the hard drive capacity information meets the first preset condition;

[0039] If the hard drive capacity information meets the first preset condition, the mark of the data to be accessed is set to a one-time write mark.

[0040] In one implementation, the processing module is specifically used for:

[0041] In response to a hard disk write operation request, obtain the business information corresponding to the data to be accessed;

[0042] Determine whether the business information meets the second preset condition;

[0043] If the business information meets the second preset condition, the tag of the data to be accessed will be set as a one-time write tag.

[0044] In one implementation, the processing module is specifically used for:

[0045] If the business type in the business information is a preset business type, it is determined that the business information meets the second preset condition;

[0046] Alternatively, if the business priority in the business information is a preset priority, then the business information is determined to meet the second preset condition.

[0047] Thirdly, embodiments of this application provide a chip, the chip including at least one processor, the processor being configured to execute program instructions to perform the method of the first aspect.

[0048] Fourthly, this application provides a chip module on which a computer program is stored. When the computer program is executed by the chip module, it implements the method as described in any of the first aspects.

[0049] Fifthly, embodiments of this application provide an electronic device, including: memory, hard disk, and processor;

[0050] The processor is connected to both the memory and the hard drive.

[0051] The processor is used to execute methods such as those in the first aspect.

[0052] In a sixth aspect, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the method of the first aspect.

[0053] In a seventh aspect, embodiments of this application provide a computer program product, including computer execution instructions, which, when executed by a processor, cause the method of the first aspect to be performed.

[0054] This application provides a data access method, apparatus, device, medium, and program product. In this method, a first file system, in response to a hard disk write operation request, sets a marker for the data to be accessed as a one-time write marker; wherein the hard disk write operation request indicates the data to be accessed. The first file system sends a hard disk write operation request to a driver, so that the driver writes the data to be accessed from memory to the hard disk based on the hard disk write operation request. In response to a hard disk read operation request, the first file system sends a hard disk read operation request to the driver, so that the driver stores the data to be accessed stored on the hard disk in memory based on the hard disk read operation request. Based on the marker for the data to be accessed being set as a one-time write marker, the first file system controls the driver to delete the data to be accessed stored on the hard disk. By setting the marker for the data to be accessed as a one-time write marker, the data to be accessed can be deleted from the hard disk after a single read, avoiding the data to be accessed occupying hard disk storage resources and improving hard disk resource utilization. Attached Figure Description

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

[0056] Figure 1 This is a diagram illustrating data access in related technologies;

[0057] Figure 2 A schematic diagram of an electronic device provided in an embodiment of this application;

[0058] Figure 3a A flowchart illustrating a data access method according to an embodiment of this application;

[0059] Figure 3b A data access diagram provided for an embodiment of this application;

[0060] Figure 4 A flowchart illustrating a second embodiment of a data access method provided in this application;

[0061] Figure 5 A flowchart illustrating a third embodiment of a data access method provided in this application;

[0062] Figure 6 This is a schematic diagram of the structure of a data access device provided in an embodiment of this application. Detailed Implementation

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

[0064] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented, for example, in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0065] In this application, "at least one" refers to one or more, and "multiple" refers to two or more. Furthermore, the word "equal to" in this application can be used with either "greater than" or "less than". When "equal to" and "greater than" are used together, the technical solution using "greater than" is adopted; when "equal to" and "less than" are used together, the technical solution using "less than" is adopted.

[0066] By dumping data from memory to the hard drive, more storage space can be freed up for programs that actually need it. When data needs to be moved from memory to the hard drive, it can be read back into memory.

[0067] For example, Figure 1 This is a diagram illustrating data access in related technologies. For example... Figure 1 As shown, data in anonymous pages of memory needs to be placed in the swap cache area first. Then, the block layer IO scheduler processes the disk write operation request and sends it to the driver (SCSI / UFS driver). The driver then stores the data to the disk based on the processed disk write operation request. It's important to note that the buffer in the swap cache area refers to data that is about to be swapped out to the disk. It's also important to note that the swap cache area belongs to memory.

[0068] Similarly, when memory needs to access data that has been moved to the hard drive, the block device scheduling layer needs to process the hard drive read operation request. The data needs to be placed in the swap area and then in anonymous pages in memory. It should be noted that the cached state in the swap cache area refers to the data that has just been swapped out from the hard drive.

[0069] When data needs to be deleted from the hard drive, the block device scheduling layer can send an unmap instruction to the driver based on the delete instruction. The driver can then delete the data from the hard drive based on the unmap instruction.

[0070] However, in related technologies, for data that is read and written only once, after the data is read back from the hard drive to memory, the data is still stored on the hard drive. This results in invalid data occupying storage resources for a long time, leading to low utilization of hard drive resources.

[0071] To address the aforementioned technical problems, this application provides a data access method. A first file system, in response to a hard disk write operation request, sets the marker for the data to be accessed as a one-time write marker; wherein the hard disk write operation request indicates the data to be accessed. The first file system sends a hard disk write operation request to a driver, enabling the driver to write the data to be accessed from memory to the hard disk based on the hard disk write operation request. In response to a hard disk read operation request, the first file system sends a hard disk read operation request to the driver, enabling the driver to store the data to be accessed from the hard disk into memory based on the hard disk read operation request. Based on the marker for the data to be accessed being set as a one-time write marker, the first file system controls the driver to delete the data to be accessed stored on the hard disk. By setting the marker for the data to be accessed as a one-time write marker, the data to be accessed can be deleted from the hard disk after a single read, avoiding the data to be accessed occupying hard disk storage resources and improving hard disk resource utilization.

[0072] Figure 2 This is a schematic diagram of an electronic device provided in an embodiment of this application.

[0073] like Figure 2 As shown, the electronic device 10 may include a memory 101, a processor 102, and a hard disk 103. The processor 102 is connected to both the memory 101 and the hard disk 103.

[0074] The processor 102 can run the first file system ( Figure 2 (not shown), driver () Figure 2 (Not shown).

[0075] In response to a disk write operation request, the first file system sets the marker for the data to be accessed to a one-time write marker. The disk write operation request indicates the data to be accessed.

[0076] The first file system sends a hard disk write operation request to the driver, so that the driver can write the data to be accessed from memory 101 to hard disk 103 based on the hard disk write operation request.

[0077] In response to a hard disk read operation request, the first file system sends a hard disk read operation request to the driver, so that the driver can store the data to be accessed in the hard disk 103 into the memory 101 based on the hard disk read operation request.

[0078] The first file system uses the marker for the data to be accessed as a one-time write marker, and controls the driver to delete the data to be accessed stored on hard disk 103.

[0079] The technical solutions shown in this application will now be described in detail through specific embodiments. It should be noted that the following embodiments may exist independently or in combination with each other; for identical or similar content, the description will not be repeated in different embodiments.

[0080] It should be noted that, from a hardware perspective, the execution entity in the following embodiments is an electronic device, more specifically, a processor in the electronic device; from a software perspective, it is the first file system running on the processor.

[0081] Figure 3a This is a flowchart illustrating a data access method according to an embodiment of this application. Please refer to [link / reference]. Figure 3a The method may include:

[0082] S301: In response to a hard disk write operation request, the first file system sets the tag of the data to be accessed to a one-time write tag.

[0083] In this embodiment, when it is necessary to store the data to be accessed in memory to the hard disk, the first file system can receive a hard disk write operation request. In one implementation, the hard disk write operation request can be generated by the application.

[0084] The disk write operation request may include data information of the data to be accessed. In one implementation, the data information may include the storage address of the data to be accessed. In another implementation, the data information may also include the data identifier of the data to be accessed.

[0085] As can be understood, a disk write operation request refers to an operation request that write the data to be accessed in memory to the disk.

[0086] The primary file system can respond to disk write operation requests by setting the tag of the data to be accessed as a one-time write tag. In one implementation, the tag of the data to be accessed can be recorded in the file corresponding to the data. The primary file system can manage the file corresponding to the data to be accessed.

[0087] It should be noted that the first file system can be called a one-time file system, or other names, and this application embodiment does not limit this.

[0088] It should be noted that the one-time write mark can be called a single-write mark, or it can be called other names. This application embodiment does not limit this.

[0089] The following describes the process by which the first file system, in response to a hard disk write operation request, sets the marker of the data to be accessed to a one-time write marker.

[0090] In one implementation:

[0091] The first file system can respond to hard disk write operation requests and obtain hard disk capacity information.

[0092] The first file system can determine whether the hard disk capacity information meets the first preset condition.

[0093] The first file system can set the marker of the data to be accessed to a one-time write marker if the hard disk capacity information meets the first preset condition.

[0094] The following describes the process by which the first file system determines whether the hard disk capacity information meets the first preset condition.

[0095] In one implementation:

[0096] Hard drive capacity information can include the remaining capacity of the hard drive.

[0097] The first file system can determine whether the remaining disk capacity is less than or equal to the preset remaining capacity.

[0098] The first file system can determine that the hard disk capacity information meets the first preset condition if the remaining hard disk capacity is less than or equal to the preset remaining capacity.

[0099] Alternatively, the first file system can determine that the hard disk capacity information does not meet the first preset condition if the remaining hard disk capacity is greater than the preset remaining capacity.

[0100] In one implementation:

[0101] Hard drive capacity information can include the used capacity. As can be understood, used capacity refers to the portion of the total hard drive capacity that is already occupied by data.

[0102] The first file system can determine whether the hard drive's used capacity is greater than or equal to the preset used capacity.

[0103] The first file system can determine that the hard disk capacity information meets the first preset condition if the hard disk usage capacity is greater than or equal to the preset usage capacity.

[0104] Alternatively, the first file system can determine that the hard disk capacity information does not meet the first preset condition if the hard disk usage capacity is greater than the preset usage capacity.

[0105] In one implementation:

[0106] Hard drive capacity information can include the percentage of remaining hard drive capacity. In simpler terms, the percentage of remaining hard drive capacity refers to the ratio of unused capacity to the total hard drive capacity.

[0107] The first file system can determine whether the percentage of remaining hard disk capacity is less than or equal to the preset percentage of remaining capacity.

[0108] The first file system can determine that the hard disk capacity information meets the first preset condition if the percentage of the remaining hard disk capacity is less than or equal to the preset percentage of the remaining hard disk capacity.

[0109] Alternatively, the first file system can determine that the hard disk capacity information does not meet the first preset condition if the percentage of remaining hard disk capacity is greater than the preset percentage of remaining hard disk capacity.

[0110] In one implementation:

[0111] The first file system responds to a disk write operation request by obtaining the business information corresponding to the data to be accessed. In one implementation, the disk write operation request can indicate the business information.

[0112] The first file system determines whether the business information meets the second preset condition.

[0113] When the business information meets the second preset condition, the first file system sets the tag of the data to be accessed to a one-time write tag.

[0114] The following section explains the process by which the first file system determines whether the business information meets the second preset condition.

[0115] In one implementation:

[0116] Business information can include the business type.

[0117] The first file system determines whether the business type in the business information is a preset business type. For example, the preset business type could be a verification code type. Another example is an encryption key type. Yet another example is a process snapshot data type.

[0118] The first file system can determine that the business information meets the second preset condition if the business type in the business information is a preset business type.

[0119] Alternatively, the first file system can determine that the business information does not meet the second preset condition if the business type in the business information is not a preset business type.

[0120] In one implementation:

[0121] Business information can include business priorities.

[0122] The first file system determines whether the business priority in the business information is the preset priority. For example, the preset business priority can be a low priority.

[0123] The first file system can determine if the business information meets the second preset condition if the business priority in the business information is a preset priority.

[0124] Alternatively, the first file system can determine that the business information does not meet the second preset condition if the business priority in the business information is not a preset priority.

[0125] S302: The first file system sends a hard disk write operation request to the driver so that the driver can write the data to be accessed from memory to the hard disk.

[0126] In this embodiment, the first file system can send a hard disk write operation request to the driver. Figure 3b This is a schematic diagram illustrating data access as provided in an embodiment of this application. Figure 3b As shown, the driver receives a hard disk write operation request.

[0127] The driver writes the data to be accessed from memory to the hard disk based on the hard disk write operation request.

[0128] It should be noted that when the Universal Flash Storage (UFS) device is a hard drive, this driver is the driver corresponding to the hard drive.

[0129] It should be noted that the first file system may first execute "send a hard disk write operation request to the driver" and then execute "set the marker of the data to be accessed to a one-time write marker"; the first file system may also first execute "set the marker of the data to be accessed to a one-time write marker" and then execute "send a hard disk write operation request to the driver"; the first file system may also execute "set the marker of the data to be accessed to a one-time write marker" at the same time as executing "send a hard disk write operation request to the driver". This application embodiment does not limit this.

[0130] S303: In response to a hard disk read operation request, the first file system sends a hard disk read operation request to the driver so that the driver can store the data to be accessed on the hard disk into memory based on the hard disk read operation request.

[0131] In this embodiment, when it is necessary to store the data to be accessed from the hard disk into memory, the first file system can receive a hard disk read operation request. In one implementation, the hard disk read operation request can be generated by an application.

[0132] The disk read operation request may include data information of the data to be accessed. In one implementation, the data information may include the storage address of the data to be accessed. In another implementation, the data information may also include an identifier of the data to be accessed. The identifier of the data to be accessed may be the name of the data to be accessed, or it may be the name and storage timestamp of the data to be accessed, or it may be other information that can reflect the identity of the data to be accessed.

[0133] As can be understood, a hard disk read operation request refers to an operation request that write the data to be accessed stored on the hard disk into memory.

[0134] The first file system can respond to hard disk read operation requests by sending hard disk read operation requests to the driver.

[0135] The driver can store data to be accessed on the hard drive into memory based on hard drive read operation requests.

[0136] S304: The first file system uses the marker of the data to be accessed as a one-time write marker, and controls the driver to delete the data to be accessed stored on the hard disk.

[0137] In this embodiment, when the data to be accessed is obtained from the hard disk and stored in memory, the first file system can control the driver to delete the data to be accessed from the hard disk based on the data to be accessed being marked as a one-time write.

[0138] The following describes the process by which the first file system controls the driver to delete the data to be accessed stored on the hard drive based on the marking of the data to be accessed as a one-time write mark.

[0139] In one implementation:

[0140] The first file system can change the marker for the data to be accessed from a one-time write marker to an invalid marker.

[0141] The first file system can respond to the fact that the data to be accessed is marked as invalid, and control the driver to delete the data stored on the hard drive.

[0142] The beneficial effects of this embodiment are as follows: In response to a hard disk write operation request, the first file system sets the marker for the data to be accessed to a one-time write marker; wherein, the hard disk write operation request indicates the data to be accessed. The first file system sends a hard disk write operation request to the driver, so that the driver can write the data to be accessed from memory to the hard disk based on the hard disk write operation request. In response to a hard disk read operation request, the first file system sends a hard disk read operation request to the driver, so that the driver can store the data to be accessed stored on the hard disk into memory based on the hard disk read operation request. Based on the marker for the data to be accessed being set to a one-time write marker, the first file system controls the driver to delete the data to be accessed stored on the hard disk. By setting the marker for the data to be accessed to a one-time write marker, the data to be accessed can be deleted from the hard disk after a single read, avoiding the data to be accessed occupying the hard disk's storage resources and improving the hard disk's resource utilization.

[0143] Figure 4 This is a flowchart illustrating a second embodiment of a data access method provided in this application. Please refer to [link / reference]. Figure 4 The method may include:

[0144] S401: In response to a hard disk write operation request, the first file system sets the tag of the data to be accessed to a one-time write tag.

[0145] In this embodiment, the first file system may, in response to a hard disk write operation request, set the tag of the data to be accessed as a one-time write tag.

[0146] Among them, the hard disk write operation request indicates the data to be accessed.

[0147] The specific implementation process is the same as that of S301, and will not be described in detail here.

[0148] S402: The first file system sends a hard disk write operation request to the driver, so that the driver can write the data to be accessed from memory to the hard disk based on the hard disk write operation request.

[0149] In this embodiment, the first file system can send a hard disk write operation request to the driver.

[0150] The driver can write the data to be accessed from memory to the hard disk based on the hard disk write operation request.

[0151] The specific implementation process is the same as that of S302, and will not be described in detail here.

[0152] S403: In response to a hard disk read operation request, the first file system sends a hard disk read operation request to the driver so that the driver can store the data to be accessed on the hard disk into memory.

[0153] In this embodiment, the first file system can respond to a hard disk read operation request by sending a hard disk read operation request to the driver.

[0154] The driver can store data to be accessed on the hard drive into memory based on hard drive read operation requests.

[0155] The specific implementation process is the same as that of S303, and will not be described in detail here.

[0156] S404: The first file system changes the marker for the data to be accessed from a one-time write marker to an invalid marker.

[0157] In this embodiment, the first file system can change the marker of the data to be accessed from a one-time write marker to an invalid marker after sending a hard disk read operation request to the driver.

[0158] In one implementation:

[0159] The first file system can manage the files corresponding to the data to be accessed. These files can record the tags of the data to be accessed.

[0160] The first file system can change the marker of the data to be accessed recorded in the file from a one-time write marker to an invalid marker.

[0161] S405: The first file system responds to the fact that the flag of the data to be accessed is invalid, and controls the driver to delete the data to be accessed from the hard disk.

[0162] In this embodiment, the first file system can control the driver to delete the data to be accessed stored on the hard disk in response to the data being marked as invalid.

[0163] The beneficial effects of this embodiment are as follows: In response to a hard disk write operation request, the first file system sets the marker of the data to be accessed to a one-time write marker; wherein, the hard disk write operation request indicates the data to be accessed. The first file system sends a hard disk write operation request to the driver, so that the driver can write the data to be accessed from memory to the hard disk based on the hard disk write operation request. In response to a hard disk read operation request, the first file system sends a hard disk read operation request to the driver, so that the driver can store the data to be accessed stored on the hard disk into memory based on the hard disk read operation request. The first file system changes the marker of the data to be accessed from a one-time write marker to an invalid marker. The first file system can control the driver to delete the data to be accessed stored on the hard disk in response to the marker of the data to be accessed being invalidated. By setting the marker of the data to be accessed to a one-time write marker and changing the marker of the data to be accessed from a one-time write marker to an invalid marker after one read, the data to be accessed stored on the hard disk that has already been read once can be deleted promptly and accurately after one read, avoiding the data to be accessed occupying the storage resources of the hard disk and improving the resource utilization of the hard disk. In addition, by directly connecting the first file system to the driver, the overhead is saved at the software level, and the read and write efficiency is improved.

[0164] Figure 5 This is a flowchart illustrating a third embodiment of a data access method provided in this application. Please refer to [link / reference]. Figure 5 The method may include:

[0165] S501: In response to a hard disk write operation request, the first file system sets the tag of the data to be accessed to a one-time write tag.

[0166] In this embodiment, the first file system may, in response to a hard disk write operation request, set the tag of the data to be accessed as a one-time write tag.

[0167] Among them, the hard disk write operation request indicates the data to be accessed.

[0168] The specific implementation process is the same as that of S301, and will not be described in detail here.

[0169] S502: The first file system sends a hard disk write operation request to the driver, so that the driver can write the data to be accessed from memory to the hard disk based on the hard disk write operation request.

[0170] In this embodiment, the first file system can directly interface with the driver. It should be noted that this driver is the driver corresponding to the hard drive. For example, this driver can be a Universal Flash Storage (UFS) driver.

[0171] The first file system can send hard disk write operation requests to the driver.

[0172] The driver can write the data to be accessed in memory to the hard disk based on the hard disk write operation request.

[0173] The following describes the process by which the driver writes the data to be accessed to the hard disk based on a hard disk write operation request.

[0174] In one implementation:

[0175] The driver can generate a UFS Transfer Request Descriptor (UTRD) based on disk write operation requests. For example, Figure 2 As shown, the UTRD can include a Command UFS Protocol Information Unit (UPIU), a Response UPIU, and a Physical Region Descriptor Table (PRDT).

[0176] The UTRD indicates the storage address of the data to be accessed in the data buffer. The UTRD is used by the UFS host controller (hardware) on the processor to access the data stored in the memory data buffer. The UFS host controller then sends the data to the hard disk for storage processing. It should be noted that in this embodiment, the hard disk is a UFS device used to store the data to be accessed.

[0177] S503: In response to a hard disk read operation request, the first file system sends a hard disk read operation request to the driver so that the driver can store the data to be accessed on the hard disk into memory based on the hard disk read operation request.

[0178] In this embodiment, the first file system can respond to a hard disk read operation request by sending a hard disk read operation request to the driver, so that the driver can store the data to be accessed in the hard disk into memory based on the hard disk read operation request.

[0179] S504: The first file system changes the tag of the data to be accessed from a one-time write tag to an invalid tag.

[0180] In this embodiment, the first file system can change the tag of the data to be accessed from a one-time write tag to an invalid tag.

[0181] S505: In response to the invalidation of the data to be accessed, the first file system sends a deletion command to the driver, so that the driver can generate an unmapping command in response to the deletion command, and delete the data to be accessed stored on the hard disk based on the unmapping command.

[0182] In this embodiment, the first file system sends a deletion command to the driver in response to the invalidation of the data to be accessed. The driver then generates an unmap command in response to the deletion command and deletes the data to be accessed stored on the hard disk based on the unmap command.

[0183] It should be noted that in one implementation, the hard drive can directly erase the data to be accessed based on demapping instructions. In another implementation, the hard drive can mark the storage area containing the data to be accessed as an overwriteable area based on demapping instructions, thereby deleting the data to be accessed.

[0184] The beneficial effects of this embodiment are as follows: In this embodiment, the first file system, in response to a hard disk write operation request, sets the marker of the data to be accessed to a one-time write marker; wherein, the hard disk write operation request indicates the data to be accessed. The first file system sends a hard disk write operation request to the driver, so that the driver can write the data to be accessed from memory to the hard disk based on the hard disk write operation request. In response to a hard disk read operation request, the first file system sends a hard disk read operation request to the driver, so that the driver can store the data to be accessed stored on the hard disk into memory based on the hard disk read operation request. The first file system changes the marker of the data to be accessed from a one-time write marker to an invalid marker. In response to the marker of the data to be accessed being invalid, the first file system sends a deletion command to the driver, so that the driver can generate an unmapping command in response to the deletion command, and delete the data to be accessed stored on the hard disk based on the unmapping command. Through the above method, the data to be accessed can be deleted in a timely manner after being marked as invalid, which can reduce the burden on hard disk storage space and metadata maintenance caused by invalid data to reside for a long time.

[0185] The following are embodiments of the apparatus described in this application, which can be used to execute the embodiments of the method described in this application. For details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the method described in this application.

[0186] Figure 6 This is a schematic diagram of the structure of a data access device provided in an embodiment of this application. Figure 6 As shown, the data access device 60 includes a processing module 61 and a control module 62. The data access device can also be referred to as a first file system.

[0187] Processing module 61 is configured to, in response to a hard disk write operation request, set the marker of the data to be accessed to a one-time write marker; wherein the hard disk write operation request indicates the data to be accessed;

[0188] The processing module 61 is also used to send a hard disk write operation request to the driver so that the driver can write the data to be accessed from memory to the hard disk based on the hard disk write operation request.

[0189] Processing module 61 is also used to respond to a hard disk read operation request by sending a hard disk read operation request to the driver so that the driver can store the data to be accessed in the hard disk into memory based on the hard disk read operation request;

[0190] The control module 62 is used to control the driver to delete the data to be accessed stored on the hard disk based on the tag of the data to be accessed being marked as a one-time write tag.

[0191] The data access device provided in this application embodiment can execute the technical solutions in the above method embodiments, and its beneficial effects are similar, so they will not be described again here.

[0192] In one implementation, the control module 62 is specifically used for:

[0193] Change the tag of the data to be accessed from a one-time write tag to an invalid tag;

[0194] In response to the data to be accessed being marked as invalid, the control driver deletes the data to be accessed from the hard drive.

[0195] The data access device provided in this application embodiment can execute the technical solutions in the above method embodiments, and its beneficial effects are similar, so they will not be described again here.

[0196] In one implementation, the control module 62 is specifically used for:

[0197] In response to the data to be accessed being marked as invalid, a delete command is sent to the driver, which then generates an unmapping command and deletes the data to be accessed from the hard disk based on the unmapping command.

[0198] The data access device provided in this application embodiment can execute the technical solutions in the above method embodiments, and its beneficial effects are similar, so they will not be described again here.

[0199] In one implementation, processing module 61 is specifically used for:

[0200] In response to a hard disk write operation request, obtain hard disk capacity information;

[0201] Determine whether the hard drive capacity information meets the first preset condition;

[0202] If the hard drive capacity information meets the first preset condition, the mark of the data to be accessed is set to a one-time write mark.

[0203] The data access device provided in this application embodiment can execute the technical solutions in the above method embodiments, and its beneficial effects are similar, so they will not be described again here.

[0204] In one implementation, processing module 61 is specifically used for:

[0205] In response to a hard disk write operation request, obtain the business information corresponding to the data to be accessed;

[0206] Determine whether the business information meets the second preset condition;

[0207] If the business information meets the second preset condition, the tag of the data to be accessed will be set as a one-time write tag.

[0208] The data access device provided in this application embodiment can execute the technical solutions in the above method embodiments, and its beneficial effects are similar, so they will not be described again here.

[0209] In one implementation, processing module 61 is specifically used for:

[0210] If the business type in the business information is a preset business type, it is determined that the business information meets the second preset condition;

[0211] Alternatively, if the business priority in the business information is a preset priority, then the business information is determined to meet the second preset condition.

[0212] The data access device provided in this application embodiment can execute the technical solutions in the above method embodiments, and its beneficial effects are similar, so they will not be described again here.

[0213] This application provides a chip, which includes at least one processor. The processor is used to execute program instructions to perform the methods described in the foregoing method embodiments.

[0214] This application also provides a chip module. It is understood that, in one implementation, the chip module can be a 5G chip module.

[0215] The chip module stores a computer program, and when the computer program is executed by the chip module, it implements the method as described in the above method embodiment.

[0216] This application also provides an electronic device, including a memory, a hard disk, and a processor;

[0217] The processor is connected to both the memory and the hard drive.

[0218] The processor is used to execute the technical solutions of any of the foregoing method embodiments.

[0219] The processor is used to execute the technical solutions in the aforementioned method embodiments. Its implementation principle and technical effect are similar, and will not be described again here.

[0220] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the technical solutions of any of the foregoing method embodiments.

[0221] This application also provides a computer program product, including computer execution instructions, which, when executed by a processor, cause the technical solutions of any of the foregoing method embodiments to be executed.

[0222] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

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

Claims

1. A data access method, characterized in that, include: In response to a hard disk write operation request, the first file system sets the marker of the data to be accessed to a one-time write marker; wherein the hard disk write operation request indicates the data to be accessed; The first file system sends the hard disk write operation request to the driver, so that the driver can write the data to be accessed from memory to the hard disk based on the hard disk write operation request; In response to a hard disk read operation request, the first file system sends the hard disk read operation request to the driver, so that the driver can store the data to be accessed in the hard disk into the memory based on the hard disk read operation request; The first file system controls the driver to delete the data to be accessed stored on the hard disk based on the data to be accessed being marked as a one-time write.

2. The method according to claim 1, characterized in that, The first file system, based on the marker of the data to be accessed being marked as a one-time write, controls the driver to delete the data to be accessed stored on the hard disk, including: The first file system modifies the tag of the data to be accessed from the one-time write tag to the invalid tag; In response to the flag indicating that the data to be accessed is invalid, the first file system controls the driver to delete the data to be accessed stored on the hard disk.

3. The method according to claim 2, characterized in that, In response to the flag indicating that the data to be accessed is invalid, the first file system controls the driver to delete the data to be accessed stored on the hard disk, including: In response to the invalidation flag of the data to be accessed, the first file system sends a deletion command to the driver, so that the driver generates an unmapping command in response to the deletion command and deletes the data to be accessed stored in the hard disk based on the unmapping command.

4. The method according to claim 1, characterized in that, In response to a hard disk write operation request, the first file system sets the marker of the data to be accessed as a one-time write marker, including: The first file system responds to the hard disk write operation request and obtains hard disk capacity information; The first file system determines whether the hard disk capacity information meets the first preset condition; When the hard disk capacity information meets the first preset condition, the first file system sets the marker of the data to be accessed as the one-time write marker.

5. The method according to claim 1, characterized in that, In response to a hard disk write operation request, the first file system sets the marker of the data to be accessed as a one-time write marker, including: The first file system responds to the hard disk write operation request and obtains the business information corresponding to the data to be accessed; The first file system determines whether the business information meets the second preset condition; When the business information meets the second preset condition, the first file system sets the tag of the data to be accessed as the one-time write tag.

6. The method according to claim 5, characterized in that, The first file system determines whether the business information meets the second preset condition, including: If the business type in the business information is a preset business type, the first file system determines that the business information meets the second preset condition. Alternatively, if the first file system determines that the business information meets the second preset condition, and the business priority in the business information is a preset priority, then the business information is determined to meet the second preset condition.

7. A data access device, characterized in that, include: A processing module is configured to, in response to a hard disk write operation request, set the marker of the data to be accessed as a one-time write marker; wherein the hard disk write operation request indicates the data to be accessed; The processing module is further configured to send the hard disk write operation request to the driver, so that the driver can write the data to be accessed from memory to the hard disk based on the hard disk write operation request; The processing module is further configured to send the hard disk read operation request to the driver in response to the hard disk read operation request, so that the driver can store the data to be accessed in the hard disk into the memory based on the hard disk read operation request; The control module is used to control the driver to delete the data to be accessed stored in the hard disk based on the fact that the data to be accessed is marked as a one-time write.

8. An electronic device, characterized in that, include: Memory, hard drive, and processor; The processor is connected to both the memory and the hard disk. The processor is used to execute the data access method as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the data access method according to any one of claims 1 to 6.

10. A computer program product, characterized in that, It includes computer execution instructions, which, when executed by a processor, cause the data access method as described in any one of claims 1 to 6 to be executed.