Physical backup method, device and equipment of database, medium and program product
By dynamically determining the larger files in the database based on the system resource status and allocating multiple backup threads, the problem of long and low efficiency of physical backup of the database is solved, and a more efficient backup process is achieved.
Patent Information
- Application Number
- CN202411603780.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-11
- Publication Date
- 2025-02-11
AI Technical Summary
In the prior art, the physical backup process of databases takes a long time and is inefficient. Especially when there are large files in the database, the backup time is determined by the thread that consumes the most time, resulting in a longer overall backup time.
By dynamically determining the larger physical files in the database based on the system resource status and allocating multiple threads to the physical file for backup, the overall time-consuming physical backup of the database is reduced and the backup processing efficiency is improved.
Without affecting the system services, make full use of system resources and backup larger files simultaneously through multi-threading, reducing backup time and improving the overall efficiency of physical database backup.
Smart Images

Figure CN119415322A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of physical backup of databases, and in particular to a method, device, equipment, medium and program product for physical backup of databases. Background Art
[0002] In modern database management systems, data security and availability are crucial. In order to prevent data loss, database administrators usually perform database backup operations regularly.
[0003] Physical backup is a commonly used backup method that involves copying the database's physical files (such as data files, log files, etc.) to a safe storage location. Physical backup of a database is usually performed in units of files, and multiple threads are usually used for concurrent backup, so the time required for a physical backup is determined by the thread that consumes the most time.
[0004] As the size of the database continues to grow, the size of a single database file may become very large, which brings challenges to the backup process. If there is a file in the database that is several orders of magnitude larger than other files, the threads consumed by the backup of this file are much larger than those of other threads, which will result in a longer overall time and lower efficiency for physical backup. Summary of the invention
[0005] The present application provides a method, apparatus, device, medium and program product for physical backup of a database, which are used to solve the technical problems of long time consumption and low efficiency in the physical backup process of a database in the prior art. By dynamically determining the larger physical files in the database according to the system resource status and allocating multiple threads to the physical files for backup, the overall time consumption of the physical backup of the database is reduced and the processing efficiency of the physical backup of the database is improved.
[0006] In a first aspect, the present application provides a physical backup method of a database, comprising:
[0007] When starting a physical backup of a database, determining at least one target physical file in the database; the target physical file is a physical file in the database whose storage capacity satisfies a preset first capacity threshold condition; the first capacity threshold condition is determined based on a system resource state corresponding to a system where the database is located at a current moment;
[0008] For any target physical file, determining a first number of backup threads corresponding to the target physical file according to the system resource status; the first number is greater than 1;
[0009] Perform physical backup processing on the target physical file according to the backup threads corresponding to the first number.
[0010] In an optional implementation manner, the higher the level of business of the system represented by the system resource status, the smaller the first number.
[0011] In an optional implementation, performing physical backup processing on the target physical file according to the backup threads corresponding to the first number includes:
[0012] For any one of the backup threads corresponding to the first number, determining, according to the first number and the storage capacity of the target physical file, a backup capacity corresponding to the current thread when performing physical backup on the target physical file;
[0013] A backup operation is performed on the file content corresponding to the backup capacity based on the current thread.
[0014] In an optional implementation, determining, according to the first number and the storage capacity of the target physical file, a backup capacity corresponding to when the current thread physically backs up the target physical file includes:
[0015] Determining an initial backup capacity corresponding to the current thread according to a quotient between the storage capacity and the first quantity;
[0016] If the initial backup capacity does not meet a preset second capacity threshold condition, the initial backup capacity is adjusted to obtain the backup capacity.
[0017] In an optional implementation, determining at least one target physical file in the database includes:
[0018] Determine the system resource state corresponding to the system at the current moment;
[0019] Determine the first capacity threshold according to a preset first mapping relationship and the system resource state; the first mapping relationship is a mapping relationship between the system resource state and the first capacity threshold;
[0020] At least one target physical file in the database is determined according to the storage capacity of each physical file in the database and the first capacity threshold.
[0021] In an optional implementation, the database also includes at least one other physical file;
[0022] The method further comprises:
[0023] For any of the other physical files, a single number of backup threads are used to perform physical backup processing on the other physical files.
[0024] In a second aspect, the present application provides a physical backup device for a database, comprising:
[0025] A target physical file determination module is used to determine at least one target physical file in the database when starting physical backup of the database; the target physical file is a physical file in the database whose storage capacity meets a preset first capacity threshold condition; the first capacity threshold condition is determined based on the system resource status corresponding to the system where the database is located at the current moment;
[0026] A thread quantity determination module, configured to determine, for any target physical file, a first quantity of backup threads corresponding to the target physical file according to the system resource state; the first quantity is greater than 1;
[0027] The first backup processing module is used to perform physical backup processing on the target physical file according to the backup threads corresponding to the first number.
[0028] In a third aspect, the present application provides an electronic device, comprising: a processor, and a memory communicatively connected to the processor;
[0029] The memory stores computer-executable instructions;
[0030] The processor executes the computer-executable instructions stored in the memory to implement the method according to the first aspect.
[0031] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the method described in the first aspect.
[0032] In a fifth aspect, the present application provides a computer program product, including a computer program, which implements the method described in the first aspect when executed by a processor.
[0033] The physical backup technical solution of the database provided by the present application determines at least one target physical file in the database when starting physical backup of the database; the target physical file is a physical file in the database whose storage capacity meets a preset first capacity threshold condition; the first capacity threshold condition is determined based on the system resource status corresponding to the system where the database is located at the current moment; for any target physical file, the first number of backup threads corresponding to the target physical file is determined according to the system resource status; the first number is greater than 1; the target physical file is physically backed up according to the backup threads corresponding to the first number; in the above-mentioned backup processing, the target physical file that needs to be backed up by multiple backup threads is determined according to the resource status of the system where the database is located, and a suitable number of backup threads are allocated to the target physical file for backup processing according to the resource status, so as to fully utilize system resources without affecting system services, and to use multiple backup threads to simultaneously back up a larger target physical file, thereby reducing the time consumption of backing up the target physical file and improving the overall efficiency of physical backup of the database. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0035] Figure 1 A schematic diagram of a scenario of a physical backup method of a database in the prior art;
[0036] Figure 2 A schematic diagram of a scenario of a physical backup method of a database provided in this application;
[0037] Figure 3 A schematic diagram of a flow chart of a physical backup method of a database provided in an embodiment of the present application;
[0038] Figure 4 A schematic diagram of thread allocation corresponding to a system resource status representation when the system is highly busy provided in an embodiment of the present application;
[0039] Figure 5 A schematic diagram of thread allocation corresponding to a system resource status representation when the system busyness is low provided in an embodiment of the present application;
[0040] Figure 6 A schematic diagram of the structure of a physical backup device for a database provided in an embodiment of the present application;
[0041] Figure 7 It is a block diagram of an electronic device shown in an embodiment of the present application.
[0042] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0043] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0044] In modern database management systems, data security and availability are crucial. In order to prevent data loss, database administrators usually perform database backup operations regularly.
[0045] Physical backup is a commonly used backup method that involves copying the database's physical files (such as data files, log files, etc.) to a safe storage location. Physical backup of a database is usually performed in units of files, and multiple threads are usually used for concurrent backup, so the time required for a physical backup is determined by the thread that consumes the most time.
[0046] As the size of the database continues to grow, the size of a single database file may become very large, which brings challenges to the backup process. If there is a file in the database that is several orders of magnitude larger than other files, the threads consumed by the backup of this file are much larger than those of other threads, which will result in a longer overall time and lower efficiency for physical backup.
[0047] The physical backup method of the database provided in the present application is intended to solve the above technical problems of the prior art. Specifically, by determining the target physical file that needs to be backed up by multiple backup threads according to the resource status of the system where the database is located, and allocating an appropriate number of backup threads to the target physical file for backup processing according to the resource status, it is possible to fully utilize system resources without affecting system services, and to achieve multi-threaded simultaneous backup of the same large file, thereby reducing the time consumption of large file backup and improving the overall backup efficiency.
[0048] Figure 1 Schematic diagram of a physical backup method of a database in the prior art. Figure 1 , copy the files in the database on the DB node to the REPO node to achieve a redundant backup of the database system. Specifically, Figure 1Each box in represents a physical file. Among them, file 4 has a large storage capacity and is several orders of magnitude larger than other files. In the physical backup process, a backup thread is assigned to each physical file, that is, Figure 1 The arrow corresponding to each file in the figure represents a backup thread, which executes the file backup task in the team. The backup thread corresponding to file 4 in this physical backup takes 100 seconds, which is much longer than the backup threads corresponding to other files, which take 2 seconds. Usually, the time taken for a database backup is determined by the thread that takes the most time, so the time taken for this physical backup is the 100 seconds taken for file 4, and other threads have no new tasks assigned after completing the backup tasks for the corresponding files. In summary, the overall time taken for this physical backup is relatively long, and the network or IO resources in the system are not fully utilized.
[0049] Figure 2 A scenario diagram of a physical backup method of a database provided in this application. Figure 2 When copying the files in the database on the DB node to the REPO node, the storage capacity threshold is determined according to the system resource status of the DB node at the current moment, and the physical files in the database whose storage capacity is greater than the storage capacity threshold are determined, such as file 4. Since the DB node is still providing services to the outside world at the current moment, the system resources that the DB node can use to perform physical backup tasks are determined without affecting the normal services of the DB node, and the total number of threads that can be used to perform physical backup tasks is determined based on the system resources. Since other files are smaller files, a single number of threads can be used to perform backup tasks; based on this, the first number that can be allocated to file 4 for multi-threaded fast backup can be obtained. Finally, for file 4, the backup task is synchronously performed on file 4 according to the first number of backup threads, so as to fully utilize system resources without affecting system services, and it is also possible to use multiple threads to simultaneously back up the same larger file, thereby reducing the overall time consumption of physical backup of the database and improving the overall efficiency of backup.
[0050] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0051] Figure 3The flowchart of a physical backup method of a database provided in an embodiment of the present application is shown in FIG. The method can be executed by a physical backup device of the database, which can be a server or an electronic device. The following description takes an electronic device as an example. The method in this embodiment can be implemented by software, hardware, or a combination of software and hardware, such as Figure 3 As shown, the method includes the following steps.
[0052] S301. When starting physical backup of a database, determine at least one target physical file in the database.
[0053] In the present application, the target physical file is a physical file in the database whose storage capacity satisfies a preset first capacity threshold condition; the first capacity threshold condition is determined based on the system resource status corresponding to the system where the database is located at the current moment.
[0054] In the present application, satisfying the first capacity threshold condition can be understood as the storage capacity being greater than the first capacity threshold. Before performing physical backup, in order to improve the overall efficiency of physical backup, the present application can predetermine a physical file with a larger database storage capacity, i.e., a target physical file. Furthermore, when performing physical backup, multiple threads can be used to simultaneously perform backup processing on the target physical file.
[0055] It should be understood that, in the case of pre-setting a static first capacity threshold condition, if the threshold is set to be relatively large, when screening the physical files in the database based on the relatively large first capacity threshold condition, there will be some physical files whose storage capacity is slightly smaller than the first capacity threshold that are not screened as target physical files. At this time, when performing backup based on the screening result, the above physical files will be backed up using a single thread, which will increase the overall time consumption of the backup and reduce the overall backup efficiency; on the contrary, if the threshold is set to be relatively small. When screening the physical files in the database based on the relatively small first capacity threshold condition, more target physical files will be screened out. In this way, when performing physical backup, if the system is relatively busy at the moment and more system resources are not allocated to the backup task, the total number of backup threads used to execute the backup task will be relatively small, and there will also be relatively more target physical files that need to be allocated to multiple threads for physical backup. This will cause all backup threads to need to perform multiple rounds of backup to complete the overall backup of the database, which will also reduce the physical efficiency. Moreover, in any round of backup, since the storage capacity of the target physical file is not large, the backup can be completed quickly when multiple threads are assigned to back it up. While waiting for other physical files to be backed up in the current round, the above backup threads are idle, resulting in no utilization of system resources and a waste of system resources.
[0056] In view of the above situation, in the process of determining the target physical file, the present application dynamically determines the dynamic first capacity threshold condition according to the system resource status of the system where the database is located, rather than presetting the static first capacity threshold condition. In this way, it is possible to flexibly and accurately determine the target physical file that needs to be allocated with multiple threads according to the system resource status, and to quickly complete the overall physical backup of the database without wasting system resources, thereby improving the backup efficiency.
[0057] In some embodiments, the process of determining the target physical file may include: determining the system resource status corresponding to the system at the current moment; determining a first capacity threshold based on a preset first mapping relationship and the system resource status; the first mapping relationship is a mapping relationship between the system resource status and the first capacity threshold; and determining at least one target physical file in the database based on the storage capacity of each physical file in the database and the first capacity threshold.
[0058] In the present application, multiple system resource states used by the system to execute the assigned tasks are obtained in advance, and multiple first capacity thresholds are set in advance. The multiple system resource states and multiple first capacity thresholds are combined multiple times, and the same database is simulated to perform physical backups to obtain multiple backup results. According to the multiple simulation results, a first mapping relationship between the system resource state and the first capacity threshold is determined.
[0059] Specifically, when performing a physical backup of a database, the system resource status corresponding to the current moment, that is, when performing the physical backup, can be determined by querying the system. Exemplarily, the system resources may include but are not limited to: CPU resources, memory resources, hard disk resources, and network resources; the system resource status can be understood as the usage of the above system resources. When the system resource status is determined, the first capacity threshold corresponding to the system resource status is searched in the first mapping relationship.
[0060] Furthermore, the physical files are screened according to the determined first capacity threshold and the storage capacity of each physical file in the database to obtain a target physical file whose storage capacity is greater than the first capacity threshold among the physical files.
[0061] In this way, when backing up each physical file in the database, multiple backup threads can be used to perform backup processing on the target physical file with a larger storage capacity, thereby improving the overall efficiency of the physical backup of the database.
[0062] S302: For any target physical file, determine a first number of backup threads corresponding to the target physical file according to a system resource state.
[0063] In the present application, since the determined target physical file is a physical file with a large storage capacity, in order to achieve the overall efficiency of providing physical backup of the database, multiple backup threads can be used simultaneously for processing when backing up the target physical file. Therefore, the number of threads for backing up the target physical file in the present application can be pre-set to be greater than 1, that is, the first number is greater than 1.
[0064] In the present application, since the system is still providing services to the outside world while performing physical backup, in order not to affect its own efficiency in providing services, the system resources occupied by it when providing services, that is, the system resource status of the system at the current moment, can be used to determine the system resources that can perform physical backup tasks in the system, and determine all backup threads corresponding to the system resources.
[0065] It should be noted that when the system resource status represents a higher level of system busyness, the first number is smaller.
[0066] Specifically, it can be understood that the higher the system business, the more system resources the system occupies when providing services, and the correspondingly fewer system resources available for executing physical backup tasks, and thus the fewer total number of backup threads used for physical backup. In this case, the number of threads used to back up the target physical file, i.e., the first number, is also correspondingly smaller.
[0067] Figure 4 and Figure 5 The corresponding thread situations under different system resource states are respectively displayed. For example, the examples in the above application scenarios are still used as examples for introduction.
[0068] Figure 4 The system resource status provided in the embodiment of the present application represents the thread allocation corresponding to the high busyness of the system. Figure 4 When the system resource status represents that the system is busier, the first number of backup threads that can be allocated when backing up the target physical data is smaller. For example, fewer backup threads are allocated to file 4, that is, 5 backup threads simultaneously back up file 4.
[0069] Figure 5 The system resource status provided in the embodiment of the present application represents the thread allocation corresponding to the low busyness of the system. Figure 5 When the system resource status represents that the system is less busy, more backup threads can be allocated when backing up the target physical data. For example, more backup threads are allocated to file 4, that is, 10 backup threads simultaneously back up file 4.
[0070] In an optional implementation, during the physical backup process, when allocating threads to each physical file in the database, first determine the relationship between the total number of threads and the number of files. If the number of threads is much larger than the number of files, then each of the other physical files in the database can be allocated a single number of backup threads for physically backing up the files. The remaining backup threads are allocated based on the number of threads and the storage capacity of the target physical file, so that the target physical file can be backed up using multiple backup threads.
[0071] Optionally, if the total number of threads is less than the number of files, multiple rounds of physical backup can be used according to the storage capacity of each physical file and the number of threads to complete the physical backup of the entire database. For any round of processing, the above thread allocation processing method can be referred to, and no further details will be given here.
[0072] S303: Perform physical backup processing on the target physical file according to the backup threads corresponding to the first number.
[0073] In the present application, when determining multiple backup threads for backing up the target physical file, multiple backup threads can be used to simultaneously read data, transmit data, and write data into the backup system for the target physical file, and the data written by each backup thread can be merged to complete the physical backup process of the target physical file.
[0074] Optionally, the process of determining the backup quantity corresponding to each first number of backup threads in the target physical file in the present application may include: for any thread among the backup threads corresponding to the first number, determining the backup capacity corresponding to the current thread when performing a physical backup of the target physical file based on the first number and the storage capacity of the target physical file; and performing a backup operation on the file content corresponding to the backup capacity based on the current thread.
[0075] In the present application, the number of backup threads for physically backing up the target physical file, i.e., the first number, is first determined; the storage capacity of the target physical file is then determined, and the storage capacity is evenly divided according to the first number to determine the backup capacity that each backup thread needs to back up when performing physical backup, and then each backup thread reads the number, transmits data, and writes data to the backup capacity corresponding to its own thread to complete the backup operation.
[0076] Optionally, the process of determining the backup capacity corresponding to each backup thread may be: determining the initial backup capacity corresponding to the current thread based on the quotient between the storage capacity and the first quantity; if the initial backup capacity does not meet the preset second capacity threshold condition, adjusting the initial backup capacity to obtain the backup capacity.
[0077] Specifically, the storage capacity is evenly divided according to the first quantity, and the initial backup capacity that each thread needs to process is determined. When it is determined that the initial backup capacity obtained by evenly dividing the storage capacity does not meet the preset second capacity threshold condition, in order to improve the backup efficiency, the initial backup capacity is adjusted to obtain a backup capacity that meets the second capacity threshold condition, and the corresponding backup thread is used to perform backup processing on the backup capacity.
[0078] It can be explained that satisfying the second capacity threshold condition in the present application can be understood as the initial backup capacity being the preset capacity, or a multiple of the preset capacity. The preset capacity can be set to 128MB or a multiple of 128MB. The reason for the above capacity adjustment is that 128MB is generally considered to be a relatively small configuration in modern database systems. The initial backup capacity is adjusted according to the preset capacity to facilitate the thread to read, transmit and write data, thereby improving the backup efficiency.
[0079] In the above technical scheme, when starting physical backup in the database, at least one target physical file in the database is determined; the target physical file is a physical file in the database whose storage capacity meets the preset first capacity threshold condition; the first capacity threshold condition is determined based on the system resource status corresponding to the system where the database is located at the current moment; for any target physical file, according to the system resource status, the first number of backup threads corresponding to the target physical file is determined; the first number is greater than 1; the target physical file is physically backed up according to the backup threads corresponding to the first number; in the above backup processing, the target physical file that needs to be backed up by multiple backup threads is determined according to the resource status of the system where the database is located, and a suitable number of backup threads are allocated to the target physical file for backup processing according to the resource status, so as to fully utilize system resources without affecting system services, and to use multiple backup threads to simultaneously back up a larger target physical file, thereby reducing the time consumption of backing up the target physical file and improving the overall efficiency of physical backup of the database.
[0080] Figure 6 A schematic diagram of the structure of a physical backup device for a database provided in an embodiment of the present application. Figure 6 The physical backup device 60 of the database includes: a target physical file determination module 601, a thread number determination module 602 and a first backup processing module 603; wherein,
[0081] The target physical file determination module 601 is used to determine at least one target physical file in the database when starting physical backup of the database; the target physical file is a physical file in the database whose storage capacity meets a preset first capacity threshold condition; the first capacity threshold condition is determined based on the system resource status corresponding to the system where the database is located at the current moment;
[0082] The thread number determination module 602 is used to determine, for any target physical file, a first number of backup threads corresponding to the target physical file according to the system resource status; the first number is greater than 1;
[0083] The first backup processing module 603 is used to perform physical backup processing on the target physical file according to the backup threads corresponding to the first number.
[0084] In an optional implementation manner, the higher the level of busyness of the system resource status representation system, the smaller the first number.
[0085] In an optional implementation, the first backup processing module includes:
[0086] A backup capacity determination submodule, configured to determine, for any one of the backup threads corresponding to the first number, a backup capacity corresponding to the current thread when physically backing up the target physical file according to the first number and the storage capacity of the target physical file;
[0087] The backup processing submodule is used to perform a backup operation on the file content corresponding to the backup capacity based on the current thread.
[0088] In an optional implementation, the backup capacity determination submodule includes:
[0089] an initial backup capacity determination unit, configured to determine an initial backup capacity corresponding to a current thread according to a quotient between the storage capacity and the first quantity;
[0090] The backup capacity determination unit is used to adjust the initial backup capacity to obtain the backup capacity if the initial backup capacity does not meet the preset second capacity threshold condition.
[0091] In an optional implementation, the target physical file determination module includes:
[0092] The system resource status determination submodule is used to determine the system resource status corresponding to the system at the current moment;
[0093] A first capacity threshold determination submodule, used to determine the first capacity threshold according to a preset first mapping relationship and a system resource state; the first mapping relationship is a mapping relationship between the system resource state and the first capacity threshold;
[0094] The target physical file determination submodule is used to determine at least one target physical file in the database according to the storage capacity of each physical file in the database and a first capacity threshold.
[0095] In an optional embodiment, the database also includes at least one other physical file;
[0096] The device also includes:
[0097] The second backup processing module is used to perform physical backup processing on any other physical file by using a single number of backup threads.
[0098] Figure 7 It is a block diagram of an electronic device shown in an embodiment of the present application, and the device may be a computer, a digital broadcast terminal, etc.
[0099] See also Figure 7 , the device 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output interface 812 , a sensor component 814 , and a communication component 816 .
[0100] The processing component 802 generally controls the overall operation of the device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.
[0101] The memory 804 is configured to store various types of data to support operations on the device 800. Examples of such data include instructions for any application or method operating on the device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0102] The power supply component 806 provides power to the various components of the device 800. The power supply component 806 can include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 800.
[0103] The multimedia component 808 includes a screen that provides an output interface between the device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0104] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the device 800 is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.
[0105] The input / output interface 812 provides an interface between the processing component 802 and the peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0106] The sensor assembly 814 includes one or more sensors for providing various aspects of status assessment for the device 800. For example, the sensor assembly 814 can detect the open / closed state of the device 800, the relative positioning of components, such as the display and keypad of the device 800, and the sensor assembly 814 can also detect the position change of the device 800 or a component of the device 800, the presence or absence of user contact with the device 800, the orientation or acceleration / deceleration of the device 800, and the temperature change of the device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 814 may also include an optical sensor, such as a solid image (Complementary Metal Oxide Semiconductor, CMOS) sensor or a semiconductor image (Charge-coupled Device, CCD) sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0107] The communication component 816 is configured to facilitate wired or wireless communication between the device 800 and other devices. The device 800 can access a wireless network based on a communication standard, such as WiFi, 4G or 5G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0108] In an exemplary embodiment, the device 800 may be implemented by one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), controllers, microcontrollers, microprocessors or other electronic components to perform the above method.
[0109] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, and the instructions can be executed by a processor 820 of the device 800 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0110] A non-transitory computer-readable storage medium, when the instructions in the storage medium are executed by a processor of a server, enables the server to execute the above-mentioned physical backup method of the database.
[0111] An embodiment of the present application also provides a chip for running instructions, which is used to execute the technical solution of the physical backup method of the database in the above embodiment.
[0112] An embodiment of the present application further provides a computer-readable storage medium, in which computer execution instructions are stored. When the computer execution instructions are executed on a computer, the computer executes the technical solution of the physical backup method of the database in the above embodiment.
[0113] An embodiment of the present application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium. When at least one processor executes the computer program, the technical solution of the physical backup method of the database in the above embodiment can be implemented.
[0114] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0115] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
[0116] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0117] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A physical backup method for a database, characterized in that: The method comprises: When starting a physical backup of a database, determining at least one target physical file in the database; the target physical file is a physical file in the database whose storage capacity meets a preset first capacity threshold condition; the first capacity threshold condition is determined based on a system resource state corresponding to the system where the database is located at the current moment; For any target physical file, determining a first number of backup threads corresponding to the target physical file according to the system resource status; the first number is greater than 1; Perform physical backup processing on the target physical file according to the backup threads corresponding to the first number.
2. The method according to claim 1, characterized in that: The higher the level of business of the system represented by the system resource status, the smaller the first number.
3. The method according to claim 1, characterized in that Performing physical backup processing on the target physical file according to the backup threads corresponding to the first number includes: For any one of the backup threads corresponding to the first number, determining, according to the first number and the storage capacity of the target physical file, a backup capacity corresponding to the current thread when performing physical backup on the target physical file; A backup operation is performed on the file content corresponding to the backup capacity based on the current thread.
4. The method according to claim 3, characterized in that Determining, according to the first number and the storage capacity of the target physical file, a backup capacity corresponding to the current thread when physically backing up the target physical file, includes: Determining an initial backup capacity corresponding to the current thread according to a quotient between the storage capacity and the first quantity; If the initial backup capacity does not meet a preset second capacity threshold condition, the initial backup capacity is adjusted to obtain the backup capacity.
5. The method according to any one of claims 1 to 4, characterized in that Determining at least one target physical file in the database includes: Determine the system resource state corresponding to the system at the current moment; Determine the first capacity threshold according to a preset first mapping relationship and the system resource state; the first mapping relationship is a mapping relationship between the system resource state and the first capacity threshold; At least one target physical file in the database is determined according to the storage capacity of each physical file in the database and the first capacity threshold.
6. The method according to any one of claims 1 to 4, characterized in that The database also includes at least one other physical file; The method further comprises: For any of the other physical files, a single number of backup threads are used to perform physical backup processing on the other physical files.
7. A physical backup device for a database, characterized in that: The device comprises: A target physical file determination module is used to determine at least one target physical file in the database when starting physical backup of the database; the target physical file is a physical file in the database whose storage capacity meets a preset first capacity threshold condition; the first capacity threshold condition is determined based on the system resource status corresponding to the system where the database is located at the current moment; A thread quantity determination module, configured to determine, for any target physical file, a first quantity of backup threads corresponding to the target physical file according to the system resource state; the first quantity is greater than 1; The first backup processing module is used to perform physical backup processing on the target physical file according to the backup threads corresponding to the first number.
8. An electronic device, characterized in that: include: A processor and a memory communicatively connected to the processor; The memory stores computer-executable instructions; When executing the computer-executable instruction, the processor is used to implement the physical backup method of the database as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the physical backup method of a database as described in any one of claims 1 to 6.
10. A computer program product, characterized in that The method comprises a computer program, which implements the method according to any one of claims 1 to 6 when the computer program is executed by a processor.