Data backup method and device, storage medium and electronic device
By obtaining the request instructions for the data to be backed up in the disk array, determining the target subdisk and performing data backup, the problem of low security in the prior art is solved, and efficient data backup is achieved without relying on additional storage media.
Patent Information
- Application Number
- CN202110098419.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-25
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2041-01-25
AI Technical Summary
In the prior art, new storage media is required for data backup, resulting in low security of data backup.
By obtaining the request instruction to back up the data in the disk array, the first target subdisk that stores the data to be backed up is determined based on the identification information, and in the event that there is a second target subdisk that does not store the data, the data to be backed up is transferred from the second target subdisk of the data. A target subdisk is written to backup to the second target subdisk, enabling array backup to the subdisk in the disk array without requiring additional storage media backup.
It solves the security problem caused by the need to add new storage media during data backup, improves the security of data backup, and reduces the waste of physical storage media.
Smart Images

Figure CN112817794B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a data backup method and device, a storage medium and an electronic device. Background Art
[0002] In the video surveillance system of security control, the video storage server is the core of the entire data storage, providing data storage for the front-end IPCamera to collect videos. In the data storage server of video surveillance, it is generally recommended to use a disk array storage composed of several disks. RAID (Redundant Arrays of Independent Disks) can provide more reliable and secure storage services.
[0003] RAID storage uses two concepts, Chunk and Stripe. Chunk: A logical data block on a physical hard disk. Its size indicates how much data should be written to the same hard disk on the RAID each time. Stripe: A collection of all Chunks at the same location on all hard disks in the RAID. It is the basic unit of XOR checksum and data layout.
[0004] The video data is stored in a single physical hard disk of the device, or in a disk array composed of several physical hard disks. The video files are packaged and stored in the hard disk at a fixed time or length. If a certain video involves important secrets, criminal cases and other special circumstances, it is necessary to locate the hard disk where the video is stored and physically seal the hard disk where the video is stored. The video data of other hard disks cannot be recovered.
[0005] It can be seen that the current video data backup requires additional storage media or backup devices, and requires additional download operations, which poses a risk of information leakage. For video data files stored in disk arrays, the data is distributed and stored in various sub-disks. If the physical storage medium needs to be sealed, all sub-disks need to be sealed, which greatly wastes the physical storage medium.
[0006] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0007] The embodiments of the present invention provide a data backup method and device, a storage medium and an electronic device, so as to at least solve the technical problem in the prior art that a new storage medium is required for data backup, resulting in low data backup security.
[0008] According to one aspect of an embodiment of the present invention, a data backup method is provided, comprising: in the process of backing up data stored in a disk array, obtaining a request instruction for data to be backed up, wherein the request instruction carries identification information of the data to be backed up, the request instruction is used to back up the data to be backed up, the data to be backed up is stored on a sub-disk in the disk array, and the disk array includes multiple sub-disks; determining a first target sub-disk storing the data to be backed up based on the identification information; and in the case where a second target sub-disk that does not store data exists in the disk array, writing the data to be backed up from the first target sub-disk to the second target sub-disk for backup.
[0009] Optionally, writing and backing up the data to be backed up from the first target sub-disk to the second target sub-disk includes: when the data to be backed up exists in multiple sub-disks in the disk array, reading the data to be backed up from the multiple sub-disks in stripes, and writing them to the second target sub-disk.
[0010] Optionally, before writing the to-be-backed-up data from the first target sub-disk to the second target sub-disk, the method further includes: if there is a backup sub-disk in the disk array, determining the backup sub-disk as the second target sub-disk.
[0011] Optionally, the method includes: before writing the data to be backed up from the first target sub-disk to the second target sub-disk, when there is no backup sub-disk in the disk array and when there is data in each of the multiple sub-disks, selecting a third target sub-disk from the multiple sub-disks; clearing the data stored in the third target sub-disk; and determining that the third target sub-disk from which the data is cleared is the second target sub-disk.
[0012] Optionally, the method includes: after clearing the data stored in the third target sub-disk, the method also includes: storing the data cleared from the third target sub-disk to a cache area; in a case where the data cleared from the third target sub-disk includes part of the data to be backed up, writing the data to be backed up from the first target sub-disk to the second target sub-disk, including: writing the part of the data to be backed up included in the cache area to the second target sub-disk.
[0013] Optionally, writing and backing up part of the data to be backed up included in the cache area to the second target sub-disk includes: writing and backing up part of the data to be backed up included in the cache area to the second target sub-disk through an XOR operation.
[0014] Optionally, after writing and backing up the data to be backed up from the first target sub-disk to the second target sub-disk, the method further includes: deleting the data to be backed up in the first target sub-disk; or deleting the data to be backed up in multiple sub-disks in the disk array.
[0015] Optionally, after writing and backing up the data to be backed up from the first target sub-disk to the second target sub-disk, the method further includes: displaying prompt information, wherein the prompt information is used to prompt that the backup of the data to be backed up has been completed.
[0016] According to another aspect of an embodiment of the present invention, a data backup device is also provided, including: a first acquisition unit, used to obtain a request instruction for data to be backed up, wherein the request instruction carries identification information of the data to be backed up, and the request instruction is used to back up the data to be backed up, and the data to be backed up is stored on a sub-disk in a disk array, and the disk array includes multiple sub-disks; a first determination unit, used to determine a first target sub-disk storing the data to be backed up based on the identification information; and a first backup unit, used to write the data to be backed up from the first target sub-disk to a second target sub-disk when there is a second target sub-disk in the disk array that does not store data.
[0017] Optionally, the first backup unit includes: a first writing module, which is used to read the data to be backed up from the multiple sub-disks in stripes and write the data to the second target sub-disk when the data to be backed up exists in the multiple sub-disks in the disk array.
[0018] Optionally, the device also includes: a second determination unit, which is used for, when there is a second target sub-disk that does not store data in the target sub-disk, and before writing the data to be backed up from the first target sub-disk to the second target sub-disk, and when there is a backup sub-disk in the disk array, to determine the backup sub-disk as the second target sub-disk.
[0019] Optionally, the above-mentioned device includes: a selection unit, which is used to select a third target sub-disk from the multiple sub-disks before writing the data to be backed up from the first target sub-disk to the second target sub-disk, when there is no backup sub-disk in the disk array and when there is data in each of the multiple sub-disks; a clearing unit, which is used to clear the data stored in the third target sub-disk; and a third determination unit, which is used to determine that the third target sub-disk from which the data is cleared is the second target sub-disk.
[0020] Optionally, the above-mentioned device includes: a storage unit, which is used to store the data cleared from the third target sub-disk to a cache area after the data stored in the third target sub-disk is cleared; and a second backup unit, which is used to write and back up the partial data of the data to be backed up from the cache area to the second target sub-disk when the data cleared from the third target sub-disk includes partial data of the data to be backed up.
[0021] Optionally, the second backup unit includes: a second writing module, used to write and back up part of the data to be backed up included in the cache area into the second target sub-disk through an XOR operation.
[0022] Optionally, the device also includes: a first deleting unit, used to delete the data to be backed up existing in the first target sub-disk after writing the data to be backed up from the first target sub-disk to the second target sub-disk; and a second deleting unit, used to delete the data to be backed up existing in multiple sub-disks in the disk array.
[0023] Optionally, the device further comprises: a display unit, configured to display a prompt message after the data to be backed up is written from the first target sub-disk to the second target sub-disk, wherein the prompt message is used to prompt that the backup of the data to be backed up has been completed.
[0024] According to another aspect of the embodiments of the present invention, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above data backup method when running.
[0025] According to another aspect of an embodiment of the present invention, there is provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the data backup method through the computer program.
[0026] In an embodiment of the present invention, during the process of backing up data stored in a disk array, a request instruction for the data to be backed up is obtained, wherein the request instruction carries identification information of the data to be backed up, and the request instruction is used to back up the data to be backed up, and the data to be backed up is stored on a sub-disk in the disk array, and the disk array includes multiple sub-disks; a first target sub-disk storing the data to be backed up is determined according to the identification information; in the case where there is a second target sub-disk in the disk array that does not store data, the data to be backed up is written from the first target sub-disk to the second target sub-disk for backup, so that when the array in the disk array is backed up, the array is backed up to the sub-disk in the disk array, and no additional storage medium is needed for backup, thereby solving the technical problem in the prior art that additional storage medium is needed for data backup, resulting in low data backup security. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0028] Figure 1 is a schematic diagram of an application environment of an optional data backup method according to an embodiment of the present invention;
[0029] Figure 2 is a flow chart of an optional data backup method according to an embodiment of the present invention;
[0030] Figure 3 It is an optional disk array video data backup method according to an embodiment of the present invention;
[0031] Figure 4 is a schematic diagram of an optional video data storage according to an embodiment of the present invention;
[0032] Figure 5 is a schematic diagram of an optional data recovery through XOR operation according to an embodiment of the present invention;
[0033] Figure 6 is a schematic diagram of an optional data storage to a target sub-disk according to an embodiment of the present invention;
[0034] Figure 7 is a schematic diagram of an optional data backup completion according to an embodiment of the present invention;
[0035] Figure 8 is a schematic structural diagram of an optional data backup device according to an embodiment of the present invention;
[0036] Fig. 9 It is a schematic diagram of the structure of an optional electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0037] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0038] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0039] According to one aspect of an embodiment of the present invention, a data backup method is provided. Optionally, as an optional implementation, the data backup method may be applied to, but is not limited to, Figure 1 In the environment shown, the terminal device 102 can be used to store data to be backed up, the network 104 and the service area 106 .
[0040] During the process of backing up the data stored in the disk array, the server 106 obtains a request instruction for the data to be backed up, wherein the request instruction carries identification information of the data to be backed up, and the request instruction is used to back up the data to be backed up, and the data to be backed up is stored on a sub-disk in the disk array, and the disk array includes multiple sub-disks; a first target sub-disk storing the data to be backed up is determined according to the identification information; when there is a second target sub-disk in the disk array that does not store data, the data to be backed up is written from the first target sub-disk to the second target sub-disk for backup, so that when the array in the disk array is backed up, the array is backed up to the sub-disk in the disk array, and no additional storage medium is needed for backup, thereby solving the technical problem in the prior art that additional storage medium is needed for data backup, resulting in low data backup security.
[0041] Optionally, in this embodiment, the terminal device may be a terminal device configured with a target client, which may include but is not limited to at least one of the following: a mobile phone (such as an Android phone, an iOS phone, etc.), a laptop, a tablet computer, a PDA, a MID (Mobile Internet Devices), a PAD, a desktop computer, a smart TV, etc. The target client may be a video client, etc. The network may include but is not limited to: a wired network, a wireless network, wherein the wired network includes: a local area network, a metropolitan area network and a wide area network, and the wireless network includes: Bluetooth, WIFI and other networks that implement wireless communication. The server may be a single server, or a server cluster consisting of multiple servers, or a cloud server. The above is only an example, and this embodiment does not impose any limitation on this.
[0042] Optionally, as an optional implementation, as Figure 2 As shown, the above data backup method includes:
[0043] Step S202, in the process of backing up the data stored in the disk array, obtain a request instruction for the data to be backed up, wherein the request instruction carries identification information of the data to be backed up, and the request instruction is used to back up the data to be backed up. The data to be backed up is stored on a sub-disk in the disk array, and the disk array includes multiple sub-disks.
[0044] Step S204: determining a first target sub-disk storing the data to be backed up according to the identification information.
[0045] Step S206: When there is a second target sub-disk without storing data in the disk array, the data to be backed up is written from the first target sub-disk to the second target sub-disk for backup.
[0046] Optionally, in this embodiment, the data backup may include but is not limited to data backup of data stored in a single physical hard disk of the device, or in a disk array consisting of several physical hard disks. The data may include but is not limited to video data. For example, video data is stored in a single physical hard disk of the device, or in a disk array consisting of several physical hard disks, and the video data is backed up.
[0047] The disk array may include but is not limited to a single physical hard disk or a disk array composed of several physical hard disks. The first target sub-disk stores the data to be backed up, and the second target sub-disk and the first target sub-disk are storage units of the disk array.
[0048] In this embodiment, the array in the disk array is backed up to a certain sub-disk, and no additional storage medium backup is required.
[0049] Optionally, writing the data to be backed up from the first target sub-disk to the second target sub-disk may include: when the data to be backed up exists in multiple sub-disks in the disk array, reading the data to be backed up from the multiple sub-disks in stripes and writing them to the second target sub-disk.
[0050] In this embodiment, the data to be backed up may be multiple pieces of data, and the multiple pieces of data may be stored in multiple sub-disks in a disk array, that is, the data to be backed up may be stored in different arrays in the form of pieces of data.
[0051] Through the embodiments provided by the present application, in the process of backing up data stored in a disk array, a request instruction for the data to be backed up is obtained, wherein the request instruction carries identification information of the data to be backed up, and the request instruction is used to back up the data to be backed up, and the data to be backed up is stored on a sub-disk in the disk array, and the disk array includes multiple sub-disks; a first target sub-disk storing the data to be backed up is determined according to the identification information; in the case where there is a second target sub-disk in the disk array that does not store data, the data to be backed up is written from the first target sub-disk to the second target sub-disk for backup, so that when the array in the disk array is backed up, the array is backed up to the sub-disk in the disk array, and no additional storage medium is required for backup, thereby solving the technical problem in the prior art that additional storage medium is required for data backup, resulting in low data backup security.
[0052] Optionally, before writing the to-be-backed-up data from the first target sub-disk to the second target sub-disk for backup, the method may further include: if a backup sub-disk exists in the disk array, determining the backup sub-disk as the second target sub-disk.
[0053] In this embodiment, when backing up data, it can be determined whether there is a backup sub-disk in the disk array. If there is a backup sub-disk, the backup sub-disk is used to back up the data to be backed up.
[0054] The backup sub-disk mentioned above can be understood as a hot spare disk. The function of a hot spare disk is equivalent to making another backup in the RAID. For example, in the original RAID, the system and data can still run normally when only one disk is damaged, but it cannot run normally when two are damaged. However, after adding a hot spare disk, two disks can be damaged at the same time, and the system and data can still run normally.
[0055] Optionally, in the above method, when there is no backup sub-disk in the disk array and there is data in each of the multiple sub-disks, a third target sub-disk is selected from the multiple sub-disks; the data stored in the third target sub-disk is cleared; and the third target sub-disk from which the data is cleared is determined to be the second target sub-disk.
[0056] In this embodiment, when there is no backup sub-disk in the disk array, data in one of the multiple sub-disks in the disk array may be cleared, and the cleared sub-disk is used to store the backup data to be backed up.
[0057] Optionally, in the above method, after the data stored in the third target sub-disk is cleared, the method also includes: storing the data cleared from the third target sub-disk to a cache area; in a case where the data cleared from the third target sub-disk includes part of the data to be backed up, writing the data to be backed up from the first target sub-disk to the second target sub-disk for backup, including: writing part of the data to be backed up from the cache area for backup to the second target sub-disk.
[0058] When data on a sub-disk is deleted and the deleted data includes part of the data to be backed up, the deleted data can be restored and backed up to the sub-disk to complete the backup of the data to be backed up.
[0059] Optionally, writing part of the data to be backed up included in the cache area to the second target sub-disk for backup may include: writing part of the data to be backed up included in the cache area to the second target sub-disk for backup through an XOR operation.
[0060] Optionally, after writing the data to be backed up from the first target sub-disk to the second target sub-disk, the method may further include: deleting the data to be backed up in the first target sub-disk; or deleting the data to be backed up in multiple sub-disks in the disk array.
[0061] In this embodiment, the array in the disk array is backed up to one of the sub-disks, the storage stripe data in the disk array is cleared, and the entire video data backup is completed in the disk array, without the need for additional storage medium backup. After the backup is completed, only the sub-disk has data, and other sub-disks have no corresponding data.
[0062] Optionally, after writing the data to be backed up from the first target sub-disk to the second target sub-disk for backup, the method may further include: displaying prompt information, wherein the prompt information is used to prompt that the backup of the data to be backed up has been completed.
[0063] In this embodiment, the prompt information can be displayed through the indicator light. After the backup is completed, the disk array read / write indicator light is set to be always on, indicating that the backup is completed and the data to be backed up is backed up to the target backup sub-disk.
[0064] It should be noted that the above data backup method can include but is not limited to the application of security field, storing the video data in RAID to complete the backup of video data in RAID, the target video file is backed up to the RAID sub-disk, the source RAID data is deleted, the read / write light of the Raid sub-disk is always on, and the sub-disk is pulled out to complete the backup of the video data. The entire backup process does not rely on other backup media, and RAID can still continue to store work.
[0065] Optionally, as an optional implementation, as Figure 3 As shown, the present application also provides an optional disk array video data backup method.
[0066] Step S301, start;
[0067] Step S302, locating target video data information;
[0068] In step S302, the video file is located. The user converts the video information and time and channel related information into a unique ID of the video file, and can use the ID to locate the target video file REC in the video data. Figure 4 As shown, the schematic diagram of video data storage.
[0069] Step S303, determine whether there is a hot spare disk, if yes, execute step S304, if no, execute step S305;
[0070] Step S304, selecting the hot spare disk as the backup disk;
[0071] In step S304, if there is a spare disk in the RAID, it is preferred. Otherwise, one of the sub-disks in the RAID is selected as a backup. If the RAID sub-disk is used as a backup disk, the RAID will be degraded. In this embodiment, RAID5 is taken as an example. There is a redundant disk in RAID5. If a sub-disk is kicked out, the RAID can work normally and data is not lost. Among them, the hot spare disk can be understood as a backup sub-disk.
[0072] Step S305, selecting a sub-disk as a backup disk;
[0073] Step S306, the backup disk is kicked out of RAID;
[0074] Step S307, deleting the selected sub-disk data;
[0075] In step S307, the remaining data in the RAID of the kicked-out disk is first read, and the data in the kicked-out sub-disk is restored through XOR operation. The data is read into the cache, and the read data is written to the kicked-out sub-disk. Figure 5 As shown, the schematic diagram of data recovery through XOR operation,
[0076] That is
[0077] Step S308, stripe data backup;
[0078] In step S308, the data is read and written into the target disk DISK4 one by one according to the stripes until the video is fully backed up. Figure 6 As shown, a schematic diagram of storing data to a target sub-disk. Figure 7 As shown, this is a schematic diagram of data backup completion.
[0079] Step S309, deleting data in the source RAID;
[0080] In step S309, the source RAID data is deleted to ensure that the data is fully backed up and the existing data cannot be restored.
[0081] Step S310, the read / write indicator of the target data disk is always on;
[0082] In step S310, the backup is completed, and the hard disk read / write indicator is turned on steadily, indicating that the backup is completed and the target backup sub-disk is marked.
[0083] Step S311, end.
[0084] In this embodiment, no additional backup storage medium is required. The target data is backed up to a sub-disk in the RAID, and no additional storage medium or device is required. It is not necessary to seal all storage media (RAID sub-disks). It is only necessary to seal a sub-disk that has been processed by the proposed method to improve the utilization rate of the hard disk. The backup is completed within the RAID, reducing the risk of leakage of important and confidential target video files. RAID has data redundancy, and the backup can be restored or partially restored after deletion. The target video strip data is deleted immediately after the RAID backup is completed, which can ensure that the data is irrecoverable and data security.
[0085] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
[0086] According to another aspect of the embodiment of the present invention, a data backup device for implementing the above data backup method is also provided. Figure 8 As shown, the device includes: a first obtaining unit 81, a first determining unit 83 and a first backup unit 85.
[0087] The first acquisition unit 81 is used to obtain a request instruction for the data to be backed up during the process of backing up the data stored in the disk array, wherein the request instruction carries identification information of the data to be backed up, and the request instruction is used to back up the data to be backed up. The data to be backed up is stored on a sub-disk in the disk array, and the disk array includes multiple sub-disks.
[0088] The first determining unit 83 is configured to determine a first target sub-disk storing the data to be backed up according to the identification information.
[0089] The first backup unit 85 is used to write the data to be backed up from the first target sub-disk to the second target sub-disk when there is a second target sub-disk without storing data in the disk array.
[0090] Optionally, the first backup unit 85 may include: a first writing module, which is used to read the data to be backed up from multiple sub-disks in the disk array in stripes and write the data to the second target sub-disk when the data to be backed up exists in the multiple sub-disks in the disk array.
[0091] Through the embodiment provided by the present application, the first acquisition unit 81 obtains a request instruction for the data to be backed up during the process of backing up the data stored in the disk array, wherein the request instruction carries the identification information of the data to be backed up, and the request instruction is used to back up the data to be backed up, and the data to be backed up is stored on a sub-disk in the disk array, and the disk array includes multiple sub-disks; the first determination unit 83 determines the first target sub-disk storing the data to be backed up according to the identification information; the first backup unit 85 writes the data to be backed up from the first target sub-disk to the second target sub-disk when there is a second target sub-disk without data stored in the disk array. When the array in the disk array is backed up, the array is backed up to the sub-disk in the disk array, and no additional storage medium is required for backup, thereby solving the technical problem in the prior art that the data backup security is low due to the need to add a new storage medium when backing up the data.
[0092] Optionally, the apparatus may further include: a second determining unit, configured to determine the backup sub-disk as the second target sub-disk if there is a backup sub-disk in the disk array before writing the data to be backed up from the first target sub-disk to the second target sub-disk.
[0093] Optionally, the above-mentioned device may include: a selection unit, used for selecting a third target sub-disk from multiple sub-disks before writing the data to be backed up from the first target sub-disk to the second target sub-disk, if there is no backup sub-disk in the disk array and there is data in each of the multiple sub-disks; a clearing unit, used for clearing the data stored in the third target sub-disk; and a third determination unit, used for determining that the third target sub-disk from which the data is cleared is the second target sub-disk.
[0094] Optionally, the above-mentioned device may include: a storage unit, which is used to store the data cleared from the third target sub-disk to a cache area after the data stored in the third target sub-disk is cleared; and a second backup unit, which is used to write the partial data of the data to be backed up from the cache area to the second target sub-disk for backup when the data cleared from the third target sub-disk includes partial data of the data to be backed up.
[0095] Optionally, the second backup unit may include: a second writing module, configured to write part of the data to be backed up from the cache area into the second target sub-disk through an XOR operation.
[0096] Optionally, the above-mentioned device may also include: a first deleting unit, used to delete the data to be backed up in the first target sub-disk after writing the data to be backed up from the first target sub-disk to the second target sub-disk; a second deleting unit, used to delete the data to be backed up in multiple sub-disks in the disk array.
[0097] Optionally, the above device may further include: a display unit, configured to display prompt information after writing the data to be backed up from the first target sub-disk to the second target sub-disk, wherein the prompt information is used to prompt that the backup of the data to be backed up has been completed.
[0098] According to another aspect of the embodiment of the present invention, there is also provided an electronic device for implementing the above data backup method, which may be Figure 1 The terminal device or server shown in the figure. This embodiment is described by taking the electronic device as a server as an example. Fig. 9 As shown, the electronic device includes a memory 902 and a processor 904. The memory 902 stores a computer program, and the processor 904 is configured to execute the steps in any of the above method embodiments through the computer program.
[0099] Optionally, in this embodiment, the electronic device may be located in at least one network device among a plurality of network devices of a computer network.
[0100] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0101] S1, in the process of backing up data stored in a disk array, obtaining a request instruction for the data to be backed up, wherein the request instruction carries identification information of the data to be backed up, and the request instruction is used to back up the data to be backed up, and the data to be backed up is stored on a sub-disk in the disk array, and the disk array includes multiple sub-disks;
[0102] S2, determining a first target sub-disk storing the data to be backed up according to the identification information;
[0103] S3: When there is a second target sub-disk without storing data in the disk array, the data to be backed up is written from the first target sub-disk to the second target sub-disk for backup.
[0104] Alternatively, a person skilled in the art may understand that: Fig. 9 The structure shown is for illustration only, and the electronic device may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (MID), a PAD, and other terminal devices. Fig. 9The electronic device and the electronic equipment described above are not limited in structure. Fig. 9 More or fewer components (such as network interfaces, etc.) as shown in, or with Fig. 9 Different configurations are shown.
[0105] Among them, the memory 902 can be used to store software programs and modules, such as program instructions / modules corresponding to the data backup method and device in the embodiments of the present invention. The processor 904 executes various functional applications and data processing by running the software programs and modules stored in the memory 902, that is, to implement the above-mentioned data backup method. The memory 902 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 902 may further include a memory remotely located relative to the processor 904, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. Among them, the memory 902 may be specifically, but not limited to, used to store information such as data to be backed up, identification information, etc. As an example, such as Fig. 9 As shown, the memory 902 may include but is not limited to the first acquisition unit 81, the first determination unit 83 and the first backup unit 85 in the data backup device. In addition, it may also include but is not limited to other module units in the data backup device, which will not be repeated in this example.
[0106] Optionally, the transmission device 906 is used to receive or send data via a network. Specific examples of the above-mentioned network may include a wired network and a wireless network. In one example, the transmission device 906 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers via a network cable so as to communicate with the Internet or a local area network. In one example, the transmission device 906 is a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0107] In addition, the electronic device further includes: a display 908 for displaying the prompt information; and a connection bus 910 for connecting various module components in the electronic device.
[0108] In other embodiments, the terminal device or server may be a node in a distributed system, wherein the distributed system may be a blockchain system, and the blockchain system may be a distributed system formed by connecting the multiple nodes through network communication. Among them, the nodes may form a peer-to-peer (P2P, Peer To Peer) network, and any form of computing device, such as a server, terminal and other electronic devices, may become a node in the blockchain system by joining the peer-to-peer network.
[0109] According to one aspect of the present application, a computer program product or computer program is provided, the computer program product or computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the data backup method provided in the above-mentioned data backup aspect or various optional implementations of the data backup aspect. The computer program is configured to execute the steps of any of the above-mentioned method embodiments when it is run.
[0110] Optionally, in this embodiment, the computer-readable storage medium may be configured to store a computer program for performing the following steps:
[0111] S1, in the process of backing up data stored in a disk array, obtaining a request instruction for the data to be backed up, wherein the request instruction carries identification information of the data to be backed up, and the request instruction is used to back up the data to be backed up, and the data to be backed up is stored on a sub-disk in the disk array, and the disk array includes multiple sub-disks;
[0112] S2, determining a first target sub-disk storing the data to be backed up according to the identification information;
[0113] S3: When there is a second target sub-disk without storing data in the disk array, the data to be backed up is written from the first target sub-disk to the second target sub-disk for backup.
[0114] Optionally, in this embodiment, a person of ordinary skill in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing hardware related to the terminal device through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.
[0115] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0116] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which can be personal computers, servers or network devices, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention.
[0117] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0118] In the several embodiments provided in the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0119] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0120] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0121] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A data backup method, characterized in that: include: In the process of backing up data stored in a disk array, a request instruction for the data to be backed up is obtained, wherein the request instruction carries identification information of the data to be backed up, the request instruction is used to back up the data to be backed up, the data to be backed up is stored on a sub-disk in the disk array, and the disk array includes multiple sub-disks; Determine a first target sub-disk storing the data to be backed up according to the identification information; In the case that there is a second target sub-disk without storing data in the disk array, writing the data to be backed up from the first target sub-disk to the second target sub-disk for backup; Before writing the to-be-backed-up data from the first target sub-disk to the second target sub-disk for backup, the method includes: In a case where there is no backup sub-disk in the disk array and there is data in each of the multiple sub-disks, selecting a third target sub-disk from the multiple sub-disks; Clearing the data stored in the third target sub-disk; The third target sub-disk from which data is to be cleared is determined to be the second target sub-disk.
2. The method according to claim 1, characterized in that The step of writing and backing up the data to be backed up from the first target sub-disk to the second target sub-disk includes: In the case that the data to be backed up exists in a plurality of sub-disks in the disk array, the data to be backed up is read from the plurality of sub-disks in stripes and written into the second target sub-disk.
3. The method according to claim 1, characterized in that Before writing the to-be-backed-up data from the first target sub-disk to the second target sub-disk for backup, the method further includes: In the case where there is a backup sub-disk in the disk array, the backup sub-disk is determined as the second target sub-disk.
4. The method according to claim 1, characterized in that include: After clearing the data stored in the third target sub-disk, the method further includes: storing the data cleared from the third target sub-disk into a cache area; In the case that the data cleared from the third target sub-disk includes part of the data to be backed up, writing and backing up the data to be backed up from the first target sub-disk to the second target sub-disk includes: writing and backing up the part of the data to be backed up included in the cache area to the second target sub-disk.
5. The method according to claim 4, characterized in that The step of writing part of the data to be backed up from the buffer area to the second target sub-disk for backup comprises: Part of the data to be backed up included in the buffer area is written and backed up into the second target sub-disk through an XOR operation.
6. The method according to claim 1, characterized in that After writing the data to be backed up from the first target sub-disk to the second target sub-disk, the method further includes: deleting the data to be backed up stored in the first target sub-disk; or The data to be backed up in the plurality of sub-disks in the disk array is deleted.
7. The method according to claim 1, characterized in that After writing the data to be backed up from the first target sub-disk to the second target sub-disk, the method further includes: A prompt message is displayed, wherein the prompt message is used to prompt that the backup of the data to be backed up has been completed.
8. A data backup device, characterized in that: include: A first acquisition unit is used to acquire a request instruction for data to be backed up during the process of backing up data stored in the disk array, wherein the request instruction carries identification information of the data to be backed up, the request instruction is used to back up the data to be backed up, and the data to be backed up is stored on a sub-disk in the disk array, and the disk array includes multiple sub-disks; A first determining unit, configured to determine a first target sub-disk storing the data to be backed up according to the identification information; A first backup unit is used for writing the data to be backed up from the first target sub-disk to the second target sub-disk when there is a second target sub-disk without storing data in the disk array; The device also includes: A selection unit, configured to select a third target sub-disk from the plurality of sub-disks before writing the data to be backed up from the first target sub-disk to the second target sub-disk, if there is no backup sub-disk in the disk array and if there is data in each of the plurality of sub-disks; A clearing unit, used for clearing the data stored in the third target sub-disk; The third determining unit is configured to determine that the third target sub-disk from which data is to be cleared is the second target sub-disk.
9. The device according to claim 8, characterized in that The first backup unit includes: The first writing module is used for reading the data to be backed up from the multiple sub-disks in stripes and writing the data to the second target sub-disk when the data to be backed up exists in multiple sub-disks in the disk array.
10. The device according to claim 8, characterized in that The device also includes: The second determining unit is configured to, before writing the to-be-backed-up data from the first target sub-disk to a second target sub-disk, determine the backup sub-disk as the second target sub-disk if there is a backup sub-disk in the disk array.
11. The device according to claim 8, characterized in that include: A storage unit, configured to store the data cleared from the third target sub-disk to a buffer area after clearing the data stored in the third target sub-disk; The second backup unit is configured to write the partial data of the data to be backed up from the cache area into the second target sub-disk for backup when the data cleared from the third target sub-disk includes partial data of the data to be backed up.
12. The device according to claim 11, characterized in that The second backup unit includes: The second writing module is used to write part of the data to be backed up included in the buffer area into the second target sub-disk through an XOR operation.
13. The device according to claim 8, characterized in that The device also includes: A first deleting unit is configured to delete the data to be backed up stored in the first target sub-disk after writing the data to be backed up from the first target sub-disk to the second target sub-disk; or The second deleting unit is used to delete the to-be-backed-up data stored in the plurality of sub-disks in the disk array.
14. The device according to claim 8, characterized in that The device also includes: The display unit is used for displaying prompt information after writing the data to be backed up from the first target sub-disk to the second target sub-disk, wherein the prompt information is used for prompting that the backup of the data to be backed up has been completed.
15. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the method described in any one of claims 1 to 7 when executed.
16. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 7 through the computer program.
