A method and system for rescuing important data based on shutting down the system
By performing hardware and software monitoring before the system is shut down, identifying and prioritizing the data that needs to be archived, and using tape archive tools and hash function deduplication technology for packaging and transmission, the backup time-consuming problem caused by large data volume and limited network bandwidth is solved, and fast and reliable data archiving and recovery are achieved.
Patent Information
- Application Number
- CN202411434147.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-15
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2044-10-15
AI Technical Summary
When performing rescue archives of important data before the system is shut down, the data volume is large and the network bandwidth is limited, which causes the backup operation to take a long time, which may lead to the loss of some key data and economic losses.
Through hardware and software monitoring, the data that needs to be archived is identified and prioritized, the file system data is packaged using tape archive tool, and the hash function deduplication technology reduces storage capacity requirements and archive time, and is transferred to external hard disk or cloud storage services.
It effectively reduces data archiving time, reduces storage capacity requirements, avoids data loss caused by excessive backup time, and improves the reliability and efficiency of data recovery.
Smart Images

Figure CN119415319B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of rescue archiving of important data based on shutting down a system, and in particular to a method and system for rescue archiving of important data based on shutting down a system. Background Art
[0002] In the event that the system needs to be shut down or faces potential risks, it is critical to perform rescue archiving of important data. This usually involves extracting key data from the source system and transferring it to a safe place for subsequent use or recovery. Therefore, rescue archiving is needed. Archiving refers to the process of collecting, organizing and storing important data to ensure that the data can be recovered and used at a certain point in the future. Archiving is usually done to prevent data loss, meet legal or compliance requirements, or prepare for possible future analysis and research.
[0003] When performing rescue archiving of important data before system shutdown, some time-consuming disadvantages may occur. When the amount of data is large, the backup operation may take a long time to complete, especially when the network bandwidth is limited, which may cause some key data to be lost, causing economic losses to the enterprise;
[0004] Moreover, if the application cannot be quickly restored after a crash, it will cause inconvenience to users and have a series of negative impacts on the company's operations and technical maintenance. Summary of the invention
[0005] In view of the problems in the related art, the present invention proposes a method and system for rescue archiving of important data based on shutting down a system, so as to overcome the above technical problems existing in the existing related art.
[0006] To this end, the specific technical solution adopted by the present invention is as follows:
[0007] A method for rescuing important data of a shutdown system comprises the following steps:
[0008] Step S1: First, hardware and software monitoring is performed. Hardware monitoring monitors the health status of the hardware facilities of the monitoring server, storage device, and network device, and promptly detects hardware failure warning signals. Software monitoring performs hard disk SMART detection, power failure detection, overtemperature detection, fan failure detection, monitoring the health status of applications and services, application crash detection, database connection problem detection, and performance degradation detection;
[0009] Step S2: When the system is about to be shut down or faces potential risks, list the data that needs to be archived and prioritize them according to business impact and recovery difficulty. The archived data includes databases, configuration files, and user-uploaded data.
[0010] Step S3: Use a tape archive tool to package the file system data, eliminate duplicate data blocks through deduplication technology, reduce storage capacity requirements, and shorten data archiving time. Then, transfer the packaged file system data to an external hard disk or cloud storage service.
[0011] Step S4: Decompress the backup file and check whether it can be read correctly. Try to restore some data in a test environment to ensure the validity of the backup file. In the cloud storage service, ensure that strong encryption is used and that only authorized users can access it correctly.
[0012] Step S5: Record the specific time and content of the backup, and the storage location of the backup file to facilitate subsequent search.
[0013] Furthermore, the deduplication technology in step S3 uses a hash function to reduce storage space requirements by identifying and deleting duplicate data blocks.
[0014] Furthermore, the hash function uses the SHA-256 algorithm, and the SHA-256 algorithm includes the following steps:
[0015] initialization:
[0016] First, eight 32-bit registers (also called status registers) are initialized:
[0017] a=0x6a09e667
[0018] b=0xbb67ae85
[0019] c = 0x3c6ef372
[0020] d=0xa54ff53a
[0021] e=0x510e527f
[0022] f=0x9b05688c
[0023] g = 0x1f83d9ab
[0024] h=0x5be0cd19
[0025] Preprocessing:
[0026] Preprocess the input message, including padding and appending message length;
[0027] Fill message:
[0028] Append a bit to the end of the message;
[0029] Append enough zero bits so that the total length of the message modulo 512 is equal to 448 (that is, the total length of the message plus the 64-bit message length is an integer multiple of 512);
[0030] Additional message length:
[0031] A 64-bit bit length representation (Big Endian format) is appended to the end of the padded message.
[0032] Processing message block:
[0033] Divide the preprocessed message into 512-bit (64-byte) message blocks, and process each block;
[0034] Chunking:
[0035] Each 512-bit message block is divided into 16 32-bit small blocks ω0 and ω 15 ;
[0036] Extended message block:
[0037] Each message block is expanded to generate 64 32-bit words ω0 to ω 63 , where ω i (i>15) is obtained by rotating the first 16 words left (ROL) and performing XOR operation:
[0038]
[0039]
[0040] Main loop:
[0041] Perform main loop processing on each expanded message block, a total of 64 steps;
[0042] Main loop steps:
[0043] Initialize working registers a, b, c, d, e, f, g, h to the values of the current status registers; for each step number t (t from 0 to 63);
[0044]
[0045] in:
[0046] sigma0(x):=(x<<<2)xor(x<<<13)xor(x<<<22)
[0047] sigma1(x):=(x<<<6)xor(x<<<11)xor(x<<<25)
[0048] ch(x,y,z):=(xandy)xor((notx)amdz)
[0049] maj(x,y,z):=(xandy)xor(xandz)xor(yandz)
[0050] K[t] is a constant used for each round of scrambling;
[0051] Update status register:
[0052] After the main loop ends, the working registers a, b, c, d, e, f, g, h are added to the current status register;
[0053] a+=A
[0054] b+=B
[0055] c+=C
[0056] d+=D
[0057] e+=E
[0058] f+=F
[0059] g+=G
[0060] h+=H
[0061] Output hash value:
[0062] After all message blocks are processed, the final state registers a, b, c, d, e, f, g, h are concatenated to form a 256-bit hash value.
[0063] Furthermore, the tool for tape archive in step S3 includes the process of creating a tar file and extracting data from the tar file, and the algorithm is:
[0064] Creating a tar file
[0065]
[0066]
[0067] Extract tar file
[0068]
[0069] Furthermore, the application crash detection in step S1 uses an exception capture mechanism, including the following steps:
[0070] S11. Throwing an exception: When the program encounters a situation where it cannot continue to execute, an exception object will be thrown;
[0071] S12. Capture exceptions: Capture thrown exceptions through exception handling blocks (try-except statements);
[0072] S13, handle exceptions: Once an exception is caught, the exception handling program can take appropriate measures to handle it, including logging, clearing resources, and notifying users;
[0073] S14. Resume execution: After handling the exception, the resume execution program can choose to resume the normal execution process and can exit normally.
[0074] Furthermore, the general framework for exception capture is as follows:
[0075]
[0076]
[0077] Exception catching is a mechanism used in programming to handle program runtime errors.
[0078] Furthermore, the basic structure of the exception handling block (try-except) is as follows:
[0079]
[0080] The exception handling block (try-except) is a mechanism in a programming language for capturing and handling exceptions that occur during program execution.
[0081] The application crash recovery in step S14 includes the following steps:
[0082] S141. Retry failed operations: For operations that can be retried, add retry logic, define reasonable retry intervals and times, and avoid infinite retry loops;
[0083] S142, reinitialize state: if the application crashes due to state problems, try to reinitialize the states of related components;
[0084] S143. Roll back to the previous state: For transactional operations, ensure that there is a rollback mechanism and use a version control system to manage the code to ensure that you can roll back to the previous version at any time;
[0085] S144. Restart the service: When the above steps S141, S142, and S143 are invalid, restart the application and configure an automated restart script to automatically restart the failed service.
[0086] The automated restart application script of step S144 is used in the Windows environment as follows:
[0087]
[0088]
[0089] Furthermore, in step S1, the application crash is analyzed using a memory dump, and the memory dump analysis includes the following steps:
[0090] S101. Install debugging tools: select appropriate debugging tools according to the operating system;
[0091] S102, obtaining a dump file: obtaining a full dump file generated when the application crashes;
[0092] S103, loading the dump file: start the debugging tool, use the graphical interface to load the memory dump file into the debugging tool, and use the analyze -v command in the debugging tool to load and analyze the dump file;
[0093] S104, check basic crash information: check the exception information recorded in the dump file, use the kb command in the debugging tool to check the call stack at the time of the crash, and understand the function call sequence before the crash;
[0094] S105, analyzing memory contents: using debugging tools to check the status of registers, understand the execution location of the program when the crash occurs, check the specific contents in the memory, including local variables, global variables, and heap memory, check the objects and data structures in the stack, to understand the state before the crash;
[0095] S106, check thread information: use debugging tools to view the status and information of all active threads, and switch to different threads for inspection;
[0096] S107, analyzing memory leaks: using debugging tools to check heap memory allocation, find the source of memory leaks, and use commands to track memory allocation and release;
[0097] S108. Analyze lock and synchronization issues: Use debugging tools to view the lock status to check deadlock and synchronization issues, and analyze synchronization operations in the thread pool;
[0098] S109, comprehensive analysis: The debugging tool refers to the log information of the application before and after the crash, combines the data in the dump file to perform comprehensive analysis, and reproduces the crash in the development environment to further verify the analysis results;
[0099] S110, Summary and Repair: The debugging tool records the problems and speculations found during the analysis process as a reference for subsequent repair work, formulates a repair plan based on the analysis results, and implements the repair as soon as possible.
[0100] The debugging tool in step S101 is WinDbg in Windows environment.
[0101] Further, for step S2, a database management tool is used to help developers manage and check database connections. These database management tools provide a graphical user interface (GUI), making it more intuitive and simple to check database connections. The database management tool is one of MySQL Workbench, pgAdmin, and SSMS.
[0102] According to another aspect of the present invention, a system for rescuing important data based on shutting down a system is provided. Figure 3 As shown, the following steps are included:
[0103] Crisis monitoring module: performs hardware and software monitoring. Hardware monitoring monitors the health status of the hardware facilities of the monitoring server, storage device, and network device, and promptly detects hardware failure warning signals. Software monitoring performs hard disk SMART detection, power failure detection, overtemperature detection, fan failure detection, monitors the health status of applications and services, application crash detection, database connection problem detection, and performance degradation detection.
[0104] Archived data sorting module: When the system is about to be shut down or faces potential risks, the module lists the data that needs to be archived and prioritizes them according to business impact and recovery difficulty. The archived data includes databases, configuration files, and user-uploaded data.
[0105] File system data packaging and transmission module: uses the tape archive tool to package the file system data, eliminates duplicate data blocks through deduplication technology, reduces storage capacity requirements, and shortens data archiving time. The packaged file system data is then transferred to an external hard disk or cloud storage service.
[0106] File system data decompression detection module: decompress the backup file, check whether it can be read correctly, try to restore some data in the test environment, ensure the validity of the backup file, and ensure that strong encryption is used in the cloud storage service and that only authorized users can access it correctly.
[0107] Backup record module: records the specific time and content of the backup, and the storage location of the backup file for easy subsequent retrieval.
[0108] The beneficial effects of the present invention are:
[0109] (1) In actual use, when performing rescue archiving of important data before system shutdown, the present invention packages the file system data, eliminates duplicate data blocks through deduplication technology, reduces storage capacity requirements, and shortens data archiving time. This solves the problem in the prior art that when the amount of backup data is huge, the backup operation may take a long time to complete, especially when the network bandwidth is limited, which may cause some key data to be lost, causing economic losses to the enterprise.
[0110] (2) In actual use, the hardware and software are monitored. The health status of the hardware facilities of storage devices and network devices is monitored to detect hardware failure warning signals in a timely manner. The software monitoring performs hard disk SMART detection, power failure detection, high temperature detection, fan failure detection, monitors the health status of applications and services, application crash detection, database connection problem detection, performance degradation detection, and ensures timely archiving before system shutdown.
[0111] (3) In actual use, when catching exceptions, use an exception handling block (try-except). While catching exceptions, take appropriate measures to handle them to prevent the program from stopping completely.
[0112] (4) After an application crashes, it can be quickly restored, greatly reducing the inconvenience caused to users and the negative impact on the company's operations and technical maintenance. BRIEF DESCRIPTION OF THE DRAWINGS
[0113] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0114] Figure 1 This is one of the block diagrams of a method for rescuing important data based on shutting down a system according to an embodiment of the present invention;
[0115] Figure 2 This is the second block diagram of a method for rescue archiving of important data based on shutting down a system according to an embodiment of the present invention.
[0116] Figure 3 is a block diagram of a system for rescuing important data based on shutting down a system according to an embodiment of the present invention;
[0117] Figure 4 It is a block diagram of application crash recovery execution in a method for salvage archiving of important data based on shutting down a system according to an embodiment of the present invention;
[0118] Figure 5 It is one of the block diagrams of memory dump analysis in a method for rescue archiving of important data based on shutting down a system according to an embodiment of the present invention;
[0119] Figure 6 This is the second block diagram of memory dump analysis in a method for rescue archiving of important data based on shutting down a system according to an embodiment of the present invention. DETAILED DESCRIPTION
[0120] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0121] Embodiment 1
[0122] According to an embodiment of the present invention, a method for rescuing important data of a shutdown system is provided. Figure 1 As shown, the following steps are included:
[0123] Step S1: First, hardware and software monitoring is performed. Hardware monitoring monitors the health status of the hardware facilities of the monitoring server, storage device, and network device, and promptly detects hardware failure warning signals. Software monitoring performs hard disk SMART detection, power failure detection, overtemperature detection, fan failure detection, monitoring the health status of applications and services, application crash detection, database connection problem detection, and performance degradation detection;
[0124] Step S2: When the system is about to be shut down or faces potential risks, list the data that needs to be archived and prioritize them according to business impact and recovery difficulty. The archived data includes databases, configuration files, and user-uploaded data.
[0125] Step S3: Use a tape archive tool to package the file system data, eliminate duplicate data blocks through deduplication technology, reduce storage capacity requirements, and shorten data archiving time. Then, transfer the packaged file system data to an external hard disk or cloud storage service.
[0126] Step S4: Decompress the backup file and check whether it can be read correctly. Try to restore some data in a test environment to ensure the validity of the backup file. In the cloud storage service, ensure that strong encryption is used and that only authorized users can access it correctly.
[0127] Step S5: Record the specific time and content of the backup, and the storage location of the backup file to facilitate subsequent search.
[0128] Embodiment 2
[0129] Further illustrating on the basis of the first embodiment, the deduplication technology in step S3 uses a hash function to reduce the storage space requirement by identifying and deleting duplicate data blocks.
[0130] The hash function uses the SHA-256 algorithm, which includes the following steps:
[0131] initialization:
[0132] First, eight 32-bit registers (also called status registers) are initialized:
[0133] a=0x6a09e667
[0134] b=0xbb67ae85
[0135] c = 0x3c6ef372
[0136] d=0xa54ff53a
[0137] e=0x510e527f
[0138] f=0x9b05688c
[0139] g = 0x1f83d9ab
[0140] h=0x5be0cd19
[0141] Preprocessing:
[0142] Preprocess the input message, including padding and appending message length;
[0143] Fill message:
[0144] Append a bit to the end of the message;
[0145] Append enough zero bits so that the total length of the message modulo 512 is equal to 448 (that is, the total length of the message plus the 64-bit message length is an integer multiple of 512);
[0146] Additional message length:
[0147] A 64-bit bit length representation (Big Endian format) is appended to the end of the padded message.
[0148] Processing message block:
[0149] Divide the preprocessed message into 512-bit (64-byte) message blocks, and process each block;
[0150] Chunking:
[0151] Each 512-bit message block is divided into 16 32-bit small blocks ω0 and ω 15 ;
[0152] Extended message block:
[0153] Each message block is expanded to generate 64 32-bit words ω0 to ω 63 , where ω i (i>15) is obtained by rotating the first 16 words left (ROL) and performing XOR operation:
[0154]
[0155]
[0156] Main loop:
[0157] Perform main loop processing on each expanded message block, a total of 64 steps;
[0158] Main loop steps:
[0159] Initialize working registers a, b, c, d, e, f, g, h to the values of the current status registers; for each step number t (t from 0 to 63);
[0160]
[0161] in:
[0162] sigma0(x):=(x<<<2)xor(x<<<13)xor(x<<<22)
[0163] sigma1(x):=(x<<<6)xor(x<<<11)xor(x<<<25)
[0164] ch(x,y,z):=(xandy)xor((notx)amdz)
[0165] maj(x,y,z):=(xandy)xor(xandz)xor(yandz)
[0166] K[t] is a constant used for each round of scrambling;
[0167] Update status register:
[0168] After the main loop ends, the working registers a, b, c, d, e, f, g, h are added to the current status register;
[0169] a+=A
[0170] b+=B
[0171] c+=C
[0172] d+=D
[0173] e+=E
[0174] f+=F
[0175] g+=G
[0176] h+=H
[0177] Output hash value:
[0178] After all message blocks are processed, the final state registers a, b, c, d, e, f, g, h are concatenated to form a 256-bit hash value.
[0179] Further explanation based on the first embodiment, the tool of tape archive in step S3 includes the process of creating a tar file and extracting data from the tar file, and the algorithm is:
[0180] Creating a tar file
[0181]
[0182]
[0183] Extract tar file
[0184]
[0185] Embodiment 3
[0186] Further explanation is given on the basis of Example 1, as Figure 2 As shown, the application crash detection in step S1 uses an exception capture mechanism, including the following steps:
[0187] S11. Throwing an exception: When the program encounters a situation where it cannot continue to execute, an exception object will be thrown;
[0188] S12. Capture exceptions: Capture thrown exceptions through exception handling blocks (try-except statements);
[0189] S13, handle exceptions: Once an exception is caught, the exception handling program can take appropriate measures to handle it, including logging, clearing resources, and notifying users;
[0190] S14. Resume execution: After handling the exception, the resume execution program can choose to resume the normal execution process and can exit normally.
[0191] Further explanation based on Example 3, the general framework of exception capture is as follows:
[0192]
[0193] Exception catching is a mechanism used in programming to handle program runtime errors.
[0194] Embodiment 4
[0195] Further explanation based on the third embodiment, the basic structure of the exception handling block (try-except) is as follows:
[0196]
[0197] An exception handling block (try-except) is a mechanism in programming languages that is used to capture and handle exceptions that occur during program execution.
[0198] The application crash recovery in step S14 includes the following steps: Figure 4 As shown:
[0199] S141. Retry failed operations: For operations that can be retried, add retry logic, define reasonable retry intervals and times, and avoid infinite retry loops;
[0200] S142, reinitialize state: if the application crashes due to state problems, try to reinitialize the states of related components;
[0201] S143. Roll back to the previous state: For transactional operations, ensure that there is a rollback mechanism and use a version control system to manage the code to ensure that you can roll back to the previous version at any time;
[0202] S144. Restart the service: When the above steps S141, S142, and S143 are invalid, restart the application and configure an automated restart script to automatically restart the failed service.
[0203] The automated restart application script of step S144 is used in the Windows environment as follows:
[0204]
[0205]
[0206] like Figure 5 and Figure 6As shown, in step S1, the application crash is analyzed by using a memory dump, and the memory state, register value, and call stack information at the time of the application crash can be viewed to help find the cause of the application crash. The memory dump analysis includes the following steps:
[0207] S101. Install debugging tools: select appropriate debugging tools according to the operating system;
[0208] S102, obtaining a dump file: obtaining a full dump file generated when the application crashes;
[0209] S103, loading the dump file: start the debugging tool, use the graphical interface to load the memory dump file into the debugging tool, and use the analyze -v command in the debugging tool to load and analyze the dump file;
[0210] S104, check basic crash information: check the exception information recorded in the dump file, use the kb command in the debugging tool to check the call stack at the time of the crash, and understand the function call sequence before the crash;
[0211] S105, analyzing memory contents: using debugging tools to check the status of registers, understand the execution location of the program when the crash occurs, check the specific contents in the memory, including local variables, global variables, and heap memory, check the objects and data structures in the stack, to understand the state before the crash;
[0212] S106, check thread information: use debugging tools to view the status and information of all active threads, and switch to different threads for inspection;
[0213] S107, analyzing memory leaks: using debugging tools to check heap memory allocation, find the source of memory leaks, and use commands to track memory allocation and release;
[0214] S108. Analyze lock and synchronization issues: Use debugging tools to view the lock status to check deadlock and synchronization issues, and analyze synchronization operations in the thread pool;
[0215] S109, comprehensive analysis: The debugging tool refers to the log information of the application before and after the crash, combines the data in the dump file to perform comprehensive analysis, and reproduces the crash in the development environment to further verify the analysis results;
[0216] S110, Summary and Repair: The debugging tool records the problems and speculations found during the analysis process as a reference for subsequent repair work, formulates a repair plan based on the analysis results, and implements the repair as soon as possible.
[0217] The debugging tool in step S101 is WinDbg in Windows environment.
[0218] Embodiment 5
[0219] Further explanation is given on the basis of the first embodiment, for step S2, a database management tool is used to help developers manage and check database connections. These database management tools provide a graphical user interface (GUI), making it more intuitive and simple to check database connections. The database management tool is one of MySQL Workbench, pgAdmin, and SSMS.
[0220] MySQL Workbench provides some graphical features to help write and debug SQL queries:
[0221] 1. Auto-completion: When you start entering SQL statements, Workbench will automatically prompt table names, field names, etc.
[0222] 2. Format SQL: You can format the SQL code to make it more readable by right-clicking on the SQL editor and selecting the “Format SQL” option.
[0223] 3. Execute query: Click the "Execute" button on the toolbar (usually a green triangle icon), or use the shortcut key F5 to execute the SQL query in the current editor.
[0224] 4. View results: The query results will be displayed in the result panel below, where you can view data, export results, etc.
[0225] In the pgAdmin graphical user interface, you can do the following:
[0226] 1. Open the SQL Editor: Double-click a table or database object, or select the "SQL Editor" icon from the toolbar to open the SQL Editor.
[0227] 2. Auto-completion: When you start entering SQL statements in the SQL editor, pgAdmin will automatically prompt table names, field names, etc.
[0228] 3. Format SQL: In the SQL editor, you can select the "Format SQL" option to beautify the SQL code.
[0229] 4. Execute the query: Click the "Execute" button on the toolbar (usually a green triangle icon), or use the shortcut keys Ctrl+Enter (Windows / Linux) or Cmd+Return (Mac) to execute the SQL query in the current editor.
[0230] 5. View results: The query results will be displayed in the result panel below, where you can view data, export results, etc.
[0231] 6. Object Browser: Use the Object Browser to browse objects in the database, such as tables, views, stored procedures, etc., and you can perform some basic operations directly in the Object Browser.
[0232] In the SSMS graphical user interface, you can perform the following operations:
[0233] 1. Open the query editor: After launching SSMS, you will see a query editor window where you can write and execute SQL queries.
[0234] 2. Auto-completion: When you start entering a SQL statement in the query editor, SSMS will automatically prompt for table names, field names, etc.
[0235] 3. Format SQL: In the query editor, you can format the SQL code to make it easier to read through the menu item "Query" -> "Format SQL".
[0236] 4. Execute query: Click the "Execute" button on the toolbar (usually a green triangle icon), or use the shortcut key F5 to execute the SQL query in the current editor.
[0237] 5. View results: The query results will be displayed in the result panel below, where you can view data, export results, etc.
[0238] 6. Object Explorer: Use the Object Explorer to browse objects in the database, such as tables, views, stored procedures, etc., and you can perform some basic operations directly in the Object Explorer.
[0239] 7. SQL Analyzer: SSMS provides a SQL Analyzer that can help you optimize SQL query performance. You can use this feature through the menu item "Query" -> "Analyze Query".
[0240] According to another aspect of the present invention, a system for rescuing important data based on shutting down a system is provided. Figure 3 As shown, the following steps are included:
[0241] Crisis monitoring module: performs hardware and software monitoring. Hardware monitoring monitors the health status of the hardware facilities of the monitoring server, storage device, and network device, and promptly detects hardware failure warning signals. Software monitoring performs hard disk SMART detection, power failure detection, overtemperature detection, fan failure detection, monitors the health status of applications and services, application crash detection, database connection problem detection, and performance degradation detection.
[0242] Archived data sorting module: When the system is about to be shut down or faces potential risks, the module lists the data that needs to be archived and prioritizes them according to business impact and recovery difficulty. The archived data includes databases, configuration files, and user-uploaded data.
[0243] File system data packaging and transmission module: uses the tape archive tool to package the file system data, eliminates duplicate data blocks through deduplication technology, reduces storage capacity requirements, and shortens data archiving time. The packaged file system data is then transferred to an external hard disk or cloud storage service.
[0244] File system data decompression detection module: decompress the backup file, check whether it can be read correctly, try to restore some data in the test environment, ensure the validity of the backup file, and ensure that strong encryption is used in the cloud storage service and that only authorized users can access it correctly.
[0245] Backup record module: records the specific time and content of the backup, and the storage location of the backup file for easy subsequent retrieval.
[0246] In order to facilitate understanding of the above technical solutions of the present invention, the working principle or operation mode of the present invention in the actual process is described in detail below.
[0247] To sum up, with the help of the above-mentioned technical scheme of the present invention, in actual use, when performing rescue archiving of important data before system shutdown, the file system data is packaged, and duplicate data blocks are eliminated through deduplication technology, thereby reducing storage capacity requirements and data archiving time. This solves the problem in the prior art that when the amount of backup data is huge, the backup operation may take a long time to complete, especially when the network bandwidth is limited, which may cause some key data to be lost and cause economic losses to the enterprise.
[0248] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for rescuing important data based on shutting down a system, characterized in that: The following steps are involved: Step S1: First, hardware and software monitoring is performed. Hardware monitoring monitors the health status of the hardware facilities of the monitoring server, storage device, and network device, and promptly detects hardware failure warning signals. Software monitoring performs hard disk SMART detection, power failure detection, overtemperature detection, fan failure detection, monitoring the health status of applications and services, application crash detection, database connection problem detection, and performance degradation detection; Step S2: When the system is about to be shut down or faces potential risks, list the data that needs to be archived and prioritize them according to business impact and recovery difficulty. The archived data includes databases, configuration files, and user-uploaded data. Step S3: Use a tape archive tool to package the file system data, eliminate duplicate data blocks through deduplication technology, reduce storage capacity requirements, and shorten data archiving time. Then, transfer the packaged file system data to an external hard disk or cloud storage service. Step S4: decompress the backup file, check whether it can be read correctly, try to restore some data in the test environment, ensure the validity of the backup file, and ensure that strong encryption is used in the cloud storage service and that only authorized users can access it correctly; Step S5: Record the specific time and content of the backup, and the storage location of the backup file for easy subsequent search; The application crash detection in step S1 uses an exception capture mechanism, including the following steps: S11. Throwing an exception: When the program encounters a situation where it cannot continue to execute, an exception object will be thrown; S12. Capture exceptions: Capture the thrown exceptions through the exception handling block; S13, handle exceptions: Once an exception is caught, the exception handling program can take appropriate measures to handle it, including logging, clearing resources, and notifying users; S14, resume execution: after handling the exception, the resume execution program can choose to resume the normal execution process and can exit normally; The application crash recovery in step S14 includes the following steps: S141. Retry failed operations: For operations that can be retried, add retry logic, define reasonable retry intervals and times, and avoid infinite retry loops; S142, reinitialize state: if the application crashes due to a state problem, try to reinitialize the state of the application; S143. Roll back to the previous state: For transactional operations, ensure that there is a rollback mechanism and use a version control system to manage the code to ensure that you can roll back to the previous version at any time; S144. Restart the service: When the above steps S141, S142, and S143 are invalid, restart the application and configure an automated restart script to automatically restart the failed service.
2. A method for rescuing important data based on shutting down a system according to claim 1, characterized in that: The deduplication technology in step S3 uses a hash function to reduce storage space requirements by identifying and deleting duplicate data blocks.
3. The method for rescuing important data based on shutting down a system according to claim 2 is characterized in that: The hash function uses the SHA-256 algorithm.
4. The method for rescuing important data based on shutting down a system according to claim 3 is characterized in that: The tool for tape archive in step S3 includes the process of creating a tar file and extracting data from the tar file.
5. The method for rescuing important data based on shutting down a system according to claim 1 is characterized in that: In step S1, the application crash is analyzed using a memory dump, and the memory dump analysis includes the following steps: S101. Install debugging tools: select appropriate debugging tools according to the operating system; S102, obtaining a dump file: obtaining a full dump file generated when the application crashes; S103, loading the dump file: starting the debugging tool, using the graphical interface to load the memory dump file into the debugging tool, and using the !analyze -v command in the debugging tool to load and analyze the dump file; S104, check basic crash information: check the exception information recorded in the dump file, use the kb command in the debugging tool to check the call stack at the time of the crash, and understand the function call sequence before the crash; S105, analyzing memory contents: using debugging tools to check the status of registers, understand the execution location of the program when the crash occurs, check the specific contents in the memory, including local variables, global variables, and heap memory, check the objects and data structures in the stack, to understand the state before the crash; S106, check thread information: use debugging tools to view the status and information of all active threads, and switch to different threads for inspection; S107, analyzing memory leaks: using debugging tools to check heap memory allocation, find the source of memory leaks, and use commands to track memory allocation and release; S108. Analyze lock and synchronization issues: Use debugging tools to view the lock status to check deadlock and synchronization issues, and analyze synchronization operations in the thread pool; S109, comprehensive analysis: The debugging tool refers to the log information of the application before and after the crash, combines the data in the dump file to perform comprehensive analysis, and reproduces the crash in the development environment to further verify the analysis results; S110, Summary and Repair: The debugging tool records the problems and speculations found during the analysis process as a reference for subsequent repair work, formulates a repair plan based on the analysis results, and implements the repair as soon as possible.
6. The method for rescuing important data based on shutting down a system according to claim 5, characterized in that: The debugging tool in step S101 is WinDbg in Windows environment.
7. The method for rescuing important data based on shutting down a system according to claim 1, characterized in that: For step S2, a database management tool is used to help developers manage and check database connections. These database management tools provide a graphical user interface. The database management tool is one of MySQL Workbench, pgAdmin, and SSMS.
8. A system for rescuing important data of a shutdown system, based on the application of the method for rescuing important data of a shutdown system according to claim 7, characterized in that: include: Crisis monitoring module: performs hardware and software monitoring. Hardware monitoring monitors the health status of the hardware facilities of the monitoring server, storage device, and network device, and promptly detects hardware failure warning signals. Software monitoring performs hard disk SMART detection, power failure detection, overtemperature detection, fan failure detection, monitors the health status of applications and services, application crash detection, database connection problem detection, and performance degradation detection. Archived data sorting module: When the system is about to be shut down or faces potential risks, the module lists the data that needs to be archived and prioritizes them according to business impact and recovery difficulty. The archived data includes databases, configuration files, and user-uploaded data. File system data packaging and transmission module: uses the tape archive tool to package the file system data, eliminates duplicate data blocks through deduplication technology, reduces storage capacity requirements, and shortens data archiving time. The packaged file system data is then transferred to an external hard disk or cloud storage service. File system data decompression detection module: decompress the backup file, check whether it can be read correctly, try to restore some data in the test environment, ensure the validity of the backup file, and ensure that strong encryption is used in the cloud storage service and that only authorized users can access it correctly. Backup record module: records the specific time and content of the backup, and the storage location of the backup file for easy subsequent retrieval.
Citation Information
Patent Citations
Data management platform, method and node
CN114064356A
Automatic adaptive archiving method and system in recovery after file is regularly backed up to magnetic tape
CN115480958A