High-reliability data storage and recovery method

By obtaining the historical logs and performance information of network equipment, determining the quantity and quality of cloud storage devices, the problem of unreliable data recovery of network equipment is solved and high-reliability data storage and recovery is achieved.

CN119759648AActive Publication Date: 2025-04-04HUBEI ANXIN SMART TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The prior art cannot effectively ensure the correctness and reliability of data after power loss of network equipment, and cannot meet the needs of high-reliability data storage and recovery.

Method used

By obtaining the historical log information and current performance information of network devices, determine the required number of cloud storage devices; obtain the memory footprint and historical storage log of each cloud storage device, and calculate its storage quality score; store the configuration files of network devices in the local device and the target cloud storage device, and when a power failure is detected, the configuration files are obtained from multiple devices and restored.

Benefits of technology

Improves the reliability of network equipment data recovery and ensures the correct recovery of configuration files in the event of power outage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119759648A_ABST
    Figure CN119759648A_ABST
Patent Text Reader

Abstract

The invention relates to a high-reliability data storage and recovery method, and the method comprises the steps: obtaining the historical log information of network equipment and the current performance information of the equipment, and determining the required number of cloud storage equipment based on the historical log information and the performance information, obtaining a current memory occupation percentage and a historical storage log of the cloud storage device, determining a storage quality score of the cloud storage device based on the memory occupation percentage and the historical storage log, and determining a target cloud storage device based on the storage quality score and the required number, storing the configuration file of the network equipment into local main equipment, standby equipment and target cloud storage equipment, and when power failure is monitored, acquiring the configuration files of the main equipment, the standby equipment and the target cloud storage equipment, and determining a to-be-recovered configuration file from the configuration files of the main device, the standby device and the target cloud storage device, and recovering the to-be-recovered configuration file. The method has the effect of improving the reliability of data recovery of the network equipment.
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, and in particular to a high-reliability data storage and recovery method. Background Art

[0002] Network devices include switches and routers, which are important components of network communications and are widely used in fields such as communications and industry. Accordingly, the data of network devices needs to be stored and recorded. The data of network devices includes configuration files, which include IP addresses, routing protocol configurations, access control lists, etc. These information define how 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. If the network device or the local device loses power, the data is read from the flash and restored to the memory. However, this method cannot determine the correctness of the network data when restoring data, and cannot guarantee the correctness and reliability of the data when the device restarts and reads data. It cannot meet the scenario with high reliability requirements for network data storage and recovery. Summary of the invention

[0004] In order to improve the reliability of data recovery of network devices, 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: A high-reliability data storage and recovery method, comprising: Obtain historical log information of the network device and current performance information of the device, and determine the required number of cloud storage devices based on the historical log information and performance information; Obtaining the current memory usage percentage and historical storage logs of each cloud storage device, and determining the storage quality score of each cloud storage device based on the memory usage percentage and historical storage logs; Determine a target cloud storage device based on the storage quality score and the required quantity; Storing the configuration files of the network devices in the local master device, the backup device and the target cloud storage device, one configuration file for each network device; When a power failure is detected, obtaining configuration files in the primary device, the backup device, and the target cloud storage device; The configuration file to be restored is determined from the configuration files in the primary device, the backup device and the target cloud storage device and restored.

[0006] By adopting the above technical solution, the historical log information of the network device and the current performance information of the device are obtained. The historical log information records the historical operation status and abnormal conditions of the network device, thereby characterizing the importance of the network device. The higher the importance, the more cloud storage devices are required to ensure the reliability of configuration file recovery when power is off. The performance information characterizes the operation status of the device. The higher the performance, the lower the possibility of power off, and the fewer cloud storage devices are required. Therefore, the appropriate required number of cloud storage devices is determined based on the historical log information and performance information, and the current memory usage percentage and historical storage logs of each cloud storage device are obtained. The smaller the memory usage percentage, the more suitable it is for storing configuration files. The historical storage logs characterize the historical storage data of the cloud storage device. Therefore, the memory usage percentage and historical storage logs can be used to accurately determine the status of each cloud storage device. The target cloud storage device can be determined according to the storage quality score and the required quantity, and then the configuration files can be stored in the main device, i.e., this device, the backup device and the target cloud storage device. Then the power outage is monitored. When a power outage occurs, the configuration files are obtained from the three devices and the configuration files to be restored are determined from the obtained configuration files and the recovery operation is performed. Since the target cloud storage devices are all devices with high storage quality, the required quantity is also determined according to the operation status of the network device and this device. That is, using an appropriate number of target cloud storage devices to store configuration files can ensure that an appropriate number of configuration files are backed up and stored, which ensures an appropriate number of storage samples of the configuration files. At the same time, the target cloud storage device stores the configuration files. The combination of the two can ensure the correctness of the configuration files as much as possible, so that the reliability of the restored configuration files is higher when recovering data after power outage.

[0007] In another possible implementation, the historical log information includes an exception log and a data volume of each configuration file, the performance information includes a performance occupancy percentage, a network speed, and a device temperature, and determining the required number of cloud storage devices based on the historical log information and the performance information includes: Determine a first ratio of the total amount of data of all configuration files and the amount of abnormal logs to the amount of all historical log information; Determine the time interval from the most recent time point of the abnormal log to the current time; Determine the importance level of the network device based on the total amount, the first ratio, and the time interval; Determine the operating status score of the device based on the performance occupancy percentage, network speed and device temperature; The required number of the cloud storage devices is determined based on the importance level and the operating status score.

[0008] In another possible implementation, the historical storage log includes verification information of whether the configuration file stored in the cloud storage device is consistent with the standard configuration file, and determining the storage quality score of each cloud storage device based on the memory usage percentage and the historical storage log includes: Obtain the power-off time of the device and determine the target historical storage log corresponding to the power-off time of each cloud storage device; Determine the number of first target history storage logs in the target history storage logs of each cloud storage device, where the first target history storage logs are storage logs whose configuration files are consistent with the standard configuration files; Determining a second ratio of the number of the first target history storage logs to the number of all target history storage logs; A storage quality score of each cloud storage device is determined based on the memory occupancy percentage, the second ratio, and the respective corresponding coefficients.

[0009] In another possible implementation, determining the target cloud storage device based on the storage quality score and the required quantity includes: Sort all cloud storage devices according to their storage quality scores from large to small to obtain a sorting result; According to the sorting result, the required number of cloud storage devices mentioned above are determined as the target cloud storage devices.

[0010] In another possible implementation, determining the configuration file to be restored from the configuration files in the primary device, the backup device, and the target cloud storage device includes: Comparing configuration files of the primary device, the backup device, and the target cloud storage device; If the configuration files of the primary device and the backup device are inconsistent, determining the same target configuration file in the target cloud storage device, and comparing the target configuration file with the configuration files of the primary device and the backup device respectively; If the target configuration file is consistent with the configuration file of the master device, and the ratio of the number of the target configuration files to the required number reaches a preset ratio threshold, determining the configuration file of the master device as the configuration file to be restored; If the target configuration file is consistent with the configuration file of the standby device, and the ratio of the number of the target configuration files to the required number reaches a preset ratio threshold, the configuration file of the standby device is determined as the configuration file to be restored; 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 backup device, and the ratio of the number of target configuration files to the required number reaches a preset ratio threshold, the target configuration file is determined as the configuration file to be restored.

[0011] In another possible implementation, the method further includes: 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 backup device, and the ratio of the number of target configuration files to the required number reaches a preset ratio threshold, then an abnormal cloud storage device among all target cloud storage devices is determined, and the configuration files stored in the abnormal cloud storage device include: abnormal configuration files that are different from the configuration data of the target configuration file; Determine the number of network nodes between each abnormal cloud storage device and the master device; Control the master device to send a test data packet to the abnormal cloud storage device and determine the communication delay from 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; 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; Determine the position of each target data segment in the target configuration file, and determine the importance level of each target data segment, where data at different positions in the target configuration file correspond to different importance levels; Determine a storage loss quality score for each abnormal cloud storage device based on the data length and importance level of the target data segment; The product of the communication loss quality score and the storage loss quality score is used as the working quality loss value of each abnormal cloud storage device in the current storage; A storage quality score of the abnormal cloud storage device is obtained, a third ratio of the storage quality score to the work quality loss value is determined, and the abnormal cloud storage device whose third ratio reaches a specified ratio is removed from all cloud storage devices.

[0012] In another possible implementation manner, determining the preset proportion threshold includes: determining a score based on the importance level and the required quantity; A preset score interval in which the score is located is determined, each preset score interval corresponds to a preset ratio, and a preset proportion corresponding to the preset score interval in which the score is located is determined as the preset proportion threshold.

[0013] In another possible implementation, the method further includes: 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 backup device, and the ratio of the number of target configuration files to the required number does not reach a preset ratio, then determining inconsistent data in the configuration file of the primary device, the configuration file of the backup device, and the configuration file of the target cloud storage device; The inconsistent data is marked, and the marked configuration data is output.

[0014] In a second aspect, the present application provides a high-reliability data storage and recovery device, which adopts the following technical solution: A high-reliability data storage and recovery device, comprising: A first determination module is used to obtain historical log information of the network device and current performance information of the device, and determine the required number of cloud storage devices based on the historical log information and performance information; A second determination module is used to obtain the current memory usage percentage and historical storage log of each cloud storage device, and determine the storage quality score of each cloud storage device based on the memory usage percentage and historical storage log; A third determination module, configured to determine a target cloud storage device based on the storage quality score and the required quantity; A storage module, used to store the configuration files of the network devices in a local master device, a backup device and a target cloud storage device, wherein each of the network devices has one configuration file; A file acquisition module, used to acquire configuration files in the master device, the backup device and the target cloud storage device when a power failure is detected; The file recovery module is used to determine the configuration file to be recovered from the configuration files in the primary device, the backup device and the target cloud storage device and recover it.

[0015] By adopting the above technical solution, the first determination module obtains the historical log information of the network device and the current performance information of the device. The historical log information records the historical operation status and abnormal conditions of the network device, thereby characterizing the importance of the network device. The higher the importance, the more cloud storage devices are required to ensure the reliability of configuration file recovery during power failure. The performance information characterizes the operation status of the device. The higher the performance, the lower the possibility of power failure, and the fewer cloud storage devices are required. Therefore, the appropriate required number of cloud storage devices is determined based on the historical log information and performance information. The second determination module obtains the current memory occupancy percentage and historical storage log of each cloud storage device. The smaller the memory occupancy percentage, the more suitable it is for storing configuration files. The historical storage log characterizes the historical storage data of the cloud storage device. Therefore, the storage quality of each cloud storage device can be accurately determined based on the memory occupancy percentage and historical storage log. The third determination module can determine the target cloud storage device according to the storage quality score and the required quantity, and then the storage module starts to store the configuration files in the main device, i.e., this device, the backup device and the target cloud storage device, and then monitors the power failure. When a power failure occurs, the file acquisition module obtains the configuration files from the three devices and the file recovery module determines the configuration files to be recovered from the obtained configuration files and performs the recovery operation. Since the target cloud storage devices are all devices with high storage quality, the required quantity is also determined according to the operation status of the network device and the present device, that is, using an appropriate number of target cloud storage devices to store configuration files can ensure that an appropriate number of configuration files are backed up and stored, which ensures an appropriate number of storage samples of the configuration files. At the same time, the target cloud storage device stores the configuration files. The combination of the two can ensure the correctness of the configuration files as much as possible, so that the reliability of the restored configuration files is higher when recovering data after a power failure.

[0016] In another possible implementation, the historical log information includes an exception log and a data volume of each configuration file, and the performance information includes a performance occupancy percentage, a network speed, and a device temperature. When the first determination module determines the required number of cloud storage devices based on the historical log information and the performance information, it is specifically used to: Determine a first ratio of the total amount of data of all configuration files and the amount of abnormal logs to the amount of all historical log information; Determine the time interval from the most recent time point of the abnormal log to the current time; Determine the importance level of the network device based on the total amount, the first ratio, and the time interval; Determine the operating status score of the device based on the performance occupancy percentage, network speed and device temperature; The required number of the cloud storage devices is determined based on the importance level and the operating status score.

[0017] In another possible implementation, the historical storage log includes verification information of whether the configuration file stored in the cloud storage device is consistent with the standard configuration file, and the second determination module determines the storage quality score of each cloud storage device based on the memory occupancy percentage and the historical storage log, specifically for: Obtain the power-off time of the device and determine the target historical storage log corresponding to the power-off time of each cloud storage device; Determine the number of first target history storage logs in the target history storage logs of each cloud storage device, where the first target history storage logs are storage logs whose configuration files are consistent with the standard configuration files; Determining a second ratio of the number of the first target history storage logs to the number of all target history storage logs; A storage quality score of each cloud storage device is determined based on the memory occupancy percentage, the second ratio, and the respective corresponding coefficients.

[0018] In another possible implementation, when determining the target cloud storage device based on the storage quality score and the required quantity, the third determination module is specifically configured to: Sort all cloud storage devices according to their storage quality scores from large to small to obtain a sorting result; According to the sorting result, the required number of cloud storage devices mentioned above are determined as the target cloud storage devices.

[0019] In another possible implementation, when the file recovery module determines the configuration file to be recovered from the configuration files in the primary device, the backup device, and the target cloud storage device, it is specifically used to: Comparing configuration files of the primary device, the backup device, and the target cloud storage device; If the configuration files of the primary device and the backup device are inconsistent, determining the same target configuration file in the target cloud storage device, and comparing the target configuration file with the configuration files of the primary device and the backup device respectively; If the target configuration file is consistent with the configuration file of the master device, and the ratio of the number of the target configuration files to the required number reaches a preset ratio threshold, determining the configuration file of the master device as the configuration file to be restored; If the target configuration file is consistent with the configuration file of the standby device, and the ratio of the number of the target configuration files to the required number reaches a preset ratio threshold, the configuration file of the standby device is determined as the configuration file to be restored; 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 backup device, and the ratio of the number of target configuration files to the required number reaches a preset ratio threshold, the target configuration file is determined as the configuration file to be restored.

[0020] In another possible implementation, the device further includes: an abnormal cloud storage device determining module, configured to determine an abnormal cloud storage device among all target cloud storage devices when 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 backup device, and the ratio of the number of target configuration files to the required number reaches a preset ratio threshold, wherein the configuration files stored in the abnormal cloud storage device include: abnormal configuration files having configuration data different from that of the target configuration file; A network node determination module, used to determine the number of network nodes between each abnormal cloud storage device and the main device; A control module, used to control the main device to send a test data packet to the abnormal cloud storage device and determine the communication delay from the main device to each abnormal cloud storage device; A communication loss quality score determination module, configured to determine a communication loss quality score based on the number of network nodes and communication delay; A target data segment determination module, used 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; An importance level determination module is used to determine the position of each target data segment in the target configuration file and determine the importance level of each target data segment, where data at different positions in the target configuration file correspond to different importance levels; 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 importance level of the target data segment; A work quality loss value determination module, used to use 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; The elimination module is used to obtain the storage quality score of the abnormal cloud storage device, determine a third ratio of the storage quality score to the work quality loss value, and eliminate the abnormal cloud storage device whose third ratio reaches a specified ratio from all cloud storage devices.

[0021] In another possible implementation manner, the preset proportion threshold is determined, and the device further includes: a fourth determination module, configured to determine a score based on the importance level and the required quantity; The fifth determination module is used to determine the preset score interval where the score is located, each preset score interval corresponds to a preset ratio, and the preset proportion corresponding to the preset score interval where the score is located is determined as the preset proportion threshold.

[0022] In another possible implementation, the device further includes: a sixth determination module, configured to determine inconsistent data in the configuration file of the primary 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 primary device, the target configuration file is inconsistent with the configuration file of the backup device, and the ratio of the number of target configuration files to the required number does not reach a preset ratio; The marking module is used to mark the inconsistent data and output the marked configuration data.

[0023] In a third aspect, the present application provides an electronic device, which adopts the following technical solution: An electronic device, comprising: at least one processor; Memory; At least one application, wherein at least one application is stored in a memory and configured to be executed by at least one processor, and at least one is configured to: execute a high-reliability data storage and recovery method shown in any possible implementation of the first aspect.

[0024] In a fourth aspect, the present application provides a computer-readable storage medium, which adopts the following technical solution: A computer-readable storage medium, when the computer program is executed in a computer, causes the computer to execute a high-reliability data storage and recovery method as described in any one of the first aspects.

[0025] In summary, the present application includes at least one of the following beneficial technical effects: Obtain the historical log information of the network device and the current performance information of the device. The historical log information records the historical operation status and abnormal conditions of the network device, thereby characterizing the importance of the network device. The higher the importance, the more cloud storage devices are needed to ensure the reliability of configuration file recovery during power failure. The performance information characterizes the operation status of the device. The higher the performance, the lower the possibility of power failure, and the fewer cloud storage devices are needed. Therefore, determine the appropriate number of cloud storage devices based on the historical log information and performance information, obtain the current memory usage percentage and historical storage logs of each cloud storage device. The smaller the memory usage percentage, the more suitable it is for storing configuration files. The historical storage log characterizes the historical storage data of the cloud storage device. Therefore, the storage quality of each cloud storage device can be accurately determined based on the memory usage percentage and historical storage logs. The target cloud storage device can be determined according to the storage quality score and the required quantity, and then the configuration files are stored in the main device, i.e., this device, the backup device and the target cloud storage device. Then the power outage is monitored. When a power outage occurs, the configuration files are obtained from the three devices and the configuration files to be restored are determined from the obtained configuration files and the recovery operation is performed. Since the target cloud storage devices are all devices with high storage quality, the required quantity is also determined according to the operation of the network device and this device. That is, using an appropriate number of target cloud storage devices to store configuration files can ensure that an appropriate number of configuration files are backed up and stored, which ensures an appropriate number of storage samples of the configuration files. At the same time, the target cloud storage device stores the configuration files. The combination of the two can ensure the correctness of the configuration files as much as possible, so that the reliability of the restored configuration files is higher when recovering data after power outage. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0027] Figure 2 It is a structural schematic diagram of a high-reliability data storage and recovery device in an embodiment of the present application.

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

[0029] The present application is further described in detail below in conjunction with the accompanying drawings.

[0030] After reading this specification, those skilled in the art may make non-creative modifications to this embodiment as needed, but such modifications are protected by patent law as long as they are within the scope of the claims of this application.

[0031] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0032] In addition, the term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article, unless otherwise specified, generally means that the associated objects before and after are in an "or" relationship.

[0033] The embodiments of the present application are further described in detail below in conjunction with the drawings in the specification.

[0034] The embodiment of the present application provides a high-reliability data storage and recovery method, which is executed by an electronic device, which can be a server or a terminal device, wherein the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services. The terminal device can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc., but is not limited to this. The terminal device and the server can be directly or indirectly connected via wired or wireless communication, and the embodiment of the present application does not limit this. Figure 1 As shown, the method includes step S101, step S102, step S103, step S104, step S105 and step S106, wherein: S101, 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 performance information.

[0035] For the embodiments of the present application, the network devices include switches, routers, firewalls and other devices. The electronic device is connected to the network device by a wire or wirelessly. The historical log information can be stored in the storage medium of the network device, in a cloud server, or in the 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 files are very important for troubleshooting, performance analysis and security auditing. Therefore, the importance level of the network device can be accurately determined through the historical log information.

[0036] The device is an electronic device, and the performance information includes the CPU performance occupancy, the running memory usage, etc. The staff can set up a plug-in or script to monitor the performance in the electronic device to collect the above performance information. The performance information can accurately determine the current running status of the electronic device.

[0037] In order to better restore the configuration files of network devices when the electronic device loses power, the electronic device is also connected to multiple cloud storage devices through wires or wirelessly, that is, when the electronic device stores the configuration files of the network devices, the cloud storage device also stores the configuration files, so that when a power outage occurs, the configuration files can be more reliably restored based on the consistency of the configuration files stored in multiple cloud storage devices. The higher the importance level of the network device, the higher the requirements and accuracy for the recovery of the configuration file data, and the more cloud storage devices are needed, and vice versa; the worse the current operating state of the electronic device, the greater the possibility of power outage, the higher the requirements and accuracy for the recovery of the configuration file data, and the more cloud storage devices are needed, and vice versa. The less the number required. Therefore, the electronic device determines the number of cloud storage devices suitable for storing the configuration files, that is, the required number, based on the importance level and performance information.

[0038] S102, obtaining the current memory usage 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 usage percentage and the historical storage log.

[0039] For the embodiment of the present application, the electronic device sends an acquisition instruction to each cloud storage device. After receiving the acquisition instruction, the cloud storage device sends its own memory usage percentage and historical storage log to the electronic device. The larger the memory usage percentage, the less remaining memory, and the less suitable it is as a cloud storage device for storing configuration files. Conversely, the more suitable it is. The historical storage log records whether the configuration files stored by the cloud storage device in the past are consistent with the original configuration files. The more inconsistencies there are, the less suitable it is as a cloud storage device for storing configuration files. Therefore, the memory usage percentage and the historical storage log both characterize the storage quality of the cloud storage device. Therefore, the electronic device comprehensively determines the storage quality score of each cloud storage device based on the memory usage percentage and the historical storage log.

[0040] S103: Determine a target cloud storage device based on the storage quality score and the required quantity.

[0041] For the embodiment of the present application, after the electronic device determines the storage quality score and the required quantity, it can determine a suitable target cloud storage device based on the two. Since the determined target cloud storage devices all have high storage quality, using the target cloud storage device to store the configuration file will have better effect and higher accuracy when data needs to be restored in the event of a subsequent power outage.

[0042] S104, storing the configuration files of the network devices in the local master device, the backup device and the target cloud storage device.

[0043] There is one configuration file for each network device.

[0044] For the embodiment of the present 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 local storage medium of the electronic device, the storage medium of the backup device, and each target cloud storage device, so as to facilitate subsequent data recovery. The backup device can be a terminal device set near or beside the electronic device, and is also connected to the electronic device through a wire.

[0045] S105, when power failure is detected, obtaining configuration files in the main device, the backup device, and the target cloud storage device.

[0046] For the embodiment of the present application, the electronic device monitors its own voltage. When the voltage is detected to be 0, it indicates that a power outage has occurred. The electronic device has the function of automatically recovering from a power outage. Therefore, when a power outage occurs, the electronic device restarts. After the electronic device restarts, it retrieves the configuration file in its own storage medium, the configuration file in the backup device, and the configuration file in each target cloud storage device. The master device is the electronic device.

[0047] S106, determining the configuration file to be restored from the configuration files in the primary device, the backup device and the target cloud storage device and restoring it.

[0048] For the embodiment of the present application, since the sudden power failure and power restoration of the electronic device may cause errors in the configuration file or loss of some data, the electronic device performs consistency analysis on the configuration file stored in the main device, the configuration file stored in the backup device, and the configuration file stored in each target cloud storage device, thereby determining the correct configuration file, that is, the configuration file to be restored. After the electronic device determines the file to be restored, it can directly replace the locally stored configuration file with the configuration file to be restored, thereby improving the reliability of data recovery.

[0049] In a possible implementation of the embodiment of the present application, the historical log information includes an abnormal log, the data volume of each configuration file, and the performance information includes the performance occupancy percentage, the network speed, and the device temperature. In S101, the required number of cloud storage devices is determined based on the historical log information and the performance information, specifically including step S1011 (not shown in the figure), step S1012 (not shown in the figure), step S1013 (not shown in the figure), step S1014 (not shown in the figure), and step S1015 (not shown in the figure), wherein: S1011, determining a first ratio of the total amount of data of all configuration files and the amount of abnormal logs to the amount of all historical log information.

[0050] For the embodiment of the present application, after the electronic device determines the data volume of each configuration file from the historical log information, the electronic device sums the data volume of all configuration files to obtain the total volume. The larger the total volume of the data volume of the network device, the more data the network device transmits, and the more important the network device is. The abnormal log is the log when the network device fails or other abnormalities occur. The more abnormal logs there are, the greater the probability that the network device will be abnormal, and the greater the probability that the abnormality will occur during the next operation. The higher the importance of real-time monitoring of the network device, the higher the importance of data recovery when power is off, and the more important the network device is. Therefore, the electronic device determines the 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.

[0051] S1012, determining the time interval from the most recent time point of the abnormal log to the current time.

[0052] For the embodiment of the present application, each log generated by the network device has a corresponding generation time. Therefore, the electronic device determines the most recent daily log based on the generation time of the log. The electronic device can obtain the current time from the local clock chip or from the Internet, and then subtract the current time from the most recent time point of the abnormal log to obtain the time interval. The larger the time interval, the longer the network device has been operating normally without any abnormality, and the greater the possibility of an abnormality occurring next time, which means that the network device is more important.

[0053] S1013: Determine the importance level of the network device based on the total amount, the first ratio, and the time interval.

[0054] 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 have different degrees of influence on the importance of the network device. Therefore, the staff sets the corresponding coefficients for the above three 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 corresponding coefficients for weighted calculation to obtain the score of the network device, and the score can represent the importance of the network device. Multiple preset score intervals can be stored in the electronic device, each preset score interval corresponds to a preset level, and the preset level corresponding to each interval is set by the staff according to calculations or actual conditions. The electronic device determines the preset score interval where the score is located, and determines the preset level corresponding to the preset score interval as the importance level of the network device.

[0055] S1014: Determine the operating status score of the device based on the performance utilization percentage, network speed, and device temperature.

[0056] For the embodiments of the present application, the greater the percentage of electronic device performance occupancy, the fewer remaining unused performance resources, the worse the operating condition of the electronic device, and the more likely it is that the CPU and other chip devices will overheat and cause power failure. In order to ensure the reliability of data recovery when power failure occurs later, more cloud storage devices are required. Similarly, the faster the network speed, the higher and more reliable the efficiency of downloading and transmitting configuration files, the better the operating condition of the electronic device, and the less likely it is to have a power failure. Conversely, the worse the operating condition of the electronic device, the greater the possibility of a power failure. In order to ensure the reliability of data recovery when power failure occurs later, more cloud storage devices are required. The staff can set a temperature sensor on the electronic device to monitor the operating temperature of the electronic device. The higher the operating temperature, the worse the operating condition of the electronic device, and the greater the possibility of a power failure. In order to ensure the reliability of data recovery when power failure occurs later, more cloud storage devices are required.

[0057] Since the performance utilization percentage and device temperature are inversely proportional to the operation of the electronic device and are directly proportional to the number of required cloud storage devices, and the network speed is directly proportional to the operation of the electronic device and inversely proportional to the number of required cloud storage devices, the electronic device can be calculated by taking the inverse of the network speed.

[0058] In summary, performance utilization percentage, network speed and device temperature are all key factors that affect the operation of electronic equipment, and the degree of influence is different. The staff can set the corresponding coefficients for the above three through the visual operation interface and store them in the electronic equipment. After the electronic equipment determines the performance utilization percentage, the inverse of the network speed and the device temperature, the corresponding coefficients are retrieved for calculation to obtain the operating status score of the electronic equipment. The higher the operating status score, the worse the operating status of the electronic equipment.

[0059] S1015, determining the required number of cloud storage devices based on the importance level and the operation status score.

[0060] For the embodiments of the present application, in summary, the importance level of the network device and the operating status score of the electronic device are both important factors affecting the required number of cloud storage devices for storing configuration files. As above, the staff sets the coefficients corresponding to the importance level and the operating status score, and the electronic device calls the corresponding coefficients to perform weighted calculation on the importance level and the operating status score to obtain a score. The electronic device can directly round 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. It is more accurate to comprehensively determine the required number of cloud network devices by determining the importance level of the network device and the operating status of the electronic device.

[0061] In a possible implementation of the embodiment of the present application, the historical storage log includes verification information on whether the configuration file stored in the cloud storage device is consistent with the standard configuration file. In step S102, the storage quality score of each cloud storage device is determined based on the memory usage percentage and the historical storage log, specifically including 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: S1021, obtaining the power-off time of the device, and determining the target historical storage log corresponding to the power-off time of each cloud storage device.

[0062] For the embodiment of the present application, each time the electronic device loses power, the power-off time is stored, and the electronic device retrieves the power-off time each time. Since each historical storage log of the cloud storage device corresponds to a generation time, the electronic device can easily determine the log corresponding to each cloud storage device at the power-off time, that is, the target historical storage log. The log of the cloud storage device includes the consistency of the configuration file stored in the cloud storage device with the original configuration file, that is, the standard configuration file, after the electronic device loses power, that is, consistency or inconsistency.

[0063] S1022: Determine the number of first target history storage logs in the target history storage logs of each cloud storage device.

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

[0065] For the embodiment of the present application, the logs when the cloud storage file is consistent with the standard configuration file and the logs when they are inconsistent can be represented by different identifiers. 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 the first target historical storage logs.

[0066] S1023: Determine a second ratio of the number of the first target history storage logs to the number of all target history storage logs.

[0067] For the embodiment of the present application, the more the number of the first target history storage logs, the higher the accuracy of the configuration file stored in the cloud storage device and the higher the consistency with the standard configuration file. The target history storage log is a log for each power outage. After the electronic device determines the number of the first target history storage logs, it calculates the second ratio of the number of the first target history storage logs to the number of all target history storage logs. The larger the second ratio, the greater the proportion of accurate times of the configuration file stored in the cloud storage device when the electronic device loses power, the more reliable the cloud storage device is, and the more suitable it is as the cloud storage device for the next storage configuration file.

[0068] S1024: Determine a storage quality score of each cloud storage device based on the memory occupancy percentage, the second ratio, and the respective corresponding coefficients.

[0069] 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 configuration file may not be fully stored, and the less suitable it is as a cloud storage device for storing the configuration file next. The larger the second ratio, the more reliable the cloud storage device is, and the more suitable it is as a cloud storage device for storing the configuration file next. 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 corresponding coefficients to perform weighted calculations on 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 it is as a cloud storage device for storing the configuration file next.

[0070] Since the memory usage percentage is inversely proportional to the storage quality, the electronic device can take the inverse of the memory usage percentage for weighted calculation, so that the calculation is more accurate and in line with reality. The storage quality score of each cloud storage device is more accurately determined by comprehensively determining the memory usage percentage of the cloud storage device and the second ratio of the log with the correct storage configuration file to the log when all power is off.

[0071] In other embodiments, the electronic device may also determine a second storage log in the target history storage log other than the first target history storage log. Determine the similarity between the configuration file in the second storage log and the standard configuration file. The higher the similarity, the greater the proportion of correct data in the configuration file stored in the cloud storage device, which also indicates a higher storage quality. Therefore, the above similarity may be determined and the storage quality score may be comprehensively calculated by the similarity, the memory usage percentage and the second ratio.

[0072] In a possible implementation of the embodiment of the present application, in step S103, the target cloud storage device is determined based on the storage quality score and the required quantity, which specifically includes step S1031 (not shown in the figure) and step S1032 (not shown in the figure), wherein: S1031, sorting all cloud storage devices according to storage quality scores from large to small to obtain a sorting result.

[0073] S1032: Determine the previously required number of cloud storage devices as target cloud storage devices according to the sorting result.

[0074] For the embodiment of the present application, after the electronic device determines the storage quality score of each cloud storage device, the cloud storage devices are sorted from large to small according to the 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 devices are sorted in order from large to small, and the sorting results are device c, device a, device e, device d and device b. Assuming that the required number is 3, the electronic device only needs to determine the first 3 in the sorting result, namely device c, device a and device e. It is more convenient to determine the target cloud storage device by sorting.

[0075] In a possible implementation of the embodiment of the present application, in step S106, a configuration file to be restored is determined from the configuration files in the primary device, the backup device, and the target cloud storage device, 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: S1061, comparing configuration files of the primary device, the backup device, and the target cloud storage device.

[0076] For the embodiment of the present application, the electronic device can use the md5 algorithm to compare the configuration file stored in the device, i.e., the main 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 configuration file with consistent data and the inconsistent configuration file.

[0077] S1062, if the configuration files of the primary device and the backup 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 primary device and the backup device respectively.

[0078] For the embodiment of the present application, if the configuration file of the primary device is inconsistent with the configuration file of the backup device, the correct configuration file cannot be determined from the primary device or the backup device, and the correct configuration file needs to be determined based on the configuration file of the target cloud storage device. Therefore, the electronic device determines the configuration file with consistent data in the target cloud storage device, that is, the target configuration file. Then the target configuration file is compared with the configuration files of the primary device and the backup device to determine the correct configuration file.

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

[0080] For the embodiment of the present application, the preset ratio threshold is used as the demarcation point for whether the consistency of the target configuration file is high, and the required number is the total number of target cloud storage devices. Since each target cloud storage device stores a configuration file, the electronic device determines the configuration file with consistent data, that is, 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 the configuration file data stored in 7 target cloud storage devices is consistent, then the number of target configuration files is 7, so the electronic device determines the ratio of the target configuration file 7 to the required number 10, that is, 7:10. If it is consistent with the configuration file of the main device, and the ratio of the target configuration file to the required number reaches the preset ratio, it means that the configuration file stored in the main device is consistent with the configuration files stored in most of the target cloud storage devices, and the target configuration file is likely to be the correct configuration file. In this case, the electronic device can directly determine the configuration file of the main device as the configuration file to be restored, and there is no need to obtain the target configuration file from the target cloud storage device, which is more convenient.

[0081] S1064: If the target configuration file is consistent with the configuration file of the standby device, and the ratio of the number of the target configuration files to the required number reaches a preset ratio threshold, the configuration file of the standby device is determined as the configuration file to be restored.

[0082] For the embodiment of the present application, both the main device and the backup device are local devices, so the main device and the backup device can maintain a high consistency when storing configuration files, or when a power outage occurs, if the configuration files of the main device and the backup device are inconsistent, the correct configuration file cannot be determined based on the main device and the backup device, but there is a configuration file with consistent data among the configuration files stored in multiple target cloud storage devices, namely, the target configuration file. Therefore, the electronic device determines the ratio of the target configuration file to the required number in the manner of step S1063. If the ratio reaches the preset ratio threshold, it means that the number of target configuration files is large, and the target configuration file is consistent with the configuration file stored in the backup device, indicating that the configuration file stored in the backup device is likely to be the correct configuration file. The electronic device can directly determine the configuration file of the backup device as the configuration file to be restored, and there is no need to obtain the target configuration file from the target cloud storage device, which is more convenient.

[0083] S1065: 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 backup device, and the ratio of the number of target configuration files to the required number reaches a preset ratio threshold, the target configuration file is determined as the configuration file to be restored.

[0084] For the embodiment of the present application, if the target configuration file is inconsistent with the configuration file of the primary device and the configuration file of the backup device, and the ratio of the target configuration file to the required number reaches the preset ratio threshold, it means that there is a high possibility that the configuration files stored in the primary device and the backup device are both incorrect configuration files. Since the ratio of the number of target configuration files to the number of target cloud storage devices still reaches the preset ratio threshold, it means that the number of target configuration files is large and the target configuration file is likely to be the correct configuration file. The electronic device can directly determine the target configuration file as the configuration file to be restored.

[0085] If the configuration file of the main device is consistent with the configuration file of the backup device, and the ratio of the target configuration file to the required number does not reach the preset ratio threshold, the configuration file stored in the main device can be determined as the configuration file to be restored. If the configuration file of the main device is inconsistent with the configuration file of the backup device, and the ratio 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. At this time, the electronic device can output a prompt message, such as controlling the display screen device to display a text prompt message "Please manually check the correct configuration file".

[0086] In a possible implementation of the embodiment of the present application, step S106 further includes step S1 (not shown in the figure), step S2 (not shown in the figure), step S3 (not shown in the figure), step S4 (not shown in the figure), step S5 (not shown in the figure), step S6 (not shown in the figure), step S7 (not shown in the figure), step S8 (not shown in the figure) and step S9 (not shown in the figure), wherein: S1, 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 backup device, and the ratio of the number of target configuration files to the required number reaches a preset ratio threshold, then determine the abnormal cloud storage device among all target cloud storage devices.

[0087] The configuration files stored in the abnormal cloud storage device include: abnormal configuration files having configuration data different from that of the target configuration file.

[0088] For the embodiment of the present application, the electronic device parses the configuration file stored in each target cloud storage device to obtain the configuration data stored in each target cloud storage device, and the electronic device compares the configuration data with the configuration data of the target configuration file to identify the abnormal cloud storage device.

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

[0090] For the embodiment of the present application, the electronic device can obtain the number of network nodes between each abnormal cloud storage device and the main device through route tracing related technologies, such as using the "tracert" command in combination with the route tracing of each abnormal cloud storage device. The more network nodes there are, the greater the possibility of instability during data transmission, and the greater the possibility of data transmission errors.

[0091] S3, controlling the main device to send a test data packet to the abnormal cloud storage device and determining the communication delay from the main device to each abnormal cloud storage device.

[0092] For the embodiment of the present application, the electronic device controls the main device to send a test data packet to each abnormal cloud storage device, and determines the communication delay of each abnormal cloud storage device based on the sending time and the time of receiving the response signal of each abnormal cloud storage device. The larger the communication delay, the more unstable the communication is, and the greater the possibility of data transmission errors and losses.

[0093] S4, determining a communication loss quality score based on the number of network nodes and the communication delay.

[0094] For the embodiments of the present application, the number of network nodes and communication delay are both key factors affecting communication quality. Therefore, different coefficients can be set for the number of network nodes and communication delay. Then, after the electronic device determines the number of network nodes and communication delay, it performs weighted calculation based on the corresponding coefficients to determine the communication loss quality score of each abnormal cloud storage device.

[0095] S5, determining 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.

[0096] For the embodiment of the present application, after the electronic device determines the abnormal cloud storage device, the configuration data of the stored abnormal configuration file and the data of the target configuration file are screened to obtain the target data segment with storage errors, i.e., different data, corresponding to each abnormal cloud storage device. The longer the target data segment, the more data is stored with errors, and the worse the reliability of the abnormal cloud storage device.

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

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

[0099] For the embodiment of the present application, the importance of data at different locations in the target configuration file is different. 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 ratio of the number of target configuration files to the required number does not reach the preset ratio threshold, it is necessary to manually restore the data. Some data with high importance levels will have a greater impact on the normal operation of the network device after being stored incorrectly or lost, and need to be restored as soon as possible. Some data with low importance levels will have a smaller impact on the normal operation of the network device after being stored incorrectly or lost, and the priority of recovery is lower. Therefore, the staff can set different importance levels for the configuration data at different locations 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 location set. The higher the importance level of the target data segment, the worse the reliability of the corresponding abnormal cloud storage device, the worse the storage quality, and the less suitable it is for storage work.

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

[0101] For the embodiment of the present application, the data length and importance level of the target data segment are both key factors affecting the storage quality of the abnormal cloud storage device, so the staff sets the coefficients of the data length and importance level in the electronic device in advance. After the electronic device determines the data length and importance level of the target data segment, it can perform weighted calculation according to the corresponding coefficients to obtain the storage loss quality score of each abnormal cloud storage device.

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

[0103] For the embodiment of the present application, the larger the communication loss quality score, the lower the communication quality of the abnormal cloud storage device, and the less reliable it is. The larger the storage loss quality score, the less reliable the abnormal cloud storage device is in performing 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.

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

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

[0106] In a possible implementation manner of the embodiment of the present application, a preset proportion threshold is determined, and the method further includes step Sa (not shown in the figure) and step Sb (not shown in the figure), wherein: Sa, score is determined based on importance level and required quantity.

[0107] Sb, determine the preset score interval where the score is located, each preset score interval corresponds to a preset ratio, and determine the preset proportion corresponding to the preset score interval where the score is located as the preset proportion threshold.

[0108] For the embodiments of the present application, the importance level and required number of network devices are both key factors affecting the preset proportion 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 calculations on the importance level and the required number to obtain a score. After determining the score, the electronic device determines the preset score interval in which the score is located. The preset proportion corresponding to each preset score interval is obtained by the staff according to actual conditions or by calculation. The electronic device determines the preset proportion of the preset score interval in which the score is located as the preset proportion threshold. It is more accurate to comprehensively determine the preset proportion threshold by combining the importance level of the network device and the required number of cloud storage devices.

[0109] In a possible implementation manner of the embodiment of the present application, the method further includes step S107 (not shown in the figure) and step S108 (not shown in the figure), wherein: S107, 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 backup device, and the ratio of the number of target configuration files to the required number does not reach the preset ratio, then determine the inconsistent data in the configuration file of the primary device, the configuration file of the backup device, and the configuration file of the target cloud storage device.

[0110] S108, marking the inconsistent data, and outputting the marked configuration data.

[0111] For the embodiment of the present application, if the configuration file of the main device is inconsistent with the configuration file of the backup device, and the ratio 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 verification of the configuration information, the electronic device marks the inconsistent data in the configuration file, such as highlighting, bolding or displaying different colors for different data. Then the marked configuration file is output in the format of a text file, so that the staff can find the inconsistent data more conveniently and directly.

[0112] The above embodiment introduces a high-reliability data storage and recovery method from the perspective of method flow, and the following embodiment introduces a high-reliability data storage and recovery device from the perspective of a virtual module or a virtual unit. For details, please refer to the following embodiment.

[0113] The present application embodiment provides a high reliability data storage and recovery device 20, such as Figure 2As shown, the high-reliability data storage and recovery device 20 may specifically include: A first determination module 201 is used to obtain historical log information of a network device and current performance information of the device, and determine the required number of cloud storage devices based on the historical log information and the performance information; A second determination module 202 is used to obtain the current memory usage percentage and historical storage logs of each cloud storage device, and determine the storage quality score of each cloud storage device based on the memory usage percentage and the historical storage logs; A third determination module 203, configured to determine a target cloud storage device based on the storage quality score and the required quantity; Storage module 204, used to store the configuration files of the network devices in the local master device, the backup device and the target cloud storage device, one configuration file for each network device; The file acquisition module 205 is used to acquire configuration files in the main device, the backup device and the target cloud storage device when a power failure is detected; The file recovery module 206 is used to determine the configuration file to be recovered from the configuration files in the primary device, the backup device and the target cloud storage device and recover it.

[0114] The embodiment of the present application discloses a high-reliability data storage and recovery device 20, wherein the first determination module 201 obtains historical log information of a network device and the current performance information of the device, the historical log information records the historical operation status and abnormal conditions of the network device, thereby characterizing the importance of the network device, the higher the importance, the more cloud storage devices are required to ensure the reliability of configuration file recovery during power failure, the performance information characterizes the operation status of the device, the higher the performance, the lower the possibility of power failure, and the fewer cloud storage devices are required, so the appropriate required number of cloud storage devices is determined based on the historical log information and performance information, the second determination module 202 obtains the current memory usage percentage and historical storage log of each cloud storage device, the smaller the memory usage percentage, the more suitable it is for storing configuration files, the historical storage log characterizes the historical storage data of the cloud storage device, so the memory usage percentage and historical storage log can be used to accurately determine the required number of cloud storage devices. The storage quality score of the device, the third determination module 203 can determine the target cloud storage device according to the storage quality score and the required quantity, and then the storage module 204 starts to store the configuration files in the main device, i.e., the present device, the backup device and the target cloud storage device, and then monitors the power failure. When a power failure occurs, the file acquisition module 205 acquires the configuration files from the three devices and the file recovery module 206 determines the configuration files to be recovered from the acquired configuration files and performs the recovery operation. Since the target cloud storage devices are all devices with high storage quality, the required quantity is also determined according to the operation status of the network device and the present device, that is, using an appropriate number of target cloud storage devices to store configuration files can ensure that an appropriate number of configuration files are backed up and stored, which ensures an appropriate number of storage samples of the configuration files. At the same time, the combination of the target cloud storage device storing the configuration files can ensure the correctness of the configuration files as much as possible, so that the reliability of the restored configuration files is higher when recovering data after a power failure.

[0115] In a possible implementation of the embodiment of the present application, the historical log information includes an abnormal log and the data volume of each configuration file, and the performance information includes the performance occupancy percentage, the network speed, and the device temperature. When the first determination module 201 determines the required number of cloud storage devices based on the historical log information and the performance information, it is specifically used to: Determine a first ratio of the total amount of data of all configuration files and the amount of abnormal logs to the amount of all historical log information; Determine the time interval from the most recent time point of the abnormal log to the current time; determining an importance level of the network device based on the total amount, the first ratio, and the time interval; Determine the operating status score of the device based on the performance utilization percentage, network speed, and device temperature; Determine the required number of cloud storage devices based on the criticality and health scores.

[0116] In a possible implementation of the embodiment of the present application, the historical storage log includes verification information of whether the configuration file stored in the cloud storage device is consistent with the standard configuration file. The second determination module 202 determines the storage quality of each cloud storage device based on the memory usage percentage and the historical storage log, specifically for: Obtain the power-off time of the device and determine the target historical storage log corresponding to the power-off time of each cloud storage device; Determine the number of first target history storage logs in the target history storage logs of each cloud storage device, where the first target history storage logs are storage logs whose configuration files are consistent with the standard configuration files; determining a second ratio of the number of the first target historical storage logs to the number of all target historical storage logs; The storage quality score of each cloud storage device is determined based on the memory usage percentage, the second ratio, and the corresponding coefficients.

[0117] In a possible implementation of the embodiment of the present application, when the third determination module 203 determines the target cloud storage device based on the storage quality score and the required quantity, it is specifically used to: Sort all cloud storage devices according to their storage quality scores from large to small to obtain a sorting result; According to the sorting result, the required number of cloud storage devices are determined as target cloud storage devices.

[0118] In a possible implementation of the embodiment of the present application, when the file recovery module 206 determines the configuration file to be restored from the configuration files in the primary device, the backup device, and the target cloud storage device, it is specifically used to: Compare the configuration files of the primary device, backup device, and target cloud storage device; If the configuration files of the primary device and the backup device are inconsistent, then determine the same target configuration file in the target cloud storage device, and compare the target configuration file with the configuration files of the primary device and the backup device respectively; If the target configuration file is consistent with the configuration file of the main device, and the ratio of the number of the target configuration files to the required number reaches a preset ratio threshold, the configuration file of the main device is determined as the configuration file to be restored; If the target configuration file is consistent with the configuration file of the backup device, and the ratio of the number of the target configuration files to the required number reaches a preset ratio threshold, the configuration file of the backup device is determined as the configuration file to be restored; 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 backup device, and the ratio of the number of target configuration files to the required number reaches a preset ratio threshold, the target configuration file is determined as the configuration file to be restored.

[0119] In another possible implementation, the device 20 further includes: The abnormal cloud storage device determination module is used to determine the abnormal cloud storage device among all the target cloud storage devices when 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 backup device, and the ratio of the number of target configuration files to the required number reaches a preset ratio threshold, wherein the configuration files stored in the abnormal cloud storage device include: abnormal configuration files having configuration data different from that of the target configuration file; A network node determination module, used to determine the number of network nodes between each abnormal cloud storage device and the main device; A control module, used to control the main device to send a test data packet to the abnormal cloud storage device and determine the communication delay from the main device to each abnormal cloud storage device; A communication loss quality score determination module, used to determine the communication loss quality score based on the number of network nodes and the communication delay; A target data segment determination module, used 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; The importance level determination module is used to determine the position of each target data segment in the target configuration file and determine the importance level of each target data segment. Data at different positions in the target configuration file correspond to different importance levels. A storage loss quality score determination module, used to determine the storage loss quality score of each abnormal cloud storage device based on the data length and importance level of the target data segment; A work quality loss value determination module, used 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; The elimination module is used to determine a third ratio of the storage quality score to the working quality loss value, and eliminate abnormal cloud storage devices whose third ratio reaches a specified ratio from all cloud storage devices.

[0120] In a possible implementation of the embodiment of the present application, the preset proportion threshold is determined, and the device 20 further includes: a fourth determination module, for determining a score based on the importance level and the required quantity; The fifth determination module is used to determine a preset score interval in which the score is located, each preset score interval corresponds to a preset ratio, and a preset proportion corresponding to the preset score interval in which the score is located is determined as a preset proportion threshold.

[0121] In a possible implementation of the embodiment of the present application, the device 20 further includes: a sixth determination module, configured to determine inconsistent data in the configuration file of the primary 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 primary 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 files to the required number does not reach a preset ratio; The marking module is used to mark inconsistent data and output the marked configuration data.

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

[0123] An electronic device is provided in an embodiment of the present application, such as Figure 3 As shown, Figure 3 The electronic device 30 shown 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 may also 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.

[0124] The processor 301 may 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 devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. The processor 301 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0125] The bus 302 may include a path to transmit information between the above components. The bus 302 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus 302 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 Only one thick line is used in the diagram, but it does not mean that there is only one bus or only one type of bus.

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

[0127] The memory 303 is used to store the application code for executing the solution of the present application, and the execution is controlled by the processor 301. The processor 301 is used to execute the application code stored in the memory 303 to implement the contents shown in the above method embodiment.

[0128] The electronic devices include, but are not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), and fixed terminals such as digital TVs, desktop computers, etc. It can also be a server, etc. Figure 3 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0129] The embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer-readable storage medium is run on a computer, the computer can execute the corresponding content in the aforementioned method embodiment. Compared with the related art, the embodiment of the present application obtains the historical log information of the network device and the current performance information of the device. The historical log information records the historical operation status and abnormal conditions of the network device, thereby characterizing the importance of the network device. The higher the importance, the more cloud storage devices are required to ensure the reliability of the configuration file recovery when the power is off. The performance information characterizes the operation status of the device. The higher the performance, the lower the possibility of power off, and the fewer the number of cloud storage devices required. Therefore, the appropriate required number of cloud storage devices is determined based on the historical log information and performance information, and the current memory usage percentage and historical storage log of each cloud storage device are obtained. The smaller the memory usage percentage, the more suitable it is for storing configuration files. The historical storage log characterizes the historical storage data of the cloud storage device. Therefore, the memory usage percentage and historical storage log can be accurately determined for each cloud storage device. The target cloud storage device can be determined based on the storage quality score and the required quantity, and then the configuration files can be stored in the main device, i.e., this device, the backup device, and the target cloud storage device. Then, the power outage can be monitored. When a power outage occurs, the configuration files can be obtained from the three devices and the configuration files to be restored can be determined from the obtained configuration files and the recovery operation can be performed. Since the target cloud storage devices are all devices with high storage quality, the required quantity is also determined based on the operation of the network device and this device. That is, using an appropriate number of target cloud storage devices to store configuration files can ensure that an appropriate number of configuration files are backed up and stored, which ensures an appropriate number of storage samples of the configuration files. At the same time, the target cloud storage device stores the configuration files. The combination of the two can ensure the correctness of the configuration files as much as possible, so that the reliability of the restored configuration files is higher when recovering data after a power outage.

[0130] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.

[0131] The above description is only a partial implementation method of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A high reliability data storage and recovery method, characterized in that: include: Obtain historical log information of the network device and current performance information of the device, and determine the required number of cloud storage devices based on the historical log information and performance information; Obtaining the current memory usage percentage and historical storage logs of each cloud storage device, and determining the storage quality score of each cloud storage device based on the memory usage percentage and historical storage logs; Determine a target cloud storage device based on the storage quality score and the required quantity; Storing the configuration files of the network devices in the local master device, the backup device and the target cloud storage device, one configuration file for each network device; When a power failure is detected, obtaining configuration files in the primary device, the backup device, and the target cloud storage device; The configuration file to be restored is determined from the configuration files in the primary device, the backup device and the target cloud storage device and restored.

2. A high reliability data storage and recovery method according to claim 1, characterized in that: The historical log information includes abnormal logs and the amount of data in each configuration file, the performance information includes performance occupancy percentage, network speed, and device temperature, and determining the required number of cloud storage devices based on the historical log information and the performance information includes: Determine a first ratio of the total amount of data of all configuration files and the amount of abnormal logs to the amount of all historical log information; Determine the time interval from the most recent time point of the abnormal log to the current time; Determine the importance level of the network device based on the total amount, the first ratio, and the time interval; Determine the operating status score of the device based on the performance occupancy percentage, network speed and device temperature; The required number of the cloud storage devices is determined based on the importance level and the operating status score.

3. A high reliability data storage and recovery method according to claim 1, characterized in that: The historical storage log includes verification information of whether the configuration file stored in the cloud storage device is consistent with the standard configuration file, and the storage quality score of each cloud storage device is determined based on the memory usage percentage and the historical storage log, including: Obtain the power-off time of the device and determine the target historical storage log corresponding to the power-off time of each cloud storage device; Determine the number of first target history storage logs in the target history storage logs of each cloud storage device, where the first target history storage logs are storage logs whose configuration files are consistent with the standard configuration files; Determining a second ratio of the number of the first target history storage logs to the number of all target history storage logs; A storage quality score of each cloud storage device is determined based on the memory occupancy percentage, the second ratio, and the respective corresponding coefficients.

4. A high reliability data storage and recovery method according to claim 1, characterized in that: The determining of the target cloud storage device based on the storage quality score and the required quantity includes: Sort all cloud storage devices according to their storage quality scores from large to small to obtain a sorting result; According to the sorting result, the required number of cloud storage devices mentioned above are determined as the target cloud storage devices.

5. A high reliability data storage and recovery method according to claim 1, characterized in that: The step of determining the configuration file to be restored from the configuration files in the primary device, the backup device, and the target cloud storage device includes: Comparing configuration files of the primary device, the backup device, and the target cloud storage device; If the configuration files of the primary device and the backup device are inconsistent, the configuration files of each target cloud storage device are parsed to obtain configuration data, a target configuration file with the same configuration data is determined, and the target configuration file is compared with the configuration files of the primary device and the backup device respectively; If the target configuration file is consistent with the configuration file of the master device, and the ratio of the number of the target configuration files to the required number reaches a preset ratio threshold, determining the configuration file of the master device as the configuration file to be restored; If the target configuration file is consistent with the configuration file of the standby device, and the ratio of the number of the target configuration files to the required number reaches a preset ratio threshold, the configuration file of the standby device is determined as the configuration file to be restored.

6. A high reliability data storage and recovery method according to claim 5, characterized in that: The method further comprises: 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 backup device, and the ratio of the number of target configuration files to the required number reaches a preset ratio threshold, then an abnormal cloud storage device among all target cloud storage devices is determined, and the configuration files stored in the abnormal cloud storage device include: abnormal configuration files that are different from the configuration data of the target configuration file; Determine the number of network nodes between each abnormal cloud storage device and the master device; Control the master device to send a test data packet to the abnormal cloud storage device and determine the communication delay from 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; 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; Determine the position of each target data segment in the target configuration file, and determine the importance level of each target data segment, where data at different positions in the target configuration file correspond to different importance levels; Determine a storage loss quality score for each abnormal cloud storage device based on the data length and importance level of the target data segment; The product of the communication loss quality score and the storage loss quality score is used as the working quality loss value of each abnormal cloud storage device in the current storage; A storage quality score of the abnormal cloud storage device is obtained, a third ratio of the storage quality score to the work quality loss value is determined, and the abnormal cloud storage device whose third ratio reaches a specified ratio is removed from all cloud storage devices.

7. A high reliability data storage and recovery method according to claim 5, characterized in that: Determining the preset percentage threshold includes: determining a score based on the importance level and the required quantity; A preset score interval in which the score is located is determined, each preset score interval corresponds to a preset ratio, and a preset proportion corresponding to the preset score interval in which the score is located is determined as the preset proportion threshold.

8. A high reliability data storage and recovery device, characterized in that: include: A first determination module is used to obtain historical log information of the network device and current performance information of the device, and determine the required number of cloud storage devices based on the historical log information and performance information; A second determination module is used to obtain the current memory usage percentage and historical storage log of each cloud storage device, and determine the storage quality score of each cloud storage device based on the memory usage percentage and historical storage log; A third determination module, configured to determine a target cloud storage device based on the storage quality score and the required quantity; A storage module, used to store the configuration files of the network devices in a local master device, a backup device and a target cloud storage device, wherein each of the network devices has one configuration file; A file acquisition module, used to acquire configuration files in the master device, the backup device and the target cloud storage device when a power failure is detected; The file recovery module is used to determine the configuration file to be recovered from the configuration files in the primary device, the backup device and the target cloud storage device and recover it.

9. An electronic device, characterized in that: It includes: at least one processor; Memory; At least one application, wherein the at least one application is stored in the memory and configured to be executed by the at least one processor, and the at least one application is used to execute a high-reliability data storage and recovery method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed in a computer, the computer is caused to execute a high-reliability data storage and recovery method as claimed in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Cache data protection method and device

    CN106919474A

  • Data backup and storage method and device, computer equipment and storage medium

    CN115495285A

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

    CN115509802A

  • Log storage method and device

    CN116821749A

  • Managing data from internet of things devices in a vehicle

    US20200334125A1