A data writing method and device, electronic equipment and storage medium
By dividing the data index into static and dynamic indexes in the shingled magnetic recording disk and storing them separately in the CMR and SMR areas, the problem of data storage performance being affected is solved, and efficient data writing is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HANGZHOU HIKVISION SYST TECH CO LTD
- Filing Date
- 2022-12-26
- Publication Date
- 2026-05-19
AI Technical Summary
When storing data, the distribution of CMR and SMR zones in shingled magnetic recording disks affects data storage performance, especially when updating the index from the SMR zone to the CMR zone, which requires large-span offset writes, impacting efficiency.
By dividing the data index into static index and dynamic index, the static index records unchanging key information stored in the CMR area, while the dynamic index records changing index information stored in the SMR area. The static index area is used to determine the information of user data blocks and dynamic index data blocks, and user data is written to available user data blocks and dynamic index blocks, thereby reducing large-span offset writes.
It improves the data writing efficiency of shingled magnetic recording disks, reduces the need for large-span offset writes, and enhances storage performance.
Smart Images

Figure CN115774522B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of information technology, and in particular to a data writing method, apparatus, electronic device, and storage medium. Background Technology
[0002] Shingled magnetic recording (SMR) disks, as a new magnetic recording method, can effectively increase the effective capacity of hard drives by employing track overlap technology. SMR disks are divided into CMR (Conventional Perpendicular Recording) zones and SMR (Shingled Perpendicular Recording) zones. CMR zones support random read / write, while SMR zones support concurrent read / write between SMR zones, with each SMR zone supporting only sequential writes. Currently, when using SMR disks, storage systems often store data indexes in the CMR zones and store user data sequentially in the SMR zones according to certain rules. This approach matches the characteristics of SMR disks and achieves data storage functionality.
[0003] However, due to the distribution of CMR ZONE (traditional perpendicular magnetic recording) and SMR ZONE in shingled magnetic recording disks, when data is stored in the SMR ZONE and the index of the CMR area is updated, a large-span offset write is often required, which affects the data storage performance. Summary of the Invention
[0004] The purpose of this application is to provide a data writing method, apparatus, electronic device, and storage medium to improve the data writing efficiency of shingled magnetic recording disks. The specific technical solution is as follows:
[0005] A first aspect of this application provides a data writing method applied to a shingled magnetic recording disk, the shingled magnetic recording disk including a CMR region and an SMR region, the CMR region including a static index area, the SMR region including a data block, the method comprising:
[0006] Obtain the write request of the first user, wherein the write request includes the user data to be written and the user data index;
[0007] The static index area is queried to determine the first information of the user data block and dynamic index data block of the first user, wherein the static index area records the information of the user data block and dynamic index data block of each user;
[0008] If the first information indicates the existence of an available user data block and an available dynamic index data block for the first user, the user data is written into the available user data block for the first user, and the user's data index is written into the dynamic index block.
[0009] Optionally, the method further includes:
[0010] If the first information indicates that there are no available user data blocks and available dynamic index data blocks for the first user, then an unused data block is selected from the data blocks to obtain the available user data block for the first user; and a data block is selected from the data blocks to obtain the available dynamic index data block for the first user.
[0011] The information of the available user data blocks and available dynamic index data blocks of the first user is written into the static index area.
[0012] Optionally, the method further includes:
[0013] If the first information indicates that there is no available user data block for the first user but there is an available dynamic index data block for the first user, then an unused data block is selected from the data blocks to obtain the available user data block for the first user.
[0014] Write the information of the available user data blocks of the first user into the static index area.
[0015] Optionally, the method further includes:
[0016] If the first information indicates that there is an available user data block for the first user but no available dynamic index data block for the first user, then select a data block from the data blocks to obtain the available dynamic index data block for the first user.
[0017] Write the information of the available dynamic index data blocks of the first user into the static index area.
[0018] Optionally, selecting a data block from the data blocks to obtain the available dynamic index data block for the first user includes:
[0019] If the data block includes an incomplete dynamic index data block, select one dynamic index data block from the incomplete dynamic index data blocks to obtain the available dynamic index data block for the first user.
[0020] If the data block does not include an incomplete dynamic index data block, an unused data block is selected from the data block to obtain the available dynamic index data block for the first user.
[0021] Optionally, if the data block includes an incomplete dynamic index data block, selecting one dynamic index data block from the incomplete dynamic index data blocks to obtain the available dynamic index data block for the first user includes:
[0022] If the data block includes an incomplete dynamic index data block, the dynamic index data block closest to the available user data block of the first user is selected from the incomplete dynamic index data blocks to obtain the available dynamic index data block of the first user.
[0023] Optionally, when the first information indicates the existence of an available user data block and an available dynamic index data block for the first user, writing the user data into the available user data block for the first user and writing the user's data index into the dynamic index block includes:
[0024] When the first information indicates the existence of available user data blocks and available dynamic index data blocks for the first user, the user data is written into the available user data block of the first user, and the user's data index is written into the dynamic index block. If the available user data block of the first user is full, the storage location information of the user data block is recorded in the static index area.
[0025] Select an unused data block from the data blocks to obtain the newly created available user data block for the first user;
[0026] Continue writing the remaining unwritten user data into the newly created available user data block for the first user.
[0027] Optionally, when the first information indicates the existence of an available user data block and an available dynamic index data block for the first user, writing the user data into the available user data block for the first user and writing the user's data index into the dynamic index block includes:
[0028] When the first information indicates the existence of an available user data block and an available dynamic index data block for the first user, the user data is written into the available user data block of the first user, and the user's data index is written into the dynamic index block. If the available dynamic index data block is full, the storage location information of the available dynamic index data block is recorded in the static index area.
[0029] Select an unused data block from the data blocks to obtain the newly created and available dynamic index data block for the first user;
[0030] The remaining unwritten data indexes of the user will continue to be written into the newly created available dynamic index data block of the first user.
[0031] Optionally, the CMR region further includes a startup block, and before obtaining the write request from the first user, the method further includes:
[0032] Receive the formatting request from the first user;
[0033] Obtain information about the static index area in the shingled recording disk;
[0034] The information of the static index area is written into the startup block, and the initialization information is written into the static index block.
[0035] Optionally, after writing the user data into the first user's available user data block and the user's data index into the dynamic index block, when the first information indicates the existence of an available user data block and an available dynamic index data block for the first user, the method further includes:
[0036] Receive deletion information for a specified user's data block;
[0037] Based on the deletion information, the static index in the static index area corresponding to the specified user data block is marked as invalid, and the dynamic index in the dynamic index block corresponding to the specified user data block is marked as invalid.
[0038] Optionally, after writing the user data into the first user's available user data block and the user's data index into the dynamic index block, when the first information indicates the existence of an available user data block and an available dynamic index data block for the first user, the method further includes:
[0039] A request to retrieve the user data of the second user;
[0040] Based on the information of each user's user data block and dynamic index data block recorded in the static index area, determine the user data block and dynamic index data block of the second user in the data block;
[0041] Read the user data index from the dynamic index data block of the second user;
[0042] User data is read from the user data block of the second user according to the user data index.
[0043] A second aspect of this application provides a data reading method, the method comprising:
[0044] Receive a read request sent by a third user, wherein the read request includes the filename of the file to be requested, and the file to be requested is written by any of the data writing methods in this application;
[0045] Based on the filename of the file to be requested, identify the location information of the dynamic index block corresponding to the file to be requested from the static index area;
[0046] The corresponding dynamic index block is located based on the location information, the requested file is read, and the read file is sent to the third user.
[0047] A third aspect of this application provides a data writing apparatus applied to a shingled magnetic recording disk, the shingled magnetic recording disk including a CMR region and an SMR region, the CMR region including a static index area, the SMR region including data blocks, the apparatus comprising:
[0048] The request receiving module is used to obtain the write request of the first user, wherein the write request includes user data to be written and user data index;
[0049] The information query module is used to query the static index area to determine the first information of the user data block and dynamic index data block of the first user, wherein the static index area records the information of the user data block and dynamic index data block of each user;
[0050] The data storage module is configured to, when the first information indicates the existence of an available user data block and an available dynamic index data block for the first user, write the user data into the available user data block for the first user and write the user's data index into the dynamic index block.
[0051] Optionally, the device further includes:
[0052] The first dynamic index creation module is used to select an unused data block from the data blocks to obtain the first user's available user data block when the first information indicates that there are no available user data blocks and available dynamic index data blocks for the first user; and to select a data block from the data blocks to obtain the first user's available dynamic index data block.
[0053] The first dynamic index writing module is used to write the information of the first user's available user data blocks and available dynamic index data blocks into the static index area.
[0054] Optionally, the device further includes:
[0055] The first user data block creation module is used to select an unused data block from the data blocks to obtain the first user's available user data block when the first information indicates that there is no available user data block for the first user but there is an available dynamic index data block for the first user.
[0056] The first user data block writing module is used to write the information of the available user data blocks of the first user into the static index area.
[0057] Optionally, the device further includes:
[0058] The second dynamic index creation module is used to select a data block from the data blocks to obtain the first user's available dynamic index data block when the first information indicates that there is an available user data block for the first user but there is no available dynamic index data block for the first user.
[0059] The second dynamic index writing module is used to write the information of the available dynamic index data blocks of the first user into the static index area.
[0060] Optionally, the first dynamic index creation module or the second dynamic index creation module is specifically used to select a dynamic index data block from the unfilled dynamic index data blocks when the data block includes unfilled dynamic index data blocks, to obtain the available dynamic index data block for the first user; and to select an unused data block from the data block when the data block does not include unfilled dynamic index data blocks, to obtain the available dynamic index data block for the first user.
[0061] Optionally, the first dynamic index creation module or the second dynamic index creation module is further configured to, when the data block includes an incomplete dynamic index data block, select the dynamic index data block closest to the available user data block of the first user from the incomplete dynamic index data blocks to obtain the available dynamic index data block of the first user.
[0062] Optionally, the data storage module includes:
[0063] The user data block recording submodule is used to write the user data into the available user data block of the first user when the first information indicates that there are available user data blocks and available dynamic index data blocks of the first user. During the process of writing the user's data index into the dynamic index block, if the available user data block of the first user is full, the user data block storage location information is recorded in the static index area.
[0064] The first data block selection submodule is used to select an unused data block from the data blocks to obtain the newly created available user data block for the first user.
[0065] The user data writing submodule is used to continue writing the remaining unwritten user data into the newly created available user data block of the first user.
[0066] Optionally, the data storage module includes:
[0067] The dynamic index recording submodule is used to write the user data into the first user's available user data block and the user's data index into the dynamic index block when the first information indicates the existence of the first user's available user data block and available dynamic index data block. If the available dynamic index data block is full during the process of writing the user's data index into the dynamic index block, the storage location information of the available dynamic index data block is recorded in the static index area.
[0068] The second data block selection submodule is used to select an unused data block from the data blocks to obtain the newly created available dynamic index data block for the first user.
[0069] The dynamic index writing submodule is used to continue writing the remaining unwritten data index of the user into the newly created available dynamic index data block of the first user.
[0070] Optionally, the device further includes:
[0071] A formatting request receiving module is used to receive the formatting request from the first user;
[0072] The index area information acquisition module is used to acquire information about the static index area in the shingled recording disk;
[0073] The index area information writing module is used to write the information of the static index area into the startup block and to write the initialization information into the static index block.
[0074] Optionally, the device further includes:
[0075] The deletion information receiving module is used to receive deletion information for a specified user data block;
[0076] The data block deletion module is used to mark the static index in the static index area corresponding to the specified user data block as invalid, and to mark the dynamic index in the dynamic index block corresponding to the specified user data block as invalid, based on the deletion information.
[0077] Optionally, the device further includes:
[0078] The read request receiving module is used to obtain read requests for the second user's user data;
[0079] The data block determination module is used to determine the user data block and dynamic index data block of the second user in the data block based on the information of the user data blocks and dynamic index data blocks of each user recorded in the static index area.
[0080] The user index reading module is used to read the user data index from the dynamic index data block of the second user;
[0081] The user data reading module is used to read user data from the user data block of the second user according to the user data index.
[0082] A fourth aspect of this application provides a data reading device, the device comprising:
[0083] A request receiving module is used to receive a read request sent by a third user, wherein the read request includes the filename of the file to be requested, and the file to be requested is written by any of the data writing devices described in this application;
[0084] The location identification module is used to identify the location information of the dynamic index block corresponding to the file to be requested from the static index area based on the file name of the file to be requested;
[0085] The file reading module is used to locate the corresponding dynamic index block based on the location information, read the requested file, and send the read file to the third user.
[0086] In another aspect of this application, an electronic device is provided, comprising:
[0087] Memory, used to store computer programs;
[0088] The processor, when executing a program stored in memory, implements any of the above data writing methods.
[0089] In another aspect of the embodiments of this application, a computer-readable storage medium is provided, wherein a computer program is stored therein, and the computer program, when executed by a processor, implements any of the above-described data writing methods.
[0090] This application also provides a computer program product containing instructions that, when run on a computer, cause the computer to execute any of the above-described data writing methods.
[0091] Beneficial effects of the embodiments in this application:
[0092] This application provides a data writing method, apparatus, electronic device, and storage medium applied to a shingled magnetic recording disk. The shingled magnetic recording disk includes a CMR region and an SMR region. The CMR region includes a static index area, and the SMR region includes data blocks. The method includes: obtaining a write request from a first user, wherein the write request includes user data to be written and a user data index; querying the static index area to determine first information of the first user's user data blocks and dynamic index data blocks, wherein the static index area records information of each user's user data blocks and dynamic index data blocks; and, if the first information indicates the existence of available user data blocks and available dynamic index data blocks for the first user, writing the user data into the first user's available user data blocks and writing the user's data index into the dynamic index blocks. By using the method of this application embodiment, when performing input writing, it is only necessary to determine the first information of the first user's user data block and dynamic index data block in the static index area of the CMR region. Based on the determined first information of the first user's user data block and dynamic index data block, the user data can be written into the available user data block of the first user in the SMR region, and the user data index can be written into the available dynamic index data block in the SMR region. Thus, there is no need to perform large-span offset writing when writing data, thereby improving the data writing efficiency.
[0093] Of course, implementing any product or method of this application does not necessarily require achieving all of the advantages described above at the same time. Attached Figure Description
[0094] 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 embodiments can be obtained based on these drawings.
[0095] Figure 1 A flowchart illustrating a data writing method provided in an embodiment of this application;
[0096] Figure 2 A schematic diagram of a shingled recording disk provided in an embodiment of this application;
[0097] Figure 3 A schematic diagram illustrating a process for writing data block information into a static index area, as provided in an embodiment of this application;
[0098] Figure 4 This application provides a schematic diagram of a process for writing a user's data index into a dynamic index block.
[0099] Figure 5This application provides a schematic diagram of a process for writing initialization information into a static index block.
[0100] Figure 6 A schematic flowchart of a formatting process provided for an embodiment of this application;
[0101] Figure 7 This application provides a schematic diagram of a process for writing a user's data index into a dynamic index block.
[0102] Figure 8 An example diagram of a data writing method provided in an embodiment of this application;
[0103] Figure 9 A schematic diagram of the structure of a data writing device provided in an embodiment of this application;
[0104] Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;
[0105] Figure 11 This is a schematic diagram of the structure of another electronic device provided in an embodiment of this application. Detailed Implementation
[0106] 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 based on this application are within the scope of protection of this application.
[0107] A first aspect of this application provides a data writing method applied to a shingled magnetic recording disk. The shingled magnetic recording disk includes a CMR (conventional perpendicular magnetic recording) region and an SMR (shearboard perpendicular magnetic recording) region. The CMR region includes a static index area, and the SMR region includes data blocks. See [link to previous section]. Figure 1 The above methods include:
[0108] Step S11: Obtain the write request from the first user.
[0109] In one example, the method of this application embodiment is applied to a shingled recording disk, see [link to relevant documentation]. Figure 2Shingled magnetic record (SMR) disks include a CMR region and a SMR region. The CMR region includes a boot block and a static index area, while the SMR region includes data blocks, which in turn include user data blocks and dynamic index data blocks. Specifically, the boot block records key information about the file system, including basic SMR disk information, the disk's unique identifier, the location of the static index area, the size of the static index data blocks, the location of the data area, and the size of the data blocks. Data blocks initially have no attributes, but as data is written, they gradually divide into two categories: user data blocks and dynamic index data blocks. User data blocks are used only to store user data, while dynamic index data blocks store dynamic indexes of the user data. A dynamic index block can store dynamic indexes for multiple user data blocks, but only one user data block can be stored at a time. The static index block records basic information about the data block, the basic information of the user to whom the data block belongs, and information about the dynamic index data blocks. The CMR zone supports random reads. Specifically, it obtains the start block, static index area, reserved area, static index area backup, and start block backup through CMRZONE (CMR zone) and σ. Then, it obtains σ and static index data block backup based on the static index area backup. Based on the two copies, it obtains the dynamic index data block by recording the location information of the dynamic index storage. For the SMR zone, it supports concurrency between zones, but only sequential read and write within a zone. It obtains the data block through SMEZONE (SMR zone), and then obtains the dynamic index data block from the technical data block. The user data block is obtained by recording the detailed index of the user data through the dynamic index data block.
[0110] The write request includes the user data to be written and the user data index. Specifically, the user data to be written can be any data that needs to be written to this shingled magnetic record disk, while the user data index is the index of this user data. This user data index facilitates the user's search for specific data within the user data. For example, the user data index could be the filename, time, type, etc.
[0111] Step S12: Query the static index area to determine the first information of the first user's user data block and dynamic index data block.
[0112] The static index area records information about each user's user data blocks and dynamic index data blocks. Specifically, in actual use, the static index block can record basic information about the data block, basic information about the user to whom the data block belongs, and information about the dynamic index data block. For example, when obtaining a write request from the first user and determining the first user's user data block and dynamic index data block information, the available user data blocks and available dynamic index data blocks belonging to that user can be queried from the SMR area using the static index block.
[0113] Step S13: If the first information indicates the existence of an available user data block and an available dynamic index data block for the first user, write the user data into the available user data block for the first user and write the user's data index into the dynamic index block.
[0114] The static index area records the available user data blocks and available dynamic index data blocks for each user. When determining the first user's user data block and dynamic index data block, the user data block and dynamic index data block can be directly obtained by querying the static index.
[0115] If the first information indicates the existence of available user data blocks and available dynamic index data blocks for the first user, then the user data is written to the available user data block for the first user, and the user's data index is written to the dynamic index block. There can be an association between the available user data blocks and the available dynamic index data blocks; that is, the dynamic index data block is an associated dynamic index data block of the user data block. In actual use, a user data block may belong to only one user, while the dynamic index data block may be an associated data block of multiple user data blocks, i.e., it stores the index of data from multiple user data blocks.
[0116] The method described in this application divides the data index into static index and dynamic index. The static index records key information about the data, index information that does not change with continuous data writing; this part of the data is recorded in the CMR area and only undergoes minor updates. The dynamic index records incremental indexes of user data, index information that changes with continuous data writing; this part is stored as internal data in the SMR area, with position mapping only recorded in the CMR area. This approach reduces the problem of frequent updates to the CMR area in shingled magnetic recording disks, improving the storage performance of shingled magnetic recording disks.
[0117] As can be seen, by using the method of this application embodiment, when performing input writing, it is only necessary to determine the first information of the first user's user data block and dynamic index data block in the static index area of the CMR region. Based on the determined first information of the first user's user data block and dynamic index data block, the user data can be written into the available user data block of the first user in the SMR region, and the user data index can be written into the available dynamic index data block in the SMR region. Thus, there is no need to perform large-span offset writing when writing data, thereby improving the data writing efficiency.
[0118] Optional, see Figure 3 The above methods also include:
[0119] Step S31: If the first information indicates that there are no available user data blocks and available dynamic index data blocks for the first user, select an unused data block from the data blocks to obtain the available user data block for the first user; select a data block from the data blocks to obtain the available dynamic index data block for the first user.
[0120] Step S32: Write the information of the available user data blocks and available dynamic index data blocks of the first user into the static index area.
[0121] Optionally, the above method further includes: if the first information indicates that there is no available user data block for the first user but there is an available dynamic index data block for the first user, selecting an unused data block from the data blocks to obtain the available user data block for the first user; and writing the information of the available user data block for the first user into the static index area.
[0122] Optionally, the above method further includes: if the first information indicates that there is an available user data block for the first user but there is no available dynamic index data block for the first user, selecting a data block from the data blocks to obtain the available dynamic index data block for the first user; and writing the information of the available dynamic index data block for the first user into the static index area.
[0123] In this embodiment, the SMR region can be divided into multiple data blocks, for example, each data block is a fixed 128 MB. If the first information indicates that there is no available user data block or available dynamic index data block for the first user, then a new user data block or dynamic index data block needs to be created. During creation, an unused data block can be directly selected in the SMR region and used as the newly created user data block or dynamic index data block. The information of the available dynamic index data block for the first user is written to the static index area, and the location information of the available dynamic index data block for the first user in the SMR region can be written to the static index area.
[0124] Optionally, selecting a data block from the data block to obtain the available dynamic index data block for the first user includes: if the data block includes an incomplete dynamic index data block, selecting a dynamic index data block from the incomplete dynamic index data block to obtain the available dynamic index data block for the first user; if the data block does not include an incomplete dynamic index data block, selecting an unused data block from the data block to obtain the available dynamic index data block for the first user.
[0125] Optionally, if the data block includes an incomplete dynamic index data block, selecting one dynamic index data block from the incomplete dynamic index data blocks to obtain the available dynamic index data block for the first user includes: if the data block includes an incomplete dynamic index data block, selecting the dynamic index data block closest to the available user data block for the first user from the incomplete dynamic index data blocks to obtain the available dynamic index data block for the first user.
[0126] For example, when writing data, the file first selects from the user's incomplete user data blocks. If such a block exists, it is directly allocated for data writing. If no incomplete user data block belongs to the user, a new user data block is allocated, and a dynamic index block is assigned to it. If an incomplete dynamic index block exists, a nearby dynamic index block is selected, and the mapping relationship is recorded in the static index area of the new user data block. If no incomplete dynamic index block exists, a new data block is selected as the dynamic index block. The static index area of the new dynamic index block is updated first, marking it as a dynamic index block, and then the mapping relationship is recorded in the static index area of the user data block.
[0127] Optional, see Figure 4 If the first information indicates the existence of an available user data block and an available dynamic index data block for the first user, the user data is written to the available user data block for the first user, and the user's data index is written to the dynamic index block, including:
[0128] In step S41, if the first information indicates the existence of available user data blocks and available dynamic index data blocks for the first user, the user data is written into the available user data block of the first user. During the process of writing the user's data index into the dynamic index block, if the available user data block of the first user is full, the storage location information of the user data block is recorded in the static index area.
[0129] Step S42: Select an unused data block from the data blocks to obtain the newly created available user data block for the first user;
[0130] Step S43: Continue writing the remaining unwritten user data into the newly created available user data block of the first user.
[0131] Optionally, if the first information indicates the existence of available user data blocks and available dynamic index data blocks for the first user, writing user data into the available user data blocks for the first user and writing user data indexes into the dynamic index blocks includes: if the available dynamic index data blocks are full, recording the storage location information of the available dynamic index data blocks in the static index area; selecting an unused data block from the data blocks to obtain a newly created available dynamic index data block for the first user; and continuing to write the remaining unwritten user data indexes into the newly created available dynamic index data block for the first user.
[0132] Specifically, the storage location information of user data blocks is recorded in the static index area. The entire location occupied by a user data block in the SMR area can be written into the static index area. Based on this entire location, the storage range of the user data block can be determined, facilitating the reading of available user data blocks. When selecting an unused data block to obtain a newly created available user data block for the first user, the information of this newly created available user data block can also be sent to the static index area.
[0133] Select an unused data block from the data block to obtain the newly created available dynamic index data block for the first user. You can select one of the available data blocks that are close to the user's data block as the newly created available dynamic index data block, and write the location information of the newly created available dynamic index data block into the static index area.
[0134] For example, when user data is continuously written, if the user data block is full, the valid range of the dynamic index needs to be marked in the static index area of the user data block, and simultaneously, the valid range also needs to be marked in the static index area of the dynamic index block. Then, the dynamic index block continues to be allocated for writing data. Similarly, when user data is continuously written, if the dynamic index area is full, the valid range of the dynamic index needs to be marked in the static index area of the user data block, and simultaneously, the valid range also needs to be marked in the static index area of the dynamic index block. Then, the dynamic index block continues to be allocated for writing data indexes.
[0135] Optionally, the CMR region also includes a startup block, which is used before receiving the first user's write request; see [link to relevant documentation]. Figure 5 The above methods also include:
[0136] Step S51: Receive the formatting request from the first user;
[0137] Step S52: Obtain information about the static index area in the shingled recording disk;
[0138] Step S53: Write the information of the static index area into the startup block and write the initialization information into the static index block.
[0139] For details, please refer to Figure 6 It can receive user formatting requests; then, it obtains information about the shingled magnetic disk to calculate the index area information. Specifically, it can obtain the size of the shingled disk's zone, the number of CMR zones (conventional perpendicular magnetic recording zones), and the number of SMR zones (sham-mounted perpendicular magnetic recording zones). The size of a data block is equal to the size of one SMR zone. The number of data blocks is calculated based on this, thus determining the number of static index blocks. The size of the static index area is then calculated based on the size of the static index blocks. The startup block information is written to the corresponding locations, and the initial information for each static index block is written, completing the formatting operation.
[0140] Optionally, if the first information indicates the existence of an available user data block and an available dynamic index data block for the first user, the user data is written to the available user data block for the first user, and the user's data index is written to the dynamic index block. See [link to relevant documentation]. Figure 7 The above methods also include:
[0141] Step S71: Receive deletion information for the specified user data block;
[0142] Step S72: Based on the deletion information, mark the static index in the static index area corresponding to the specified user data block as invalid, and mark the dynamic index in the dynamic index block corresponding to the specified user data block as invalid.
[0143] Specifically, when a user's data block is deleted, it is only necessary to mark the static index of the user's data block as invalid, and at the same time mark the relevant areas of the static index region of the dynamic index block allocated to that user's data block as invalid. When all areas in the dynamic index block are marked as invalid, the dynamic index block itself also needs to be marked as invalid.
[0144] Optionally, if the first information indicates the existence of available user data blocks and available dynamic index data blocks for the first user, after writing user data into the available user data block for the first user and writing the user's data index into the dynamic index block, the method further includes: obtaining a read request for user data from the second user; determining the user data block and dynamic index data block for the second user in the data block based on the information of user data blocks and dynamic index data blocks for each user recorded in the static index area; reading the user data index from the dynamic index data block of the second user; and reading user data from the user data block of the second user based on the user data index. When the user reads data, the static index can be read to locate the position information of the dynamic index area and the position information of the data block, and then the dynamic index can be read to retrieve the data required by the user and return it to the user.
[0145] To illustrate the solutions of the embodiments of this application, the following description is provided in conjunction with specific examples. (See also...) Figure 8 The specific steps include:
[0146] 1. User requests to write data.
[0147] 2. The file system first selects from the incomplete user data blocks belonging to the current user. If such blocks exist, they are directly allocated for data writing. Proceed to step 6.
[0148] 3. If there is no unused user data block belonging to the user, allocate a new user data block and then allocate a dynamic index block for that data block.
[0149] 4. If there are any incomplete dynamic index blocks, select a dynamic index block from the nearest position and then record the mapping relationship in the static index area of the new user data block.
[0150] 5. If there are no incomplete dynamic index blocks, select a new data block as the dynamic index block, first update the static index area of the new dynamic index block, mark the block as a dynamic index block, and then record the mapping relationship in the static index area of the user data block.
[0151] 6. When writing user data, write the user data to the user data block and write the user data index, such as file name, time, type, etc., to the dynamic index area.
[0152] 7. When continuously writing user data, if the user data block is full, the valid range of the dynamic index needs to be marked in the static index area of the user data block, and the valid range also needs to be marked in the static index area of the dynamic index block. Then, continue to allocate user data blocks for writing.
[0153] 8. When user data is continuously written, if the dynamic index area is full, the valid range of the dynamic index also needs to be marked in the static index area of the user data block. Then, the dynamic index block continues to be allocated for writing data indexes.
[0154] A second aspect of this application provides a data reading method, the method comprising: receiving a reading request sent by a third user, wherein the reading request includes the filename of a file to be requested, the file to be requested being written by any of the above data writing methods; identifying the location information of a dynamic index block corresponding to the file to be requested from a static index area based on the filename of the file to be requested; searching for the corresponding dynamic index block based on the location information, reading the file to be requested, and sending the read file to the third user.
[0155] The data reading method in this embodiment is used during reading after data has been written using any of the above-described data writing methods. Specifically, the data reading process in this embodiment can be the reverse of the data writing process described above. The requested file is written using any of the above-described data writing methods. Based on the filename of the requested file, the location information of the dynamic index block corresponding to the requested file is identified from the static index area. Since user data is written to the available user data block of the first user and the user's data index is written to the dynamic index block during data writing, identifying the location information of the dynamic index block corresponding to the requested file from the static index area based on the filename allows for querying the location information of the dynamic index block corresponding to the requested file from the static index area based on the filename. This allows for locating the corresponding dynamic index block based on the queried location information and reading the file, then returning the read file to the user.
[0156] A third aspect of this application provides a data writing apparatus applied to a shingled magnetic recording disk. The shingled magnetic recording disk includes a CMR region and an SMR region. The CMR region includes a static index area, and the SMR region includes data blocks. See [link to previous section] Figure 9 The aforementioned device includes:
[0157] The request receiving module 901 is used to obtain the write request of the first user, wherein the write request includes the user data to be written and the user data index;
[0158] The information query module 902 is used to query the static index area to determine the first information of the user data block and the dynamic index data block of the first user. The static index area records the information of the user data block and the dynamic index data block of each user.
[0159] The data storage module 903 is used to write user data into the available user data block of the first user and write the user's data index into the dynamic index block when the first information indicates that there is an available user data block and an available dynamic index data block for the first user.
[0160] Optionally, the above-mentioned device further includes:
[0161] The first dynamic index creation module is used to select an unused data block from the data blocks to obtain the first user's available user data block, and to select a data block from the data blocks to obtain the first user's available dynamic index data block, when the first information indicates that there are no available user data blocks and available dynamic index data blocks for the first user.
[0162] The first dynamic index writing module is used to write the information of the first user's available user data blocks and available dynamic index data blocks into the static index area.
[0163] Optionally, the above-mentioned device further includes:
[0164] The first user data block creation module is used to select an unused data block from the data blocks to obtain the first user's available user data block when the first information indicates that there is no available user data block for the first user but there is an available dynamic index data block for the first user.
[0165] The first user data block writing module is used to write the information of the available user data blocks of the first user into the static index area.
[0166] Optionally, the above-mentioned device further includes:
[0167] The second dynamic index creation module is used to select a data block from the data blocks to obtain the first user's available dynamic index data block when the first information indicates that there is an available user data block for the first user but there is no available dynamic index data block for the first user.
[0168] The second dynamic index writing module is used to write the information of the available dynamic index data blocks of the first user into the static index area.
[0169] Optionally, the first dynamic index creation module or the second dynamic index creation module is specifically used to select a dynamic index data block from the unfilled dynamic index data blocks when the data block includes unfilled dynamic index data blocks, to obtain the available dynamic index data block for the first user; and to select an unused data block from the data block when the data block does not include unfilled dynamic index data blocks, to obtain the available dynamic index data block for the first user.
[0170] Optionally, the first dynamic index creation module or the second dynamic index creation module is further configured to, when the data block includes an incomplete dynamic index data block, select the dynamic index data block that is closest to the available user data block of the first user from the incomplete dynamic index data blocks to obtain the available dynamic index data block of the first user.
[0171] Optional, the data storage module includes:
[0172] The user data block recording submodule is used to write user data into the available user data block of the first user and write the user's data index into the dynamic index block when the first information indicates that there are available user data blocks and available dynamic index data blocks of the first user. If the available user data block of the first user is full during the process of writing the user's data index into the dynamic index block, the user data block storage location information is recorded in the static index area.
[0173] The first data block selection submodule is used to select an unused data block from the data blocks to obtain the newly created available user data block for the first user;
[0174] The user data writing submodule is used to continue writing the remaining unwritten user data into the newly created available user data block of the first user.
[0175] Optional, the data storage module includes:
[0176] The dynamic index recording submodule is used to write user data into the first user's available user data block and to write the user's data index into the dynamic index block when the first information indicates that there is an available user data block and an available dynamic index data block for the first user. If the available dynamic index data block is full during the process of writing the user's data index into the dynamic index block, the storage location information of the available dynamic index data block is recorded in the static index area.
[0177] The second data block selection submodule is used to select an unused data block from the data blocks to obtain the newly created available dynamic index data block for the first user;
[0178] The dynamic index writing submodule is used to continue writing the remaining unwritten user data indexes into the newly created available dynamic index data block for the first user.
[0179] Optionally, the above-mentioned device further includes:
[0180] The formatting request receiving module is used to receive formatting requests from the first user.
[0181] The index area information acquisition module is used to acquire information about the static index area in the shingled record disk;
[0182] The index area information writing module is used to write the information of the static index area into the startup block and write the initialization information into the static index block.
[0183] Optionally, the above-mentioned device further includes:
[0184] The deletion information receiving module is used to receive deletion information for a specified user data block;
[0185] The data block deletion module is used to mark the static index in the static index area corresponding to the specified user data block as invalid, and to mark the dynamic index in the dynamic index block corresponding to the specified user data block as invalid, based on the deletion information.
[0186] Optionally, the above-mentioned device further includes:
[0187] The read request receiving module is used to obtain read requests for the second user's user data;
[0188] The data block determination module is used to determine the user data block and dynamic index data block of the second user in the data block based on the information of the user data blocks and dynamic index data blocks of each user recorded in the static index area.
[0189] The user index reading module is used to read the user data index from the dynamic index data block of the second user;
[0190] The user data reading module is used to read user data from the user data block of the second user according to the user data index.
[0191] A fourth aspect of the embodiments of this application provides a data reading device, the device comprising:
[0192] The request receiving module is used to receive a read request sent by a third user, wherein the read request includes the filename of the file to be requested, and the file to be requested is written by any of the above-mentioned data writing devices;
[0193] The location recognition module is used to identify the location information of the dynamic index block corresponding to the file to be requested from the static index area based on the file name of the file to be requested;
[0194] The file reading module is used to locate the corresponding dynamic index block based on the location information, read the requested file, and send the read file to a third user.
[0195] As can be seen, with the apparatus of this application embodiment, when performing input writing, it is only necessary to determine the first information of the first user's user data block and dynamic index data block in the static index area of the CMR region. Based on the determined first information of the first user's user data block and dynamic index data block, the user data can be written into the available user data block of the first user in the SMR region, and the user data index can be written into the available dynamic index data block in the SMR region. Thus, there is no need to perform large-span offset writing when writing data, thereby improving the data writing efficiency.
[0196] This application also provides an electronic device, such as... Figure 10 As shown, it includes:
[0197] Memory 1001 is used to store computer programs;
[0198] When processor 1002 executes a program stored in memory 1001, it performs the following steps:
[0199] Obtain the write request of the first user, wherein the write request includes the user data to be written and the user data index;
[0200] The static index area is queried to determine the first information of the user data block and dynamic index data block of the first user. The static index area records the information of the user data block and dynamic index block of each user.
[0201] If the first information indicates the existence of a usable user data block and a usable dynamic index data block for the first user, the user data is written to the usable user data block for the first user, and the user's data index is written to the dynamic index block.
[0202] Obtain the write request of the first user, wherein the write request includes the user data to be written and the user data index;
[0203] The static index area is queried to determine the first information of the user data block and dynamic index data block of the first user. The static index area records the information of the user data block and dynamic index block of each user.
[0204] If the first information indicates the existence of a usable user data block and a usable dynamic index data block for the first user, the user data is written to the usable user data block for the first user, and the user's data index is written to the dynamic index block.
[0205] Furthermore, the aforementioned electronic device may also include a communication bus and / or a communication interface, with the processor 1002, the communication interface, and the memory 1001 communicating with each other via the communication bus.
[0206] This application also provides an electronic device, such as... Figure 11As shown, it includes:
[0207] Memory 1101 is used to store computer programs;
[0208] When processor 1102 executes the program stored in memory 1101, it performs the following steps:
[0209] Receive a read request sent by a third user, wherein the read request includes the filename of the file to be requested, and the file to be requested is written using any of the above data writing methods;
[0210] Based on the filename of the file to be requested, identify the location information of the dynamic index block corresponding to the file to be requested from the static index area;
[0211] The system locates the corresponding dynamic index block based on the location information, reads the requested file, and sends the read file to the third user.
[0212] Furthermore, the aforementioned electronic device may also include a communication bus and / or a communication interface, with the processor 1102, the communication interface, and the memory 1101 communicating with each other via the communication bus.
[0213] The communication bus mentioned in the above electronic devices can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.
[0214] The communication interface is used for communication between the aforementioned electronic devices and other devices.
[0215] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0216] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0217] In another embodiment provided in this application, a computer-readable storage medium is also provided, which stores a computer program that, when executed by a processor, implements the steps of any of the above-described data writing methods.
[0218] In another embodiment provided in this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute any of the data writing methods described above.
[0219] In another embodiment provided in this application, a computer-readable storage medium is also provided, which stores a computer program that, when executed by a processor, implements the steps of any of the above-described data reading methods.
[0220] In another embodiment provided in this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to perform any of the data reading methods described above.
[0221] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)).
[0222] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0223] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments of apparatus, electronic devices, storage media, and computer program products are basically similar to the method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0224] The above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application are included within the scope of protection of this application.
Claims
1. A data writing method, characterized in that, The method is applied to shingled recording disks, wherein the shingled recording disk includes a CMR region and an SMR region, the CMR region includes a static index area, and the SMR region includes data blocks. Obtain the write request of the first user, wherein the write request includes the user data to be written and the user data index; The static index area is queried to determine the first information of the user data block and dynamic index data block of the first user, wherein the static index area records the information of the user data block and dynamic index data block of each user; If the first information indicates the existence of an available user data block and an available dynamic index data block for the first user, the user data is written into the available user data block for the first user, and the user's data index is written into the dynamic index data block.
2. The method according to claim 1, characterized in that, The method further includes: If the first information indicates that there are no available user data blocks and available dynamic index data blocks for the first user, then an unused data block is selected from the data blocks to obtain the available user data block for the first user; and a data block is selected from the data blocks to obtain the available dynamic index data block for the first user. The information of the available user data blocks and available dynamic index data blocks of the first user is written into the static index area.
3. The method according to claim 1, characterized in that, The method further includes: If the first information indicates that there is no available user data block for the first user but there is an available dynamic index data block for the first user, then an unused data block is selected from the data blocks to obtain the available user data block for the first user. Write the information of the available user data blocks of the first user into the static index area.
4. The method according to claim 1, characterized in that, The method further includes: If the first information indicates that there is an available user data block for the first user but no available dynamic index data block for the first user, then select a data block from the data blocks to obtain the available dynamic index data block for the first user. Write the information of the available dynamic index data blocks of the first user into the static index area.
5. The method according to claim 2 or 4, characterized in that, The step of selecting a data block from the data blocks to obtain the available dynamic index data block for the first user includes: If the data block includes an incomplete dynamic index data block, select one dynamic index data block from the incomplete dynamic index data blocks to obtain the available dynamic index data block for the first user. If the data block does not include a partially filled dynamic index data block, an unused data block is selected from the data block to obtain the available dynamic index data block for the first user.
6. The method according to claim 5, characterized in that, When the data block includes an incomplete dynamic index data block, selecting one dynamic index data block from the incomplete dynamic index data blocks to obtain the available dynamic index data block for the first user includes: If the data block includes an incomplete dynamic index data block, the dynamic index data block closest to the available user data block of the first user is selected from the incomplete dynamic index data blocks to obtain the available dynamic index data block of the first user.
7. The method according to claim 1, characterized in that, When the first information indicates the existence of an available user data block and an available dynamic index data block for the first user, writing the user data into the available user data block for the first user and writing the user's data index into the dynamic index data block includes: When the first information indicates the existence of available user data blocks and available dynamic index data blocks for the first user, the user data is written into the available user data block of the first user, and the user's data index is written into the dynamic index data block. If the available user data block of the first user is full, the storage location information of the user data block is recorded in the static index area. Select an unused data block from the data blocks to obtain the newly created available user data block for the first user; Continue writing the remaining unwritten user data into the newly created available user data block for the first user.
8. The method according to claim 1, characterized in that, When the first information indicates the existence of an available user data block and an available dynamic index data block for the first user, writing the user data into the available user data block for the first user and writing the user's data index into the dynamic index data block includes: When the first information indicates the existence of an available user data block and an available dynamic index data block for the first user, the user data is written into the available user data block of the first user, and the user's data index is written into the dynamic index data block. If the available dynamic index data block is full, the storage location information of the available dynamic index data block is recorded in the static index area. Select an unused data block from the data blocks to obtain the newly created and available dynamic index data block for the first user; The remaining unwritten data indexes of the user will continue to be written into the newly created available dynamic index data block of the first user.
9. The method according to claim 1, characterized in that, The CMR region further includes a startup block, and before obtaining the write request from the first user, the method further includes: Receive the formatting request from the first user; Obtain information about the static index area in the shingled recording disk; The information of the static index area is written into the startup block, and the initialization information is written into the static index block.
10. The method according to claim 1, characterized in that, When the first information indicates the existence of an available user data block and an available dynamic index data block for the first user, after writing the user data into the available user data block of the first user and writing the user's data index into the dynamic index data block, the method further includes: Receive deletion information for a specified user's data block; Based on the deletion information, the static index in the static index area corresponding to the specified user data block is marked as invalid, and the dynamic index in the dynamic index data block corresponding to the specified user data block is marked as invalid.
11. The method according to claim 1, characterized in that, When the first information indicates the existence of an available user data block and an available dynamic index data block for the first user, after writing the user data into the available user data block of the first user and writing the user's data index into the dynamic index data block, the method further includes: A request to retrieve the user data of the second user; Based on the information of each user's user data block and dynamic index data block recorded in the static index area, determine the user data block and dynamic index data block of the second user in the data block; Read the user data index from the dynamic index data block of the second user; User data is read from the user data block of the second user according to the user data index.
12. A data reading method, characterized in that, The method includes: Receive a read request sent by a third user, wherein the read request includes the filename of the file to be requested, and the file to be requested is written by the method described in any one of claims 1-11; Based on the filename of the file to be requested, identify the location information of the dynamic index data block corresponding to the file to be requested from the static index area; The system locates the corresponding dynamic index data block based on the location information, reads the requested file, and sends the read file to the third user.
13. A data writing device, characterized in that, An apparatus for use with shingled recording disks, the shingled recording disk including a CMR region and an SMR region, the CMR region including a static index area, the SMR region including data blocks, the apparatus comprising: The request receiving module is used to obtain the write request of the first user, wherein the write request includes user data to be written and user data index; The information query module is used to query the static index area to determine the first information of the user data block and dynamic index data block of the first user, wherein the static index area records the information of the user data block and dynamic index data block of each user; The data storage module is used to write the user data into the first user's available user data block and the user's data index into the dynamic index data block when the first information indicates the existence of the first user's available user data block and available dynamic index data block.
14. The apparatus according to claim 13, characterized in that, The device further includes: The first dynamic index creation module is used to select an unused data block from the data blocks to obtain the first user's available user data block when the first information indicates that there are no available user data blocks and available dynamic index data blocks for the first user; and to select a data block from the data blocks to obtain the first user's available dynamic index data block. The first dynamic index writing module is used to write the information of the first user's available user data blocks and available dynamic index data blocks into the static index area. The first user data block creation module is used to select an unused data block from the data blocks to obtain the first user's available user data block when the first information indicates that there is no available user data block for the first user but there is an available dynamic index data block for the first user. The first user data block writing module is used to write the information of the available user data blocks of the first user into the static index area; The second dynamic index creation module is used to select a data block from the data blocks to obtain the first user's available dynamic index data block when the first information indicates that there is an available user data block for the first user but there is no available dynamic index data block for the first user. The second dynamic index writing module is used to write the information of the available dynamic index data blocks of the first user into the static index area; The first dynamic index creation module or the second dynamic index creation module is specifically used to select a dynamic index data block from the unfilled dynamic index data blocks when the data block includes unfilled dynamic index data blocks, to obtain the available dynamic index data block for the first user; and to select an unused data block from the data block when the data block does not include unfilled dynamic index data blocks, to obtain the available dynamic index data block for the first user. The first dynamic index creation module or the second dynamic index creation module is further configured to, when the data block includes an incomplete dynamic index data block, select the dynamic index data block that is closest to the available user data block of the first user from the incomplete dynamic index data blocks, and obtain the available dynamic index data block of the first user. The user data block recording submodule is used to write the user data into the available user data block of the first user when the first information indicates that there are available user data blocks and available dynamic index data blocks of the first user. During the process of writing the user's data index into the dynamic index data block, if the available user data block of the first user is full, the user data block storage location information is recorded in the static index area. The first data block selection submodule is used to select an unused data block from the data blocks to obtain the newly created available user data block for the first user. The user data writing submodule is used to continue writing the remaining unwritten user data into the newly created available user data block of the first user; The dynamic index recording submodule is used to write the user data into the first user's available user data block and the user's data index into the dynamic index data block when the first information indicates the existence of the first user's available user data block and available dynamic index data block. If the available dynamic index data block is full during the process of writing the user's data index into the dynamic index data block, the storage location information of the available dynamic index data block is recorded in the static index area. The second data block selection submodule is used to select an unused data block from the data blocks to obtain the newly created available dynamic index data block for the first user. The dynamic index writing submodule is used to continue writing the remaining unwritten data index of the user into the newly created available dynamic index data block of the first user; A formatting request receiving module is used to receive the formatting request from the first user; The index area information acquisition module is used to acquire information about the static index area in the shingled recording disk; The index area information writing module is used to write the information of the static index area into the startup block and write the initialization information into the static index block; The deletion information receiving module is used to receive deletion information for a specified user data block; The data block deletion module is used to mark the static index in the static index area corresponding to the specified user data block as invalid, and mark the dynamic index in the dynamic index data block corresponding to the specified user data block as invalid, based on the deletion information. The read request receiving module is used to obtain read requests for the second user's user data; The data block determination module is used to determine the user data block and dynamic index data block of the second user in the data block based on the information of the user data blocks and dynamic index data blocks of each user recorded in the static index area. The user index reading module is used to read the user data index from the dynamic index data block of the second user; The user data reading module is used to read user data from the user data block of the second user according to the user data index.
15. A data reading device, characterized in that, The device includes: A request receiving module is configured to receive a read request sent by a third user, wherein the read request includes the filename of the file to be requested, and the file to be requested is written by the device according to any one of claims 13 or 14; The location identification module is used to identify the location information of the dynamic index data block corresponding to the file to be requested from the static index area based on the file name of the file to be requested; The file reading module is used to locate the corresponding dynamic index data block based on the location information, read the requested file, and send the read file to the third user.
16. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the method of any one of claims 1-11 or 12.
17. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method described in any one of claims 1-11 or 12.