CN111831485B - Data recovery method, device, electronic equipment and medium - Google Patents

Data recovery method, device, electronic equipment and medium Download PDF

Info

Publication number
CN111831485B
CN111831485B CN202010706040.3A CN202010706040A CN111831485B CN 111831485 B CN111831485 B CN 111831485B CN 202010706040 A CN202010706040 A CN 202010706040A CN 111831485 B CN111831485 B CN 111831485B
Authority
CN
China
Prior art keywords
data
storage
mirror image
backup
backed
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010706040.3A
Other languages
Chinese (zh)
Other versions
CN111831485A (en
Inventor
许金涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN202010706040.3A priority Critical patent/CN111831485B/en
Priority to PCT/CN2020/122256 priority patent/WO2021135530A1/en
Publication of CN111831485A publication Critical patent/CN111831485A/en
Application granted granted Critical
Publication of CN111831485B publication Critical patent/CN111831485B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • G06F11/1464Management of the backup or restore process for networked environments
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • G06F11/1469Backup restoration techniques

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to data processing and provides a data recovery method, a data recovery device, electronic equipment and a medium. The method can acquire a backup object, a storage object and data to be backed up, creates a storage directory in the storage object when detecting that the storage object meets a storage condition, performs mirror backup on the data to be backed up to obtain mirror backup data, transmits the mirror backup data to a path of the storage directory, determines the data volume of the mirror backup data when receiving a data recovery request of the mirror backup data, acquires a plurality of idle threads according to the data volume, and recovers the mirror backup data to a target disk by using the idle threads. The invention not only can backup the data without installing an application program, but also can improve the efficiency of data recovery. In addition, the invention also relates to a block chain technology, and the mirror image backup data can be stored in the block chain.

Description

Data recovery method, device, electronic equipment and medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a data recovery method and apparatus, an electronic device, and a medium.
Background
With the continuous development of cloud computing and large data centers, the importance of information security becomes more and more obvious, and the database is also gradually regarded as an important content of information security. In order to ensure that a terminal device can recover a service when encountering a system crash or other irreparable failures during operation, an existing method is to backup data by installing an application program on the terminal device, and to recover the data by using the backup data. However, in this way, an application needs to be installed on the terminal device in advance, and meanwhile, the application backs up and restores the data according to a layer-by-layer sequence from the file to the logical volume and then to the disk partition, which increases the complexity of data restoration and reduces the efficiency of data restoration.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a data recovery method, apparatus, electronic device and medium, which can not only backup data without installing an application program, but also improve the efficiency of data recovery.
A data recovery method, the data recovery method comprising:
acquiring a backup object and a storage object;
acquiring data to be backed up in the backup object, and determining a storage space occupied by the data to be backed up;
detecting whether the storage object meets storage conditions or not according to the storage space;
when the storage object is detected to meet the storage condition, creating a storage directory in the storage object;
carrying out mirror image backup on the data to be backed up to obtain mirror image backup data;
determining a path of the storage directory, and transmitting the mirror image backup data to the path;
when a data recovery request of the mirror image backup data is received, determining the data volume of the mirror image backup data;
and acquiring a plurality of idle threads according to the data volume, and recovering the mirror image backup data to the target disk by utilizing the idle threads.
According to a preferred embodiment of the present invention, the detecting whether the storage object satisfies a storage condition according to the storage space includes:
acquiring the residual space of the storage object;
multiplying the residual space by a preset proportion to obtain a target space;
when the storage space is smaller than the target space, determining that the storage object meets the storage condition; or
When the storage space is greater than or equal to the target space, determining that the storage object does not satisfy the storage condition.
According to a preferred embodiment of the present invention, the creating a storage directory in the storage object comprises:
determining the acquisition time of the data to be backed up;
acquiring an internet protocol address and a host name of the backup object;
splicing the acquisition time, the Internet protocol address and the host name to obtain a directory name;
creating the storage directory in the storage object with the directory name.
According to the preferred embodiment of the present invention, the performing mirror image backup on the data to be backed up to obtain mirror image backup data includes:
compressing the data to be backed up to obtain compressed data;
carrying out mirror image processing on the compressed data to obtain data subjected to mirror image processing;
detecting whether the data after the mirror image processing is the same as the data to be backed up or not;
and when detecting that the data after the mirror image processing is the same as the data to be backed up, determining the data after the mirror image processing as the mirror image backup data.
According to a preferred embodiment of the present invention, the transmitting the mirrored backup data to the path includes:
acquiring the transmission progress of the mirror image backup data transmitted to the path;
when the transmission progress is smaller than the preset progress within the preset time, acquiring an idle thread from a preset thread connection pool;
and transmitting the mirror image backup data to the path by utilizing the idle thread.
According to a preferred embodiment of the present invention, the obtaining a plurality of idle threads according to the data amount comprises:
acquiring the processing rates of all threads in the preset thread connection pool;
determining the average processing speed of all the threads according to the processing speed;
dividing the data volume by the average processing speed, and dividing an obtained result by preset time to obtain the number of threads required for processing the data volume;
and acquiring the number of idle threads of the number of the threads from the preset thread connection pool.
According to a preferred embodiment of the present invention, after the mirror image backup data is restored to the target disk by using the plurality of idle threads, the method further includes:
acquiring a request number of the data recovery request;
generating prompt information according to the request number;
encrypting the prompt message by adopting a symmetric encryption algorithm to obtain a ciphertext;
determining a request grade according to the request number, and determining a sending mode according to the request grade;
and sending the ciphertext to the terminal equipment of the appointed contact person in the sending mode.
A data recovery apparatus, the data recovery apparatus comprising:
an acquisition unit configured to acquire a backup object and a storage object;
the determining unit is used for acquiring the data to be backed up in the backup object and determining the storage space occupied by the data to be backed up;
the detection unit is used for detecting whether the storage object meets the storage condition or not according to the storage space;
a creating unit, configured to create a storage directory in the storage object when it is detected that the storage object satisfies the storage condition;
the backup unit is used for carrying out mirror image backup on the data to be backed up to obtain mirror image backup data;
the transmission unit is used for determining a path of the storage directory and transmitting the mirror image backup data to the path;
the determining unit is further configured to determine a data volume of the mirror image backup data when receiving a data recovery request of the mirror image backup data;
and the recovery unit is used for acquiring a plurality of idle threads according to the data volume and recovering the mirror image backup data to the target disk by utilizing the idle threads.
According to a preferred embodiment of the present invention, the detecting unit detecting whether the storage object satisfies a storage condition according to the storage space includes:
acquiring the residual space of the storage object;
multiplying the residual space by a preset proportion to obtain a target space;
when the storage space is smaller than the target space, determining that the storage object meets the storage condition; or
When the storage space is greater than or equal to the target space, determining that the storage object does not satisfy the storage condition.
According to a preferred embodiment of the present invention, the creating unit is specifically configured to:
determining the acquisition time of the data to be backed up;
acquiring an internet protocol address and a host name of the backup object;
splicing the acquisition time, the Internet protocol address and the host name to obtain a directory name;
creating the storage directory in the storage object with the directory name.
According to a preferred embodiment of the present invention, the backup unit is specifically configured to:
compressing the data to be backed up to obtain compressed data;
carrying out mirror image processing on the compressed data to obtain data subjected to mirror image processing;
detecting whether the data subjected to mirror image processing is the same as the data to be backed up or not;
and when the data after the mirror image processing is detected to be the same as the data to be backed up, determining the data after the mirror image processing as the mirror image backup data.
According to a preferred embodiment of the present invention, the transmission unit is specifically configured to:
acquiring the transmission progress of the mirror image backup data transmitted to the path;
when the transmission progress is smaller than the preset progress within the preset time, acquiring an idle thread from a preset thread connection pool;
and transmitting the mirror image backup data to the path by utilizing the idle thread.
According to a preferred embodiment of the present invention, the acquiring unit acquires a plurality of idle threads according to the data amount includes:
acquiring the processing rates of all threads in the preset thread connection pool;
determining the average processing speed of all the threads according to the processing speed;
dividing the data volume by the average processing speed, and dividing an obtained result by preset time to obtain the number of threads required for processing the data volume;
and acquiring the number of idle threads of the number of the threads from the preset thread connection pool.
According to a preferred embodiment of the present invention, the obtaining unit is further configured to obtain a request number of the data recovery request after the mirror image backup data is recovered to the target disk by using the plurality of idle threads;
the device further comprises:
the generating unit is used for generating prompt information according to the request number;
the encryption unit is used for encrypting the prompt message by adopting a symmetric encryption algorithm to obtain a ciphertext;
the determining unit is further configured to determine a request level according to the request number, and determine a sending manner according to the request level;
and the sending unit is used for sending the ciphertext to the terminal equipment of the appointed contact person in the sending mode.
An electronic device, the electronic device comprising:
a memory storing at least one instruction; and
a processor executing instructions stored in the memory to implement the data recovery method.
A computer-readable storage medium having at least one instruction stored therein, the at least one instruction being executable by a processor in an electronic device to implement the data recovery method.
According to the technical scheme, the storage space occupied by the data to be backed up is determined, whether the storage object meets the storage condition is detected according to the storage space, whether the storage object meets the storage condition of the data to be backed up or not can be detected, the storage object can be ensured to be stored in the data to be backed up, the storage directory is established in the storage object, the mirror image backup data of the backup object can be quickly found when the backup object loses data, the mirror image backup data is transmitted to the path, backup of the data to be backed up can be achieved without installing an application program, the appropriate number of threads can be determined according to the data quantity by determining the data quantity of the mirror image backup data, the mirror image backup data is restored to the target disk by using the idle threads with the number being the number of the threads, and the recovery efficiency of the mirror image backup data can be improved.
Drawings
FIG. 1 is a flow chart of a preferred embodiment of the data recovery method of the present invention.
FIG. 2 is a functional block diagram of a preferred embodiment of the data recovery apparatus of the present invention.
FIG. 3 is a schematic structural diagram of an electronic device implementing a data recovery method according to a preferred embodiment of the invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in detail with reference to the accompanying drawings and specific embodiments.
FIG. 1 is a flow chart of a data recovery method according to a preferred embodiment of the present invention. The order of the steps in the flow chart may be changed and some steps may be omitted according to different needs.
The data recovery method is applied to one or more electronic devices, which are devices capable of automatically performing numerical calculation and/or information processing according to preset or stored instructions, and the hardware thereof includes, but is not limited to, a microprocessor, an Application Specific Integrated Circuit (ASIC), a Programmable Gate Array (FPGA), a Digital Signal Processor (DSP), an embedded device, and the like.
The electronic device may be any electronic product capable of performing human-computer interaction with a user, for example, a Personal computer, a tablet computer, a smart phone, a Personal Digital Assistant (PDA), a game machine, an interactive Internet Protocol Television (IPTV), an intelligent wearable device, and the like.
The electronic device may also include a network device and/or a user device. The network device includes, but is not limited to, a single network server, a server group consisting of a plurality of network servers, or a Cloud Computing (Cloud Computing) based Cloud consisting of a large number of hosts or network servers.
The Network where the electronic device is located includes, but is not limited to, the internet, a wide area Network, a metropolitan area Network, a local area Network, a Virtual Private Network (VPN), and the like.
And S10, acquiring a backup object and a storage object.
In at least one embodiment of the present invention, the backup object refers to an object that needs to be backed up, where the object may be any disk or any client.
In at least one embodiment of the present invention, the storage object refers to an object storing data on the backup object, wherein the storage object may be a mounted disk.
S11, obtaining the data to be backed up in the backup object, and determining the storage space occupied by the data to be backed up.
In at least one embodiment of the present invention, the data to be backed up refers to data that needs to be backed up.
In at least one embodiment of the present invention, the electronic device may obtain the data to be backed up in the backup object through an FC switch.
And S12, detecting whether the storage object meets storage conditions or not according to the storage space.
In at least one embodiment of the present invention, the storage condition refers to whether the data to be backed up can be completely stored in the storage object.
In at least one embodiment of the present invention, the electronic device detecting whether the storage object satisfies a storage condition according to the storage space includes:
acquiring the residual space of the storage object;
multiplying the residual space by a preset proportion to obtain a target space;
when the storage space is smaller than the target space, determining that the storage object meets the storage condition; or
When the storage space is greater than or equal to the target space, determining that the storage object does not satisfy the storage condition.
The value of the preset ratio is less than 100%, and in addition, the value of the preset ratio may be set according to an application scenario, for example, the preset ratio may be 90%, and the specific value of the preset ratio is not limited in the present invention.
By multiplying the residual space by a preset proportion, the storage object can be prevented from overflowing due to full occupation.
In at least one embodiment of the present invention, after determining that the storage object does not satisfy the storage condition, selecting a target storage location according to the storage space.
S13, when the storage object is detected to meet the storage condition, a storage directory is created in the storage object.
In at least one embodiment of the invention, the electronic device creating a storage directory in the storage object comprises:
determining the acquisition time of the data to be backed up;
acquiring an internet protocol address and a host name of the backup object;
splicing the acquisition time, the Internet protocol address and the host name to obtain a directory name;
creating the storage directory in the storage object with the directory name.
By splicing the acquisition time, the internet protocol address and the host name, the uniqueness of the directory name can be ensured, and by creating the storage directory in the storage object by using the directory name, the mirror image backup data of the backup object can be quickly found when the backup object loses data.
And S14, carrying out mirror image backup on the data to be backed up to obtain mirror image backup data.
It is emphasized that, in order to further ensure the privacy and security of the mirrored backup data, the mirrored backup data may also be stored in a node of a blockchain.
In at least one embodiment of the present invention, the mirror image backup data refers to data obtained by compressing and mirroring the data to be backed up.
In at least one embodiment of the present invention, the performing, by the electronic device, mirror backup on the data to be backed up to obtain mirror backup data includes:
compressing the data to be backed up to obtain compressed data;
carrying out mirror image processing on the compressed data to obtain data subjected to mirror image processing;
detecting whether the data subjected to mirror image processing is the same as the data to be backed up or not;
and when detecting that the data after the mirror image processing is the same as the data to be backed up, determining the data after the mirror image processing as the mirror image backup data.
The data to be backed up is compressed, so that the speed of mirror image processing can be improved, the backup processing of the data to be backed up can be realized under the condition that an application program is not required to be installed by carrying out mirror image processing on the compressed data, and the consistency of the mirror image backup data and the data to be backed up can be ensured by detecting whether the data subjected to mirror image processing is the same as the data to be backed up or not.
Specifically, the electronic device may perform mirroring on the compressed data by using a DD command to obtain data after the mirroring.
In at least one embodiment of the present invention, when it is detected that the mirrored data is different from the data to be backed up, the method further includes:
determining the heterogeneous data of which the data after the mirror image processing is different from the data to be backed up;
generating alarm information according to the abnormal data;
and sending the alarm information to a client of a specified user.
Through the embodiment, the appointed user can be timely reminded when the mirror image backup data is detected to be different from the data to be backed up, and the mirror image backup data is ensured to be the same as the data to be backed up.
S15, determining a path of the storage directory, and transmitting the mirror image backup data to the path.
In at least one embodiment of the present invention, the path refers to a location where the storage directory is located.
In at least one embodiment of the present invention, the electronic device transmitting the mirrored backup data to the path includes:
acquiring the transmission progress of the mirror image backup data to the path;
when the transmission progress is smaller than the preset progress within the preset time, acquiring an idle thread from a preset thread connection pool;
and transmitting the mirror image backup data to the path by utilizing the idle thread.
By the embodiment, when the transmission progress is smaller than the preset progress, the mirror image backup data can be transmitted by using the idle thread, so that the situation that the transmission rate of the thread for transmitting the mirror image backup data is reduced due to synchronous processing of other requests is avoided, and the transmission rate of the mirror image backup data is improved.
In at least one embodiment of the invention, the method further comprises:
and displaying the transmission progress.
The transmission progress is displayed, so that the user can quickly check the transmission progress.
And S16, when receiving the data recovery request of the mirror image backup data, determining the data volume of the mirror image backup data.
In at least one embodiment of the invention, the data recovery request may be triggered upon detection of a system crash.
Further, the data information carried in the data recovery request includes, but is not limited to: a request number, etc.
And S17, acquiring a plurality of idle threads according to the data volume, and restoring the mirror image backup data to the target disk by using the idle threads.
In at least one embodiment of the present invention, the acquiring, by the electronic device, a plurality of idle threads according to the data amount includes:
acquiring the processing rates of all threads in the preset thread connection pool;
determining the average processing speed of all the threads according to the processing speed;
dividing the data volume by the average processing speed, and dividing an obtained result by preset time to obtain the number of threads required for processing the data volume;
and acquiring the number of idle threads from the preset thread connection pool, wherein the number of the idle threads is the number of the threads.
Through the embodiment, the appropriate thread number can be determined, and the data recovery efficiency can be improved under the condition of avoiding resource waste.
In at least one embodiment of the present invention, after the mirror backup data is restored to the target disk by using the plurality of idle threads, the method further includes:
acquiring a request number of the data recovery request;
generating prompt information according to the request number;
encrypting the prompt message by adopting a symmetric encryption algorithm to obtain a ciphertext;
determining a request grade according to the request number, and determining a sending mode according to the request grade;
and sending the ciphertext to the terminal equipment of the appointed contact person in the sending mode.
Wherein the request level includes, but is not limited to: level one, level two, etc.
Further, the sending method includes, but is not limited to: mail mode, telephone mode, etc.
Through the embodiment, the appointed contact person can be informed in time after the data is recovered, meanwhile, the safety of the prompt message is improved through the encryption processing of the prompt message, and in addition, the ciphertext can be sent in a proper sending mode.
According to the technical scheme, the storage space occupied by the data to be backed up is determined, whether the storage object meets the storage condition is detected according to the storage space, whether the storage object meets the storage condition of the data to be backed up or not can be detected, the storage object can be ensured to be stored in the data to be backed up, the storage directory is established in the storage object, the mirror image backup data of the backup object can be quickly found when the backup object loses data, the mirror image backup data is transmitted to the path, backup of the data to be backed up can be achieved without installing an application program, the appropriate number of threads can be determined according to the data quantity by determining the data quantity of the mirror image backup data, the mirror image backup data is restored to the target disk by using the idle threads with the number being the number of the threads, and the recovery efficiency of the mirror image backup data can be improved.
Fig. 2 is a functional block diagram of a preferred embodiment of the data recovery apparatus according to the present invention. The data restoring apparatus 11 includes an acquiring unit 110, a determining unit 111, a detecting unit 112, a creating unit 113, a backup unit 114, a transmitting unit 115, an encrypting unit 116, a restoring unit 117, a generating unit 118, a transmitting unit 119, and a displaying unit 120. The module/unit referred to in the present invention refers to a series of computer program segments that can be executed by the processor 13 and that can perform a fixed function, and that are stored in the memory 12. In the present embodiment, the functions of the modules/units will be described in detail in the following embodiments.
The acquisition unit 110 acquires a backup object and a storage object.
In at least one embodiment of the present invention, the backup object refers to an object that needs to be backed up, where the object may be any disk or any client.
In at least one embodiment of the present invention, the storage object refers to an object storing data on the backup object, wherein the storage object may be a mounted disk.
The determining unit 111 obtains data to be backed up in the backup object, and determines a storage space occupied by the data to be backed up.
In at least one embodiment of the present invention, the data to be backed up refers to data that needs to be backed up.
In at least one embodiment of the present invention, the determining unit 111 may obtain the data to be backed up in the backup object through an FC switch.
The detection unit 112 detects whether the storage object satisfies a storage condition according to the storage space.
In at least one embodiment of the present invention, the storage condition refers to whether the data to be backed up can be completely stored in the storage object.
In at least one embodiment of the present invention, the detecting unit 112 detects whether the storage object satisfies the storage condition according to the storage space, including:
acquiring the residual space of the storage object;
multiplying the residual space by a preset proportion to obtain a target space;
when the storage space is smaller than the target space, determining that the storage object meets the storage condition; or
When the storage space is greater than or equal to the target space, determining that the storage object does not satisfy the storage condition.
The value of the preset ratio is less than 100%, and in addition, the value of the preset ratio may be set according to an application scenario, for example, the preset ratio may be 90%, and the specific value of the preset ratio is not limited in the present invention.
By multiplying the residual space by a preset proportion, the storage object can be prevented from overflowing due to full occupation.
In at least one embodiment of the present invention, after determining that the storage object does not satisfy the storage condition, selecting a target storage location according to the storage space.
When detecting that the storage object satisfies the storage condition, the creating unit 113 creates a storage directory in the storage object.
In at least one embodiment of the present invention, the creating unit 113 creates a storage directory in the storage object, including:
determining the acquisition time of the data to be backed up;
acquiring an internet protocol address and a host name of the backup object;
splicing the acquisition time, the Internet protocol address and the host name to obtain a directory name;
creating the storage directory in the storage object with the directory name.
By splicing the acquisition time, the internet protocol address and the host name, the uniqueness of the directory name can be ensured, and by creating the storage directory in the storage object by using the directory name, the mirror image backup data of the backup object can be quickly found when the backup object loses data.
The backup unit 114 performs mirror backup on the data to be backed up to obtain mirror backup data.
It is emphasized that, in order to further ensure the privacy and security of the mirrored backup data, the mirrored backup data may also be stored in a node of a blockchain.
In at least one embodiment of the present invention, the mirror image backup data refers to data obtained by compressing and mirroring the data to be backed up.
In at least one embodiment of the present invention, the performing, by the backup unit 114, mirror backup on the data to be backed up to obtain mirror backup data includes:
compressing the data to be backed up to obtain compressed data;
carrying out mirror image processing on the compressed data to obtain data subjected to mirror image processing;
detecting whether the data after the mirror image processing is the same as the data to be backed up or not;
and when the data after the mirror image processing is detected to be the same as the data to be backed up, determining the data after the mirror image processing as the mirror image backup data.
The data to be backed up is compressed, so that the speed of mirror image processing can be improved, the backup processing of the data to be backed up can be realized under the condition that an application program is not required to be installed by carrying out mirror image processing on the compressed data, and the consistency of the mirror image backup data and the data to be backed up can be ensured by detecting whether the data subjected to mirror image processing is the same as the data to be backed up or not.
Specifically, the backup unit 114 may perform mirroring on the compressed data by using a DD command, to obtain the mirrored data.
In at least one embodiment of the present invention, when it is detected that the mirrored data is different from the data to be backed up, the determining unit 111 determines heterogeneous data in which the mirrored data is different from the data to be backed up;
the generating unit 118 generates alarm information from the heterogeneous data;
the transmission unit 119 transmits the alert information to a client of a specified user.
Through the embodiment, the appointed user can be timely reminded when the mirror image backup data is detected to be different from the data to be backed up, and the mirror image backup data is ensured to be the same as the data to be backed up.
The transmission unit 115 determines a path of the storage directory and transmits the mirrored backup data to the path.
In at least one embodiment of the present invention, the path refers to a location where the storage directory is located.
In at least one embodiment of the present invention, the transmitting unit 115 transmits the mirrored backup data to the path includes:
acquiring the transmission progress of the mirror image backup data transmitted to the path;
when the transmission progress is smaller than the preset progress within the preset time, acquiring an idle thread from a preset thread connection pool;
and transmitting the mirror image backup data to the path by utilizing the idle thread.
By the embodiment, when the transmission progress is smaller than the preset progress, the mirror image backup data can be transmitted by using the idle thread, so that the situation that the transmission rate of the thread for transmitting the mirror image backup data is reduced due to synchronous processing of other requests is avoided, and the transmission rate of the mirror image backup data is improved.
In at least one embodiment of the present invention, the display unit 120 displays the transmission progress.
The transmission progress is displayed, so that the user can quickly check the transmission progress.
And when a data recovery request of the mirror image backup data is received, determining the data volume of the mirror image backup data.
In at least one embodiment of the invention, the data recovery request may be triggered upon detection of a system crash.
Further, the data information carried in the data recovery request includes, but is not limited to: a request number, etc.
The recovery unit 117 obtains a plurality of idle threads according to the data amount, and recovers the mirror image backup data to the target disk by using the plurality of idle threads.
In at least one embodiment of the present invention, the retrieving unit 117 acquires a plurality of idle threads according to the data amount includes:
acquiring the processing rates of all threads in the preset thread connection pool;
determining the average processing speed of all the threads according to the processing speed;
dividing the data volume by the average processing speed, and dividing an obtained result by preset time to obtain the number of threads required for processing the data volume;
and acquiring the number of idle threads of the number of the threads from the preset thread connection pool.
Through the embodiment, the appropriate thread number can be determined, and the data recovery efficiency can be improved under the condition of avoiding resource waste.
In at least one embodiment of the present invention, after the mirror image backup data is restored to the target disk by using the idle threads, the obtaining unit 110 obtains a request number of the data restoration request;
the generating unit 118 generates prompt information according to the request number;
the encryption unit 116 encrypts the prompt message by using a symmetric encryption algorithm to obtain a ciphertext;
the determining unit 111 determines a request level according to the request number, and determines a sending mode according to the request level;
the sending unit 119 sends the ciphertext to the terminal device of the designated contact in the sending manner.
Wherein the request level includes, but is not limited to: level one, level two, etc.
Further, the sending method includes, but is not limited to: mail mode, telephone mode, etc.
Through the embodiment, the designated contact person can be notified in time after data recovery, meanwhile, the safety of the prompt information is improved by encrypting the prompt information, and in addition, the ciphertext can be transmitted in a proper transmission mode.
According to the technical scheme, the storage space occupied by the data to be backed up is determined, whether the storage object meets the storage condition is detected according to the storage space, whether the storage object meets the storage condition of the data to be backed up or not can be detected, the storage object can be ensured to be stored in the data to be backed up, the storage directory is established in the storage object, the mirror image backup data of the backup object can be quickly found when the backup object loses data, the mirror image backup data is transmitted to the path, backup of the data to be backed up can be achieved without installing an application program, the appropriate number of threads can be determined according to the data quantity by determining the data quantity of the mirror image backup data, the mirror image backup data is restored to the target disk by using the idle threads with the number being the number of the threads, and the recovery efficiency of the mirror image backup data can be improved.
Fig. 3 is a schematic structural diagram of an electronic device according to a preferred embodiment of the method for recovering data of the present invention.
In one embodiment of the present invention, the electronic device 1 includes, but is not limited to, a memory 12, a processor 13, and a computer program, such as a data recovery program, stored in the memory 12 and executable on the processor 13.
It will be appreciated by a person skilled in the art that the schematic diagram is only an example of the electronic device 1 and does not constitute a limitation of the electronic device 1, and that it may comprise more or less components than shown, or some components may be combined, or different components, e.g. the electronic device 1 may further comprise an input output device, a network access device, a bus, etc.
The Processor 13 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, etc. The processor 13 is an operation core and a control center of the electronic device 1, and is connected to each part of the whole electronic device 1 by various interfaces and lines, and executes an operating system of the electronic device 1 and various installed application programs, program codes, and the like.
The processor 13 executes an operating system of the electronic device 1 and various installed application programs. The processor 13 executes the application program to implement the steps in the various data recovery method embodiments described above, such as the steps shown in fig. 1.
Alternatively, the processor 13, when executing the computer program, implements the functions of the modules/units in the above device embodiments, for example:
acquiring a backup object and a storage object;
acquiring data to be backed up in the backup object, and determining a storage space occupied by the data to be backed up;
detecting whether the storage object meets storage conditions or not according to the storage space;
when the storage object is detected to meet the storage condition, creating a storage directory in the storage object;
carrying out mirror image backup on the data to be backed up to obtain mirror image backup data;
determining a path of the storage directory and transmitting the mirror image backup data to the path;
when a data recovery request of the mirror image backup data is received, determining the data volume of the mirror image backup data;
and acquiring a plurality of idle threads according to the data volume, and recovering the mirror image backup data to the target disk by utilizing the idle threads.
Illustratively, the computer program may be partitioned into one or more modules/units, which are stored in the memory 12 and executed by the processor 13 to implement the present invention. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution process of the computer program in the electronic device 1. For example, the computer program may be divided into an acquisition unit 110, a determination unit 111, a detection unit 112, a creation unit 113, a backup unit 114, a transmission unit 115, an encryption unit 116, a restoration unit 117, a generation unit 118, a transmission unit 119, and a display unit 120.
The memory 12 can be used for storing the computer programs and/or modules, and the processor 13 implements various functions of the electronic device 1 by running or executing the computer programs and/or modules stored in the memory 12 and calling data stored in the memory 12. The memory 12 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data created according to use of the electronic device, and the like. Further, the memory 12 may include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), at least one magnetic disk storage device, a Flash memory device, or other non-volatile solid state storage device.
The memory 12 may be an external memory and/or an internal memory of the electronic device 1. Further, the memory 12 may be a memory having a physical form, such as a memory stick, a TF Card (Trans-flash Card), or the like.
The integrated modules/units of the electronic device 1 may be stored in a computer-readable storage medium if they are implemented in the form of software functional units and sold or used as separate products. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented.
Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying said computer program code, recording medium, U-disk, removable hard disk, magnetic disk, optical disk, computer Memory, read-Only Memory (ROM).
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a string of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, which is used for verifying the validity (anti-counterfeiting) of the information and generating a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
In connection with fig. 1, the memory 12 in the electronic device 1 stores a plurality of instructions to implement a data recovery method, and the processor 13 can execute the plurality of instructions to implement:
acquiring a backup object and a storage object;
acquiring data to be backed up in the backup object, and determining a storage space occupied by the data to be backed up;
detecting whether the storage object meets storage conditions or not according to the storage space;
when the storage object is detected to meet the storage condition, creating a storage directory in the storage object;
carrying out mirror image backup on the data to be backed up to obtain mirror image backup data;
determining a path of the storage directory and transmitting the mirror image backup data to the path;
when a data recovery request of the mirror image backup data is received, determining the data volume of the mirror image backup data;
and acquiring a plurality of idle threads according to the data volume, and recovering the mirror image backup data to the target disk by utilizing the idle threads.
Specifically, the processor 13 may refer to the description of the relevant steps in the embodiment corresponding to fig. 1 for a specific implementation method of the instruction, which is not described herein again.
In the embodiments provided in the present invention, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the system claims may also be implemented by one unit or means in software or hardware. The terms second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims (9)

1. A data recovery method, characterized in that the data recovery method comprises:
acquiring a backup object and a storage object;
acquiring data to be backed up in the backup object, and determining a storage space occupied by the data to be backed up;
detecting whether the storage object meets storage conditions or not according to the storage space;
when detecting that the storage object meets the storage condition, creating a storage directory in the storage object, including: determining the acquisition time of the data to be backed up; acquiring an internet protocol address and a host name of the backup object; splicing the acquisition time, the Internet protocol address and the host name to obtain a directory name; creating the storage directory in the storage object with the directory name;
carrying out mirror image backup on the data to be backed up to obtain mirror image backup data;
determining a path of the storage directory and transmitting the mirror image backup data to the path;
when a data recovery request of the mirror image backup data is received, determining the data volume of the mirror image backup data;
and acquiring a plurality of idle threads according to the data volume, and restoring the mirror image backup data to a target disk by using the idle threads.
2. The data recovery method of claim 1, wherein the detecting whether the storage object satisfies a storage condition according to the storage space comprises:
acquiring the residual space of the storage object;
multiplying the residual space by a preset proportion to obtain a target space;
when the storage space is smaller than the target space, determining that the storage object meets the storage condition; or alternatively
When the storage space is greater than or equal to the target space, determining that the storage object does not satisfy the storage condition.
3. The data recovery method of claim 1, wherein the performing mirror backup on the data to be backed up to obtain mirror backup data comprises:
compressing the data to be backed up to obtain compressed data;
carrying out mirror image processing on the compressed data to obtain data subjected to mirror image processing;
detecting whether the data subjected to mirror image processing is the same as the data to be backed up or not;
and when the data after the mirror image processing is detected to be the same as the data to be backed up, determining the data after the mirror image processing as the mirror image backup data.
4. The data recovery method of claim 1, wherein the transmitting the mirrored backup data to the path comprises:
acquiring the transmission progress of the mirror image backup data transmitted to the path;
when the transmission progress is smaller than the preset progress within the preset time, acquiring an idle thread from a preset thread connection pool;
and transmitting the mirror image backup data to the path by utilizing the idle thread.
5. The data recovery method of claim 4, wherein said obtaining a plurality of idle threads based on said amount of data comprises:
acquiring the processing rates of all threads in the preset thread connection pool;
determining the average processing speed of all the threads according to the processing speed;
dividing the data volume by the average processing speed, and dividing an obtained result by preset time to obtain the number of threads required for processing the data volume;
and acquiring the number of idle threads of the number of the threads from the preset thread connection pool.
6. The data recovery method of claim 1, wherein after recovering the mirrored backup data to the target disk using the plurality of idle threads, the method further comprises:
acquiring a request number of the data recovery request;
generating prompt information according to the request number;
encrypting the prompt message by adopting a symmetric encryption algorithm to obtain a ciphertext;
determining a request grade according to the request number, and determining a sending mode according to the request grade;
and sending the ciphertext to the terminal equipment of the appointed contact person in the sending mode.
7. A data recovery apparatus, characterized in that the data recovery apparatus comprises:
an acquisition unit configured to acquire a backup object and a storage object;
the determining unit is used for acquiring the data to be backed up in the backup object and determining the storage space occupied by the data to be backed up;
the detection unit is used for detecting whether the storage object meets the storage condition or not according to the storage space;
a creating unit, configured to create a storage directory in the storage object when it is detected that the storage object satisfies the storage condition, including: determining the acquisition time of the data to be backed up; acquiring an internet protocol address and a host name of the backup object; splicing the acquisition time, the Internet protocol address and the host name to obtain a directory name; creating the storage directory in the storage object with the directory name;
the backup unit is used for carrying out mirror image backup on the data to be backed up to obtain mirror image backup data;
the transmission unit is used for determining a path of the storage directory and transmitting the mirror image backup data to the path;
the determining unit is further configured to determine a data amount of the mirror image backup data when a data recovery request of the mirror image backup data is received;
and the recovery unit is used for acquiring a plurality of idle threads according to the data volume and recovering the mirror image backup data to a target disk by utilizing the idle threads.
8. An electronic device, characterized in that the electronic device comprises:
a memory storing at least one instruction; and
a processor executing instructions stored in the memory to implement the data recovery method of any one of claims 1 to 6.
9. A computer-readable storage medium characterized by: the computer-readable storage medium has stored therein at least one instruction that is executed by a processor in an electronic device to implement the data recovery method of any one of claims 1 to 6.
CN202010706040.3A 2020-07-21 2020-07-21 Data recovery method, device, electronic equipment and medium Active CN111831485B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202010706040.3A CN111831485B (en) 2020-07-21 2020-07-21 Data recovery method, device, electronic equipment and medium
PCT/CN2020/122256 WO2021135530A1 (en) 2020-07-21 2020-10-20 Data recovery method and apparatus, electronic device, and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010706040.3A CN111831485B (en) 2020-07-21 2020-07-21 Data recovery method, device, electronic equipment and medium

Publications (2)

Publication Number Publication Date
CN111831485A CN111831485A (en) 2020-10-27
CN111831485B true CN111831485B (en) 2023-01-13

Family

ID=72923856

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010706040.3A Active CN111831485B (en) 2020-07-21 2020-07-21 Data recovery method, device, electronic equipment and medium

Country Status (2)

Country Link
CN (1) CN111831485B (en)
WO (1) WO2021135530A1 (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113282571A (en) * 2021-05-26 2021-08-20 北京金山云网络技术有限公司 Data transfer method and device, electronic equipment and storage medium
CN113672435A (en) * 2021-07-09 2021-11-19 济南浪潮数据技术有限公司 Data recovery method, device, equipment and storage medium
CN113986620B (en) * 2021-12-28 2022-04-12 国网浙江省电力有限公司 Multi-region information backup verification recovery method and device suitable for middle station
CN114924911B (en) * 2022-05-19 2023-04-14 广州鼎甲计算机科技有限公司 Method, device, equipment and storage medium for backing up effective data of Windows operating system
CN115437849A (en) * 2022-09-21 2022-12-06 梁力 Data processing method, device, equipment and computer readable storage medium
CN117082083A (en) * 2023-08-30 2023-11-17 杭州浩联智能科技有限公司 Data storage method, device and medium based on distributed Internet of things architecture
CN117056133B (en) * 2023-10-12 2024-02-06 杭州浩联智能科技有限公司 Data backup method, device and medium based on distributed Internet of things architecture

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20130136184A (en) * 2012-06-04 2013-12-12 삼성전자주식회사 Method for contents backup and an electronic device thereof
US8914334B2 (en) * 2012-09-12 2014-12-16 International Business Machines Corporation Using a metadata image of a file system and archive instance to restore data objects in the file system
CN103455391B (en) * 2013-09-06 2016-04-20 南宁博大全讯科技有限公司 A kind of apparatus and method of data protection of dynamic conditioning
CN104331346B (en) * 2014-11-21 2017-08-25 四川神琥科技有限公司 A kind of data guard method
CN106557384B (en) * 2015-09-25 2020-10-02 南京中兴软件有限责任公司 Data processing method, device and system based on Linux
CN105373453B (en) * 2015-12-15 2019-07-30 中国农业银行股份有限公司 Data back up method and system
US10296368B2 (en) * 2016-03-09 2019-05-21 Commvault Systems, Inc. Hypervisor-independent block-level live browse for access to backed up virtual machine (VM) data and hypervisor-free file-level recovery (block-level pseudo-mount)
CN107665153A (en) * 2016-07-27 2018-02-06 中兴通讯股份有限公司 Data back up method, restoration methods and device in a kind of big data system
CN109062737A (en) * 2018-08-24 2018-12-21 郑州云海信息技术有限公司 A kind of method of quick backup test data
CN109492024A (en) * 2018-10-26 2019-03-19 平安科技(深圳)有限公司 Data processing method, device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN111831485A (en) 2020-10-27
WO2021135530A1 (en) 2021-07-08

Similar Documents

Publication Publication Date Title
CN111831485B (en) Data recovery method, device, electronic equipment and medium
CN111880967A (en) File backup method, device, medium and electronic equipment in cloud scene
CN113050900B (en) Screen sharing method, device, equipment and storage medium
CN111698088A (en) Key alternation method, key alternation device, electronic equipment and medium
CN112948851A (en) User authentication method, device, server and storage medium
CN112860737B (en) Data query method and device, electronic equipment and readable storage medium
CN111984601A (en) Log file deleting method and device, electronic equipment and storage medium
CN113342498A (en) Concurrent request processing method, device, server and storage medium
CN115118738B (en) Disaster recovery method, device, equipment and medium based on RDMA
CN112416583A (en) High-frequency request processing method and device, electronic equipment and storage medium
CN114816820A (en) Method, device, equipment and storage medium for repairing chproxy cluster fault
CN111796936A (en) Request processing method and device, electronic equipment and medium
CN111814045A (en) Data query method and device, electronic equipment and storage medium
CN111881209A (en) Data synchronization method and device for heterogeneous database, electronic equipment and medium
CN111277626B (en) Server upgrading method and device, electronic equipment and medium
CN112463454B (en) Data recovery method, server, terminal device and storage medium
CN112134968A (en) Domain name access method and device, electronic equipment and storage medium
CN111680483A (en) Document template updating method and device, electronic equipment and medium
CN113590703B (en) ES data importing method and device, electronic equipment and readable storage medium
CN112817742B (en) Data migration method, device, equipment and storage medium
CN112395319B (en) Cache sharing method and device, server and storage medium
CN112181662A (en) Task scheduling method and device, electronic equipment and storage medium
CN116225789B (en) Transaction system backup capability detection method, device, equipment and medium
CN112182598A (en) Public sample ID identification method, device, server and readable storage medium
CN112559072B (en) Service function starting method and related equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40029435

Country of ref document: HK

SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant