Data recovery method and device of distributed database
By generating and storing QR code images in a distributed database to achieve data recovery, the problem of incomplete data recovery in MySQL databases is solved, data recovery efficiency is improved, and costs and risks of leakage are reduced.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA TELECOM CORP LTD
- Filing Date
- 2022-07-06
- Publication Date
- 2026-04-14
AI Technical Summary
In existing technologies, MySQL database data recovery methods use global binary logs (Binlog) for fragmented processing, which leads to incomplete data recovery and low efficiency in data recovery for distributed databases.
The system generates and stores QR code images of the data to be stored in the storage unit of the distributed database, and retrieves the QR code images from the target storage unit for data recovery when needed, generating the recovered data through the QR code images.
It improves the integrity and efficiency of distributed database data recovery, and reduces data recovery costs and the risk of data leakage.
Smart Images

Figure CN115269267B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data recovery technology for distributed databases, and in particular to a data recovery method for distributed databases, a data recovery device for distributed databases, an electronic device, and a computer-readable storage medium. Background Technology
[0002] MySQL is an open-source relational database system that holds a place in the technology stacks of most enterprises worldwide. It is estimated to be downloaded tens of thousands of times daily. Due to its high reliability, affordability, and ease of use, MySQL is the first choice for many high-performance database developers, administrators, and IT managers.
[0003] In related technologies, to prevent data loss in MySQL databases, the following method is generally used to recover lost data: developers back up the original data to a global binary log (Binlog) on the local machine or server. When data is lost, the global binary log (Binlog) can be fragmented for data recovery. However, using the global binary log (Binlog) for data recovery can lead to incomplete data recovery, resulting in low data recovery efficiency in distributed databases. Summary of the Invention
[0004] The present invention provides a data recovery method, apparatus, electronic device, and computer-readable storage medium for distributed databases to address the problem of improving the data recovery efficiency of distributed databases.
[0005] This invention discloses a data recovery method for a distributed database, wherein the distributed database has multiple storage units and may include:
[0006] The target storage unit is determined from the storage units;
[0007] Acquire the data to be stored, and when storing the data to be stored, generate a QR code image to represent the data to be stored;
[0008] The data to be stored is stored in the storage unit, and the QR code image is stored in the target storage unit;
[0009] When it is necessary to retrieve the data to be stored, and the data to be stored has been deleted from the storage unit, or the data to be stored is corrupted, the QR code image is retrieved from the target storage unit, and the QR code image is used to generate recovery data for the data to be stored.
[0010] Optionally, the target storage unit is configured with a graphics processing module, and the step of generating a QR code image to represent the data to be stored may include:
[0011] The graphical processing module is used to generate a QR code image to represent the data to be stored.
[0012] Optionally, the step of generating a QR code image for representing the data to be stored using the graphics processing module may include:
[0013] The graphical processing module uses a binary algorithm to convert the data to be stored into a first binary sequence.
[0014] A second binary sequence is generated using the first binary sequence;
[0015] A QR code image is generated using the second binary sequence; the second binary sequence is an encrypted sequence.
[0016] Optionally, before the step of retrieving the QR code image from the target storage unit, the method may further include:
[0017] Retrieve the identity verification information sent by the user;
[0018] The identity verification information is used to determine whether the user's access is legitimate;
[0019] If so, then the step of retrieving the QR code image from the target storage unit is performed.
[0020] Optionally, the step of generating recovery data for the data to be stored using the QR code image may include:
[0021] The graphical processing module is used to parse the QR code image and generate recovery data for the data to be stored.
[0022] This invention also discloses a data recovery device for a distributed database, wherein the distributed database has multiple storage units and may include:
[0023] A target storage unit determination module is used to determine a target storage unit from the storage units;
[0024] The data to be stored acquisition module is used to acquire the data to be stored and, when storing the data to be stored, generate a QR code image to represent the data to be stored;
[0025] The data storage module is used to store the data to be stored in the storage unit and to store the QR code image in the target storage unit;
[0026] The data recovery module is used to retrieve the QR code image from the target storage unit and generate recovery data for the data to be stored when it is necessary to extract the data to be stored, and the data to be stored has been deleted from the storage unit, or the data to be stored is corrupted.
[0027] Optionally, the target storage unit is configured with a graphical processing module, and the data acquisition module to be stored may include:
[0028] A graphical processing submodule is used to generate a QR code image representing the data to be stored.
[0029] Optionally, the graphical processing submodule may include:
[0030] The first binary sequence conversion unit is used to convert the data to be stored into a first binary sequence using the graphical processing module based on a binary algorithm;
[0031] The second binary sequence conversion unit is used to generate a second binary sequence from the first binary sequence;
[0032] A QR code image generation unit is used to generate a QR code image using the second binary sequence; the second binary sequence is an encrypted sequence.
[0033] Optionally, it may also include:
[0034] The verification information acquisition module is used to acquire identity verification information sent by the user;
[0035] The legitimate access determination module is used to determine whether the user's access is legitimate using the identity verification information;
[0036] If so, the data recovery module will be invoked.
[0037] Optionally, the data recovery module includes:
[0038] The data recovery generation submodule is used to parse the QR code image using the graphical processing module and generate recovery data for the data to be stored.
[0039] This invention also discloses an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;
[0040] The memory is used to store computer programs;
[0041] When the processor executes a program stored in the memory, it implements the method described in the embodiments of the present invention.
[0042] This invention also discloses a computer-readable storage medium storing instructions that, when executed by one or more processors, cause the processors to perform the methods described in this invention.
[0043] The embodiments of the present invention include the following advantages: A target storage unit is determined from the storage unit; data to be stored is obtained, and a QR code image representing the data to be stored is generated when storing the data; the data to be stored is stored in the storage unit, and the QR code image is stored in the target storage unit; when the data to be stored needs to be retrieved, and the data to be stored has been deleted from the storage unit, or the data to be stored is corrupted, the QR code image is retrieved from the target storage unit, and the QR code image is used to generate recovery data for the data to be stored, thereby enabling the recovery data to fully represent the data to be recovered, thus improving the data recovery efficiency of the distributed database. Attached Figure Description
[0044] Figure 1 This is a flowchart illustrating the steps of a data recovery method for a distributed database provided in this embodiment of the invention.
[0045] Figure 2 This is a structural block diagram of a data recovery device for a distributed database provided in an embodiment of the present invention;
[0046] Figure 3 This is a hardware structure block diagram of an electronic device provided in various embodiments of the present invention. Detailed Implementation
[0047] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0048] Reference Figure 1 The diagram illustrates a flowchart of a data recovery method for a distributed database provided in an embodiment of the present invention, which may specifically include the following steps:
[0049] Step 101: Determine the target storage unit from the storage units;
[0050] Step 102: Obtain the data to be stored, and when storing the data to be stored, generate a QR code image to represent the data to be stored;
[0051] Step 103: Store the data to be stored in the storage unit and store the QR code image in the target storage unit;
[0052] Step 104: When it is necessary to extract the data to be stored, and the data to be stored has been deleted from the storage unit, or the data to be stored is corrupted, retrieve the QR code image from the target storage unit, and use the QR code image to generate recovery data for the data to be stored.
[0053] In specific implementations, the embodiments of the present invention can be applied to distributed databases, such as MySQL databases. Distributed databases may include multiple storage units. The storage units are not local storage devices, nor are they servers outside the distributed database. The storage units belong to the distributed database, such as the DN storage unit in a MySQL database.
[0054] In this embodiment of the invention, one or more target storage units can be determined from the storage units of a distributed database. For example, a MySQL database includes DN1, DN2, DN3, DN4, and DN5. DN5 can be determined as the target storage unit and marked as a backup data storage unit, so that DN5 is used as a storage unit specifically for storing backup data.
[0055] The embodiments of the present invention can acquire data to be stored, and when storing the data to be stored, generate a QR code image for the data to be stored and used to express the data to be stored.
[0056] In a specific implementation, the data to be stored in this embodiment of the invention can be data for storing in a distributed database, such as text data, image data, etc. After obtaining the data to be stored, when storing the data to be stored, this embodiment of the invention can generate a QR code image for the data to be stored. Specifically, the data to be stored can be converted into a binary sequence, and then the binary sequence can be used to generate a QR code image that expresses all the information of the data to be stored.
[0057] For example, assuming the data to be stored is the text data "345", we can first obtain the text data "345", then convert "345" into binary to obtain the binary sequence 101011001, and then use the binary sequence 101011001 to generate a QR code image.
[0058] After determining the target storage unit and generating a QR code image to represent the data to be stored, embodiments of the present invention can store the data to be stored in the storage unit and store the QR code image in the target storage unit.
[0059] For example, a MySQL database includes DN1, DN2, DN3, DN4, and DN5. DN5 can be designated as the target storage unit and marked as the backup data storage unit, making DN5 a dedicated storage unit for storing backup data. Now, assuming the data to be stored is the text data "345", we can first obtain the text data "345", then perform a binary conversion on "345" to obtain the binary sequence 101011001, and then use the binary sequence 101011001 to generate a QR code image. Then, the text data "345" is stored in any of the storage units DN1-DN4, and the QR code image is stored in the target storage unit DN5. This way, the text data "345" receives normal storage services, while the QR code image is stored as backup data of the text data "345" in the target storage unit DN5.
[0060] Of course, the above examples are merely illustrative. Those skilled in the art can use other data as data to be stored, such as audio and video data that occupy a large amount of memory space. In this regard, the embodiments of the present invention do not impose any limitations.
[0061] In practical applications, when the data to be stored is large in memory, such as video data, converting the data to be stored into a binary image as backup data can effectively reduce the memory space occupied by the backup data in the target storage unit compared to directly copying the data to be stored as backup data. Therefore, in an optional embodiment of the present invention, before the steps of storing the data to be stored in the storage unit and storing the QR code image in the target storage unit, it is first determined whether the number of bytes occupied by the QR code image is less than the number of bytes of the data to be stored. If so, the steps of storing the data to be stored in the storage unit and storing the QR code image in the target storage unit are executed. This effectively reduces the data recovery cost of the distributed database when the number of bytes occupied by the QR code image is less than the number of bytes of the data to be stored.
[0062] In practical applications, when data stored in a distributed database is deleted or corrupted, users may be unable to retrieve the data. If a user still wants to retrieve the original data, they need to restore the original data using backup data. Therefore, this embodiment of the invention can first determine whether the user needs to retrieve the data to be stored. For example, it can determine whether a download request for the stored data has been received from the user to the MySQL database. After determining that the user needs to retrieve the data to be stored, it can further determine whether the stored data has been deleted from the storage unit and whether the data to be stored is corrupted. When it is determined that the stored data has been deleted from the storage unit or that the stored data is corrupted, the QR code image is retrieved from the target storage unit, and recovery data for the data to be stored is generated using the QR code image. Specifically, the QR code image can be converted into a binary sequence to represent the data to be stored, and then the binary sequence can be converted into recovery data that is the same as the data to be stored.
[0063] For example, a MySQL database includes DN1, DN2, DN3, DN4, and DN5. DN5 can be designated as the target storage unit and marked as the backup data storage unit, making DN5 a dedicated storage unit for storing backup data. Now, assuming the data to be stored is the text data "345", we can first obtain the text data "345", then perform a binary conversion on "345" to obtain the binary sequence 101011001, and then use the binary sequence 101011001 to generate a QR code image. Then, the text data "345" can be stored in any of the storage units DN1-DN4, and the QR code image can be stored in the target storage unit DN5. This way, the text data "345" receives normal storage services, while the QR code image is stored as backup data for the text data "345" in the target storage unit DN5. Assuming the text data "345" is stored in storage unit DN4, and a user sends a download request for the text data "345" to MySQL, it can be determined that the text data "345" needs to be retrieved from storage unit DN4. At this point, it can be determined whether the text data "345" has been deleted from storage unit DN4. If so, the QR code image stored in the target storage unit DN5 can be retrieved and converted into a binary sequence 101011001 representing the data to be stored. This binary sequence 101011001 is then converted back into the same recovery data "345". Of course, even if the data to be detected is still stored in the target storage unit, if the detected data is corrupted... Since the user is also unable to retrieve the data to be stored, when it is detected that the user has sent a download request to MySQL for the text data "345", and it is determined that the text data "345" has not been deleted from the DN4 storage unit, it can be determined whether the text data "345" is corrupted. If the text data "345" is corrupted, that is, the text data "345" cannot be retrieved because it is detected that the text data "345" is corrupted, then the QR code image stored in the target storage unit DN5 can be called, and the QR code image can be converted into a binary sequence 101011001 to represent the data to be stored. Then, the binary sequence 101011001 can be converted into the same recovery data "345" as the data to be stored.
[0064] In this embodiment of the invention, a target storage unit is determined from the storage unit; data to be stored is obtained, and a QR code image representing the data to be stored is generated when storing the data to be stored; the data to be stored is stored in the storage unit, and the QR code image is stored in the target storage unit; when it is necessary to retrieve the data to be stored, and the data to be stored has been deleted from the storage unit, or the data to be stored is corrupted, the QR code image is retrieved from the target storage unit, and the QR code image is used to generate recovery data for the data to be stored, so that the recovery data can completely reflect the data to be recovered, thereby improving the data recovery efficiency of the distributed database.
[0065] Based on the above embodiments, modified embodiments of the above embodiments are proposed. It should be noted that, in order to keep the description brief, only the differences from the above embodiments are described in the modified embodiments.
[0066] In an optional embodiment of the present invention, the target storage unit is configured with a graphics processing module, and the step of generating a QR code image for representing the data to be stored includes:
[0067] The graphical processing module is used to generate a QR code image to represent the data to be stored.
[0068] In practical applications, to avoid the incompatibility between upstream and downstream distributed databases in generating QR code images to represent the data to be stored, embodiments of the present invention can configure a graphical processing module for the determined target storage unit, so that all distributed databases can use the graphical processing module to generate QR code images to represent the data to be stored, thereby realizing the compatibility between upstream and downstream distributed databases in generating QR code images to represent the data to be stored.
[0069] The step of generating recovery data for the data to be stored using the QR code image includes:
[0070] The graphical processing module is used to parse the QR code image and generate recovery data for the data to be stored.
[0071] As can be seen from the above, in order to avoid the incompatibility of upstream and downstream distributed databases in generating QR code images to represent the data to be stored, the embodiments of the present invention can configure a graphical processing module for the determined target storage unit, so that all distributed databases can use the graphical processing module to generate QR code images to represent the data to be stored. Therefore, when the user needs to recover data, the embodiments of the present invention can also directly use the graphical processing module to parse the QR code image and generate recovery data for the data to be stored, without the need to use other devices to parse the QR code image, thereby further improving the data recovery efficiency of the distributed database.
[0072] In an optional embodiment of the present invention, the step of generating a QR code image for representing the data to be stored using the graphics processing module includes:
[0073] The graphical processing module uses a binary algorithm to convert the data to be stored into a first binary sequence.
[0074] A second binary sequence is generated using the first binary sequence;
[0075] A QR code image is generated using the second binary sequence; the second binary sequence is an encrypted sequence.
[0076] In practical applications, if a distributed database is attacked and the QR code image is directly converted from the data to be stored into binary data, there is a significant risk of data leakage. Therefore, this invention can encrypt the QR code image to reduce the risk of data leakage when the distributed database is attacked. Specifically, this invention can use a graphical processing module to convert the data to be stored into a first binary sequence based on a binary algorithm, then encrypt the first binary sequence to generate a second binary sequence, and finally use the encrypted second binary sequence to generate a QR code image.
[0077] For example, embodiments of the present invention can encrypt the first binary sequence bit by bit by reversing it to generate the second binary sequence.
[0078] For example, assuming the data to be stored is the text data "304", 304 can be converted into binary to generate the first binary sequence "100110000". Then, the first binary sequence "100110000" can be reversed bit by bit to generate the second binary sequence "011001111".
[0079] For example, embodiments of the present invention can obtain time information and generate a second binary sequence by performing an XOR operation on a first binary sequence and the time information.
[0080] For example, assuming the data to be stored is the text data "345", the text data "345" is converted to binary to obtain the first binary sequence 101011001. Assuming the date of the data to be stored is March 30, 2022, this time information can be obtained and recorded as 20220330. The binary sequence 20220330 is converted to binary to obtain the binary sequence 1001101001000100110101010. By performing an XOR operation on the time information and the first binary sequence 101011001 (101011001 xor 1001101001000100110101010), the second binary sequence 100110100100010001111001 is obtained.
[0081] Optionally, when the encryption method involves XORing the first binary sequence and the time information to generate the second binary sequence, the time information can be used as the key.
[0082] Of course, the above is only an example. Those skilled in the art can generate a second binary sequence from a first binary sequence based on any encryption algorithm. The embodiments of the present invention do not limit this.
[0083] In this embodiment of the invention, the graphical processing module uses a binary algorithm to convert the data to be stored into a first binary sequence; a second binary sequence is generated from the first binary sequence; a QR code image is generated from the second binary sequence; and the second binary sequence is an encrypted sequence, thereby effectively reducing the risk of data leakage when the distributed database is attacked.
[0084] In an optional embodiment of the present invention, prior to the step of retrieving the QR code image from the target storage unit, the method further includes:
[0085] Retrieve the identity verification information sent by the user;
[0086] The identity verification information is used to determine whether the user's access is legitimate;
[0087] If so, then the step of retrieving the QR code image from the target storage unit is performed.
[0088] In practical applications, if an unauthorized user enters another person's computer or server to perform operations, there is a significant risk of data leakage. Therefore, this embodiment of the invention can obtain the identity verification information sent by the user before retrieving the QR code image from the target storage unit, and use the identity verification information to determine whether the user's access is legitimate. Only when the user's access is determined to be legitimate can the QR code image be retrieved from the target storage unit to achieve data recovery.
[0089] Optionally, the identity verification information can be a preset password or a mobile dynamic verification code.
[0090] In this embodiment of the invention, identity verification information sent by the user is obtained; the identity verification information is used to determine whether the user's access is legitimate; if so, the step of retrieving the QR code image from the target storage unit is executed, thereby reducing the risk of data leakage due to unauthorized login when the distributed database is performing data recovery.
[0091] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.
[0092] Reference Figure 2 The diagram illustrates a structural block diagram of a data recovery device for a distributed database provided in an embodiment of the present invention, which may specifically include the following modules:
[0093] The target storage unit determination module 201 is used to determine the target storage unit from the storage units;
[0094] The data to be stored acquisition module 202 is used to acquire the data to be stored and, when storing the data to be stored, generate a QR code image to represent the data to be stored;
[0095] The data storage module 203 is used to store the data to be stored in the storage unit and to store the QR code image in the target storage unit;
[0096] The data recovery module 204 is used to retrieve the QR code image from the target storage unit and generate recovery data for the data to be stored using the QR code image when it is necessary to extract the data to be stored, and the data to be stored has been deleted from the storage unit, or the data to be stored is corrupted.
[0097] Optionally, the target storage unit is configured with a graphical processing module, and the data acquisition module to be stored may include:
[0098] A graphical processing submodule is used to generate a QR code image representing the data to be stored.
[0099] Optionally, the graphical processing submodule may include:
[0100] The first binary sequence conversion unit is used to convert the data to be stored into a first binary sequence using the graphical processing module based on a binary algorithm;
[0101] The second binary sequence conversion unit is used to generate a second binary sequence from the first binary sequence;
[0102] A QR code image generation unit is used to generate a QR code image using the second binary sequence; the second binary sequence is an encrypted sequence.
[0103] Optionally, it may also include:
[0104] The verification information acquisition module is used to acquire identity verification information sent by the user;
[0105] The legitimate access determination module is used to determine whether the user's access is legitimate using the identity verification information;
[0106] If so, the data recovery module will be invoked.
[0107] Optionally, the data recovery module may include:
[0108] The data recovery generation submodule is used to parse the QR code image using the graphical processing module and generate recovery data for the data to be stored.
[0109] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.
[0110] In addition, this invention also provides an electronic device, including: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, it implements the various processes of the above-described distributed database data recovery method embodiments and achieves the same technical effect. To avoid repetition, it will not be described again here.
[0111] This invention also provides a computer-readable storage medium storing a computer program. When executed by a processor, the computer program implements the various processes of the data recovery method embodiments of the distributed database described above, achieving the same technical effects. To avoid repetition, it will not be described again here. The computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc.
[0112] Figure 3A schematic diagram of the hardware structure of an electronic device for implementing various embodiments of the present invention.
[0113] The electronic device 300 includes, but is not limited to, components such as: a radio frequency unit 301, a network module 302, an audio output unit 303, an input unit 304, a sensor 305, a display unit 306, a user input unit 307, an interface unit 308, a memory 309, a processor 310, and a power supply 311. Those skilled in the art will understand that... Figure 3 The electronic device structures shown are not intended to limit the electronic device. An electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements. In embodiments of the invention, the electronic device includes, but is not limited to, mobile phones, tablets, laptops, PDAs, in-vehicle terminals, wearable devices, and pedometers.
[0114] It should be understood that, in this embodiment of the invention, the radio frequency unit 301 can be used for receiving and transmitting signals during information transmission or calls. Specifically, it receives downlink data from the base station and processes it with the processor 310; additionally, it transmits uplink data to the base station. Typically, the radio frequency unit 301 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low-noise amplifier, a duplexer, etc. Furthermore, the radio frequency unit 301 can also communicate with networks and other devices through a wireless communication system.
[0115] The electronic device provides users with wireless broadband internet access through network module 302, such as helping users send and receive emails, browse web pages, and access streaming media.
[0116] The audio output unit 303 can convert audio data received by the radio frequency unit 301 or the network module 302 or stored in the memory 309 into audio signals and output them as sound. Furthermore, the audio output unit 303 can also provide audio output related to specific functions performed by the electronic device 300 (e.g., call signal reception sound, message reception sound, etc.). The audio output unit 303 includes a speaker, a buzzer, and a receiver, etc.
[0117] Input unit 304 is used to receive audio or video signals. Input unit 304 may include a graphics processing unit (GPU) 3041 and a microphone 3042. The GPU 3041 processes image data of still images or videos acquired by an image capture device (such as a camera) in video capture mode or image capture mode. The processed image frames can be displayed on display unit 306. The image frames processed by GPU 3041 can be stored in memory 309 (or other storage media) or transmitted via radio frequency unit 301 or network module 302. Microphone 3042 can receive sound and process such sound into audio data. The processed audio data can be converted into a format that can be transmitted to a mobile communication base station via radio frequency unit 301 in telephone call mode.
[0118] The electronic device 300 also includes at least one sensor 305, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor. The ambient light sensor can adjust the brightness of the display panel 3061 according to the ambient light level, and the proximity sensor can turn off the display panel 3061 and / or backlight when the electronic device 300 is moved to the ear. As a type of motion sensor, an accelerometer sensor can detect the magnitude of acceleration in various directions (generally three axes). When stationary, it can detect the magnitude and direction of gravity and can be used to identify the posture of the electronic device (such as landscape / portrait switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc. The sensor 305 may also include a fingerprint sensor, pressure sensor, iris sensor, molecular sensor, gyroscope, barometer, hygrometer, thermometer, infrared sensor, etc., which will not be described in detail here.
[0119] The display unit 306 is used to display information input by the user or information provided to the user. The display unit 306 may include a display panel 3061, which may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.
[0120] User input unit 307 can be used to receive input numerical or character information, and generate key signal inputs related to user settings and function control of electronic devices. Specifically, user input unit 307 includes a touch panel 3071 and other input devices 3072. Touch panel 3071, also known as a touch screen, can collect touch operations performed by the user on or near it (such as operations performed by the user using a finger, stylus, or any suitable object or accessory on or near touch panel 3071). Touch panel 3071 may include two parts: a touch detection device and a touch controller. The touch detection device detects the user's touch position and the signal generated by the touch operation, and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device, converts it into touch point coordinates, and sends it to the processor 310, which receives and executes commands from the processor 310. In addition, touch panel 3071 can be implemented using various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to touch panel 3071, user input unit 307 may also include other input devices 3072. Specifically, other input devices 3072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, joysticks, etc., which will not be described in detail here.
[0121] Furthermore, the touch panel 3071 can cover the display panel 3061. When the touch panel 3071 detects a touch operation on or near it, it transmits the information to the processor 310 to determine the type of touch event. Subsequently, the processor 310 provides corresponding visual output on the display panel 3061 based on the type of touch event. Although in Figure 3 In this embodiment, the touch panel 3071 and the display panel 3061 are two independent components to realize the input and output functions of the electronic device. However, in some embodiments, the touch panel 3071 and the display panel 3061 can be integrated to realize the input and output functions of the electronic device. The specific implementation is not limited here.
[0122] Interface unit 308 serves as an interface for connecting external devices to electronic device 300. For example, external devices may include a wired or wireless headphone port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with an identification module, an audio input / output (I / O) port, a video I / O port, a headphone port, and so on. Interface unit 308 can be used to receive input from external devices (e.g., data, power, etc.) and transmit the received input to one or more components within electronic device 300, or it can be used to transmit data between electronic device 300 and external devices.
[0123] The memory 309 can be used to store software programs and various data. The memory 309 may primarily include a program storage area and a data storage area. The program storage area may store the operating system, applications required for at least one function (such as sound playback, image playback, etc.), etc.; the data storage area may store data created based on the use of the mobile phone (such as audio data, phonebook, etc.). Furthermore, the memory 309 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0124] The processor 310 is the control center of the electronic device. It connects various parts of the electronic device via various interfaces and lines. By running or executing software programs and / or modules stored in the memory 309, and by calling data stored in the memory 309, it performs various functions and processes data, thereby providing overall monitoring of the electronic device. The processor 310 may include one or more processing units; preferably, the processor 310 may integrate an application processor and a modem processor. The application processor mainly handles the operating system, user interface, and applications, while the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 310.
[0125] The electronic device 300 may also include a power supply 311 (such as a battery) for supplying power to various components. Preferably, the power supply 311 can be logically connected to the processor 310 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system.
[0126] In addition, the electronic device 300 includes some functional modules not shown, which will not be described in detail here.
[0127] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0128] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0129] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of the present invention without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of the present invention.
[0130] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed in this invention can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0131] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0132] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0133] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0134] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0135] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.
[0136] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A data recovery method of a distributed database, characterized by, The distributed database has multiple storage units, including: The target storage unit is determined from the storage units; Acquire the data to be stored, and when storing the data to be stored, generate a QR code image to represent the data to be stored; The data to be stored is stored in the storage unit, and the QR code image is stored in the target storage unit; When it is necessary to extract the data to be stored, and the data to be stored has been deleted from the storage unit, or the data to be stored is corrupted, the QR code image is retrieved from the target storage unit, and the QR code image is used to generate recovery data for the data to be stored. The target storage unit is equipped with a graphics processing module, and the step of generating a QR code image to represent the data to be stored includes: The graphical processing module is used to generate a QR code image to represent the data to be stored; The step of generating a QR code image to represent the data to be stored using the graphics processing module includes: The graphical processing module uses a binary algorithm to convert the data to be stored into a first binary sequence. Obtain time information, and generate a second binary sequence by performing an XOR operation on the first binary sequence and the time information; A QR code image is generated using the second binary sequence; the second binary sequence is an encrypted sequence. When the encryption method involves XORing the first binary sequence and the time information to generate a second binary sequence, the time information is used as the key.
2. The method of claim 1, wherein, Prior to the step of retrieving the QR code image from the target storage unit, the method further includes: Retrieve the identity verification information sent by the user; The identity verification information is used to determine whether the user's access is legitimate; If so, then the step of retrieving the QR code image from the target storage unit is performed.
3. The method of claim 1, wherein, The step of generating recovery data for the data to be stored using the QR code image includes: The graphical processing module is used to parse the QR code image and generate recovery data for the data to be stored.
4. A data recovery apparatus of a distributed database, characterized by comprising: The distributed database has multiple storage units, including: A target storage unit determination module is used to determine a target storage unit from the storage units; The data to be stored acquisition module is used to acquire the data to be stored and, when storing the data to be stored, generate a QR code image to represent the data to be stored; The data storage module is used to store the data to be stored in the storage unit and to store the QR code image in the target storage unit; The data to be stored recovery module is used to retrieve the QR code image from the target storage unit when it is necessary to extract the data to be stored, and the data to be stored has been deleted from the storage unit, or the data to be stored is corrupted, and to generate recovery data for the data to be stored using the QR code image; The target storage unit is equipped with a graphical processing module, and the data acquisition module includes: A graphical processing submodule is used to generate a QR code image representing the data to be stored. The graphical processing submodule includes: The first binary sequence conversion unit is used to convert the data to be stored into a first binary sequence using the graphical processing module based on a binary algorithm; The second binary sequence conversion unit is used to acquire time information and generate a second binary sequence by performing an XOR operation on the first binary sequence and the time information. A QR code image generation unit is used to generate a QR code image using the second binary sequence; the second binary sequence is an encrypted sequence. When the encryption method involves XORing the first binary sequence and the time information to generate the second binary sequence, the time information is used as the key.
5. The apparatus of claim 4, wherein, Also includes: The verification information acquisition module is used to acquire identity verification information sent by the user; The legitimate access determination module is used to determine whether the user's access is legitimate using the identity verification information; If so, the data recovery module will be invoked.
6. The apparatus of claim 4, wherein, The data recovery module includes: The data recovery generation submodule is used to parse the QR code image using the graphical processing module and generate recovery data for the data to be stored.
7. An electronic device, comprising: It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; The memory is used to store computer programs; When the processor executes a program stored in the memory, it implements the method as described in any one of claims 1-3.
8. A computer-readable storage medium having instructions stored thereon that, when executed by one or more processors, cause the processors to perform the method as described in any one of claims 1-3.
Citation Information
Patent Citations
Backup and restoration method and device for distributed database and server
CN108241555A
Method and device for encryption storage and decryption recovery of user information
CN114710279A