Central control project data recovery and self-recovery method and system and electronic equipment
The distributed Hash table network is constructed through SHA-256 algorithm and Merkle Tree, which solves the problem of restoring and recovery of designers and central control systems when data is lost, and realizes data self-recovery and self-recovery in cases of high confidentiality levels and single point of failure. Backup transfer reduces costs and improves the reliability of redundant data backups.
Patent Information
- Application Number
- CN202411292213.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-14
- Publication Date
- 2024-12-31
AI Technical Summary
Existing designers and central control systems cannot restore and restore data when data is lost, especially in sites with high confidentiality levels or data loss problems caused by single point of failure, and existing solutions require manual intervention to increase costs.
Using SHA-256 algorithm for data blocking hash operation, build Merkle Tree and distributed Hash table (DHT) networks to realize data compilation, packaging, chunking, redundant storage and self-recovery, ensuring data between central control systems Redundant backup and transfer.
Realizing self-recovery and backup transfer of data in field and single-point failure conditions with high confidentiality levels reduces the cost of manual intervention and ensures data integrity and reliability.
Smart Images

Figure CN119226038A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of computer technology, and in particular relates to a central control project data restoration and self-recovery method, system and electronic equipment. Background Art
[0002] The existing designer and central control system is that the designer is directly installed on the central control host, and the design is performed by accessing the web page of the central control designer through a browser. Because the designer and the central control are integrated, the data is directly stored on the central control host. Therefore, this solution does not have the process of data delivery. If the central control is damaged due to some human or other reasons, the data of this central control will be completely lost and there is no way to recover it. In addition, this design cannot upload the project data and equipment data to the company's data center, and it is difficult to accumulate it into the company's data assets. Another is that the designer is installed on a PC or other specific device, that is, the designer and the central control host are separated. After the project is delivered, the data file is fully stored on the central control system. At present, there are generally one to several central control units on a small project site, while there are hundreds of central control units on a large site. Usually, there will be linkage between the central control units on a project site, which requires that the data between the central control units is related. In the existing solution, each central control only stores its own data. When restoring, it is necessary to read from all central control units to restore all the content originally delivered by the designer. The problem can also be solved by having the implementation personnel bring the designer containing the original engineering data to the site and re-issuing the project data. However, if the confidentiality level of some sites is high and the implementation personnel's work computers and data cannot be brought in or out, or if data is lost due to other reasons, the data cannot be recovered. At the same time, sending personnel to the project site also means an increase in costs.
[0003] Therefore, the designer and central control system in the prior art have the problem that data cannot be restored and recovered. Summary of the invention
[0004] In order to solve the above-mentioned problem in the prior art, that is, the designer and central control system in the prior art have the problem that data cannot be restored and recovered, the present invention provides a central control project data restoration and self-recovery method, the method comprising:
[0005] Compile and package the project data into data packets according to the equipment and interface data used by each central control; split each data packet into several data blocks; each central control has its corresponding data packet;
[0006] For each data block, use the SHA-256 algorithm to perform hash operations to obtain the hash value of each data block. The hash value of each data block is the unique identifier of this data block;
[0007] The hash values of each data block corresponding to each data packet are used as leaf nodes, and the leaf nodes corresponding to each data packet constitute a Merkle Tree; the data information of each Merkle Tree is assembled into a data relationship graph;
[0008] Send each data block and each data relationship diagram to each central control;
[0009] After receiving its corresponding data blocks and data relationship diagram, each central control updates its own distributed hash table. The distributed hash tables of each central control constitute a DHT network; each central control performs single point failure data backup and transfer, data restoration and self-recovery of the central control based on the DHT network.
[0010] In a preferred embodiment, the project data includes material files; when compiling and packaging, for the data except the material files in the project data, the data except the material files are compiled and packaged into individual data packets corresponding to each central control according to the equipment and interface data used by each central control; for the material files in the project data, the material files are separately summarized to obtain material data packets, and then the material data packets are divided into blocks to obtain individual data blocks of the material files. The material files are relatively large and may be reused among multiple central controls, and the material files are separately packaged to reduce the total data packet size.
[0011] In a preferred implementation, sending each data block and each data relationship diagram to each central control includes:
[0012] The data blocks and data relationship diagrams of each central control are not only stored on its own central control, but also on other central control.
[0013] Sending each data block and each data relationship diagram to each central control specifically includes:
[0014] When the number of central control units is less than or equal to 3, any central control unit has the data of all central control units; when the number of central control units is greater than 3, the data of each central control unit is not only stored on itself, but also on at least two other central control units.
[0015] In a preferred implementation, each central control performs backup transfer of single point failure data based on the DHT network, including:
[0016] When a central control in the DHT network fails and goes offline, the central control except the faulty central control in the DHT network will update the distributed hash table to exclude the faulty central control. At the same time, the central control system will check whether all data still meets the requirement of at least three copies.
[0017] The central control system finds the nodes in the network that have data missing due to a faulty central control, resulting in less than three copies of data. The central control holding the missing data pushes the missing data to the nodes that do not have the missing data, thereby re-forming a secure data storage environment.
[0018] In a preferred implementation, the data restoration performed by each central control based on the DHT network includes:
[0019] For confidential data that cannot be taken out due to confidentiality level and needs to be implemented again later, read all its data relationship diagrams from the confidentiality central control where the confidential data is located;
[0020] Parse all data relationship graphs of the confidential central control to obtain all unique identifiers in the confidentiality, and then use the content addressing algorithm in the DHT network to find the central control host where the content corresponding to all unique identifiers of the confidential central control is actually stored;
[0021] The data file is read on the central control host where the contents corresponding to all the unique identifiers of the confidential central control are actually stored, and reassembled into the original data file of the confidential central control, and then the integrity of the data file is verified using the data information of the Merkle Tree data structure of the confidential central control.
[0022] In a preferred implementation, each central control performs self-recovery of the central control based on the DHT network, including:
[0023] When an old central control can no longer be used, it will be replaced with a new one;
[0024] Then, the IP of the new central control is configured as the IP of the old central control, and then the new central control is added to the DHT network;
[0025] After the new central control is added to the DHT network, when the new central control finds that it has no project data but other central control in the DHT network has project data, it enters the self-recovery mode.
[0026] In a preferred embodiment, after the new central control enters the self-recovery mode, the following steps are performed:
[0027] The new central control unit that enters the self-recovery mode requests data relationship graphs from other central control units in the DHT network, finds all unique identifiers of the data relationship graphs corresponding to its own IP from the data relationship graphs of other central control units, and stores the data relationship graphs corresponding to its own IP;
[0028] The new central control that enters the self-recovery mode uses all the unique identifiers of the new central control data corresponding to its own IP to search the addresses of all the central control with the corresponding contents of all the unique identifiers of the new central control in the DHT network, and takes all the central control with the corresponding contents of all the unique identifiers of the new central control as the first central control, and performs data synchronization based on the first central control;
[0029] After the data synchronization is completed, the new central control unit re-performs a data backup balancing operation with other central control units in the DHT network to share the storage of some data files for other central control units.
[0030] A second aspect of the present invention provides a central control project data restoration and self-recovery system, the system comprising:
[0031] The designer system is used to compile and package the project data into various data packets according to the equipment and interface data used by each central control; split each data packet into several data blocks; each central control has a corresponding data packet; for each data block, use the SHA-256 algorithm to perform hash operations to obtain the hash value of each data block, and the hash value of each data block is the unique identifier of this data block; the hash value of each data block corresponding to each data packet is used as a leaf node, and the leaf nodes corresponding to each data packet constitute a Merkle Tree; the data information of each Merkle Tree is assembled into a data relationship diagram; each data block and each data relationship diagram are sent to each central control;
[0032] The central control system is used to update its own distributed hash table after receiving its corresponding data blocks and data relationship diagram. The distributed hash tables of each central control constitute a DHT network; each central control performs single point failure data backup and transfer, data restoration and self-recovery of the central control based on the DHT network.
[0033] According to a third aspect of the present invention, an electronic device is provided, comprising:
[0034] at least one processor; and
[0035] a memory communicatively connected to at least one of the processors; wherein,
[0036] The memory stores instructions that can be executed by the processor, and the instructions are used to be executed by the processor to implement the above-mentioned central control project data restoration and self-recovery method.
[0037] According to a fourth aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to be executed by the computer to implement the above-mentioned method of central control project data restoration and self-recovery.
[0038] Beneficial effects of the present invention:
[0039] (1) The present invention solves the problem of being able to recover the original engineering data from the equipment when the implementation data cannot be taken out or the original implementation data is lost due to other reasons at a site with a high degree of confidentiality.
[0040] (2) When a single point failure occurs in the central control system, the solution of the present invention can complete the fault recovery with low manual intervention, which can reduce or even eliminate the need for implementation personnel to go to the site, thus reducing the implementation cost;
[0041] (3) Based on the solution of the present invention, each central control performs backup and transfer of single-point failure data, data restoration, and self-recovery of the central control based on the DHT network. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:
[0043] Figure 1 is a schematic diagram of a central control project data restoration and self-recovery method according to an embodiment of the present invention;
[0044] Figure 2 is a schematic diagram of a central control project data restoration and self-recovery system according to an embodiment of the present invention;
[0045] Figure 3 is a schematic diagram of a Merkle Tree according to an embodiment of the present invention;
[0046] Figure 4 is a schematic diagram of a data packet storage logic according to an embodiment of the present invention;
[0047] Figure 5 It is a structural diagram of a computer system of a server for implementing the method, system, and device embodiments of the present application. DETAILED DESCRIPTION
[0048] The present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the relevant invention, rather than to limit the invention. It should also be noted that, for ease of description, only the parts related to the relevant invention are shown in the accompanying drawings.
[0049] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0050] The present invention provides a central control project data restoration and self-recovery method, the method comprising:
[0051] Compile and package the project data into data packets according to the equipment and interface data used by each central control; split each data packet into several data blocks; each central control has its corresponding data packet;
[0052] For each data block, use the SHA-256 algorithm to perform hash operations to obtain the hash value of each data block. The hash value of each data block is the unique identifier of this data block;
[0053] The hash values of each data block corresponding to each data packet are used as leaf nodes, and the leaf nodes corresponding to each data packet constitute a Merkle Tree; the data information of each Merkle Tree is assembled into a data relationship graph;
[0054] Send each data block and each data relationship diagram to each central control;
[0055] After receiving its corresponding data blocks and data relationship diagram, each central control updates its own distributed hash table. The distributed hash tables of each central control constitute a DHT network; each central control performs single point failure data backup and transfer, data restoration and self-recovery of the central control based on the DHT network.
[0056] In order to understand the present invention more clearly, some parameters of the present invention are explained:
[0057] Central control system: Central control system refers to the equipment that centrally controls various equipment such as sound, light, electricity, etc. In the conference room control industry, the central control system is mainly used to control multimedia equipment, audio and video equipment, lighting equipment, etc. in the conference room to achieve intelligent management of the conference room. The central control system includes various central controls;
[0058] Central control designer: In the conference room central control industry, the user's operation page, active and passive control logic are all designed by the designer, and the implementer can adjust the interface and control logic according to customer needs. The product of the designer's design is a data package, which contains the page data, program running data, and interface material files designed by the designer. After this data package is sent to the central control host, the central control host will load the data package to display the operation interface for the user and perform the corresponding control operations.
[0059] CID (Context Identity): Data ID, used to mark the uniqueness of a piece of data.
[0060] DHT (Distributed Hash Table): A distributed storage system used to store and retrieve data in a decentralized distributed network.
[0061] In order to more clearly explain the central control project data restoration and self-recovery method of the present invention, the following is combined with Figure 1 Each step in the embodiment of the present invention is described in detail.
[0062] The steps of the central control project data restoration and self-recovery method of the first embodiment of the present invention are described in detail as follows:
[0063] Compile and package the project data into data packets according to the equipment and interface data used by each central control; split each data packet into several data blocks; each central control has its corresponding data packet;
[0064] In this embodiment, the project data includes material files; when compiling and packaging, for the data except the material files in the project data, the data except the material files are compiled and packaged into data packets corresponding to each central control according to the equipment and interface data used by each central control; for the material files in the project data, the material files are separately summarized to obtain material data packets, and then the material data packets are divided into blocks to obtain various data blocks of the material files. The material files are relatively large and may be reused among multiple central controls, and the material files are separately packaged to reduce the total data packet size.
[0065] Data segmentation is to generate CID (Content Identity). All central control systems are in a networking environment. Each central control system is regarded as a storage node. Each node maintains a DHT. The DHT on each node stores a part of the CID on which central control node it is stored. In this way, the central control system that actually stores this piece of data can be found through CID and content addressing algorithm, and the corresponding content can be downloaded from it. At the same time, the DHT protocol itself can also avoid the problem of single point failure. Although not all CID storage information is stored on each node, a CID is not stored on only one node in the DHT network. There will also be several other nodes storing this information. When a fault occurs in the DHT network, other nodes will also synchronize and update their own routing tables to eliminate the faulty central control system.
[0066] It is absolutely impossible for data files between different central control systems to be exactly the same, so the data packets of each central control system are processed separately, and there is no need to consider the issue of a data block being reused.
[0067] Because some project sites require gorgeous effects, a large number of images, videos, audio and other materials are usually used. Such gorgeous high-quality materials are generally large in size. In order to reduce storage space, the material files are processed separately in blocks to utilize the characteristics of CID. The CIDs generated by the same content should be exactly the same, thereby reducing the duplication of material files. Assuming that picture A is used in both central control 1 and central control 2, it can be considered that the picture already has two backups, and only one more central control needs to store this picture to meet the requirement of three backups. Using CID and DHT, you can find out how many copies of this picture are stored.
[0068] like Figure 2 As shown in the figure, the relationship between the central control site designer and the central control host is described. For sites with multiple central control hosts, multiple central control hosts will be added to the designer's project. When the implementation personnel send the project data to the central control host, the designer system will compile and package the project data into data packets based on the devices and interface data used by each central control and send them to the corresponding central control host. The multiple central control sites automatically enter the networking state after the data is sent, which is not only to achieve the control effect of cross-central control device control and linkage triggering, but also to achieve the safety effect of data redundancy backup and fault transfer. For material files such as pictures and videos, in addition to being sent to the required central control, all material files will be summarized, and all files will be divided into blocks one by one before subsequent processing. The separate processing of files is to minimize the occupation of duplicate space as much as possible. When the interfaces of multiple central control use the same material picture, these files will not be repeatedly stored redundantly.
[0069] For each data block, the SHA-256 algorithm is used to perform hash operations to obtain the hash value of each data block. The hash value of each data block is the unique identifier of this data block; the hash value is the CID (contentIdentity) of this block, which is the unique identifier of this content. This identifier will never be repeated because the hash values generated by different content using SHA-256 must also be different.
[0070] The hash values of the data blocks corresponding to each data packet are used as leaf nodes, and the leaf nodes corresponding to each data packet constitute a Merkle Tree; the data information of each Merkle Tree is assembled into a data relationship graph; wherein the data relationship graph is preferably a directed acyclic graph data structure.
[0071] Attached Figure 3The data structure and principle diagram of Merkle Tree. MerkleTree is a common data structure that prevents data damage or tampering. MerkleTree is used here for file integrity verification between multiple central controls. When restoring or recovering data on the central control later, Merkle Tree is used to verify whether each block is correct and whether there is any missing. The data information of the generated Merkle Tree is then assembled into a data relationship graph (Digibird Linked Data). A data relationship graph can be used to describe the relationship between data and data. This data relationship graph data will also be sent to the central control host along with the engineering data, and this information data is also stored redundantly to ensure that the structural information of all files is not lost, so as to avoid the inability to restore the original files.
[0072] Send each data block and each data relationship diagram to each central control;
[0073] Data packet storage logic such as Figure 4 As shown in the figure: Assume that the complete data packet of the central control host 1 is split into two blocks, P1 and P2, when it is sent. First, the central control host will inevitably store the two blocks P1 and P2 for program loading and interface display. At the same time, there will be two copies distributed on other central control, and one central control may not have the complete data of another central control, and may only hold part of the data, but in the end it must be guaranteed that the data of one central control will exist on at least three central control including itself. How much data of other central control will be stored by one central control is mainly affected by the following two factors: First, the average data size after all the data is averaged to each central control. Assuming there are ten central control, the total data volume is 100MB, according to at least two redundant storage, the actual total data volume is 300MB, then one central control needs to store 30MB on average. It is the business complexity of this central control. The business complexity is a value automatically evaluated by the designer system according to the business when the project is compiled. The first point is to ensure that the storage of each central control is used as evenly as possible to avoid some central control storing too many files while others store very few. The second point is to take into account the normal execution of the central control's own business. Generally speaking, central control with more complex business will often generate more logs and occupy more storage space during operation, so these central control itself should store relatively less, so that the central control with simpler business can bear more storage responsibilities.
[0074] In this embodiment, sending each data block and each data relationship diagram to each central control includes:
[0075] The data blocks and data relationship diagrams of each central control are not only stored on its own central control, but also on other central control units. The data of other central control units will be stored between central control units for redundant storage. Only part of the data of other central control units is saved instead of all the data of other central control units. This is to avoid great pressure and waste on storage when there are many central control units on large-scale project sites. When the number of central control units is less than or equal to 3, any central control unit has the data of all central control units; when the number of central control units is greater than 3, the data of each central control unit is not only stored on itself, but also on at least two other central control units. This is a necessary prerequisite for the system to automatically send data. This ensures that when a central control unit fails, it can be restored through other central control units.
[0076] After receiving its corresponding data blocks and data relationship diagram, each central control updates its own distributed hash table. The distributed hash tables of each central control constitute a DHT network; each central control performs single point failure data backup and transfer, data restoration and self-recovery of the central control based on the DHT network.
[0077] DHT network plays a vital role in subsequent data restoration and self-recovery. In this embodiment, each central control performs backup and transfer of single-point failure data based on the DHT network, including:
[0078] When a central control in the network fails and goes offline, other central control systems will update their own DHT tables to exclude the faulty central control. At the same time, the central control system will check whether all data still meets the requirement of at least three copies. If it is found that some data no longer meets the conditions, it will spontaneously re-perform redundant backup operations between nodes to keep the files in a safe state.
[0079] When a central control in the DHT network fails and goes offline, the central control except the faulty central control in the DHT network will update the distributed hash table to exclude the faulty central control. At the same time, the central control system will check whether all data still meets the requirement of at least three copies.
[0080] The central control system finds the nodes in the network that have data missing due to a faulty central control, resulting in less than three copies of data. The central control holding the missing data pushes the missing data to the nodes that do not have the missing data, thereby re-forming a secure data storage environment.
[0081] In this embodiment, each central control performs data restoration based on the DHT network including:
[0082] In some sites, the original implementation data cannot be brought out due to the high confidentiality level. In the case of subsequent expansion and secondary implementation, the implementation personnel can use the data reading function of the designer to restore the original engineering data from the existing central control on site. For confidential data that cannot be brought out due to the confidentiality level and needs to be implemented again later, read all its data relationship graphs from the confidential central control where the confidential data is located; parse all the data relationship graphs of the confidential central control to obtain all the unique identifiers in the confidential data, and then use the content addressing algorithm in the DHT network to find the central control where the content corresponding to all the unique identifiers of the confidential central control is actually stored;
[0083] The data file is read on the central control where the contents corresponding to all the unique identifiers of the confidential central control are actually stored, and reassembled into the original data file of the confidential central control, and then the integrity of the data file is verified using the data information of the Merkle Tree data structure of the confidential central control.
[0084] The self-recovery of each central control based on the DHT network includes: when an old central control can no longer be used, it will be replaced by a new central control; then the IP of the new central control is configured as the IP of the old central control, and then the new central control is added to the DHT network; after the new central control is added to the DHT network, when the new central control finds that it has no project data but other central controls in the DHT network have project data, it enters the self-recovery mode.
[0085] In this embodiment, the new central control enters the self-recovery mode including:
[0086] The new central control unit that enters the self-recovery mode requests data relationship graphs from other central control units in the DHT network, finds all unique identifiers of the data relationship graphs corresponding to its own IP from the data relationship graphs of other central control units, and stores the data relationship graphs corresponding to its own IP;
[0087] The new central control that enters the self-recovery mode uses all the unique identifiers of the new central control data corresponding to its own IP to search the addresses of all the central control with the corresponding contents of all the unique identifiers of the new central control in the DHT network, and takes all the central control with the corresponding contents of all the unique identifiers of the new central control as the first central control, and performs data synchronization based on the first central control;
[0088] After data synchronization is completed, the new central control system will re-perform data backup and balancing operations with other central control systems in the network to share the storage of some data files with other central control systems, thus reducing the storage pressure on other central control systems.
[0089] Although the various steps in the above embodiment are described in the above-mentioned order, those skilled in the art can understand that in order to achieve the effect of this embodiment, different steps do not have to be executed in such an order. They can be executed simultaneously (in parallel) or in a reverse order. These simple changes are within the scope of protection of the present invention.
[0090] The central control project data restoration and self-recovery system of the second embodiment of the present invention comprises:
[0091] The designer system is used to compile and package the project data into various data packets according to the equipment and interface data used by each central control; split each data packet into several data blocks; each central control has a corresponding data packet; for each data block, use the SHA-256 algorithm to perform hash operations to obtain the hash value of each data block, and the hash value of each data block is the unique identifier of this data block; the hash value of each data block corresponding to each data packet is used as a leaf node, and the leaf nodes corresponding to each data packet constitute a MerkleTree; the data information of each Merkle Tree is assembled into a data relationship graph; each data block and each data relationship graph are sent to each central control;
[0092] The central control system is used to update its own distributed hash table after receiving its corresponding data blocks and data relationship diagram. The distributed hash tables of each central control constitute a DHT network; each central control performs single point failure data backup and transfer, data restoration and self-recovery of the central control based on the DHT network.
[0093] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process and related instructions of the system described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0094] It should be noted that the central control project data restoration and self-recovery system provided in the above embodiment is only illustrated by the division of the above functional modules. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the modules or steps in the embodiments of the present invention can be decomposed or combined. For example, the modules in the above embodiment can be combined into one module, or further divided into multiple sub-modules to complete all or part of the functions described above. The names of the modules and steps involved in the embodiments of the present invention are only for distinguishing the modules or steps, and are not regarded as improper limitations of the present invention.
[0095] An electronic device according to a third embodiment of the present invention includes:
[0096] at least one processor; and
[0097] a memory communicatively connected to at least one of the processors; wherein,
[0098] The memory stores instructions that can be executed by the processor, and the instructions are used to be executed by the processor to implement the above-mentioned central control project data restoration and self-recovery method.
[0099] A fourth embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to be executed by the computer to implement the above-mentioned method for restoring and self-recovering central control project data.
[0100] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process and related instructions of the electronic device and storage medium described above can refer to the corresponding process in the aforementioned method embodiment and will not be repeated here.
[0101] Those skilled in the art should be able to appreciate that the modules and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, computer software or a combination of the two, and the programs corresponding to the software modules and method steps can be placed in random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disks, removable disks, CD-ROMs, or any other form of storage medium known in the technical field. In order to clearly illustrate the interchangeability of electronic hardware and software, the composition and steps of each example have been generally described in the above description according to the function. Whether these functions are performed in electronic hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.
[0102] Reference below Figure 5 , which shows a schematic diagram of the structure of a computer system of a server for implementing the method, system, and device embodiments of the present application. Figure 5 The server 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.
[0103] like Figure 5As shown, the computer system includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 602 or the program loaded from the storage part 608 to the random access memory (RAM) 603. Various programs and data required for system operation are also stored in the RAM 603. The CPU 601, ROM 602 and RAM 603 are connected to each other through a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0104] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed so that a computer program read therefrom is installed into the storage section 608 as needed.
[0105] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the central processing unit (CPU) 601, the above-mentioned functions defined in the method of the present application are executed. It should be noted that the above-mentioned computer-readable medium of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection with one or more conductors, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, an apparatus or a device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in combination with an instruction execution system, an apparatus or a device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0106] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0107] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0108] The terms "first", "second", etc. are used to distinguish similar objects rather than to describe or indicate a particular order or sequence.
[0109] The term "comprise" or any other similar term is intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus / device that includes a list of elements includes not only those elements but also other elements not expressly listed, or also includes elements inherent to such process, method, article, or apparatus / device.
[0110] So far, the technical solutions of the present invention have been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it is easy for those skilled in the art to understand that the protection scope of the present invention is obviously not limited to these specific embodiments. Without departing from the principle of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will fall within the protection scope of the present invention.
Claims
1. A method for restoring and self-recovering central control project data, characterized in that: The method comprises: Compile and package the project data into individual data packets; split each data packet into several data blocks; each central control has its corresponding data packet; For each data block, use the SHA-256 algorithm to perform hash operations to obtain the hash value of each data block. The hash value of each data block is the unique identifier of this data block; The hash values of each data block corresponding to each data packet are used as leaf nodes, and the leaf nodes corresponding to each data packet constitute a Merkle Tree; the data information of each Merkle Tree is assembled into a data relationship graph; Send each data block and each data relationship diagram to each central control; After receiving its corresponding data blocks and data relationship diagram, each central control updates its own distributed hash table. The distributed hash tables of each central control constitute a DHT network; each central control performs single point failure data backup and transfer, data restoration and self-recovery of the central control based on the DHT network.
2. The method for restoring and self-recovering central control project data according to claim 1, characterized in that: Compiling and packaging project data into individual data packages includes: The project data includes material files; when compiling and packaging, for the data except the material files in the project data, the data except the material files are compiled and packaged into data packets corresponding to each central control according to the equipment and interface data used by each central control; for the material files in the project data, the material files are separately summarized to obtain material data packets, and then the material data packets are divided into blocks to obtain various data blocks of the material files. The material files are relatively large and may be reused among multiple central controls, and the material files are separately packaged to reduce the total data packet size.
3. The method for restoring and self-recovering central control project data according to claim 1, characterized in that: Sending each data block and each data relationship diagram to each central control includes: The data blocks and data relationship diagrams of each central control are stored not only on its own central control but also on other central control systems.
4. The method for restoring and self-recovering central control project data according to claim 3 is characterized in that: Sending each data block and each data relationship diagram to each central control also includes: When the number of central control units is less than or equal to 3, any central control unit has the data of all central control units; When the number of central control units is greater than 3, the data of each central control unit is stored not only on itself but also on at least two other central control units.
5. The method for restoring and self-recovering central control project data according to claim 4, characterized in that: The backup transfer of single-point failure data by each central control based on the DHT network includes: When a central control in the DHT network fails and goes offline, the central control except the faulty central control in the DHT network will update the distributed hash table to exclude the faulty central control. At the same time, the central control system will check whether all data still meets the requirement of at least three copies. The central control system finds the nodes in the network that have data missing due to a faulty central control, resulting in less than three copies of data. The central control holding the missing data pushes the missing data to the nodes that do not have the missing data, thereby re-forming a secure data storage environment.
6. The method for restoring and self-recovering central control project data according to claim 5, characterized in that: The data restoration performed by each central control based on the DHT network includes: For confidential data that cannot be taken out due to confidentiality level and needs to be implemented again later, read all its data relationship diagrams from the confidentiality central control where the confidential data is located; Parse all data relationship graphs of the confidential central control to obtain all unique identifiers in the confidentiality, and then use the content addressing algorithm in the DHT network to find the central control where the content corresponding to all unique identifiers of the confidential central control is actually stored; The data file is read on the central control where the contents corresponding to all the unique identifiers of the confidential central control are actually stored, and reassembled into the original data file of the confidential central control, and then the integrity of the data file is verified using the data information of the Merkle Tree data structure of the confidential central control.
7. The method for restoring and self-recovering central control project data according to claim 6, characterized in that: The self-recovery of each central control based on the DHT network includes: When an old central control can no longer be used, it will be replaced with a new one; Then, the IP of the new central control is configured as the IP of the old central control, and then the new central control is added to the DHT network; After the new central control is added to the DHT network, when the new central control finds that it has no project data but other central control in the DHT network has project data, it enters the self-recovery mode.
8. The method for restoring and self-recovering central control project data according to claim 7, characterized in that: After the new central control enters the self-recovery mode, the following steps are included: The new central control unit that enters the self-recovery mode requests data relationship graphs from other central control units in the DHT network, finds all unique identifiers of the data relationship graphs corresponding to its own IP from the data relationship graphs of other central control units, and stores the data relationship graphs corresponding to its own IP; The new central control that enters the self-recovery mode uses all the unique identifiers of the new central control data corresponding to its own IP to search the addresses of all the central control with the corresponding contents of all the unique identifiers of the new central control in the DHT network, and takes all the central control with the corresponding contents of all the unique identifiers of the new central control as the first central control, and performs data synchronization based on all the first central control; After the data synchronization is completed, the new central control unit re-performs a data backup balancing operation with other central control units in the DHT network to share the storage of some data files for other central control units.
9. A central control project data restoration and self-recovery system, characterized in that: The system comprises: The designer system is used to compile and package the project data into various data packets according to the equipment and interface data used by each central control; split each data packet into several data blocks; each central control has a corresponding data packet; for each data block, use the SHA-256 algorithm to perform hash operations to obtain the hash value of each data block, and the hash value of each data block is the unique identifier of this data block; the hash value of each data block corresponding to each data packet is used as a leaf node, and the leaf nodes corresponding to each data packet constitute a Merkle Tree; the data information of each Merkle Tree is assembled into a data relationship diagram; each data block and each data relationship diagram are sent to each central control; The central control system is used to update its own distributed hash table after receiving its corresponding data blocks and data relationship diagram. The distributed hash tables of each central control constitute a DHT network; each central control performs single point failure data backup and transfer, data restoration and self-recovery of the central control based on the DHT network.
10. An electronic device, characterized in that: include: at least one processor; And a memory communicatively connected to at least one of the processors; wherein the memory stores instructions executable by the processor, and the instructions are used to be executed by the processor to implement the central control project data restoration and self-recovery method described in any one of claims 1-8.