Data migration method, system and equipment and storage medium

By obtaining power-off location information in the SSD and controlling data migration, it avoids reading data within the range of the power-off location during the data migration process, solves the device host business abnormality problem caused by SSD data migration, and reduces the impact of data migration on the device. Host impact.

CN118550467APending Publication Date: 2024-08-27HANGZHOU HIKSTORAGE TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410674373.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-28
Publication Date
2024-08-27

AI Technical Summary

Technical Problem

During the data migration process in a solid-state drive (SSD), a power outage event causes the loss of data blocks, resulting in device host business abnormalities, such as video buffer overflow and other problems. The existing technology requires reading each data read-write unit during data migration. Fetching and error correction occupy bandwidth and increase delay.

Method used

The device host reads the data reading and writing unit of the data block in the SSD where the power-off event occurs, and obtains the pre-stored power-off location information to determine whether the data reading and writing unit is within the range of the power-off location. If it is not within the range, the data reading and writing unit will be The data is migrated to the second data block where no power-off event occurs, to avoid data reading of the data reading and writing units located within the power-off position range.

Benefits of technology

It reduces the impact of the SSD data migration process on the device host business, avoids error correction when reading data within the power-off position, reduces available bandwidth decline and device host business delays, and prevents business abnormalities from occurring.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118550467A
    Figure CN118550467A
Patent Text Reader

Abstract

The embodiment of the invention discloses a data migration method and system, equipment and a storage medium, which are used for solving the problem that when data migration is carried out on data blocks in an SSD (Solid State Disk) in related technologies, the host business of the equipment is easy to be abnormal. The method comprises the following steps: reading a data read-write unit of a first data block in a solid state disk (SSD); the SSD comprises a plurality of data blocks; the first data block is a data block with a power failure event in the plurality of data blocks; obtaining pre-stored power-down position information of the first data block; according to the power-down position information, determining whether the data read-write unit is located in a power-down position range indicated by the power-down position information; under the condition that the data read-write unit is not located in the power-down position range, migrating data in the data read-write unit to a second data block in the SSD; the second data block is a data block which does not generate a power failure event in the plurality of data blocks. According to the technical scheme, the influence of the data migration process in the SSD on the equipment host service is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a data migration method, system, device and storage medium. Background Art

[0002] SSD (Solid State Drive) is a device used to store user data. As people's storage requirements for various devices become higher and higher, SSD applications are becoming more and more widespread. For example, SSD can be used in NVR (Network Video Recorder) or DVR (Digital Video Recorder).

[0003] It is normal for NVR (or DVR) to encounter power outages during operation. When a power outage occurs in the NVR (or DVR), the data block currently being programmed in the SSD will lose some data, and the location of this data is the power outage location. In related technologies, during the data migration process of the data block where the power outage occurs in the SSD, the SSD will read each data read and write unit in the data block in turn. When the SSD reads the power outage location, it will enter exception processing and perform a large amount of error correction, which not only occupies a large bandwidth, resulting in a decrease in available bandwidth, but also increases the delay of the NVR (or DVR) service, which can easily lead to abnormalities in the NVR (or DVR) service, such as video cache overflow.

[0004] Therefore, how to reduce the impact of the data migration process in the SSD on the device host business has become a technical problem that needs to be solved urgently in this field. Summary of the invention

[0005] The purpose of the embodiments of the present application is to provide a data migration method, system, device and storage medium to solve the problem that in the related technology, when migrating data blocks in an SSD, abnormalities in the device host service may occur.

[0006] To solve the above technical problems, the embodiments of the present application are implemented as follows:

[0007] On the one hand, an embodiment of the present application provides a data migration method, including:

[0008] A data reading and writing unit for reading a first data block in a solid state drive (SSD); the SSD comprises a plurality of data blocks; the first data block is a data block in which a power failure event occurs among the plurality of data blocks;

[0009] Acquire pre-stored power-off position information of the first data block;

[0010] According to the power-off position information, determining whether the data read-write unit is located within a power-off position range indicated by the power-off position information;

[0011] When the data read / write unit is not located within the power-off position range, data in the data read / write unit is migrated to a second data block in the SSD; the second data block is a data block in the plurality of data blocks where no power-off event occurs.

[0012] On the other hand, an embodiment of the present application provides a data migration system, including a device host and a solid state drive SSD, wherein the SSD includes a plurality of data blocks; the device host and the SSD are connected; wherein:

[0013] The SSD is used to determine the power failure position information of the first data block where the power failure event occurs when a power failure event occurs; and send the power failure position information to the device host; the first data block is a data block where the power failure event occurs among the multiple data blocks;

[0014] The device host is used to store the power-off position information; read the data read-write unit of the first data block; determine whether the data read-write unit is located within the power-off position range indicated by the power-off position information according to the power-off position information; if the data read-write unit is not located within the power-off position range, migrate the data in the data read-write unit to a second data block in the SSD; the second data block is a data block among the multiple data blocks where no power-off event has occurred.

[0015] On the other hand, an embodiment of the present application provides a data migration device, including a processor; and a memory arranged to store computer executable instructions, wherein the computer executable instructions are configured to be executed by the processor, and the computer executable instructions are executed by the processor to implement the above-mentioned data migration method.

[0016] On the other hand, an embodiment of the present application provides a storage medium for storing computer-executable instructions, which implement the above-mentioned data migration method when executed by a processor.

[0017] On the other hand, an embodiment of the present application provides a computer program product, which includes a computer program, and the computer program implements the above-mentioned data migration method when executed by a processor.

[0018] By adopting the technical solution of the embodiment of the present application, the data read and write unit of the first data block in the solid-state hard disk SSD where a power failure event occurs is read through the device host, and the power failure position information of the first data block stored in advance is obtained, so as to determine whether the data read and write unit is located within the power failure position range indicated by the power failure position information based on the power failure position information. If the data read and write unit is not located within the power failure position range, the data in the data read and write unit is migrated to the second data block in the SSD where no power failure event occurs. It can be seen that in this technical solution, the device host manages the power-off position information of the data blocks where the power-off event occurs in the SSD, and the device host controls the data migration of the data blocks where the power-off event occurs in the SSD. During the data migration process, the data migration operation can be performed only on the data in the data read-write units that are not within the power-off position range indicated by the power-off position information, thereby avoiding the reading of data in the data read-write units within the power-off position range, thereby avoiding a large number of error corrections when reading data in the data read-write units within the power-off position range, resulting in a decrease in available bandwidth and excessive delay in the device host service, further leading to abnormal problems in the device host service, and reducing the impact of the data migration process in the SSD on the device host service. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0020] Figure 1 is a schematic block diagram of a data migration system according to an embodiment of the present application;

[0021] Figure 2 is a schematic flow chart of a data migration method according to an embodiment of the present application;

[0022] Figure 3 is a schematic flow chart of a method for determining power-off position information according to an embodiment of the present application;

[0023] Figure 4 is a schematic block diagram of a data reading and writing unit in a first data block according to an embodiment of the present application;

[0024] Figure 5 is a schematic block diagram of a data reading and writing unit in a first data block according to another embodiment of the present application;

[0025] Figure 6 is a schematic flow chart of a method for determining power-off position information according to another embodiment of the present application;

[0026] Figure 7 is a schematic flow chart of a data migration method according to another embodiment of the present application;

[0027] Figure 8 is a schematic flow chart of a data migration method according to another embodiment of the present application;

[0028] Fig. 9 is a schematic flow chart of a data migration method according to another embodiment of the present application;

[0029] Fig.10 It is a schematic block diagram of a data migration device according to an embodiment of the present application. DETAILED DESCRIPTION

[0030] The embodiments of the present application provide a data migration method, system, device and storage medium to solve the problem in the related art that when migrating data blocks in an SSD, abnormalities in device host services may occur.

[0031] In order to enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this application.

[0032] Figure 1 is a schematic block diagram of a data migration system according to an embodiment of the present application, such as Figure 1 As shown, the data migration system includes a device host 110 and a solid state drive SSD, and the device host 110 is connected to the SSD. The SSD includes multiple data blocks.

[0033] In actual applications, the device host 110 may be connected to multiple SSDs respectively to store different business data in the same or different SSDs. Figure 1 Schematically shows the connection relationship between n SSDs (including SSD1, SSD2...SSDn) and the device host 110.

[0034] In this embodiment, the SSD is used to determine the power failure location information of the first data block where the power failure event occurs, and send the power failure location information to the device host 110. The first data block is a data block where the power failure event occurs among multiple data blocks.

[0035] In this embodiment, the device host 110 is used to store the power-off position information, read the data read-write unit of the first data block, and thereby determine whether the data read-write unit is located within the power-off position range indicated by the power-off position information according to the power-off position information. If the data read-write unit is not located within the power-off position range, the data in the data read-write unit is migrated to the second data block in the SSD. The second data block is a data block in the plurality of data blocks where no power-off event has occurred.

[0036] In one embodiment, the data block may be a Block, which is the smallest erase unit in the SSD. Before writing data, the SSD must first erase the data in units of Blocks and then write the data. The data read and write unit may be a Page, each Block contains multiple Pages, and Page is the component unit of Block and the smallest read and write unit in the SSD.

[0037] The following describes the specific operations performed by the device host 110 and the solid state drive SSD in the data migration system during the data migration process. Figure 2 is a schematic flow chart of a data migration method according to an embodiment of the present application, which can be applied to the device host 110, such as Figure 2 As shown, the method may include:

[0038] S202, reading a data reading and writing unit of a first data block in a solid state drive SSD.

[0039] The SSD includes multiple data blocks. The first data block is a data block in which a power failure event occurs among the multiple data blocks. During the process of performing a data migration operation on the data blocks in the SSD, the device host can read the data read and write units in sequence according to the arrangement order of the data read and write units.

[0040] S204: Acquire pre-stored power-off position information of the first data block.

[0041] Optionally, the power-off position information of the first data block may be stored in a database of the device host.

[0042] S206: Determine, according to the power-off position information, whether the data reading and writing unit is located within the power-off position range indicated by the power-off position information.

[0043] Optionally, the power-off position information of the first data block where the power-off event occurs may include: position information of the first data block, and position information of the data read / write unit that has powered off in the first data block (ie, the power-off position range in the first data block).

[0044] S208 , when the data read / write unit is not located within the power-off position range, migrate the data in the data read / write unit to a second data block in the SSD.

[0045] The second data block is a data block in which no power failure event occurs among the multiple data blocks.

[0046] In one embodiment, when the data read / write unit is located within the power-off position range, invalid data may be generated by the device host, thereby writing the invalid data into the second data block.

[0047] By adopting the technical solution of the embodiment of the present application, the data read and write unit of the first data block in the solid-state hard disk SSD where a power failure event occurs is read through the device host, and the power failure position information of the first data block stored in advance is obtained, so as to determine whether the data read and write unit is located within the power failure position range indicated by the power failure position information based on the power failure position information. If the data read and write unit is not located within the power failure position range, the data in the data read and write unit is migrated to the second data block in the SSD where no power failure event occurs. It can be seen that in this technical solution, the device host manages the power-off position information of the data blocks where the power-off event occurs in the SSD, and the device host controls the data migration of the data blocks where the power-off event occurs in the SSD. During the data migration process, the data migration operation can be performed only on the data in the data read-write units that are not within the power-off position range indicated by the power-off position information, thereby avoiding the reading of data in the data read-write units within the power-off position range, thereby avoiding a large number of error corrections when reading data in the data read-write units within the power-off position range, resulting in a decrease in available bandwidth and excessive delay in the device host service, further leading to abnormal problems in the device host service, and reducing the impact of the data migration process in the SSD on the device host service.

[0048] In one embodiment, before reading the data read / write unit of the first data block in the solid state drive SSD (ie, S202), a power failure location information acquisition instruction may be sent to the SSD, thereby receiving the power failure location information of the first data block sent by the SSD, and then storing the power failure location information.

[0049] The power-off position information of the first data block where the power-off event occurs is determined by the SSD based on the power-off position information acquisition instruction, and the specific process of the SSD determining the power-off position information will be described in detail in the following embodiments. Optionally, the SSD can determine the power-off position information of the first data block based on the power-off position information acquisition instruction, or can directly send the power-off position information determined within a specified time period to the device host based on the power-off position information acquisition instruction, which is not limited in this embodiment.

[0050] In this embodiment, the device host obtains the power failure location information of the first data block where the power failure event occurs from the SSD, and records the power failure location information, providing a data basis for the device host to better control the data block where the power failure event occurs in the SSD for data migration.

[0051] In one embodiment, the data reading and writing unit for reading the first data block in the solid state drive SSD (ie, S202) may be executed as follows: when the device host satisfies a preset migration condition, the data reading and writing unit for reading the first data block.

[0052] The preset migration conditions may include: the CPU (Central Processing Unit) occupancy rate of the device host is less than or equal to a first preset threshold; and / or the cache overflow probability of the device host is less than or equal to a second preset threshold.

[0053] In this embodiment, it is possible to determine whether the device host meets the preset migration condition based on the CPU occupancy information and / or cache information of the device host. Specifically, when the preset migration condition includes that the CPU occupancy ratio of the device host is less than or equal to the first preset threshold, after determining the CPU occupancy information of the device host, the current CPU occupancy ratio can be calculated, and then the calculated CPU occupancy ratio is compared with the first preset threshold. When the calculated CPU occupancy ratio is less than or equal to the first preset threshold, it is determined that the device host meets the preset migration condition. When the calculated CPU occupancy ratio is greater than the first preset threshold, it is determined that the device host does not meet the preset migration condition.

[0054] In the case where the preset migration condition includes that the cache overflow probability of the device host is less than or equal to the second preset threshold, the current cache overflow probability can be calculated after determining the cache information of the device host, and the calculated cache overflow probability is compared with the second preset threshold, and when the calculated cache overflow probability is less than or equal to the second preset threshold, it is determined that the device host meets the preset migration condition. In the case where the calculated cache overflow probability is greater than the second preset threshold, it is determined that the device host does not meet the preset migration condition.

[0055] In the case where the preset migration conditions include the CPU occupancy ratio of the device host being less than or equal to the first preset threshold, and the cache overflow probability of the device host being less than or equal to the second preset threshold, it is necessary to respectively calculate the current CPU occupancy ratio and the current cache overflow probability after determining the CPU occupancy information and cache information of the device host, and then compare them with the corresponding preset thresholds respectively. In the case where both are less than or equal to the corresponding preset thresholds, it can be determined that the device host meets the preset migration conditions. In other cases (such as both are greater than the corresponding preset thresholds; one of the two is greater than the corresponding preset threshold, and the other is less than or equal to the corresponding preset threshold; etc.), it can be determined that the device host does not meet the preset migration conditions.

[0056] In this embodiment, the CPU occupancy rate and cache overflow probability of the device host can intuitively reflect whether the device host business is busy. The technical solution starts to execute the data migration operation for the data block where the power failure event occurs in the SSD when the CPU occupancy rate of the device host is less than or equal to the first preset threshold value, and / or the cache overflow probability of the device host is less than or equal to the second preset threshold value. This realizes the effect of controlling the data migration operation for the data block where the power failure event occurs according to the busyness of the device host business, which is beneficial to reducing the impact of the data migration process in the SSD on the device host business.

[0057] In one embodiment, when the data read and write unit is not located within the power-off position range, before migrating the data in the data read and write unit to the second data block in the SSD (i.e., S208), or before writing invalid data to the second data block, the second data block in the SSD can be determined through the following steps A1-A3.

[0058] Step A1: determine a data block in the SSD that is not powered off according to the location information of the first data block.

[0059] The power-off position information of the pre-stored first data block obtained by the device host in S204 includes the position information of the first data block. According to the position information of the first data block and the multiple data blocks included in the SSD, the data blocks in the SSD where the power-off event did not occur can be accurately determined, that is, the data blocks that did not experience the power-off event.

[0060] Step A2: If there is only one data block that has not been powered off, determine that the data block that has not been powered off is the second data block.

[0061] Step A3: if there are multiple data blocks that have not been powered off, determine the usage information of each data block that has not been powered off, and then determine the data block that has not been powered off with the highest migration priority as the second data block according to the usage information.

[0062] The usage information may include the current number of erase / write times of the non-power-off data block and / or the occupancy ratio of the data read / write unit in the non-power-off data block. The current number of erase / write times is negatively correlated with the migration priority of the non-power-off data block, and the occupancy ratio of the data read / write unit is negatively correlated with the migration priority of the non-power-off data block. Therefore, based on the usage information, the data block with the least current number of erase / write times and / or the lowest occupancy ratio of the data read / write unit in the non-power-off data block can be determined as the second data block.

[0063] In actual applications, the number of programming and erasing times of a data block is limited. When the maximum number of programming and erasing times is reached, the data block cannot be used to store business data. This technical solution uses the data block with the least number of erasing times as the second data block to be migrated, which not only ensures the success rate of data migration, but also helps to avoid accelerating the aging process of some data blocks in the SSD (such as those with more erasing times), thereby extending the service life of the SSD.

[0064] The occupancy rate of the data read and write unit reflects the size of the data stored in the data block. This technical solution ensures that there is enough space in the data block to store the migrated data by using the data block with the lowest occupancy rate of the data read and write unit as the second data block to be migrated, thereby ensuring the success rate of data migration.

[0065] In one embodiment, if there are multiple data blocks that have not lost power, determining usage information of the data blocks that have not lost power can be performed as follows: if there are multiple data blocks that have not lost power, sending a usage information acquisition instruction for the data blocks that have not lost power to the SSD, thereby receiving the usage information of the data blocks that have not lost power sent by the SSD.

[0066] The usage information of the non-power-off data block is determined by the SSD based on the usage information acquisition instruction. The usage information acquisition instruction may carry the location information of the non-power-off data block. The usage information acquisition instruction may instruct the SSD to obtain the current erase and write times of the non-power-off data block and / or the occupancy ratio of the data read and write unit in the non-power-off data block.

[0067] In this embodiment, by clarifying which data block among the data blocks that are not powered off the second data block is, it is beneficial for the data migration operation to be performed accurately and efficiently.

[0068] The above are the operations specifically performed by the device host 110 in the data migration system during the data migration process. The following is a detailed description of the operations specifically performed by the solid-state drive SSD in the data migration system during the data migration process. In this embodiment, before the device host reads the data read-write unit of the first data block in the solid-state drive SSD, the SSD can read the first data block according to the data read-write unit. Figure 3 In the manner shown, the power-off position information of the first data block is determined. Figure 3 The methods shown may include:

[0069] S302: Search for data read / write units of the first data block in sequence according to a preset data search order until a first readable data read / write unit is found.

[0070] In this embodiment, the first data block is a data block in which a power failure event occurs among the multiple data blocks, and the SSD knows which data blocks the first data block specifically includes.

[0071] Optionally, the data read / write units in the first data block are arranged in sequence. The preset data search order may be a data search order that starts from the last data read / write unit containing data in the first data block and searches for the data read / write units in reverse order. It should be understood that a data read / write unit containing data is not equivalent to a data read / write unit that can be read. For example, when a power-off event occurs, there is data in the data read / write unit being programmed, but this data read / write unit cannot be read after power-on.

[0072] S304: Determine that the data read / write unit searched before the first readable data read / write unit is an unreadable data read / write unit.

[0073] S306: Determine the power-off position information of the first data block according to the position information of the unreadable data read / write unit.

[0074] For example, in Figure 4 In the first data block shown, a power failure event occurs in the SSD after the data read / write unit 410. When the power fails, the data read / write unit ( Figure 4 The grayscale portion shown in FIG. 4 includes a data read-write unit 420, a data read-write unit 430, and a data read-write unit 440, and the data read-write unit after the data read-write unit 440 is a blank data read-write unit. Based on this, according to S302 to S306, the SSD will start from the data read-write unit 440 and search for the data read-write unit in reverse order, and the first readable data read-write unit found is the data read-write unit 410, thereby determining that the data read-write units searched before the data read-write unit 410 (i.e., the data read-write unit 420, the data read-write unit 430, and the data read-write unit 440) are unreadable data read-write units, so that the power-off position information of the first data block can be determined.

[0075] In yet another example, in Figure 5 In the first data block shown, a power failure event occurs in the SSD after the data read / write unit 510. When the power fails, the data read / write unit ( Figure 5The grayscale portion shown) includes a data read and write unit 520 and a data read and write unit 530. After power-on, invalid data is added to the data read and write unit 540 to ensure that the data to be written next is stably stored, and starting from the data read and write unit 550, data is continuously written to the data block until the data read and write unit 570. The data read and write units after the data read and write unit 570 are blank data read and write units. Based on this, according to S302 to S306, since data read and write unit 570 is a readable data read and write unit, it is necessary to start from data read and write unit 570 and search for the data read and write units in reverse order, first find the first unreadable data read and write unit (i.e., data read and write unit 530), and then start with data read and write unit 530 and search for the data read and write units in reverse order, and the first readable data read and write unit found is data read and write unit 510, thereby determining that the data read and write units searched before data read and write unit 510 (i.e., data read and write unit 520 and data read and write unit 530) are unreadable data read and write units, thereby determining the power-off position information of the first data block.

[0076] S308, storing the power-off position information.

[0077] Optionally, after determining the power-off location information of the first data block, the SSD can temporarily store the power-off location information in the internal cache of the SSD. When the power-off location information is sent to the device host based on the power-off location information acquisition instruction, the recording node of the power-off location information in the SSD can be deleted to release the internal cache of the SSD.

[0078] In this embodiment, by determining the power-off position information of the first data block where the power-off event occurs, a data basis is provided for better controlling the data migration of the data block where the power-off event occurs in the SSD.

[0079] In one embodiment, according to a preset data search order, the data read / write units of the first data block are searched in sequence until the first readable data read / write unit is found (ie, S302), which can be performed as follows: Steps B1 to B4:

[0080] Step B1: for each searched data read / write unit, determine whether the unit identifier of the data read / write unit belongs to the unit identifier in the first data block.

[0081] Optionally, the unit identifier of the data read / write unit may be a page number of the data read / write unit. In a data block, the data read / write units may be arranged in sequence according to the page numbers from 0 to N (N is an integer greater than 0).

[0082] Step B2: when the unit identifier of the data read / write unit belongs to the unit identifier in the first data block, determine whether the data read / write unit is a readable data read / write unit.

[0083] In this embodiment, when the unit identifier of the data read-write unit does not belong to the unit identifier in the first data block, the search operation for the data read-write unit in the first data block is terminated. The unit identifier of the data read-write unit does not belong to the unit identifier in the first data block may be that the page number of the data read-write unit does not exist in the first data block. For example, six data read-write units with page numbers from 0 to 5 are arranged in sequence in the first data block. If the page number of the data read-write unit currently being searched is -1 or 8, then it can be determined that the unit identifier of the data read-write unit currently being searched does not belong to the unit identifier in the first data block; if the page number of the data read-write unit currently being searched is any page number from 0 to 5, then it can be determined that the unit identifier of the data read-write unit currently being searched belongs to the unit identifier in the first data block.

[0084] Step B3: If the data read / write unit is a readable data read / write unit, determine to find the first readable data read / write unit.

[0085] Step B4: if the data read / write unit is not a readable data read / write unit, continue to search for the next data read / write unit in the data search order until the first readable data read / write unit is found.

[0086] Optionally, in a case where the data search order is to start from the last data read / write unit containing data in the first data block and search for the data read / write units in reverse order, and the unit identifier of the data read / write unit is the page number of the data read / write unit, if the data read / write unit is not a readable data read / write unit, the page number of the currently searched data read / write unit can be reduced by one according to the data search order to determine the next searched data read / write unit, and the above steps B1-B4 are performed on the next searched data read / write unit until the first readable data read / write unit is found.

[0087] The following takes the preset data search order as starting from the last data read-write unit containing data in the first data block, searching the data read-write units in reverse order, the unit identifier of the data read-write unit is the page number of the data read-write unit, and the last data read-write unit containing data in the first data block is an unreadable data read-write unit as an example to explain in detail the specific operations performed by the SSD during the data migration process. Figure 6 is a schematic flow chart of a method for determining power-off position information according to another embodiment of the present application, such as Figure 6 As shown, the power-off location information determination method may include:

[0088] S601, starting from the last data read / write unit containing data in the first data block, searching for data read / write units in reverse order.

[0089] S602, for the data read / write unit currently being searched, determine whether the page number of the data read / write unit exists in the first data block; if so, execute S603; if not, execute S609.

[0090] S603, determining whether the data read / write unit is a readable data read / write unit; if so, executing S604; if not, executing S608.

[0091] S604, determining that the first data read / write unit that can be read is found.

[0092] S605: Determine that the data read / write unit searched before the first readable data read / write unit is an unreadable data read / write unit.

[0093] S606: Determine the power-off position information of the first data block according to the position information of the unreadable data read / write unit.

[0094] S607, storing the power-off position information.

[0095] S608, determine the data read / write unit indicated by the page number minus one, and then execute S602.

[0096] S609, ending the search operation on the data reading and writing unit in the first data block.

[0097] The specific process of S601-S609 has been described in detail in the above embodiment and will not be repeated here.

[0098] In this embodiment, by determining the power-off position information of the first data block where the power-off event occurs, a data basis is provided for better controlling the data migration of the data block where the power-off event occurs in the SSD.

[0099] The above is the data migration method provided in the embodiment of the present application. The following is a detailed description of the application of the data migration method provided in the present application in a specific application scenario.

[0100] With the development of NAND storage particles (a material that can be made into flash memory components), its storage capacity is getting larger and larger, and its price is gradually decreasing. Compared with mechanical hard disks, SSDs designed with NAND storage particles as the physical unit for internal data storage have obvious advantages in terms of shock resistance, performance, power consumption, dust resistance, etc. For video surveillance, a major user of mechanical disks, replacing mechanical disks with SSDs has become a natural thing.

[0101] The traditional SSD used in the current NVR (or DVR) is processed by the SSD controller for various data processing. The SSD exposes only the accessible LBA (Logical Block Address) and operation instructions to the device host. When the SSD is actually used as a storage device, since the SSD needs to perform GC (Garbage Collection) inside, the bandwidth delay of the device host will increase, thereby affecting the device host business (such as lost video). In response to this, in order to be able to perform GC, a part of the space inside the SSD will be reserved as OP (Over Provisioning), but this will reduce the actual capacity of the SSD that can be used by the device host. In this context, a system in which all OPs are open to the device host and the device host manages the write can be designed based on the ZAC (Zone Access Control) protocol. Among them, Zone is a physical area division of a specified size inside the SSD, which is the unit of access control for the device host. In this way, the device host can schedule the write priority according to the business situation, and the release of OP also increases the storage capacity of the SSD.

[0102] It is normal for NVR (or DVR) to encounter power outages during operation. In the SSD solution based on the ZAC protocol, when a power outage occurs in the NVR (or DVR), the data block currently being programmed in the SSD will lose some data, and the location of this data is the power outage location. In related technologies, during the data migration process of the data block where the power outage occurs in the SSD, the SSD will read each data read and write unit in the data block in turn. When the SSD reads the power outage location, it will enter exception processing and perform a large amount of error correction, which not only occupies a large bandwidth, resulting in a decrease in available bandwidth, but also increases the delay of the NVR (or DVR) service, which can easily lead to abnormalities in the NVR (or DVR) service, such as video cache overflow. Based on this, this embodiment avoids reading data in data read and write units located within the power-off position range, thereby avoiding a large number of error corrections when reading data in data read and write units located within the power-off position range, which leads to a decrease in available bandwidth and excessive delay in device host services, further causing abnormalities in device host services, and reduces the impact of the data migration process in the SSD on the device host services.

[0103] The following is a detailed description of the application of the data migration method to a scenario where a data block in an SSD of a video surveillance device undergoes a power failure event. In this embodiment, the device host is a video surveillance device host. Figure 7 As shown, the data migration method is applied to a video surveillance device host, and the method may include:

[0104] S701, when the host of the video surveillance device meets the preset migration condition, read the data reading and writing unit of the first data block in the SSD.

[0105] The SSD includes multiple data blocks, and the first data block is a data block in which a power failure event occurs among the multiple data blocks. The preset migration conditions may include: the CPU occupancy rate of the central processing unit of the video surveillance device host is less than or equal to a first preset threshold; and / or, the cache overflow probability of the video surveillance device host is less than or equal to a second preset threshold.

[0106] S702: Acquire pre-stored power-off position information of a first data block.

[0107] The video surveillance device host can send a power failure location information acquisition instruction to the SSD, thereby receiving the power failure location information of the first data block sent by the SSD, and then storing the power failure location information. The power failure location information can be stored in a database of the video surveillance device host.

[0108] S703, according to the power-off position information, determine whether the data read / write unit is located within the power-off position range indicated by the power-off position information. If not, execute S704; if yes, execute S705.

[0109] S704, migrate the data in the data read / write unit to the second data block in the SSD.

[0110] The second data block is a data block in which no power failure event occurs among the multiple data blocks.

[0111] S705, generate invalid data, and write the invalid data into the second data block.

[0112] The specific process of S701-S705 has been described in detail in the above embodiment and will not be repeated here.

[0113] The technical solution of the embodiment of the present application is adopted, by reading the data read-write unit of the first data block in the SSD where the power-off event occurs, and obtaining the pre-stored power-off position information of the first data block, so as to determine whether the data read-write unit is located within the power-off position range indicated by the power-off position information according to the power-off position information, and if the data read-write unit is not located within the power-off position range, the data in the data read-write unit is migrated to the second data block in the SSD where the power-off event does not occur. If the data read-write unit is located within the power-off position range, invalid data is generated and written into the second data block. It can be seen that in this technical solution, the video surveillance device host manages the power-off position information of the data blocks where the power-off event occurs in the SSD, and the video surveillance device host controls the data migration of the data blocks where the power-off event occurs in the SSD according to its own busy situation. During the data migration process, the data migration operation can be performed only on the data in the data read-write units that are not within the power-off position range indicated by the power-off position information, thereby avoiding the reading of data in the data read-write units within the power-off position range, thereby avoiding a large number of error corrections when reading data in the data read-write units within the power-off position range, resulting in a decrease in available bandwidth and excessive delay in the video surveillance device host service, further leading to abnormal problems in the video surveillance device host service, and reducing the impact of the data migration process in the SSD on the video surveillance device host service.

[0114] In an optional implementation, in a scenario where data blocks in a SSD of a video surveillance device that has a power failure event are migrated, the data migration method can be applied to the SSD, such as Figure 8 As shown, the method may include:

[0115] S801, upon receiving power-off position information of a first data block sent by a host of a video surveillance device, read a data read-write unit of the first data block.

[0116] Wherein, the video surveillance device host can send the power-off position information of the pre-stored first data block to the SSD through a private instruction when the preset migration condition is met. The SSD includes multiple data blocks, and the first data block is a data block where the power-off event occurs among the multiple data blocks.

[0117] S802, according to the received power-off position information, determine whether the data read / write unit is located within the power-off position range indicated by the power-off position information. If not, execute S803; if yes, execute S804.

[0118] S803, migrate the data in the data reading and writing unit to the second data block in the SSD.

[0119] The second data block is a data block in which no power failure event occurs among the multiple data blocks. Optionally, the video monitoring device host may indicate which data block the second data block is. The specific process of the video monitoring device host determining the second data block can refer to the above steps A1 to A3, which will not be repeated here.

[0120] S804, generating invalid data, and writing the invalid data into the second data block.

[0121] In this embodiment, the invalid data is generated by the SSD.

[0122] The specific process of S801-S804 has been described in detail in the above embodiment and will not be repeated here.

[0123] In this embodiment, the SSD can start to perform data migration operations when receiving the power-off location information sent by the video surveillance device host, and the timing of sending the power-off location information is when the video surveillance device host meets the preset migration conditions, thereby achieving the effect of controlling the data migration operation of the data block where the power-off event occurs according to the busyness of the video surveillance device host business, which is conducive to reducing the impact of the data migration process in the SSD on the video surveillance device host business. In addition, by sending the power-off location information of the data block where the power-off event occurs to the SSD, the SSD can be prompted to perform data migration operations more targeted, avoiding the reading of data in the data read-write unit located within the power-off location range, thereby avoiding the problem of a large number of error corrections when reading the data in the data read-write unit located within the power-off location range, resulting in a decrease in available bandwidth and excessive delay in the video surveillance device host business, further causing abnormalities in the video surveillance device host business.

[0124] In an optional implementation, the power failure location information may be stored in an internal cache of the SSD. In this embodiment, the data read / write unit for reading the first data block in the solid state drive SSD (i.e., S202) may be executed as follows: when the internal cache of the SSD reaches a preset cache threshold, the data read / write unit for reading the first data block.

[0125] On this basis, in the scenario of data migration of data blocks in the SSD of the video surveillance device where a power failure event occurs, the data migration method can be applied to the SSD, such as Fig. 9 As shown, the method may include:

[0126] S901, when the internal cache of the SSD reaches a preset cache threshold, read a data read / write unit of a first data block.

[0127] S902, according to the power-off position information stored in the internal cache, determine whether the data read / write unit is located within the power-off position range indicated by the power-off position information. If not, execute S903; if yes, execute S904.

[0128] S903, migrate the data in the data read / write unit to the second data block in the SSD.

[0129] The second data block is a data block in which no power failure event occurs among the multiple data blocks. Optionally, the SSD itself can determine which data block the second data block is. The specific process of the SSD determining the second data block can refer to the above steps A1 to A3, which will not be repeated here.

[0130] S904, generate invalid data, and write the invalid data into the second data block.

[0131] In this embodiment, the invalid data is generated by the SSD. After completing the migration of the data in a first data block, the SSD can communicate with the video surveillance device host to inform the video surveillance device host of the specific second data block to which the data in the first data block is migrated, and at the same time, the recording node of the first data block in the internal cache can be released to facilitate recording the power-off position information of other data blocks where the power-off event occurs.

[0132] The specific process of S901-S904 has been described in detail in the above embodiment and will not be repeated here.

[0133] In the present embodiment, the SSD can start to perform data migration operations according to the power-off location information when the internal cache storing the power-off location information reaches a preset cache threshold, thereby reducing the execution frequency of the data migration operation and enabling the SSD to perform data migration operations more specifically, avoiding the reading of data in the data read-write units located within the power-off location range, thereby avoiding a large number of error corrections when reading data in the data read-write units located within the power-off location range, resulting in a decrease in available bandwidth and excessive delay in the host service of the video surveillance device, further leading to abnormalities in the host service of the video surveillance device.

[0134] In summary, specific embodiments of the present subject matter have been described. Other embodiments are within the scope of the appended claims. In some cases, the actions recorded in the claims can be performed in a different order and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or sequential order shown to achieve the desired results. In some embodiments, multitasking and parallel processing can be advantageous.

[0135] The above is the data migration method and data migration system provided by the embodiments of this application. Next, a detailed description will be given of Figure 1 the data migration system shown below.

[0136] As Figure 1 shown, the data migration system may include a device host 110 and a solid-state drive SSD. The SSD includes a plurality of data blocks (not shown in Figure 1 the figure); the device host 110 is connected to the SSD; where:

[0137] The SSD is configured to, when a power failure event occurs, determine the power failure position information of the first data block where the power failure event occurs; send the power failure position information to the device host 110; the first data block is the data block where the power failure event occurs among the plurality of data blocks;

[0138] The device host 110 is configured to store the power failure position information; read the data read / write unit of the first data block; determine whether the data read / write unit is within the power failure position range indicated by the power failure position information; in the case where the data read / write unit is not within the power failure position range, migrate the data in the data read / write unit to a second data block in the SSD; the second data block is a data block among the plurality of data blocks where no power failure event occurs.

[0139] In one embodiment, the device host 110 is further configured to, before reading the data read / write unit of the first data block in the solid-state drive SSD, send a power failure position information acquisition instruction to the SSD;

[0140] The SSD is further configured to determine the power failure position information of the first data block based on the power failure position information acquisition instruction; send the power failure position information of the first data block to the device host 110;

[0141] The device host 110 is further configured to store the power failure position information.

[0142] In one embodiment, the device host 110 is specifically configured to:

[0143] When the device host 110 meets the preset migration condition, read the data read / write unit of the first data block; the preset migration condition includes: the CPU occupancy ratio of the device host 110 is less than or equal to a first preset threshold; and / or, the cache overflow probability of the device host 110 is less than or equal to a second preset threshold.

[0144] In one embodiment, the device host 110 is further configured to:

[0145] When the data read / write unit is within the power failure position range, generate invalid data;

[0146] Write the invalid data into the second data block.

[0147] In one embodiment, the power-off location information includes: location information of the first data block; the device host 110 is further configured to:

[0148] When the data read / write unit is not located within the power-off position range, before migrating the data in the data read / write unit to the second data block in the SSD, determining a non-power-off data block in the SSD according to the position information of the first data block;

[0149] If the non-power-off data block includes only one, determining that the non-power-off data block is the second data block;

[0150] If there are multiple power-on data blocks, determine usage information of the power-on data blocks; the usage information includes the current number of erase and write times of the power-on data blocks, and / or the occupancy ratio of the data read and write units in the power-on data blocks; according to the usage information, determine the power-on data block with the highest migration priority as the second data block;

[0151] The current number of erase and write times is negatively correlated with the migration priority of the data block that is not powered off; and the occupied ratio of the data read and write unit is negatively correlated with the migration priority of the data block that is not powered off.

[0152] In one embodiment, the device host 110 is further configured to send a usage information acquisition instruction for the non-power-off data block to the SSD if the non-power-off data block includes multiple data blocks;

[0153] The SSD is further configured to determine usage information of the non-power-off data blocks based on the usage information acquisition instruction; and send the usage information of the non-power-off data blocks to the device host 110.

[0154] In one embodiment, the SSD is also used to:

[0155] Before reading the data read / write unit of the first data block in the solid state drive SSD, searching the data read / write units of the first data block in sequence according to a preset data search order until a first readable data read / write unit is found;

[0156] Determine that the data read-write unit searched before the first readable data read-write unit is an unreadable data read-write unit;

[0157] Determining power-off position information of the first data block according to position information of the unreadable data read / write unit;

[0158] Store power-off position information.

[0159] In one embodiment, the SSD is specifically used for:

[0160] For each searched data read / write unit, determining whether the unit identifier of the data read / write unit belongs to the unit identifier in the first data block;

[0161] In the case where the unit identifier of the data read / write unit belongs to the unit identifier in the first data block, determining whether the data read / write unit is a data read / write unit that can be read;

[0162] If the data read-write unit is a data read-write unit that can be read, determine to find the first data read-write unit that can be read;

[0163] If the data read-write unit is not a readable data read-write unit, the next data read-write unit is searched for in the data search order until the first readable data read-write unit is found.

[0164] In one embodiment, the power failure location information is stored in an internal cache of an SSD; the SSD is specifically used for:

[0165] When the internal cache of the SSD reaches a preset cache threshold, a data read / write unit reads the first data block.

[0166] In the data migration system provided by the embodiment of the present application, when a power failure event occurs, the SSD can determine the power failure position information of the first data block where the power failure event occurs, and send the power failure position information to the device host. The device host can store the power failure position information, and when reading the data read / write unit of the first data block, determine whether the data read / write unit is located within the power failure position range indicated by the power failure position information according to the power failure position information. Thus, when the data read / write unit is not located within the power failure position range, the data in the data read / write unit is migrated to the second data block in the SSD where the power failure event does not occur. It can be seen that in this technical solution, the device host manages the power-off position information of the data blocks where the power-off event occurs in the SSD, and the device host controls the data migration of the data blocks where the power-off event occurs in the SSD. During the data migration process, the data migration operation can be performed only on the data in the data read-write units that are not within the power-off position range indicated by the power-off position information, thereby avoiding the reading of data in the data read-write units within the power-off position range, thereby avoiding a large number of error corrections when reading data in the data read-write units within the power-off position range, resulting in a decrease in available bandwidth and excessive delay in the device host service, further leading to abnormal problems in the device host service, and reducing the impact of the data migration process in the SSD on the device host service.

[0167] Those skilled in the art should understand that Figure 1 The data migration system in can be used to implement the data migration method described above, and the detailed description thereof should be similar to that described in the method section above, and will not be further described here to avoid redundancy.

[0168] Based on the same idea, the embodiment of the present application also provides a data migration device, such as Fig.10 As shown. The data migration device may have relatively large differences due to different configurations or performances, and may include one or more processors 1001 and memory 1002, and one or more applications or data may be stored in the memory 1002. Among them, the memory 1002 may be a short-term storage or a persistent storage. The application stored in the memory 1002 may include one or more modules (not shown in the figure), and each module may include a series of computer executable instructions in the data migration device. Furthermore, the processor 1001 may be configured to communicate with the memory 1002 and execute a series of computer executable instructions in the memory 1002 on the data migration device. The data migration device may also include one or more power supplies 1003, one or more wired or wireless network interfaces 1004, one or more input and output interfaces 1005, and one or more keyboards 1006.

[0169] Specifically, in this embodiment, the data migration device includes a memory and one or more application programs, wherein the one or more application programs are stored in the memory, and the one or more application programs may include one or more modules, and each module may include a series of computer executable instructions in the data migration device, and the one or more application programs are configured to be executed by one or more processors, including computer executable instructions for performing the following:

[0170] A data reading and writing unit for reading a first data block in a solid state drive SSD; the SSD includes a plurality of data blocks; the first data block is a data block in which a power failure event occurs among the plurality of data blocks;

[0171] Acquire the power-off position information of the pre-stored first data block;

[0172] Determining, according to the power-off position information, whether the data read-write unit is located within the power-off position range indicated by the power-off position information;

[0173] When the data read / write unit is not located within the power-off position range, data in the data read / write unit is migrated to a second data block in the SSD; the second data block is a data block in the plurality of data blocks where no power-off event occurs.

[0174] By adopting the technical solution of the embodiment of the present application, the data read and write unit of the first data block in the solid-state hard disk SSD where a power failure event occurs is read through the device host, and the power failure position information of the first data block stored in advance is obtained, so as to determine whether the data read and write unit is located within the power failure position range indicated by the power failure position information based on the power failure position information. If the data read and write unit is not located within the power failure position range, the data in the data read and write unit is migrated to the second data block in the SSD where no power failure event occurs. It can be seen that in this technical solution, the device host manages the power-off position information of the data blocks where the power-off event occurs in the SSD, and the device host controls the data migration of the data blocks where the power-off event occurs in the SSD. During the data migration process, the data migration operation can be performed only on the data in the data read-write units that are not within the power-off position range indicated by the power-off position information, thereby avoiding the reading of data in the data read-write units within the power-off position range, thereby avoiding a large number of error corrections when reading data in the data read-write units within the power-off position range, resulting in a decrease in available bandwidth and excessive delay in the device host service, further leading to abnormal problems in the device host service, and reducing the impact of the data migration process in the SSD on the device host service.

[0175] An embodiment of the present application also proposes a storage medium, which stores one or more computer programs, and the one or more computer programs include computer executable instructions. When the computer executable instructions are executed by an electronic device including multiple applications, the electronic device can perform the various processes of the above-mentioned data migration method embodiment and achieve the same technical effect. To avoid repetition, they are not repeated here.

[0176] The embodiment of the present application also proposes a computer program product, which includes a computer program. When the computer program is executed by a processor, it implements the various processes of the above-mentioned data migration method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0177] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0178] For the convenience of description, the above device is described in various units according to their functions. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0179] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0180] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0181] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0182] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0183] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

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

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

[0186] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0187] The present application may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.

[0188] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0189] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims

1. A data migration method, characterized in that: include: A data reading and writing unit for reading a first data block in a solid state drive SSD; the SSD includes a plurality of data blocks; The first data block is a data block where a power failure event occurs among the multiple data blocks; Acquire pre-stored power-off position information of the first data block; According to the power-off position information, determining whether the data read-write unit is located within a power-off position range indicated by the power-off position information; When the data read / write unit is not located within the power-off position range, data in the data read / write unit is migrated to a second data block in the SSD; the second data block is a data block in the plurality of data blocks where no power-off event occurs.

2. The method according to claim 1, characterized in that Before the data reading and writing unit of the first data block in the solid state drive SSD is read, the method further comprises: Sending a power-off position information acquisition instruction to the SSD; receiving the power-off location information of the first data block sent by the SSD; the power-off location information is determined by the SSD based on the power-off location information acquisition instruction; The power-off position information is stored.

3. The method according to claim 1, characterized in that The data reading and writing unit for reading the first data block in the solid state drive SSD comprises: When the device host meets the preset migration conditions, the data read and write unit of the first data block is read; the preset migration conditions include: the CPU occupancy rate of the central processing unit of the device host is less than or equal to the first preset threshold; and / or the cache overflow probability of the device host is less than or equal to the second preset threshold.

4. The method according to claim 1, characterized in that: The method further comprises: generating invalid data when the data read / write unit is located within the power-off position range; The invalid data is written into the second data block.

5. The method according to claim 1, characterized in that The power-off location information includes: location information of the first data block; In the case where the data read / write unit is not located within the power-off position range, before migrating the data in the data read / write unit to the second data block in the SSD, the method further includes: Determine, according to the location information of the first data block, a non-power-off data block in the SSD; If the non-power-off data block includes only one, determining that the non-power-off data block is the second data block; If the non-power-off data block includes multiple ones, determining usage information of the non-power-off data block; the usage information includes the current number of erase and write times of the non-power-off data block, and / or the occupancy ratio of the data read and write units in the non-power-off data block; according to the usage information, determining the non-power-off data block with the highest migration priority as the second data block; The current number of erase and write times is negatively correlated with the migration priority of the data block that is not powered off; and the occupancy ratio of the data read and write unit is negatively correlated with the migration priority of the data block that is not powered off.

6. The method according to claim 5, characterized in that If the non-power-off data block includes a plurality of data blocks, determining usage information of the non-power-off data block includes: If the non-power-off data block includes a plurality of data blocks, sending a usage information acquisition instruction for the non-power-off data block to the SSD; Receive usage information of the non-power-off data block sent by the SSD; the usage information is determined by the SSD based on the usage information acquisition instruction.

7. The method according to claim 1, characterized in that Before the data reading and writing unit of the first data block in the solid state drive SSD is read, the method further comprises: Searching the data read / write units of the first data block in sequence according to a preset data search order until a first readable data read / write unit is found; Determine that the data read-write unit searched before the first readable data read-write unit is an unreadable data read-write unit; Determining the power-off position information of the first data block according to the position information of the unreadable data read / write unit; The power-off position information is stored.

8. The method according to claim 7, characterized in that The step of searching the data read / write units of the first data block in sequence according to a preset data search order until a first readable data read / write unit is found includes: For each searched data read / write unit, determining whether the unit identifier of the data read / write unit belongs to the unit identifier in the first data block; In a case where the unit identifier of the data read / write unit belongs to the unit identifier in the first data block, determining whether the data read / write unit is the data read / write unit that can be read; If the data read-write unit is the readable data read-write unit, determining to find the first readable data read-write unit; If the data read-write unit is not the readable data read-write unit, then the next data read-write unit is searched for in the data search order until the first readable data read-write unit is found.

9. The method according to claim 1, characterized in that: The power-off location information is stored in an internal cache of the SSD; The data reading and writing unit for reading the first data block in the solid state drive SSD comprises: When the internal cache of the SSD reaches a preset cache threshold, a data reading and writing unit reads the first data block.

10. A data migration system, characterized in that: It includes a device host and a solid state drive SSD, wherein the SSD includes a plurality of data blocks; the device host and the SSD are connected; wherein: The SSD is used to determine the power failure position information of the first data block where the power failure event occurs when a power failure event occurs; and send the power failure position information to the device host; the first data block is a data block where the power failure event occurs among the multiple data blocks; The device host is used to store the power-off position information; read the data read-write unit of the first data block; determine whether the data read-write unit is located within the power-off position range indicated by the power-off position information according to the power-off position information; if the data read-write unit is not located within the power-off position range, migrate the data in the data read-write unit to a second data block in the SSD; the second data block is a data block among the multiple data blocks where no power-off event has occurred.

11. A data migration device, characterized in that: include: processor; as well as A memory arranged to store computer executable instructions, wherein the computer executable instructions are configured to be executed by the processor, and the computer executable instructions are executed by the processor to implement the data migration method according to any one of claims 1 to 9.

12. A storage medium, characterized in that: The storage medium is used to store computer-executable instructions, and when the computer-executable instructions are executed by a processor, the data migration method according to any one of claims 1 to 9 is implemented.

13. A computer program product, characterized in that It comprises a computer program, which, when executed by a processor, implements the data migration method described in any one of claims 1 to 9.