A high-reliability data storage and recovery method

By obtaining historical logs and performance information from network devices, the quantity and quality of cloud storage devices can be determined, solving the problem of inaccurate data recovery after network device power failure and achieving highly reliable and accurate data recovery.

CN119759648BActive Publication Date: 2025-11-07HUBEI ANXIN SMART TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411807019.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-10
Publication Date
2025-11-07
Estimated Expiration
2044-12-10

AI Technical Summary

Technical Problem

In existing technologies, network devices cannot guarantee the reliability and correctness of data recovery after power failure, especially the storage and recovery of configuration files cannot meet high reliability requirements.

Method used

By acquiring historical log information and performance information from network devices, the required quantity and quality score of cloud storage devices are determined. Configuration files are stored in local primary devices, backup devices, and target cloud storage devices, and the configuration files are restored from these devices in the event of a power outage.

Benefits of technology

It improves the reliability and accuracy of configuration file recovery in the event of power failure, ensuring the correctness and integrity of the configuration file.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119759648B_ABST
    Figure CN119759648B_ABST
Patent Text Reader

Abstract

The application relates to a high-reliability data storage and recovery method, which comprises the following steps: acquiring historical log information of a network device and current performance information of the device, determining a required number of cloud storage devices based on the historical log information and the performance information, acquiring a current memory occupation percentage and historical storage logs of the cloud storage devices, determining a storage quality score of the cloud storage devices based on the memory occupation percentage and the historical storage logs, determining target cloud storage devices based on the storage quality score and the required number, storing configuration files of the network device into local main devices, backup devices and the target cloud storage devices, when power failure is monitored, acquiring configuration files of the main devices, the backup devices and the target cloud storage devices, determining configuration files to be recovered from the configuration files of the main devices, the backup devices and the target cloud storage devices and recovering the configuration files. The application has the effect of improving the reliability of network device data recovery.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of data storage, in particular to a high-reliability data storage and recovery method. BACKGROUND

[0002] Network devices include switches and routers, etc., and are important components of network communication, widely used in communication and industrial fields, and accordingly the data of network devices need to be stored and recorded. The data of network devices include configuration files, etc., and the configuration files include IP addresses, routing protocol configurations, access control lists, etc., which define how the network devices process data packets and route traffic.

[0003] Currently, the data of network devices is usually stored in the flash chip of the local device, and if the network device or the local device is powered off, the data is read from the flash and recovered to the memory. However, this method cannot determine the correctness of the network data when recovering the data, and the data cannot be guaranteed to be correct and reliable when the device is restarted to read the data, which cannot meet the high-reliability requirements of network data storage and recovery. SUMMARY

[0004] In order to improve the reliability of network device data recovery, the present application provides a high-reliability data storage and recovery method.

[0005] In a first aspect, the present application provides a high-reliability data storage and recovery method, which adopts the following technical solution:

[0006] A high-reliability data storage and recovery method, comprising:

[0007] Obtaining historical log information of a network device and current performance information of the device, and determining the required number of cloud storage devices based on the historical log information and the performance information;

[0008] Obtaining the current memory occupation percentage and historical storage log of each cloud storage device, and determining the storage quality score of each cloud storage device based on the memory occupation percentage and the historical storage log;

[0009] Determining the target cloud storage device based on the storage quality score and the required number;

[0010] Storing the configuration files of the network devices in the local master device, backup device and target cloud storage device, and each configuration file of the network device is one;

[0011] When a power failure is detected, obtaining the configuration files in the master device, backup device and target cloud storage device;

[0012] Determine the configuration file to be recovered from the configuration files in the master device, the backup device and the target cloud storage device and perform recovery.

[0013] By adopting the technical scheme, the historical log information of the network device and the performance information of the current device are acquired, the historical log information records the historical running condition and the abnormal condition of the network device, thereby representing the importance of the network device, the higher the importance, the more the number of cloud storage devices required to ensure the reliability of the configuration file recovery after power failure, the performance information represents the running condition of the current device, the higher the performance, the lower the possibility of power failure, and the less the number of cloud storage devices required, therefore, the appropriate required number of cloud storage devices is determined according to the historical log information and the performance information, the current memory occupation percentage of each cloud storage device and the historical storage log are acquired, the smaller the memory occupation percentage, the more suitable for storing the configuration file, and the historical storage log represents the historical storage data condition of the cloud storage device, therefore, the storage quality score of each cloud storage device can be accurately determined according to the memory occupation percentage and the historical storage log, the target cloud storage device is determined according to the storage quality score and the required number, and then the configuration file is stored in the master device, the backup device and the target cloud storage device, and then the power failure is monitored, when the power failure occurs, the configuration file is acquired from the three devices, and the configuration file to be recovered is determined from the acquired configuration file and recovery operation is performed, since the target cloud storage device is a device with high storage quality, and the required number is determined according to the running condition of the network device and the current device, that is, using an appropriate number of target cloud storage devices to store the configuration file can ensure that an appropriate number of configuration files are stored to ensure the appropriate storage sample number of the configuration file, and the combination of the target cloud storage device and the configuration file can ensure the correctness of the configuration file as much as possible, thereby improving the reliability of the configuration file recovered when the data is recovered after power failure.

[0014] In another possible implementation manner, the historical log information includes abnormal logs and the data amount of each configuration file, the performance information includes performance occupation percentage, network speed and device temperature, and the required number of cloud storage devices is determined based on the historical log information and the performance information, including:

[0015] Determine the total amount of the data amount of all configuration files and a first ratio of the number of abnormal logs to the number of all historical log information;

[0016] Determine a time interval from the last time point of the abnormal log to the current time;

[0017] Determine the importance level of the network device based on the total amount, the first ratio and the time interval;

[0018] determine a health score of the device based on the performance occupancy percentage, network speed, and device temperature;

[0019] determine a required number of the cloud storage devices based on the importance level and the health score.

[0020] In another possible implementation, the history storage log includes verification information about whether a configuration file stored in the cloud storage device is consistent with a standard configuration file, and determining a storage quality score of each cloud storage device based on the memory occupancy percentage and the history storage log includes:

[0021] obtaining a power-off time of the device, and determining a target history storage log of each cloud storage device corresponding to the power-off time;

[0022] determining a number of first target history storage logs in the target history storage log of each cloud storage device, the first target history storage log being a storage log in which a configuration file is consistent with a standard configuration file;

[0023] determining a second ratio of the number of the first target history storage logs to a total number of the target history storage logs;

[0024] determining a storage quality score of each cloud storage device based on the memory occupancy percentage, the second ratio, and a respective coefficient.

[0025] In another possible implementation, determining a target cloud storage device based on the storage quality score and the required number includes:

[0026] sorting all cloud storage devices in descending order of the storage quality score to obtain a sorting result;

[0027] determining the target cloud storage device as a cloud storage device with a highest storage quality score in the sorting result.

[0028] In another possible implementation, determining a configuration file to be restored from configuration files in the master device, the backup device, and the target cloud storage device includes:

[0029] comparing the configuration files in the master device, the backup device, and the target cloud storage device;

[0030] if the configuration files in the master device and the backup device are inconsistent, determining a same target configuration file in the target cloud storage device, and comparing the target configuration file with the configuration file in the master device and the configuration file in the backup device, respectively;

[0031] If the target configuration file is consistent with the configuration file of the primary device, and the proportion of the number of target configuration files to the required number reaches a preset proportion threshold, the configuration file of the primary device is determined as the configuration file to be recovered.

[0032] If the target configuration file is consistent with the configuration file of the standby device, and the proportion of the number of target configuration files to the required number reaches a preset proportion threshold, the configuration file of the standby device is determined as the configuration file to be recovered.

[0033] If the target configuration file is inconsistent with the configuration file of the primary device, the target configuration file is inconsistent with the configuration file of the standby device, and the proportion of the number of target configuration files to the required number reaches a preset proportion threshold, the target configuration file is determined as the configuration file to be recovered.

[0034] In another possible implementation manner, the method further includes:

[0035] If the target configuration file is inconsistent with the configuration file of the primary device, the target configuration file is inconsistent with the configuration file of the standby device, and the proportion of the number of target configuration files to the required number reaches a preset proportion threshold, it is determined that all abnormal cloud storage devices in the target cloud storage devices, and the configuration file stored in the abnormal cloud storage device includes an abnormal configuration file different from the configuration data of the target configuration file.

[0036] The number of network nodes between each abnormal cloud storage device and the primary device is determined.

[0037] The primary device is controlled to send a test data packet to the abnormal cloud storage device, and a communication delay of the primary device to each abnormal cloud storage device is determined.

[0038] A communication loss quality score is determined based on the number of network nodes and the communication delay.

[0039] A target data segment different from the configuration data of the target configuration file in the configuration data of each abnormal configuration file is determined.

[0040] The position of each target data segment in the target configuration file is determined, and an importance level of each target data segment is determined, wherein the data at different positions in the target configuration file correspond to different importance levels.

[0041] A storage loss quality score of each abnormal cloud storage device is determined based on the data length and the importance level of the target data segment.

[0042] multiplying the communication loss quality score and the storage loss quality score as a working quality loss value of each abnormal cloud storage device in the current storage;

[0043] obtaining a storage quality score of the abnormal cloud storage device, determining a third ratio of the storage quality score and the working quality loss value, and eliminating the abnormal cloud storage device whose third ratio reaches a specified ratio from all cloud storage devices.

[0044] In another possible implementation manner, the determining of the preset proportion threshold comprises:

[0045] determining a score based on the importance level and the required number;

[0046] determining a preset score interval in which the score is located, each preset score interval corresponding to a preset ratio, and determining the preset proportion corresponding to the preset score interval in which the score is located as the preset proportion threshold.

[0047] In another possible implementation manner, the method further comprises:

[0048] if the target configuration file is inconsistent with the configuration file of the master device, the target configuration file is inconsistent with the configuration file of the standby device, and the proportion of the number of target configuration files to the required number does not reach the preset proportion, determining inconsistent data in the configuration files of the master device, the standby device and the target cloud storage device;

[0049] annotating the inconsistent data, and outputting the annotated configuration data.

[0050] In a second aspect, the application provides a high-reliability data storage and recovery device, which adopts the following technical solution:

[0051] A high-reliability data storage and recovery device comprises:

[0052] a first determining module configured to obtain historical log information of a network device and current performance information of the device, and determine a required number of cloud storage devices based on the historical log information and the performance information;

[0053] a second determining module configured to obtain a current memory occupation percentage and historical storage logs of each cloud storage device, and determine a storage quality score of each cloud storage device based on the memory occupation percentage and the historical storage logs;

[0054] a third determining module configured to determine a target cloud storage device based on the storage quality score and the required number;

[0055] The storage module is configured to store the configuration file of each network device in a local master device, a backup device and a target cloud storage device;

[0056] The file acquisition module is configured to acquire the configuration file in the master device, the backup device and the target cloud storage device when a power failure is monitored;

[0057] The file recovery module is configured to determine the configuration file to be recovered from the configuration file in the master device, the backup device and the target cloud storage device and perform recovery.

[0058] By using the above technical solution, the first determination module acquires the historical log information of the network device and the performance information of the current device, the historical log information records the historical running condition and the abnormal condition of the network device, thereby representing the importance of the network device, the higher the importance, the more the number of cloud storage devices required to ensure the reliability of the configuration file recovery in the power failure, the higher the performance, the lower the possibility of power failure, and the less the number of cloud storage devices required, therefore, the appropriate required number of cloud storage devices is determined according to the historical log information and the performance information, the second determination module acquires the current memory occupation percentage and the historical storage log of each cloud storage device, the smaller the memory occupation percentage, the more suitable for storing the configuration file, and the historical storage log represents the historical storage data condition of the cloud storage device, therefore, the storage quality score of each cloud storage device can be accurately determined according to the memory occupation percentage and the historical storage log, the third determination module determines the target cloud storage device according to the storage quality score and the required number, and then the storage module starts to store the configuration file in the master device, i.e., the current device, the backup device and the target cloud storage device, and then monitors the power failure, when the power failure occurs, the file acquisition module acquires the configuration file from the three devices, and the file recovery module determines the configuration file to be recovered from the acquired configuration file and performs recovery operation, since the target cloud storage device is a device with high storage quality, and the required number is determined according to the running condition of the network device and the current device, i.e., using the appropriate number of target cloud storage devices to store the configuration file can ensure that the appropriate number of configuration files are backed up to ensure the appropriate storage sample number of the configuration file, and the combination of the target cloud storage device and the configuration file can ensure the correctness of the configuration file as much as possible, thereby improving the reliability of the configuration file recovered in the power failure recovery data.

[0059] In another possible implementation, the historical log information includes an abnormal log and a data volume of each configuration file, the performance information includes a performance occupation percentage, a network speed and a device temperature, and the first determining module, when determining the required number of the cloud storage devices based on the historical log information and the performance information, is specifically configured to:

[0060] determine a total amount of data volumes of all configuration files and a first ratio of a number of abnormal logs to a number of all historical log information;

[0061] determine a time interval from a latest time point of the abnormal logs to a current time;

[0062] determine an importance level of the network device based on the total amount, the first ratio and the time interval;

[0063] determine a running condition score of the network device based on the performance occupation percentage, the network speed and the device temperature;

[0064] determine the required number of the cloud storage devices based on the importance level and the running condition score.

[0065] In another possible implementation, the historical storage log includes verification information about whether configuration files stored in the cloud storage device are consistent with standard configuration files, and the second determining module, when determining a storage quality score of each cloud storage device based on the memory occupation percentage and the historical storage log, is specifically configured to:

[0066] obtain a power-off time of the network device, and determine target historical storage logs of each cloud storage device corresponding to the power-off time;

[0067] determine a number of first target historical storage logs of each cloud storage device in the target historical storage logs, the first target historical storage logs being storage logs in which the configuration files are consistent with the standard configuration files;

[0068] determine a second ratio of the number of the first target historical storage logs to a number of all target historical storage logs;

[0069] determine the storage quality score of each cloud storage device based on the memory occupation percentage, the second ratio and a respective corresponding coefficient.

[0070] In another possible implementation, the third determining module, when determining the target cloud storage device based on the storage quality score and the required number, is specifically configured to:

[0071] sort all cloud storage devices in descending order of the storage quality score to obtain a sorting result;

[0072] determine the target cloud storage devices as the target cloud storage devices according to the sorting result.

[0073] In another possible implementation, when the file recovery module determines the configuration files to be recovered from the configuration files in the master device, the backup device and the target cloud storage devices, the file recovery module is specifically configured to:

[0074] compare the configuration files of the master device, the backup device and the target cloud storage devices;

[0075] if the configuration files of the master device and the backup device are inconsistent, determine the same target configuration files in the target cloud storage devices, and compare the target configuration files with the configuration files of the master device and the backup device respectively;

[0076] if the target configuration files are consistent with the configuration files of the master device, and the proportion of the number of the target configuration files to the required number reaches a preset proportion threshold, determine the configuration files of the master device as the configuration files to be recovered;

[0077] if the target configuration files are consistent with the configuration files of the backup device, and the proportion of the number of the target configuration files to the required number reaches the preset proportion threshold, determine the configuration files of the backup device as the configuration files to be recovered;

[0078] if the target configuration files are inconsistent with the configuration files of the master device, the target configuration files are inconsistent with the configuration files of the backup device, and the proportion of the number of the target configuration files to the required number reaches the preset proportion threshold, determine the target configuration files as the configuration files to be recovered.

[0079] In another possible implementation, the apparatus further includes:

[0080] an abnormal cloud storage device determination module configured to, when the target configuration files are inconsistent with the configuration files of the master device, the target configuration files are inconsistent with the configuration files of the backup device, and the proportion of the number of the target configuration files to the required number reaches the preset proportion threshold, determine abnormal cloud storage devices in all the target cloud storage devices, wherein the configuration files stored in the abnormal cloud storage devices include abnormal configuration files different from the configuration data of the target configuration files;

[0081] a network node determination module configured to determine the number of network nodes between each abnormal cloud storage device and the master device;

[0082] a control module, configured to control the master device to send a test data packet to the abnormal cloud storage device and determine a communication delay from the master device to each abnormal cloud storage device;

[0083] a communication loss quality score determination module, configured to determine a communication loss quality score based on the number of network nodes and the communication delay;

[0084] a target data segment determination module, configured to determine a target data segment in the configuration data of each abnormal configuration file that is different from the configuration data of the target configuration file;

[0085] an importance level determination module, configured to determine a position of each target data segment in the target configuration file, and determine an importance level of each target data segment, the data at different positions in the target configuration file corresponding to different importance levels;

[0086] a storage loss quality score determination module, configured to determine a storage loss quality score of each abnormal cloud storage device based on the data length and the importance level of the target data segment;

[0087] a work quality loss value determination module, configured to take a product of the communication loss quality score and the storage loss quality score as a work quality loss value of each abnormal cloud storage device in the current storage;

[0088] a rejection module, configured to obtain a storage quality score of the abnormal cloud storage device, determine a third ratio of the storage quality score and the work quality loss value, and reject the abnormal cloud storage device with the third ratio reaching a specified ratio from all cloud storage devices.

[0089] In another possible implementation, the preset proportion threshold is determined, and the apparatus further includes:

[0090] a fourth determination module, configured to determine a score based on the importance level and the required number;

[0091] a fifth determination module, configured to determine a preset score interval in which the score is located, each preset score interval corresponding to a preset ratio, and determine the preset proportion corresponding to the preset score interval in which the score is located as the preset proportion threshold.

[0092] In another possible implementation, the apparatus further includes:

[0093] a sixth determination module, configured to, when the target configuration file is inconsistent with the configuration file of the master device, the target configuration file is inconsistent with the configuration file of the backup device, and the proportion of the number of target configuration files to the required number does not reach a preset proportion, determine inconsistent data in the configuration file of the master device, the configuration file of the backup device, and the configuration file of the target cloud storage device.

[0094] The annotation module is used to annotate the inconsistent data and output the annotated configuration data.

[0095] Thirdly, this application provides an electronic device that adopts the following technical solution:

[0096] An electronic device comprising:

[0097] At least one processor;

[0098] Memory;

[0099] At least one application, wherein the application is stored in memory and configured to be executed by at least one processor, the at least one configuration being for: executing a highly reliable data storage and recovery method as shown in any possible implementation of the first aspect.

[0100] Fourthly, this application provides a computer-readable storage medium, which adopts the following technical solution:

[0101] A computer-readable storage medium that, when the computer program is executed in a computer, causes the computer to perform a highly reliable data storage and recovery method as described in any one of the first aspects.

[0102] In summary, this application includes at least one of the following beneficial technical effects:

[0103] The historical log information of the network device and the current performance information of the device are acquired, the historical log information records the historical running condition and the abnormal condition of the network device, thereby representing the importance of the network device, the higher the importance is, the more the number of cloud storage devices required to ensure the reliability of the configuration file recovery after power failure is, the performance information represents the running condition of the device, the higher the performance is, the lower the possibility of power failure is, and the number of cloud storage devices required is less, therefore, the appropriate number of cloud storage devices required is determined according to the historical log information and the performance information, the current memory occupation percentage of each cloud storage device and the historical storage log are acquired, the smaller the memory occupation percentage is, the more suitable the storage of the configuration file is, and the historical storage log represents the historical storage data condition of the cloud storage device, therefore, the storage quality score of each cloud storage device can be accurately determined according to the memory occupation percentage and the historical storage log, the target cloud storage device is determined according to the storage quality score and the number required, and then the configuration file is stored in the main device, the standby device and the target cloud storage device, and then the power failure is monitored, when the power failure occurs, the configuration file is acquired from the three devices, the configuration file to be recovered is determined from the acquired configuration file, and the recovery operation is performed, since the target cloud storage device is a device with high storage quality, and the number required is determined according to the running condition of the network device and the device, that is, the appropriate number of target cloud storage devices is used to store the configuration file, which can ensure that the appropriate number of configuration files are stored to ensure the appropriate number of configuration file storage samples, and the combination of the target cloud storage device and the configuration file can ensure the correctness of the configuration file as much as possible, thereby improving the reliability of the configuration file to be recovered when the power failure is recovered. BRIEF DESCRIPTION OF DRAWINGS

[0104] Figure 1 is a flowchart of a high-reliability data storage and recovery method according to an embodiment of the present application.

[0105] Figure 2 is a structural diagram of a high-reliability data storage and recovery device according to an embodiment of the present application.

[0106] Figure 3 is a structural diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0107] The present application will be further described in detail below with reference to the accompanying drawings.

[0108] Those skilled in the art can make modifications to the present embodiment without creative contribution after reading the present specification, but as long as the modifications are within the scope of the claims of the present application, they are protected by the patent law.

[0109] In order to make the purposes, technical solutions, and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.

[0110] In addition, the term "and / or" in the present application is only used to describe the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B can mean that A exists alone, A and B exist together, and B exists alone. In addition, the character " / " in the present application generally represents an "or" relationship between the associated objects unless otherwise specified.

[0111] The embodiments of the present application will be described in further detail below with reference to the drawings of the specification.

[0112] The embodiments of the present application provide a high-reliability data storage and recovery method, which is executed by an electronic device. The electronic device can be a server or a terminal device. The server can be a standalone physical server, a server cluster composed of multiple physical servers, or a distributed system, and can also be a cloud server providing cloud computing services. The terminal device can be a smartphone, a tablet computer, a notebook computer, a desktop computer, etc., but is not limited thereto. The terminal device and the server can be directly or indirectly connected through wired or wireless communication, and the embodiments of the present application do not limit this. As shown in FIG. 1, the method includes steps S101, S102, S103, S104, S105, and S106. Figure 1

[0113] S101, obtaining historical log information of a network device and current performance information of the device, and determining a required number of cloud storage devices based on the historical log information and the performance information.

[0114] For the embodiments of the present application, the network device includes a switch, a router, a firewall, etc. The electronic device is connected to the network device through a wire or wirelessly. The historical log information can be stored in a storage medium of the network device, in a cloud server, or in a local storage medium of the electronic device, so as to obtain the historical log information. The historical log information records the activities of the network device, including system events, error messages, user login information, etc. The log file is very important for troubleshooting, performance analysis, and security audit, and therefore, the important level of the network device can be accurately determined through the historical log information.

[0115] ​The electronic device is the device, and the performance information is the performance occupation of the CPU, the use of the running memory, etc. The performance monitoring plug-in or script in the electronic device can be set by the staff to collect the performance information. The current running status of the electronic device can be accurately determined through the performance information.

[0116] In order to better restore the configuration file of the network device when the electronic device is powered off, the electronic device is also connected with a plurality of cloud storage devices through wires or wireless connection, that is, when the electronic device stores the configuration file of the network device, the cloud storage device also stores the configuration file, so that when the power-off condition occurs, the configuration file is more reliably restored according to the consistent condition of the configuration file stored in the plurality of cloud storage devices. The higher the importance level of the network device, the higher the requirement and accuracy of the configuration file data recovery, and the more the number of cloud storage devices required, and vice versa. The worse the current running state of the electronic device, the greater the possibility of power failure, the higher the requirement and accuracy of the configuration file data recovery, and the more the number of cloud storage devices required, and vice versa. Therefore, the electronic device determines the number of suitable cloud storage devices for storing the configuration file according to the importance level and the performance information, that is, the required number.

[0117] S102, obtaining the current memory occupation percentage and the historical storage log of each cloud storage device, and determining the storage quality score of each cloud storage device based on the memory occupation percentage and the historical storage log.

[0118] For the embodiment of the application, the electronic device sends an acquisition instruction to each cloud storage device, and the cloud storage device sends its memory occupation percentage and historical storage log to the electronic device after receiving the acquisition instruction. The greater the memory occupation percentage, the less the remaining memory, the less suitable for being a cloud storage device for storing the configuration file, and vice versa. Whether the cloud storage device stores the configuration file in the past is consistent with the original configuration file is recorded in the historical storage log. The more inconsistent, the less suitable for being a cloud storage device for storing the configuration file. Therefore, the memory occupation percentage and the historical storage log both represent the storage quality of the cloud storage device, so the electronic device determines the storage quality score of each cloud storage device based on the memory occupation percentage and the historical storage log.

[0119] S103, determining the target cloud storage device based on the storage quality score and the required number.

[0120] For the embodiment of the application, the electronic device determines the storage quality score and the required number, and then determines the appropriate target cloud storage device according to the two. Since the determined target cloud storage device is of high storage quality, the effect of using the target cloud storage device to store the configuration file is better and the accuracy is higher when the power failure occurs subsequently and the data needs to be recovered.

[0121] S104, the configuration file of the network device is stored in the local master device, the standby device and the target cloud storage device.

[0122] Each network device has one configuration file.

[0123] For the embodiment of the application, after the electronic device determines the target cloud storage device, the electronic device starts to receive the configuration file of the network device and stores the configuration file in the storage medium of the electronic device, the storage medium of the standby device and each target cloud storage device, thereby facilitating subsequent data recovery. The standby device can be a terminal device arranged near or beside the electronic device, which is also connected to the electronic device through a wire.

[0124] S105, when the power failure is monitored, the configuration file in the master device, the standby device and the target cloud storage device is obtained.

[0125] For the embodiment of the application, the electronic device monitors its own voltage. When the voltage is detected to be 0, it means that the power failure occurs. The electronic device has the function of automatic recovery after power failure, so the electronic device restarts when the power failure occurs. After the electronic device restarts, the configuration file in the storage medium of the electronic device, the configuration file in the standby device and the configuration file in each target cloud storage device are retrieved. The master device is the electronic device.

[0126] S106, the configuration file to be recovered is determined from the configuration file in the master device, the standby device and the target cloud storage device and is recovered.

[0127] For the embodiment of the application, since the sudden power failure and power recovery of the electronic device may cause errors or loss of part of the data of the configuration file, the electronic device performs consistency analysis on the configuration file stored in the master device, the configuration file stored in the standby device and the configuration file stored in each target cloud storage device, thereby determining the correct configuration file, i.e. the configuration file to be recovered. After the electronic device determines the configuration file to be recovered, the configuration file to be recovered is directly replaced with the locally stored configuration file, thereby improving the reliability of data recovery.

[0128] In a possible implementation of the embodiment, the historical log information includes abnormal logs and data volume of each configuration file, the performance information includes performance occupation percentage, network speed and device temperature, and the required number of the cloud storage devices is determined based on the historical log information and the performance information in S101, specifically including the following steps: S1011 (not shown in the figure), S1012 (not shown in the figure), S1013 (not shown in the figure), S1014 (not shown in the figure) and S1015 (not shown in the figure), wherein

[0129] In S1011, the total amount of data volume of all configuration files and a first ratio of the number of abnormal logs to the number of all historical log information are determined.

[0130] For the embodiment, after the electronic device determines the data volume of each configuration file from the historical log information, the electronic device sums up the data volume of all configuration files to obtain a total amount. The larger the total amount of data volume of the network device, the more data the network device transmits, and the more important the network device is. The abnormal logs are logs when the network device has an abnormality such as failure. The more the number of abnormal logs, the greater the probability that the network device has an abnormality, and the greater the probability that the network device has an abnormality in the next time operation. The more important the network device is, and the more important the real-time monitoring of the network device is, and the more important the data recovery when power failure occurs. Therefore, the electronic device determines a first ratio of the number of abnormal logs to the number of all historical log information. The larger the first ratio, the greater the proportion of abnormal logs, and the more important the network device is.

[0131] In S1012, a time interval from a time point of the last abnormal log to a current time is determined.

[0132] For the embodiment, the network device has a generation time corresponding to each log, so that the electronic device determines the last abnormal log according to the generation time of the log. The electronic device can obtain the current time from a local clock chip or from the Internet, and then obtain the time interval by subtracting the time point of the last abnormal log from the current time. The larger the time interval, the longer the time that the network device is in normal operation, and the greater the possibility that the network device has an abnormality in the next time operation, which means that the network device is more important.

[0133] In S1013, the importance level of the network device is determined based on the total amount, the first ratio and the time interval.

[0134] For the embodiment of the present application, in summary, the total amount of data, the first ratio and the time interval of the configuration file transmitted by the network device are all key factors affecting the importance of the network device, and the three factors have different degrees of influence on the importance of the network device. Therefore, the staff sets the respective corresponding coefficients of the above three factors through the visual operation interface and stores them in the storage medium of the electronic device. After the electronic device obtains the total amount of data, the first ratio and the time interval, it retrieves the respective corresponding coefficients for weighted calculation to obtain the score of the network device, which can represent the importance of the network device. The electronic device can store a plurality of preset score intervals, each preset score interval corresponds to a preset level, and the preset level corresponding to each interval is set by the staff according to the calculation or actual situation. The electronic device determines the preset score interval where the score is located, and determines the preset level corresponding to the preset score interval where the score is located as the importance level of the network device.

[0135] S1014, determine the running condition score of the device based on the performance occupation percentage, network speed and device temperature.

[0136] For the embodiment of the present application, the greater the performance occupation percentage of the electronic device, the less the remaining unused performance resource, the worse the running condition of the electronic device, and the more likely the CPU and other chip devices overheat and cause power failure. In order to ensure the reliability of data recovery when power failure occurs subsequently, more cloud storage devices are required. Similarly, the faster the network speed, the higher the efficiency and reliability of downloading and transmitting configuration files, the better the running condition of the electronic device, and the less likely the power failure. Conversely, the worse the running condition of the electronic device, the more likely the power failure. In order to ensure the reliability of data recovery when power failure occurs subsequently, more cloud storage devices are required. The staff can set a temperature sensor on the electronic device to monitor the running temperature of the electronic device. The higher the running temperature, the worse the running condition of the electronic device, and the more likely the power failure. In order to ensure the reliability of data recovery when power failure occurs subsequently, more cloud storage devices are required.

[0137] Since the performance occupation percentage and the device temperature are inversely proportional to the running condition of the electronic device and proportional to the number of required cloud storage devices, and the network speed is proportional to the running condition of the electronic device and inversely proportional to the number of required cloud storage devices, the electronic device can calculate the inverse of the network speed.

[0138] In summary, the performance occupation percentage, network speed and device temperature are all key factors affecting the running condition of the electronic device, and the influence degree is different. The staff can set the respective corresponding coefficients of the above three through the visual operation interface and store them in the electronic device. After the electronic device determines the performance occupation percentage, the reciprocal of the network speed and the device temperature, the respective corresponding coefficients are called to calculate to obtain the running condition score of the electronic device. The higher the running condition score is, the worse the running condition of the electronic device is.

[0139] S1015, determining the required number of cloud storage devices based on the importance level and the running condition score.

[0140] For the embodiments of the present application, in summary, the importance level of the network device and the running condition score of the electronic device are both important factors affecting the required number of cloud storage devices of the storage configuration file. As above, the staff sets the respective corresponding coefficients of the importance level and the running condition score, the electronic device calls the respective corresponding coefficients to weight and calculate the importance level and the running condition score to obtain a score, and the electronic device can directly take the score as the required number, or determine the preset score interval where the score is located, and determine the preset number corresponding to the preset score interval as the required number. The required number of cloud network devices is more accurate by determining the importance level of the network device and the running condition of the electronic device.

[0141] In one possible implementation manner of the embodiments of the present application, the history storage log includes the verification information of whether the configuration file stored by the cloud storage device is consistent with the standard configuration file, and step S102 of determining the storage quality score of each cloud storage device based on the memory occupation percentage and the history storage log specifically includes step S1021 (not shown in the figure), step S1022 (not shown in the figure), step S1023 (not shown in the figure) and step S1024 (not shown in the figure), wherein,

[0142] S1021, obtaining the power-off time of the device, and determining the target history storage log of each cloud storage device corresponding to the power-off time.

[0143] For the embodiments of the present application, the electronic device stores the power-off time after each power-off of the electronic device. The electronic device calls the power-off time each time, since each history storage log of the cloud storage device corresponds to a generation time, the electronic device is convenient to determine the log of each cloud storage device corresponding to the power-off time, i.e. the target history storage log. The log of the cloud storage device includes the consistency of the configuration file stored by the cloud storage device after the power-off of the electronic device and the original configuration file, i.e. the standard configuration file, i.e. consistent or inconsistent.

[0144] S1022, determine a number of first target historical storage logs in the target historical storage logs of each cloud storage device.

[0145] The first target historical storage log is a storage log in which the configuration file is consistent with the standard configuration file.

[0146] For the embodiment of the present application, the log when the cloud storage file is consistent with the standard configuration file and the log when the cloud storage file is inconsistent with the standard configuration file can be represented by different markers. Therefore, the electronic device can determine the first target historical storage log from the target historical storage logs of each cloud storage device and count to obtain the number of first target historical storage logs.

[0147] S1023, determine a second ratio of the number of first target historical storage logs to the number of all target historical storage logs.

[0148] For the embodiment of the present application, the more the number of first target historical storage logs, the higher the accuracy of the cloud storage device in storing the configuration file and the higher the consistency with the standard configuration file. The target historical storage log is the log when power failure occurs each time. After the electronic device determines the number of first target historical storage logs, the second ratio of the number of first target historical storage logs to the number of all target historical storage logs is calculated. The larger the second ratio, the larger the proportion of the number of times that the configuration file stored by the cloud storage device is accurate when the electronic device experiences power failure. The cloud storage device is more reliable and more suitable as the cloud storage device for storing the configuration file next time.

[0149] S1024, determine the storage quality score of each cloud storage device based on the memory usage percentage, the second ratio, and the respective corresponding coefficients.

[0150] For the embodiment of the present application, the larger the memory usage percentage of the cloud storage device, the smaller the remaining memory, and the more likely the configuration file cannot be completely stored, which is less suitable as the cloud storage device for storing the configuration file next time. The larger the second ratio, the more reliable the cloud storage device, which is more suitable as the cloud storage device for storing the configuration file next time. Therefore, the staff can set different coefficients for the memory usage percentage and the second ratio and store them in the electronic device. The electronic device calls the respective corresponding coefficients to weight the memory usage percentage and the second ratio to obtain the storage quality score of each cloud storage device. The higher the storage quality score, the more suitable the cloud storage device as the cloud storage device for storing the configuration file next time.

[0151] Since the memory occupation percentage is inversely proportional to the storage quality, the electronic device can take the inverse of the memory occupation percentage for weighted calculation, so that the calculation is more accurate and conforms to the actual situation. The storage quality score of each cloud storage device is determined more accurately by comprehensively determining the memory occupation percentage of the cloud storage device and the second ratio of the correct log of the storage configuration file to the log at the time of all power failures.

[0152] In other embodiments, the electronic device can also determine a second storage log in the target historical storage log in addition to the first target historical storage log. The similarity between the configuration file and the standard configuration file in the second storage log is determined. The higher the similarity, the greater the proportion of correct data stored by the cloud storage device, which also indicates a higher storage quality. Therefore, the similarity can be determined, and the storage quality score can be calculated by comprehensively calculating the similarity, the memory occupation percentage, and the second ratio.

[0153] In one possible implementation of the embodiments of the present application, the target cloud storage device is determined based on the storage quality score and the required number in step S103, specifically including step S1031 (not shown in the figure) and step S1032 (not shown in the figure), wherein,

[0154] S1031, all cloud storage devices are sorted in descending order of storage quality score to obtain a sorting result.

[0155] S1032, the first required number of cloud storage devices is determined as the target cloud storage device according to the sorting result.

[0156] For the embodiments of the present application, after the electronic device determines the storage quality score of each cloud storage device, the cloud storage devices are sorted in descending order of storage quality score. For example, there are five cloud storage devices, namely device a, device b, device c, device d, and device e, and the corresponding scores are 0.8, 0.5, 0.85, 0.6, and 0.7, respectively. The electronic device sorts them in descending order, and the sorting result is device c, device a, device e, device d, and device b. Assuming that the required number is 3, the electronic device determines the first 3 in the sorting result, i.e., device c, device a, and device e. It is more convenient to determine the target cloud storage device by sorting.

[0157] In one possible implementation of the embodiments of the present application, the configuration file to be restored is determined from the configuration files in the master device, the standby device, and the target cloud storage device in step S106, specifically including step S1061 (not shown in the figure), step S1062 (not shown in the figure), step S1063 (not shown in the figure), step S1064 (not shown in the figure), and step S1065 (not shown in the figure), wherein,

[0158] S1061, compare the configuration files of the master device, the backup device and the target cloud storage device.

[0159] For the embodiment of the application, the electronic device can use the md5 algorithm to compare the configuration file stored in the device, i.e., the master device, the configuration file stored in the backup device and the configuration file stored in the target cloud storage device, so as to determine the consistent configuration file and the inconsistent configuration file.

[0160] S1062, if the configuration files of the master device and the backup device are inconsistent, determine the target configuration file in the target cloud storage device, and compare the target configuration file with the configuration file of the master device and the configuration file of the backup device respectively.

[0161] For the embodiment of the application, if the configuration file of the master device and the configuration file of the backup device are inconsistent, the correct configuration file cannot be determined from the master device or the backup device, and the correct configuration file needs to be determined according to the configuration file of the target cloud storage device, so the electronic device determines the consistent configuration file in the target cloud storage device, i.e., the target configuration file. Then, the target configuration file is compared with the configuration file of the master device and the configuration file of the backup device to determine the correct configuration file.

[0162] S1063, if the target configuration file is consistent with the configuration file of the master device, and the proportion of the number of target configuration files to the required number reaches a preset proportion threshold, the configuration file of the master device is determined as the configuration file to be restored.

[0163] For the embodiment of the application, the preset proportion threshold is used as the demarcation point of whether the consistency of the target configuration file is high, and the required number is the total number of the target cloud storage devices. Since each target cloud storage device stores a configuration file, the electronic device determines the consistent configuration file, i.e., the target configuration file, and determines the number of target configuration files. Assuming that there are 10 target cloud storage devices, the required number is 10, and 7 target cloud storage devices store consistent configuration file data, so the number of target configuration files is 7, and the electronic device determines the proportion of the target configuration file 7 to the required number 10, i.e., 7:10. If it is consistent with the configuration file of the master device, and the proportion of the target configuration file to the required number reaches the preset proportion, it means that the configuration file stored in the master device is consistent with the configuration file stored in most target cloud storage devices, and the target configuration file has a high probability of being the correct configuration file, so the electronic device directly determines the configuration file of the master device as the configuration file to be restored, without the need to obtain the target configuration file from the target cloud storage device, which is more convenient.

[0164] S1064, if the target configuration file is consistent with the configuration file of the backup device, and the proportion of the number of target configuration files to the required number reaches a preset proportion threshold, the configuration file of the backup device is determined as the configuration file to be restored.

[0165] For the embodiments of the present application, the master device and the backup device both belong to local devices, so the master device and the backup device can maintain high consistency when storing configuration files, or if the configuration files of the master device and the backup device are inconsistent and the correct configuration file cannot be determined according to the master device and the backup device, there are configuration files with consistent data, i.e., target configuration files, in the plurality of target cloud storage devices. Therefore, the electronic device determines the proportion of the target configuration file to the required number in the manner of step S1063, and if the proportion reaches the preset proportion threshold, it means that the number of target configuration files is large, the target configuration file is consistent with the configuration file stored by the backup device, and the configuration file stored by the backup device is more likely to be the correct configuration file. Therefore, the electronic device can directly determine the configuration file of the backup device as the configuration file to be restored, without the need to obtain the target configuration file from the target cloud storage device, which is more convenient.

[0166] S1065, if the target configuration file is inconsistent with the configuration file of the master device, the target configuration file is inconsistent with the configuration file of the backup device, and the proportion of the number of target configuration files to the required number reaches a preset proportion threshold, the target configuration file is determined as the configuration file to be restored.

[0167] For the embodiments of the present application, if the target configuration file is inconsistent with the configuration file of the master device and the backup device, and the proportion of the number of target configuration files to the required number reaches a preset proportion threshold, it means that the configuration files stored by the master device and the backup device are more likely to be incorrect configuration files. Since the proportion of the number of target configuration files to the number of target cloud storage devices still reaches the preset proportion threshold, it means that the number of target configuration files is large, and the target configuration file is more likely to be the correct configuration file. Therefore, the electronic device can directly determine the target configuration file as the configuration file to be restored.

[0168] If the configuration file of the master device is consistent with the configuration file of the backup device, and the proportion of the number of target configuration files to the required number does not reach the preset proportion threshold, the configuration file stored by the master device can be determined as the configuration file to be restored. If the configuration file of the master device is inconsistent with the configuration file of the backup device, and the proportion of the number of target configuration files to the required number does not reach the preset proportion threshold, the correct configuration file cannot be determined, and the configuration file to be restored cannot be determined. At this time, the electronic device can output a prompt information, such as a text prompt information of "please manually check the correct configuration file" displayed on the display screen device.

[0169] In a possible implementation of the embodiment of the application, after step S106, the method further includes steps S1 (not shown in the figure), S2 (not shown in the figure), S3 (not shown in the figure), S4 (not shown in the figure), S5 (not shown in the figure), S6 (not shown in the figure), S7 (not shown in the figure), S8 (not shown in the figure), and S9 (not shown in the figure), wherein

[0170] S1, if the target configuration file is inconsistent with the configuration file of the master device, the target configuration file is inconsistent with the configuration file of the backup device, and the proportion of the number of target configuration files to the required number reaches a preset proportion threshold, it is determined that all the abnormal cloud storage devices in the target cloud storage devices.

[0171] The configuration file stored in the abnormal cloud storage device includes an abnormal configuration file different from the configuration data of the target configuration file.

[0172] For the embodiment of the application, the electronic device analyzes the configuration file stored in each target cloud storage device to obtain the configuration data stored in each target cloud storage device, and compares the configuration data with the configuration data of the target configuration file to determine the abnormal cloud storage device.

[0173] S2, determine the number of network nodes between each abnormal cloud storage device and the master device.

[0174] For the embodiment of the application, the electronic device can use a routing tracking related technology, such as using the "tracert" command in combination with each abnormal cloud storage device to perform routing tracking to obtain the number of network nodes between each abnormal cloud storage device and the master device. The more the number of network nodes, the more likely it is that the data transmission process is unstable, and the more likely it is that data transmission errors occur.

[0175] S3, control the master device to send a test data packet to the abnormal cloud storage device and determine the communication delay of the master device to each abnormal cloud storage device.

[0176] For the embodiment of the application, the electronic device controls the master device to send a test data packet to each abnormal cloud storage device, and determines the communication delay of each abnormal cloud storage device according to the sending time and the time of receiving the response signal of each abnormal cloud storage device. The greater the communication delay, the more unstable the communication, and the greater the possibility of data transmission errors and loss.

[0177] S4, determine the communication loss quality score based on the number of network nodes and the communication delay.

[0178] For the embodiments of the present application, the number of network nodes and the communication delay are key factors affecting the communication quality, so different coefficients can be set for the number of network nodes and the communication delay, and then the electronic device determines the communication loss quality score of each abnormal cloud storage device by weighted calculation according to the respective coefficients.

[0179] S5, determining the target data segment different from the configuration data of the target configuration file in the configuration data of each abnormal configuration file.

[0180] For the embodiments of the present application, after the electronic device determines the abnormal cloud storage device, the configuration data of the abnormal configuration file stored and the data of the target configuration file are screened to obtain the storage error corresponding to each abnormal cloud storage device, that is, the target data segment different from the data. The longer the target data segment is, the more storage error data there is, and the poorer the reliability of the abnormal cloud storage device is.

[0181] S6, determining the position of each target data segment in the target configuration file and determining the importance level of each target data segment.

[0182] Among them, the data in different positions of the target configuration file correspond to different importance levels.

[0183] For the embodiments of the present application, the data in different positions of the target configuration file correspond to different importance levels. For example, some data is more important to the network device. If the target configuration file is inconsistent with the configuration file of the main device, the target configuration file is inconsistent with the configuration file of the backup device, and the proportion of the number of target configuration files to the required number does not reach the preset proportion threshold, manual data recovery is required. Some data with high importance level has a greater impact on the normal operation of the network device after storage error or loss, and needs to be recovered as soon as possible. Some data with low importance level has a smaller impact on the normal operation of the network device after storage error or loss, and has a lower priority for recovery. Therefore, the staff can set different importance levels for the configuration data in different positions in advance. Therefore, after the electronic device determines the target data segment, the importance level of the target data segment can be determined according to the importance level corresponding to each position set. The higher the importance level of the target data segment is, the poorer the reliability of the corresponding abnormal cloud storage device is, the poorer the storage quality is, and the less suitable for storage work.

[0184] S7, determining the storage loss quality score of each abnormal cloud storage device based on the data length and the importance level of the target data segment.

[0185] For the embodiments of the present application, the data length and the importance level of the target data segment are key factors affecting the storage quality of the abnormal cloud storage device, so the staff sets the coefficients of the data length and the importance level in the electronic device in advance. After the electronic device determines the data length and the importance level of the target data segment, the storage loss quality score of each abnormal cloud storage device can be obtained by weighted calculation according to the respective coefficients.

[0186] S8, taking the product of the communication loss quality score and the storage loss quality score as the work quality loss value of each abnormal cloud storage device in the current storage.

[0187] For the embodiments of the present application, the larger the communication loss quality score is, the lower the communication quality of the abnormal cloud storage device is, and the more unreliable it is. The larger the storage loss quality score is, the more unreliable the abnormal cloud storage device is in storage work, and the less suitable it is for cloud storage. Therefore, the electronic device calculates the product of the communication loss quality score and the storage loss quality score, and uses the product to represent the work quality loss value of the abnormal cloud storage device in the current storage work.

[0188] S9, obtaining the storage quality score of the abnormal cloud storage device, determining a third ratio of the storage quality score and the work quality loss value, and removing the abnormal cloud storage device whose third ratio reaches a specified ratio from all cloud storage devices.

[0189] For the embodiments of the present application, the storage quality score of the cloud storage device is determined according to the method in steps S1021 to S1024 and stored in the electronic device, so the electronic device can obtain the storage quality score of the abnormal cloud storage device. In combination with the storage quality score of the abnormal cloud storage device, the larger the storage quality score is, the more suitable it is for storage work, and the larger the work quality loss value is, the less suitable it is for storage work. Therefore, the electronic device calculates the third ratio, for example, the work quality loss value as the numerator and the storage quality score as the denominator. The larger the third ratio is, the less suitable the abnormal cloud storage device is for cloud storage work. The specified ratio is used as the demarcation point of whether the third ratio is too large. Therefore, the electronic device compares the third ratio with the specified ratio. If the third ratio reaches the specified ratio, it means that it is less suitable for cloud storage work. Therefore, the electronic device removes the abnormal cloud storage device whose third ratio reaches the specified ratio from all cloud storage devices and no longer uses it in subsequent cloud storage work, thereby optimizing the overall storage quality of the cloud storage device and improving the reliability of subsequent cloud storage devices in cloud data storage.

[0190] In one possible implementation manner of the embodiments of the present application, a preset proportion threshold is determined, and the method further includes steps Sa (not shown in the figure) and step Sb (not shown in the figure), wherein,

[0191] Sa, determining the score based on the importance level and the required number.

[0192] Sb, determining a preset score interval where the score is located, each preset score interval corresponding to a preset ratio, and determining the preset ratio corresponding to the preset score interval where the score is located as the preset ratio threshold.

[0193] For the embodiment of the present application, the importance level and the required number of the network devices are both key factors affecting the preset ratio threshold, and the degree of influence is different. The staff can set different coefficients for the importance level and the required number and store them in the electronic device. The electronic device retrieves the respective coefficients and performs weighted calculation on the importance level and the required number to obtain a score. After the score is determined, the electronic device judges the preset score interval where the score is located, and the preset ratio corresponding to each preset score interval is obtained by the staff according to the actual situation or through calculation. The electronic device can determine the preset ratio threshold of the preset score interval where the score is located, which is more accurate by combining the importance level of the network device and the required number of the cloud storage device to comprehensively determine the preset ratio threshold.

[0194] In one possible implementation of the embodiment of the present application, the method further includes steps S107 (not shown in the figure) and S108 (not shown in the figure), wherein,

[0195] S107, if the target configuration file is inconsistent with the configuration file of the master device, the target configuration file is inconsistent with the configuration file of the standby device, and the proportion of the number of the target configuration file to the required number does not reach the preset ratio, then the inconsistent data in the configuration file of the master device, the configuration file of the standby device and the configuration file of the target cloud storage device is determined.

[0196] S108, the inconsistent data is labeled, and the labeled configuration data is output.

[0197] For the embodiment of the present application, if the configuration file of the master device is inconsistent with the configuration file of the standby device, and the proportion of the target configuration file to the required number does not reach the preset ratio threshold, the correct configuration file cannot be determined, and the configuration file to be restored cannot be determined. In order to facilitate manual checking of the configuration information, the electronic device labels the inconsistent data in the configuration file, such as highlighting, bolding or displaying in different colors. Then the labeled configuration file is output in the format of a text file, so that the staff can more conveniently and directly find the inconsistent data.

[0198] The above embodiment introduces a high-reliability data storage and recovery method from the perspective of method flow. The following embodiment introduces a high-reliability data storage and recovery device from the perspective of virtual modules or virtual units. For details, see the following embodiment.

[0199] This application provides a highly reliable data storage and recovery device 20, such as... Figure 2 As shown, the high-reliability data storage and recovery device 20 may specifically include:

[0200] The first determining module 201 is used to obtain historical log information of the network device and the current performance information of the device, and determine the required number of cloud storage devices based on the historical log information and performance information.

[0201] The second determining module 202 is used to obtain the current memory usage percentage and historical storage logs of each cloud storage device, and to determine the storage quality score of each cloud storage device based on the memory usage percentage and historical storage logs.

[0202] The third determining module 203 is used to determine the target cloud storage device based on the storage quality score and the required quantity;

[0203] Storage module 204 is used to store the configuration files of network devices to the local main device, backup device and target cloud storage device, with one configuration file for each network device;

[0204] The file acquisition module 205 is used to acquire configuration files from the main device, the backup device, and the target cloud storage device when a power failure is detected.

[0205] File recovery module 206 is used to determine the configuration file to be recovered from the configuration files in the main device, backup device and target cloud storage device and to recover it.

[0206] The embodiment of the application discloses a high-reliability data storage and recovery device 20, wherein the first determination module 201 obtains the historical log information of the network device and the performance information of the current device, the historical log information records the historical operation condition and the abnormal condition of the network device, thereby representing the importance of the network device, the higher the importance is, the more the number of cloud storage devices required to ensure the reliability of the configuration file recovery when power failure occurs, the performance information represents the operation condition of the device, the higher the performance is, the lower the possibility of power failure is, and the smaller the number of cloud storage devices required is, therefore, the appropriate required number of cloud storage devices is determined according to the historical log information and the performance information, the second determination module 202 obtains the current memory occupation percentage of each cloud storage device and the historical storage log, the smaller the memory occupation percentage is, the more suitable the cloud storage device is for storing the configuration file, and the historical storage log represents the historical storage data condition of the cloud storage device, therefore, the storage quality score of each cloud storage device can be accurately determined according to the memory occupation percentage and the historical storage log, the third determination module 203 determines the target cloud storage device according to the storage quality score and the required number, then the storage module 204 starts to store the configuration file in the main device, i.e., the device, the backup device and the target cloud storage device, then the power failure is monitored, when the power failure occurs, the file acquisition module 205 acquires the configuration file from the three devices, and the file recovery module 206 determines the configuration file to be recovered from the acquired configuration file and performs the recovery operation, since the target cloud storage device is a device with high storage quality, and the required number is determined according to the operation condition of the network device and the device, i.e., the appropriate number of target cloud storage devices is used to store the configuration file, which can ensure that the appropriate number of configuration files are stored to ensure the appropriate storage sample number of the configuration file, and the combination of the configuration file stored by the target cloud storage device can ensure the correctness of the configuration file as much as possible, thereby the reliability of the configuration file recovered when the data is recovered is higher.

[0207] In a possible implementation of the embodiment of the application, the historical log information includes the abnormal log and the data amount of each configuration file, the performance information includes the performance occupation percentage, the network speed and the device temperature, and the first determination module 201 is specifically used for:

[0208] determining the total amount of the data amount of all configuration files and the first ratio of the number of abnormal logs to the number of all historical log information;

[0209] determining the time interval from the last time point of the abnormal log to the current time;

[0210] determining the importance level of the network device based on the total amount, the first ratio and the time interval;

[0211] determine the health score of the device based on the performance occupancy percentage, the network speed, and the device temperature;

[0212] determine the required number of cloud storage devices based on the importance level and the health score.

[0213] In a possible implementation of the embodiments of the present application, the history storage log includes verification information about whether the configuration file stored in the cloud storage device is consistent with the standard configuration file, and the second determination module 202, when determining the storage quality score of each cloud storage device based on the memory occupancy percentage and the history storage log, is specifically configured to:

[0214] obtain the power-off time of the device, and determine the target history storage log of each cloud storage device corresponding to the power-off time;

[0215] determine the number of first target history storage logs in the target history storage log of each cloud storage device, the first target history storage log being the storage log in which the configuration file is consistent with the standard configuration file;

[0216] determine a second ratio of the number of the first target history storage logs to the number of all target history storage logs;

[0217] determine the storage quality score of each cloud storage device based on the memory occupancy percentage, the second ratio, and the respective corresponding coefficient.

[0218] In a possible implementation of the embodiments of the present application, when determining the target cloud storage device based on the storage quality score and the required number, the third determination module 203 is specifically configured to:

[0219] sort all cloud storage devices in descending order of the storage quality score to obtain a sorting result;

[0220] determine the target cloud storage device as the first required number of cloud storage devices according to the sorting result.

[0221] In a possible implementation of the embodiments of the present application, when determining the configuration file to be recovered from the configuration files in the master device, the standby device, and the target cloud storage device, the file recovery module 206 is specifically configured to:

[0222] compare the configuration files of the master device, the standby device, and the target cloud storage device;

[0223] if the configuration files of the master device and the standby device are inconsistent, determine the same target configuration file in the target cloud storage device, and compare the target configuration file with the configuration files of the master device and the standby device respectively;

[0224] If the target configuration file is consistent with the configuration file of the main device, and the proportion of the number of the target configuration file to the required number reaches a preset proportion threshold, the configuration file of the main device is determined as the configuration file to be restored.

[0225] If the target configuration file is consistent with the configuration file of the standby device, and the proportion of the number of the target configuration file to the required number reaches a preset proportion threshold, the configuration file of the standby device is determined as the configuration file to be restored.

[0226] If the target configuration file is inconsistent with the configuration file of the main device, the target configuration file is inconsistent with the configuration file of the standby device, and the proportion of the number of the target configuration file to the required number reaches a preset proportion threshold, the target configuration file is determined as the configuration file to be restored.

[0227] In another possible implementation manner, the apparatus 20 further includes:

[0228] The abnormal cloud storage device determination module is configured to determine abnormal cloud storage devices in all target cloud storage devices when the target configuration file is inconsistent with the configuration file of the main device, the target configuration file is inconsistent with the configuration file of the standby device, and the proportion of the number of the target configuration file to the required number reaches a preset proportion threshold, and the configuration file stored in the abnormal cloud storage device includes an abnormal configuration file different from the configuration data of the target configuration file.

[0229] The network node determination module is configured to determine the number of network nodes between each abnormal cloud storage device and the main device.

[0230] The control module is configured to control the main device to send a test data packet to the abnormal cloud storage device and determine a communication delay of the main device to each abnormal cloud storage device.

[0231] The communication loss quality score determination module is configured to determine a communication loss quality score based on the number of network nodes and the communication delay.

[0232] The target data segment determination module is configured to determine a target data segment in the configuration data of each abnormal configuration file different from the configuration data of the target configuration file.

[0233] The importance level determination module is configured to determine a position of each target data segment in the target configuration file, and determine an importance level of each target data segment, the data at different positions in the target configuration file corresponding to different importance levels.

[0234] The storage loss quality score determination module is configured to determine a storage loss quality score of each abnormal cloud storage device based on a data length and an importance level of the target data segment.

[0235] a work quality loss value determination module, configured to take the product of the communication loss quality score and the storage loss quality score as the work quality loss value of each abnormal cloud storage device in the current storage;

[0236] a rejection module, configured to determine a third ratio of the storage quality score and the work quality loss value, and reject the abnormal cloud storage device whose third ratio reaches a specified ratio from all the cloud storage devices.

[0237] In a possible implementation of the embodiment, the device 20 further includes:

[0238] a fourth determination module, configured to determine the score based on the importance level and the required number;

[0239] a fifth determination module, configured to determine a preset score interval in which the score is located, each preset score interval corresponds to a preset ratio, and determine the preset ratio corresponding to the preset score interval in which the score is located as the preset ratio threshold.

[0240] In a possible implementation of the embodiment, the device 20 further includes:

[0241] a sixth determination module, configured to determine the inconsistent data in the configuration file of the master device, the configuration file of the backup device, and the configuration file of the target cloud storage device when the target configuration file is inconsistent with the configuration file of the master device, the target configuration file is inconsistent with the configuration file of the backup device, and the ratio of the number of the target configuration file to the required number does not reach the preset ratio.

[0242] a labeling module, configured to label the inconsistent data, and output the labeled configuration data.

[0243] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described high-reliability data storage and recovery device 20 can refer to the corresponding process in the foregoing method embodiments, which will not be described here.

[0244] In the embodiment, an electronic device is provided, as shown in Figure 3 as shown in Figure 3 The electronic device 30 shown in the embodiment includes a processor 301 and a memory 303. The processor 301 and the memory 303 are connected, such as through a bus 302. Optionally, the electronic device 30 can further include a transceiver 304. It should be noted that in actual applications, the transceiver 304 is not limited to one, and the structure of the electronic device 30 does not constitute a limitation on the embodiments of the present application.

[0245] The processor 301 can be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic device, transistor logic device, hardware component, or any combination thereof. It can implement or execute various exemplary logical blocks, modules and circuits described in connection with the disclosure. The processor 301 can also be a combination of computing functions, such as one or more microprocessor combinations, combinations of DSP and microprocessor, etc.

[0246] The bus 302 can include a path for transmitting information between the above-mentioned components. The bus 302 can be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The bus 302 can be divided into an address bus, a data bus, a control bus, etc. For convenience of representation, Figure 3 In the figure, only one thick line is used, but it does not mean that there is only one bus or one type of bus.

[0247] The memory 303 can be a ROM (Read Only Memory) or other type of static storage device that can store static information and instructions, a RAM (Random Access Memory) or other type of dynamic storage device that can store information and instructions, an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, an optical disk storage (including a compact disk, a laser disk, an optical disk, a digital versatile disk, a Blu-ray disk, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and capable of being accessed by a computer, but not limited thereto.

[0248] The memory 303 is configured to store application program codes for implementing the solutions of the present application, and the processor 301 is configured to execute the application program codes stored in the memory 303.

[0249] The electronic device includes, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (Personal Digital Assistant), a PAD (Tablet Personal Computer), a PMP (Portable Multimedia Player), a car terminal (for example, a car navigation terminal), and the like, and a fixed terminal such as a digital TV, a desktop computer, and the like. It can also be a server or the like. Figure 3 The electronic device shown is only an example and should not impose any limitation on the functions and use range of the embodiments of the present application.

[0250] The computer readable storage medium of the embodiments of the present application stores a computer program, and when the computer program runs on a computer, the computer can execute the corresponding content in the foregoing method embodiments. Compared with the related art, the historical log information of the network device and the performance information of the current device are obtained in the embodiments of the present application, the historical log information records the historical running situation and the abnormal situation of the network device, thereby representing the importance of the network device. The higher the importance is, the more the number of cloud storage devices required to ensure the reliability of the configuration file recovery after power failure is. The performance information represents the running status of the device, and the higher the performance is, the lower the possibility of power failure is, and the smaller the number of cloud storage devices required is. Therefore, the appropriate required number of cloud storage devices is determined according to the historical log information and the performance information, the current memory occupation percentage of each cloud storage device and the historical storage log are obtained, the smaller the memory occupation percentage is, the more suitable the storage configuration file is, and the historical storage log represents the historical storage data of the cloud storage device. Therefore, the storage quality score of each cloud storage device can be accurately determined according to the memory occupation percentage and the historical storage log, and the target cloud storage device is determined according to the storage quality score and the required number. Then, the configuration file is stored in the main device (the device itself), the standby device, and the target cloud storage device, and then the power failure is monitored. When the power failure occurs, the configuration file is obtained from the three devices, and the configuration file to be recovered is determined from the obtained configuration file and the recovery operation is performed. Since the target cloud storage device is a device with high storage quality, the required number is determined according to the running status of the network device and the device, that is, the use of an appropriate number of target cloud storage devices to store the configuration file can ensure that an appropriate number of configuration files are stored to ensure the appropriate storage sample number of the configuration file, and the combination of the target cloud storage device and the configuration file can ensure the correctness of the configuration file as much as possible, thereby improving the reliability of the configuration file recovered when the power failure recovers the data.

[0251] It should be understood that although the steps in the flowcharts of the accompanying drawings are shown in a sequential order following the arrows, the steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated otherwise herein, the execution of the steps is not necessarily limited to the order in which the steps are shown in the flowcharts. Moreover, at least some of the steps in the flowcharts of the accompanying drawings can comprise a plurality of sub-steps or stages, which are not necessarily executed at the same time, but can be executed at different times, and which are not necessarily executed sequentially, but can be executed in rotation or alternation with at least some of the other steps or sub-steps or stages of other steps.

[0252] The above only describes some embodiments of the present application. It should be pointed out that, for those skilled in the art, without departing from the principles of the present application, a number of improvements and refinements can be made, which should also be considered as the protection scope of the present application.

Claims

1. A high-reliability data storage and recovery method, characterized by, The application comprises the following steps: acquiring historical log information of network devices and current performance information of the device, and determining the required number of cloud storage devices based on the historical log information and the performance information; acquiring the current memory occupation percentage and historical storage log of each cloud storage device, and determining the storage quality score of each cloud storage device based on the memory occupation percentage and the historical storage log; determining the target cloud storage device based on the storage quality score and the required number; storing the configuration file of the network device in the local master device, backup device and target cloud storage device, with one configuration file for each network device; when power failure is monitored, acquiring the configuration file in the master device, backup device and target cloud storage device; determining the configuration file to be restored from the configuration file in the master device, backup device and target cloud storage device and restoring it; the historical log information comprises abnormal log and data volume of each configuration file, and the performance information comprises performance occupation percentage, network speed and device temperature; the required number of cloud storage devices is determined based on the historical log information and the performance information, which comprises determining the total amount of data volume of all configuration files and the first ratio of the number of abnormal logs to the number of all historical log information; determining the time interval from the latest time point of abnormal log to the current time; determining the importance level of the network device based on the total amount, the first ratio and the time interval; determining the running condition score of the device based on the performance occupation percentage, the network speed and the device temperature; determining the required number of cloud storage devices based on the importance level and the running condition score; the historical storage log comprises verification information of whether the configuration file stored in the cloud storage device is consistent with the standard configuration file; the storage quality score of each cloud storage device is determined based on the memory occupation percentage and the historical storage log, which comprises acquiring the power failure time of the device and determining the target historical storage log of each cloud storage device corresponding to the power failure time; determining the number of first target historical storage logs of each cloud storage device in the target historical storage log, wherein the first target historical storage log is the storage log with consistent configuration file and standard configuration file; determining the second ratio of the number of first target historical storage logs to the number of all target historical storage logs; determining the storage quality score of each cloud storage device based on the memory occupation percentage, the second ratio and the respective corresponding coefficient.

2. The method of claim 1, wherein, The target cloud storage device is determined based on the storage quality score and the required number, which comprises sorting all cloud storage devices in descending order of storage quality score to obtain a sorting result; and determining the first required number of cloud storage devices as the target cloud storage device according to the sorting result.

3. The method of claim 1, wherein, The determining the configuration file to be recovered from the configuration files of the master device, the backup device and the target cloud storage devices comprises: comparing the configuration files of the master device, the backup device and the target cloud storage devices; if the configuration files of the master device and the backup device are inconsistent, analyzing the configuration files of each target cloud storage device to obtain configuration data, determining a target configuration file with the same configuration data, and comparing the target configuration file with the configuration file of the master device and the configuration file of the backup device respectively; if the target configuration file is consistent with the configuration file of the master device, and the proportion of the number of target configuration files to the required number reaches a preset proportion threshold, the configuration file of the master device is determined as the configuration file to be recovered; if the target configuration file is consistent with the configuration file of the backup device, and the proportion of the number of target configuration files to the required number reaches the preset proportion threshold, the configuration file of the backup device is determined as the configuration file to be recovered.

4. The method of claim 3, wherein, The method further comprises: if the target configuration file is inconsistent with the configuration file of the master device, the target configuration file is inconsistent with the configuration file of the backup device, and the proportion of the number of target configuration files to the required number reaches the preset proportion threshold, determining an abnormal cloud storage device in all target cloud storage devices, the configuration file stored in the abnormal cloud storage device comprising an abnormal configuration file different from the configuration data of the target configuration file; determining the number of network nodes between each abnormal cloud storage device and the master device; controlling the master device to send a test data packet to the abnormal cloud storage device and determining the communication delay of the master device to each abnormal cloud storage device; determining a communication loss quality score based on the number of network nodes and the communication delay; determining a target data segment in the configuration data of each abnormal configuration file, which is different from the configuration data of the target configuration file; determining the position of each target data segment in the target configuration file, and determining the importance level of each target data segment, the data at different positions in the target configuration file corresponding to different importance levels; determining a storage loss quality score of each abnormal cloud storage device based on the data length and importance level of the target data segment; taking the product of the communication loss quality score and the storage loss quality score as a working quality loss value of each abnormal cloud storage device in the current storage; obtaining a storage quality score of the abnormal cloud storage device, determining a third ratio of the storage quality score and the working quality loss value, and removing the abnormal cloud storage device with the third ratio reaching a specified ratio from all cloud storage devices.

5. The method of claim 3, wherein, The preset proportion threshold is determined by: determining a score based on the importance level and the required number; determining a preset score interval in which the score is located, each preset score interval corresponding to a preset ratio, and determining the preset proportion corresponding to the preset score interval in which the score is located as the preset proportion threshold.

6. A high reliability data storage and recovery apparatus, characterized by, The method further comprises: The first determining module is configured to acquire historical log information of the network device and current performance information of the device, and determine a required number of cloud storage devices based on the historical log information and the performance information; the historical log information includes abnormal logs and data volume of each configuration file, and the performance information includes performance occupation percentage, network speed and device temperature; the determination of the required number of cloud storage devices based on the historical log information and the performance information includes: determining a total amount of data volume of all configuration files and a first ratio of a number of abnormal logs to a number of all historical log information; determining a time interval from a latest time point of the abnormal logs to a current time; determining an importance level of the network device based on the total amount, the first ratio and the time interval; determining an operating condition score of the device based on the performance occupation percentage, the network speed and the device temperature; and determining the required number of cloud storage devices based on the importance level and the operating condition score; The second determining module is configured to acquire a current memory occupation percentage of each cloud storage device and historical storage logs, and determine a storage quality score of each cloud storage device based on the memory occupation percentage and the historical storage logs; the historical storage logs include verification information about whether configuration files stored in the cloud storage device are consistent with standard configuration files; the determination of the storage quality score of each cloud storage device based on the memory occupation percentage and the historical storage logs includes: acquiring a power-off time of the device, and determining target historical storage logs of each cloud storage device corresponding to the power-off time; determining a number of first target historical storage logs in the target historical storage logs of each cloud storage device, the first target historical storage logs being storage logs in which the configuration files are consistent with the standard configuration files; determining a second ratio of the number of the first target historical storage logs to a number of all target historical storage logs; and determining the storage quality score of each cloud storage device based on the memory occupation percentage, the second ratio and respective corresponding coefficients; The third determining module is configured to determine a target cloud storage device based on the storage quality score and the required number. The storage module is configured to store configuration files of the network device in a local master device, a backup device and the target cloud storage device, and each configuration file of the network device is one; The file acquisition module is configured to acquire the configuration files in the master device, the backup device and the target cloud storage device when a power-off is monitored. The file recovery module is configured to determine configuration files to be recovered from the configuration files in the master device, the backup device and the target cloud storage device and recover the configuration files.

7. An electronic device, comprising: It comprises: at least one processor; a memory; at least one application program, wherein the at least one application program is stored in the memory and is configured to be executed by the at least one processor, and the at least one application program is configured to execute a high-reliability data storage and recovery method according to any one of claims 1-5.

8. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program product is characterized in that when the computer program is executed in the computer, the computer is caused to execute the high-reliability data storage and recovery method in any one of claims 1-5.

Citation Information

Patent Citations

  • Backup decision-making method and device of network equipment, electronic equipment and storage medium

    CN115509802A

  • Log storage method and device

    CN116821749A