Distributed backup, restoration and synchronization method among multiple devices, electronic device and data management system
By adopting multi-device dispersed data backup method in industrial automation applications, using group identifiers and encryption programs, the security and management problems of backup and restore between heterogeneous devices are solved, and efficient data backup between heterogeneous devices is realized With restore and ensure data security in the network.
Patent Information
- Application Number
- CN202310529218.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-11
- Publication Date
- 2024-11-12
AI Technical Summary
In existing industrial automation applications, backup and restore methods lack the protection of heterogeneous devices and data encryption, resulting in the inability to effectively manage and protect the backup and restore mechanism.
Using the method of dispersed data backup between multiple devices, searching for backup service providers by sending query service packets, formulating a backup plan, preparing data blocks and setting shared memory, realizing data backup, restoration and synchronization, combining group identifiers and Encryption programs to ensure the secure transfer of data between heterogeneous devices.
Decentralized backup and restore between heterogeneous devices is realized, the flexibility and data security of the production line are improved, the risk of backup failure is reduced, and the network nodes are effectively used to pass data in trusted or open networks.
Smart Images

Figure CN118939471A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to a backup method and an electronic device and a system for executing the backup method, and in particular to a distributed data backup method, an electronic device and a data backup system for multiple devices. Background Art
[0002] In current industrial automation applications, users need to use specific equipment to back up and restore target devices, i.e. centralized backup and restore. For example, a personal computer can be used to back up and restore a programmable logic controller (PLC), a human machine interface (HMI) to a PLC, or a PLC to a fieldbus device.
[0003] There are two parts to backup and restore: the first part is the communication interface, which allows the two devices to exchange data; the second part is the content, which can be setting parameters, historical records or firmware programs. In practice, users can set the parameters of the inverter through the PLC, or download the program to the PLC through the HMI; however, these two methods generally use different communication interfaces and are limited to specific types of devices.
[0004] In addition, the above methods do not support active backup and restoration in most cases, nor do they have a data encryption protection mechanism, resulting in the backup and restoration mechanism being unable to be effectively managed and protected.
[0005] Therefore, how to provide a backup and restore method and system that can support heterogeneous devices, automation and encryption protection functions is an important issue in the field. Summary of the invention
[0006] The purpose of the present disclosure is to provide a distributed data backup and sharing mechanism between multiple devices, which can realize a mechanism for sharing storage and automatic restoration between different types of devices.
[0007] According to an embodiment of the present disclosure, a data backup method between multiple devices is disclosed, which is used for a local device among the multiple devices. The data backup method includes the following steps: 1) sending a query service packet including a group identifier to at least one of the multiple devices to search for at least one backup service provider; 2) receiving at least one reply packet including the group identifier to formulate a backup plan; 3) preparing a data block and setting a shared memory of at least one backup service provider according to the backup plan to generate a data packet including the group identifier and the data block; and 4) sending the data packet to at least one backup service provider to back up the data block to the shared memory.
[0008] According to an embodiment of the present disclosure, a data restoration method between multiple devices is disclosed, which is used for a local device among the multiple devices. The data restoration method includes the following steps: A1) sending a query service packet including a group identifier to at least one of the multiple devices to search for at least one restoration service provider; A2) receiving at least one reply packet including the group identifier from at least one restoration service provider to formulate a restoration plan; A3) according to the restoration plan, issuing a restoration request to at least one restoration service provider to request to retrieve a data block from a shared memory of at least one restoration service provider; and A4) receiving a data packet including the group identifier and the data block from at least one restoration service provider.
[0009] According to an embodiment of the present disclosure, a data synchronization method between multiple devices is disclosed, which is used for a local device among the multiple devices. The data synchronization method includes the following steps: B1) sending a query service packet including a group identifier to at least one of the multiple devices to search for at least one synchronization service provider; B2) receiving at least one reply packet including the group identifier from at least one synchronization service provider to formulate a synchronization plan; B3) issuing a synchronization request to at least one recovery service provider to request synchronization of a data block from a shared memory of at least one synchronization service provider; and B4) receiving a data packet including the group identifier and the data block from at least one synchronization service provider.
[0010] According to one embodiment of the present disclosure, an electronic device is disclosed, including a memory, a communication module and a processor. The memory is configured to store a program code, wherein a data backup method, a data restoration method and a data synchronization method are compiled into the program code. The communication module is configured to be connected to other devices. The processor is coupled to the memory and the communication module, and is configured to read and execute the program code to perform data backup, restoration and synchronization.
[0011] According to one embodiment of the present disclosure, a data management system is disclosed, including a workstation, multiple upstream devices, and multiple downstream devices. The workstation is used to perform a data backup method, a data restoration method, and a data synchronization method. Multiple upstream devices are connected to the workstation to perform a data backup method, a data restoration method, and a data synchronization method. Multiple downstream devices are connected to multiple upstream devices, and are connected to the workstation through multiple upstream devices to perform a data backup method and a data restoration method. Each of the workstation, multiple upstream devices, and multiple downstream devices has at least one group identifier and a shared memory, and one of the at least one group identifier is a preset group identifier; wherein all devices belonging to the same group have the same group identifier and have access rights to all shared memories of all devices.
[0012] The distributed backup, restoration and synchronization method, electronic device and data management system disclosed in the present invention for multiple devices have the following advantages:
[0013] 1. A local device can search for service providers with the same group identifier in a hierarchical architecture or network topology, and use multiple shared storages to perform data backup, restoration, and synchronization to achieve distributed backup, restoration, synchronization, and deployment.
[0014] 2. Through flexible backup, restore and synchronization plans and encryption procedures, the present disclosure can fully utilize network nodes in a trusted local area network or open network to transmit backup data and protect information security.
[0015] 3. In industrial automation applications, multiple heterogeneous devices on the same production line are grouped in the same group. This allows the grouped backup and restore procedures for heterogeneous devices to be implemented without affecting other production lines, thereby facilitating line changes.
[0016] 4. Continuing from point 3, since heterogeneous devices belonging to the same group can access the backup data of the shared memory of other devices, the computing resources and data throughput of a single device can be dispersed, and the risk of backup failure can be reduced. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 FIG. 4 is a schematic diagram of a hierarchical architecture of distributed backup, restoration, and synchronization according to an embodiment of the present disclosure.
[0018] Figure 2A The present invention is a flowchart of a data backup process performed by a local device according to an embodiment of the present disclosure.
[0019] Figure 2B A packet sequence diagram for data backup according to an embodiment of the present disclosure.
[0020] Figure 3 is a schematic diagram of a packet format according to an embodiment of the present disclosure.
[0021] Figure 4A The present invention is a flowchart of a data restoration process performed by a device according to an embodiment of the present disclosure.
[0022] Figure 4B FIG. 4 is a packet sequence diagram for data restoration according to an embodiment of the present disclosure.
[0023] Figure 5 The present invention is a flowchart of a data synchronization process performed by a device according to an embodiment of the present disclosure.
[0024] Figure 6 is a circuit block diagram of an electronic device according to an embodiment of the present disclosure.
[0025] Description of reference numerals:
[0026] 110a~110d: Inverter
[0027] 112a: AC servo drive
[0028] 120a~120c: Programmable logic controller
[0029] 130a~130b:Human-machine interface
[0030] 132a~132c: shared memory
[0031] 150: Workstation
[0032] 152a~152c: backup data blocks
[0033] G1: Group 1
[0034] G2: The second group
[0035] G3: The third group
[0036] 160: First Equipment
[0037] 170a~170b: Equipment
[0038] 300: Packet
[0039] 310: Operation section
[0040] 320: Core Information
[0041] 322: Operation
[0042] 324: Group identifier
[0043] 326: My Identifier
[0044] 330: Interface Information
[0045] 332: Checksum
[0046] 334: Data size
[0047] 350: Data section
[0048] 360: Data attributes
[0049] 362: Source device identifier
[0050] 364: Data block identifier
[0051] 366: Encryption mark
[0052] 370: Encrypted Information
[0053] 380: Content
[0054] 610: Setting interface
[0055] 620: Processor
[0056] 630: Communication module
[0057] 640: Memory
[0058] 642: Shared memory
[0059] A21~A26, A41~A46, B51~B56, S210~S260, S410~S440: Steps DETAILED DESCRIPTION
[0060] The present disclosure is further described below in conjunction with the accompanying drawings and embodiments so that relevant persons in the technical field to which the present invention belongs can better understand the present invention and implement it accordingly.
[0061] Please refer to Figure 1 , which is a schematic diagram of a hierarchical architecture for distributed backup, restoration, and synchronization according to an embodiment of the present disclosure. In one embodiment, the hierarchical architecture includes multiple electronic devices for industrial control systems, such as variable frequency drivers (VFDs), alternating-current servo drivers (ASDs), programmable logic controllers (PLCs), or human machine interfaces (HMIs). Figure 1 In the embodiment of FIG. 1 , the hierarchical architecture includes a plurality of VFDs 110 a - 110 d , an ASD 112 a , a plurality of PLCs 120 a - 120 c , and a plurality of HMIs 130 a - 130 b .
[0062] In industrial automation, for example, a workstation 150 is configured to set operating parameters of multiple production lines or multiple sites to control HMI 130a-130b, HMI 130a-130b is configured to set operating parameters of one production line or one site to control PLC 120a-120c, and PLC 120a-120c is configured to set motor parameters to control VFD 110a-110d, ASD 112a. In order to implement the above control mechanism, each of these devices includes a communication module, which is connected to other devices through the communication module to exchange packets, thereby forming the Internet of Things (IoT).
[0063] In one embodiment, the communication module is configured to support one or more communication interfaces. For example, the communication interface supported by VFD 110a-110d and ASD 112a is RS-485; the communication interface supported by PLC 120a-120c is RS-485 and Ethernet; the communication interface supported by HMI 130a-130b is Ethernet. Figure 1 As shown, VFD 110a is connected to PLC 120a via RS-485, and PLC 120a is connected to HMI 130a via Ethernet. The communication modules of these devices can perform communication interface conversion to interpret packet information.
[0064] In one embodiment, each of the workstation 150 and the plurality of devices (i.e., the plurality of electronic devices for the industrial control system described above) is provided with a memory, wherein a portion of the memory is configured as a shared memory in a hierarchical architecture. The shared memory can be configured to allow other devices with access rights to read or store data.
[0065] In one embodiment, a group identifier is set for each device. Devices with the same group identifier are recognized by the system as belonging to the same group and have access to the shared memory of all devices in the same group. In another embodiment, a device can be set with multiple group identifiers, and the device will be recognized by the system as belonging to multiple groups at the same time, and has access to the shared memory of devices in multiple groups. Member devices in the same group can back up data to each other, and devices belonging to different groups only play the role of relay devices to assist in data transmission without executing any backup procedures. In one embodiment, a group identifier is set for each data block, and devices with the same group identifier can access data blocks corresponding to the same group identifier. In one embodiment, the device includes an operation interface for providing a user to input one or more group identifiers of the device; for example, the workstation 150, HMI 130a and 130b each include an operation interface for providing a user to input a group identifier and select group members.
[0066] like Figure 1 As shown, the hierarchical devices are set to belong to one to three groups. The first group G1 includes the workstation 150, HMI 130a, PLC 120a-120b and VFD 110a-110c, and is a heterogeneous device group. All devices in the first group G1 belong to a production line or assembly line, so each device in the workstation 150, HMI 130a, PLC 120a-120b and VFD 110a-110c can access the shared memory of other devices in the first group G1 to perform backup and restore procedures.
[0067] Similarly, the second group G2 includes the workstation 150, HMI 130b, PLC 120c, ASD 112a and VFD 110d, and is a heterogeneous device group. All devices in the second group G2 belong to another production line or assembly line, so each device in the workstation 150, HMI 130b, PLC 120c, ASD 112a and VFD 110d can access the shared memory of other devices in the second group G2 to perform backup and restore procedures.
[0068] Grouping multiple heterogeneous devices of the same production line into the same group can implement the grouped backup and restore procedures of heterogeneous devices without affecting other production lines, so as to facilitate line changes. Furthermore, because heterogeneous devices belonging to the same group can access the backup data of the shared memory of other devices, the computing resources and data throughput of a single device can be dispersed, and the risk of backup failure can be reduced. For example, HMI 130b, PLC 120c, ASD 112a and VFD 110d do not need to access backup data from a single workstation 150, which can reduce the computing resources and data throughput of the workstation 150, and can also reduce the risk of backup delay or failure due to busy workstation 150, crash or memory damage. In addition, the data of the device can be divided into multiple data blocks, and each device can determine the backup strategy based on the importance, timestamp or serial number of the data block, without the need to back up all data blocks to the same device.
[0069] The third group G3 includes VFDs 110a to 110d and is a homogeneous device group. Each of the VFDs 110a to 110d can access the shared memory of other devices in the third group G3 to perform backup and restore procedures. Grouping multiple homogeneous devices in the same factory in the same group can implement group backup and restore procedures for homogeneous devices without affecting other heterogeneous devices. Because the hardware specifications and supported communication interfaces of homogeneous devices are quite similar or the same, the speed of connecting to adjacent homogeneous devices to access data is relatively fast, thereby improving the efficiency of the backup procedure. In one embodiment, downstream devices in the same group can back up data to upstream devices to achieve distributed data backup and deployment. Taking the first group G1 as an example, VFD 110a can back up and deploy its own data V1 to the upstream PLC 120a, HMI 130a and workstation 150; PLC 120a can back up and deploy its own data P1 to the upstream HMI 130a and workstation 150; and HMI 130a can back up and deploy its own data H1 to the upstream workstation 150. Taking the second group G2 as an example, ASD 112a can back up and deploy its own data V5 to the upstream PLC 120c, HMI 130b and workstation 150; PLC 120c can back up and deploy its own data P3 to the upstream HMI 130b and workstation 150; and HMI 130b can back up and deploy its own data H2 to the upstream workstation 150.
[0070] In one embodiment, the upstream devices belonging to the same group can access the backup data of the downstream devices to actively perform data backup (i.e., data synchronization) and serve as the data source for restoration. For example, if the VFD 110a backs up the data V1 to the HMI 130a, the workstation 150 can perform backup synchronization at a fixed time every day to access the data V1 stored in the HMI 130a. Therefore, when the VFD 110a needs to be restored, the workstation 150 can serve as the data source.
[0071] In one embodiment, a device of the same level or homogeneity can copy or replace its own data to another device of the same level or homogeneity to achieve distributed data backup and deployment. Taking the first group G1 as an example, the homogeneous PLC 120a can copy or replace its own data P1 to the homogeneous PLC 120b, so that the contents of data P1 and P2 are substantially the same; and the homogeneous VFD110a can copy or replace its own data V1 to the homogeneous VFD110b~110c, so that the contents of data V1, V2, and V3 are substantially the same. From another perspective, assuming that the data V1 of the homogeneous VFD110a is the initial setting data, copying or replacing the initial setting data V1 to the homogeneous VFD110b~110c can achieve data restoration or reset of the homogeneous devices.
[0072] In one embodiment, the operation functions of the upstream device are more numerous and complex than those of the downstream device, so the size of a data block of the upstream device is one or several times the size of a data block of the downstream device. In order to correctly store data in the shared memory, the size or capacity of the storage block in the shared memory of the upstream device is also one or several times the size or capacity of the storage block of the downstream device.
[0073] In one embodiment, the upstream devices of the same group may respectively configure multiple shared memories for multiple downstream branches, and the multiple downstream branches include parts of multiple downstream devices. Taking the first group G1 as an example, the upstream HMI 130a is connected to two downstream branches, one branch includes PLC 120a and VFD 110a-110b, and the other branch includes PLC 120b and VFD110c. The upstream HMI 130a may configure a shared memory 132a for the downstream branch PLC 120a and VFD 110a-110b to store data P1, V1, and V2; the upstream HMI 130a may configure another shared memory 132b for another downstream branch PLC120b and VFD 110c to store data P2 and V3. Taking the second group G2 as an example, the upstream HMI 130b can configure the shared memory 132c for the downstream branch PLC 120c, VFD 110d, ASD 112a to store data P3, V4, V5. The workstation 150 is the most upstream device of the first group G1, the second group G2, and the third group G3, and can configure multiple shared memories for multiple downstream branches to back up the data of all downstream devices. The workstation 150 configures the shared memory 152a for the first group G1, the shared memory 152b for the second group G2, and the shared memory 152c for the third group G3 to back up the data of all downstream devices.
[0074] At Figure 1 , data blocks H1-H2 and P1-P3 filled with slash patterns have the same first data type (e.g., setting parameters), and blank data blocks V1-V5 and unlabeled blank data blocks have the same second data type (e.g., historical data), wherein the contents of data blocks of the same type may be substantially the same or different. It is worth noting that ASD 102a includes data blocks of different data types. When performing a restore or reset operation, ASD 102a may access data blocks from at least one device in the same group according to a data access policy (e.g., data integrity, device priority, etc.) to enhance the flexibility of data access. For example, ASD 102a may access data blocks of different data types from at least one of the workstation 150, HMI 130b, and PLC 120c of the second group G2.
[0075] For further explanation of the backup procedure disclosed herein, please refer to Figure 2A . Figure 2A The present invention is a flowchart of a local device executing a data backup process according to an embodiment of the present disclosure, wherein the data backup process includes the following steps.
[0076] Step A21: Searching for backup service providers based on the group identifier.
[0077] Step A22: Develop a backup plan and determine whether it is feasible. If so, proceed to step A23; if not, return to step A21.
[0078] Step A23: Prepare data blocks and set the shared memory of the backup service provider to generate data packets.
[0079] Step A24: Sending a data packet including the group identifier to the backup service provider.
[0080] Step A25: Determine whether the data backup is successful. If yes, proceed to step A26; if not, return to step A22.
[0081] Step A26: Determine whether the backup plan is completed. If so, end the backup process; if not, return to step A23.
[0082] In step A21, the local device searches for a backup service provider based on a group identifier. Specifically, the local device sends a query service packet including a group identifier to at least one device to search for service providers belonging to the same group. In one embodiment, if the RS-485 communication interface is supported, the local device sends a query service packet to a device (i.e., a potential service provider) by polling. In one embodiment, if the TCP / IP communication protocol of the Ethernet interface is supported, the local device sends a query service packet to multiple devices by broadcasting. In one embodiment, the local device sends a query service packet to at least one device by unicast or multicast. Then, the local device receives at least one reply packet to determine the searched service provider and establish a group device list.
[0083] In step A22, the local device formulates a backup plan and determines whether it is feasible. When there is no service provider or the network status does not allow the backup plan to be infeasible or the packet transmission fails, the local device updates the backup plan to search for the backup service provider again (i.e., return to step A21). In one embodiment, the backup plan includes the data to be backed up and the corresponding shared memory (also called a data pool). In detail, the data to be backed up can be divided into multiple data blocks according to the importance of the data, the data type, the amount of data, the timestamp and the serial number, etc. Then, the local device can set the shared memory corresponding to the data block from the group device list according to the communication interface, the number of hops (hopcount), the device priority, and the memory capacity, that is, select the backup service provider to which the data packet is to be sent. For example, a data block of high importance can be set to multiple shared memories, and the backup service providers are backed up in order from the nearest to the farthest (for example, the order of the number of hops from the local device from small to large) to minimize the risk of backup failure. For example, when multiple backup service providers in the group device list support the TCP / IP communication protocol, the local device can select multiple shared storages for data blocks to formulate a multicast backup plan and perform batch backup to improve backup efficiency.
[0084] In step A23, when the backup plan is feasible, the local device prepares the data blocks and sets the shared memory according to the backup plan to generate a data packet. For example, the local device generates a data packet according to a packet format (such as Figure 3 As shown), each data block is packaged into a data packet.
[0085] In step A24 , the local device sends a data packet including a group identifier to the backup service provider through a communication interface to back up the data blocks to the shared memory.
[0086] In step A25, the local device determines whether the data backup is successful. In one embodiment, when the local device receives a backup confirmation from the service provider, it can be determined that the data backup is successful. On the contrary, when the local device receives a failure message from the service provider or does not receive a backup confirmation within the validity period, the backup plan is re-formulated and determined whether it is feasible (i.e., returning to step A22).
[0087] In step A26, when it is determined that the data has been successfully backed up to the shared storage of the service provider, the local device determines whether the backup plan is completed. When the backup plan is not completed, the local device executes steps A23 to A25 again until the backup plan is completed (for example, a piece of data divided into multiple data blocks is completely backed up). When the backup plan is completed, the local device ends the backup process.
[0088] In one embodiment, in step A23, the data backup method further includes the local device performing an encryption process on the data block to generate a data packet. Therefore, the relay device cannot decrypt the data packet if it does not support the same encryption process. Figure 1 The hierarchical architecture shown is an open network that protects information security by encrypting data blocks.
[0089] In short, through the data backup process disclosed in this disclosure, the local device can Figure 1 In the hierarchical architecture or network topology shown, backup service providers with the same group identifier are searched, and data is backed up to multiple shared storages to achieve distributed backup and deployment. Furthermore, through flexible backup plans and encryption procedures, the present disclosure can fully utilize network nodes in an open network to transmit backup data and protect information security.
[0090] Figure 2B FIG. 1 is a packet sequence diagram for data backup according to an embodiment of the present disclosure. In step S210 , the local device 160 sends a query service packet including a group identifier to at least one of the target devices 170 a and 170 b to search for backup service providers belonging to the same group.
[0091] In step S210, when receiving the inquiry service packet, the devices 170a and 170b determine whether the group identifier in the inquiry service packet is the same as their own group identifier to decide whether to respond to the device 160. Assuming that the device 170a belongs to the first group, the device 170a sends a reply packet to the local device 160 in response to the inquiry service packet. Assuming that the device 170b belongs to the second group, which is different from the first group to which the local device 160 belongs, the device 170b does not send any packet to the local device 160.
[0092] In step S220 , the local device 160 receives a reply packet from the device 170 a , where the reply packet includes a group identifier and a device identifier of the device 170 a .
[0093] In step S230 , the device 160 creates a group device list according to the received reply packet to formulate a backup plan. The group device list includes device identifiers of other devices 170 a that belong to the same group as the local device 160 .
[0094] In step S240, the local device 160 prepares the data block and configures the shared memory according to the backup plan to generate a data packet including the group identifier. In one embodiment, the local device 160 encrypts the data block to generate the data packet.
[0095] In step S250 , the local device 160 sends the data packet including the group identifier to the target device (ie, the device 170 a ) according to the backup plan.
[0096] In step S260, when receiving the data packet, the target device (i.e., device 170a) backs up the data of the data packet in its own shared memory. In one embodiment, device 170a configures the shared memory to store the backup data and the corresponding group identifier; accordingly, device 170a allows data of other devices with the same group identifier to be stored in its own shared memory. In one embodiment, device 170a configures the shared memory to pre-configure the encryption program and encryption key used to store the backup data; accordingly, device 170a can decrypt the backup data to view or use it.
[0097] See also Figure 3 , which is a schematic diagram of a packet format according to an embodiment of the present disclosure. Figure 3 As shown, the format of each data packet 300 sent by the local device includes an operation section 310 and a data section 350. The operation section 310 includes core information 320 and interface information 330, wherein the core information 320 includes fields such as operation 322, group identifier 324 and my identifier 326 (i.e., the device identifier of the local device), and the interface information 330 includes fields such as checksum 332 and data size 334.
[0098] In one embodiment, operation 322 carries information about control operations, such as searching for available space operations, searching for devices operations, storing data operations, or reading data operations. The target device or workstation 150 executes the corresponding instruction after reading operation 322. The contents carried by checksum 332 and data size 334 are used for data required for interface stacking, such as confirming whether data errors occur in packet data due to transmission factors. In one embodiment, since interface information 330 is used to confirm whether packet data has errors due to the transmission process, it is not necessary to store the contents as backup data in the shared memory.
[0099] The data segment 350 includes data attributes 360, encryption information 370, and content 380, among which the data attributes 360 include an owner identifier 362, a data block identifier 364, and an encryption mark 366 (protection indication). The owner identifier 362 is the device identifier of the original data owner; if the original data comes from a local device, then my identifier 326 is equal to the owner identifier 362; conversely, if the local device is a relay device or a service provider, then my identifier 326 is different from the owner identifier 362. Since a complete data can be divided into multiple data blocks, the data block identifier 364 is used to identify different data blocks. For example, when the encryption mark 366 is bit 1, it means that the data is encrypted and protected, and when the encryption mark 366 is bit 0, it means that the data is not encrypted and protected.
[0100] The encryption information 370 carries the preset data of the encryption data and the group shared data, which indicates an encryption procedure. For example, if the devices belonging to the same group have agreed in advance on the encryption and decryption algorithm used by the encryption procedure, the group shared data can be data carrying the public key. The encryption and decryption algorithm can be a symmetric or asymmetric encryption and decryption algorithm.
[0101] Content 380 is used to record data blocks, such as setting parameters, event logs, firmware programs or device data. In a closed or trusted local area network, content 380 is used to record plain text data, and all devices that receive this packet can interpret the content 380 of the packet. In one embodiment, content 380 is used to record encrypted data blocks, and devices with access rights can decrypt according to the encrypted information 370 to view the original data recorded in content 380.
[0102] To further explain the restoration process of this disclosure, please refer to Figure 4A . Figure 4A The present invention is a flowchart of a data restoration process executed by a device according to an embodiment of the present disclosure. The data restoration process includes the following steps.
[0103] Step A41: Search for a restoration service provider based on the group identifier.
[0104] Step A42: Formulate a restoration plan and determine whether it is feasible. If so, proceed to step A43; if not, return to step A41.
[0105] Step A43: Obtain shared memory.
[0106] Step A44: Receive a data packet including a group identifier from the shared memory.
[0107] Step A45: Determine whether the data restoration is successful. If so, proceed to step A46; if not, return to step A42.
[0108] Step A46: Determine whether the restoration plan has been completed. If so, end the restoration process; if not, return to step A43.
[0109] In step A41, the local device searches for a restoration service provider based on the group identifier. Specifically, the local device sends a query service packet including the group identifier to at least one device to search for restoration service providers belonging to the same group. Then, the local device creates a group device list based on the searched restoration service providers.
[0110] In step A42, the local device formulates a restoration plan and determines whether it is feasible. When there is no restoration service provider or the network status does not allow the restoration plan to be infeasible or the packet transmission fails, the local device updates the restoration plan to search for the backup service again (i.e., return to step A41). In one embodiment, the restoration plan includes the data to be restored and the corresponding shared memory (also called a data pool). In detail, according to the importance of the data, the data type, the data volume, the timestamp and the serial number, the data to be restored can be divided into a plurality of data blocks, and each data block can be stored in at least one shared memory. Accordingly, when the data block to be restored has been selected, the local device can select the shared memory corresponding to the data block from the group device list according to the communication interface, the hop count, the device priority, and the data integrity, that is, select which restoration service provider (i.e., the device storing the backup data) to receive the data packet to retrieve the restored data. For example, the local device can specify a shared memory with high data integrity and close communication interface to retrieve the restored data to minimize the risk of restoration failure. For example, when a designated data block has multiple shared memories available for selection, the local device may set the priority of the multiple shared memories to retrieve the designated data block.
[0111] In step A43, when the restoration plan is feasible, the local device obtains the shared storage, for example, the local device sends a restoration request to the service provider to request to retrieve the restoration data from the shared storage of the restoration service provider.
[0112] In step A44 , the local device receives a data packet including a group identifier from the shared memory.
[0113] In step A45, the local device determines whether the data restoration is successful. For example, when the local device receives a data packet from the restoration service provider and can correctly decrypt and interpret it, it can be determined that the data restoration is successful. On the contrary, when the local device receives a failure message from the restoration service provider or does not receive a data packet within the effective period, it will re-formulate a restoration plan and determine whether it is feasible (i.e., return to step A42).
[0114] In step A46, when the restoration plan is not completed, the local device executes steps A43 to A45 again until the restoration plan is completed (for example, a piece of data divided into multiple data blocks is completely restored, or a partially lost data block is retrieved and repaired). When the restoration plan is completed, the local device ends the restoration process.
[0115] In one embodiment, in step A45, the data restoration process further includes decrypting the data packet. The data packet can be decrypted if the local device supports the pre-agreed encryption program and encryption key; that is, if the data packet needs to be transmitted through a relay device, the relay device cannot decrypt the data packet if it does not know the pre-agreed encryption program. Figure 1 The hierarchical architecture shown is an open network that protects information security by encrypting data blocks.
[0116] In short, through the data restoration process disclosed in this disclosure, the local device can Figure 1 In the hierarchical architecture or network topology shown, a recovery service provider with the same group identifier is searched, and data is retrieved from multiple shared storages to achieve distributed recovery. Furthermore, through flexible recovery plans and encryption procedures, the present disclosure can fully utilize network nodes in an open network to transmit recovery data and protect information security.
[0117] Figure 4B FIG4 is a packet sequence diagram for data restoration according to an embodiment of the present disclosure. In step S410, the local device 160 sends a query service packet including a group identifier to at least one device 170a and 170b to search for service providers belonging to the same group. In one embodiment, the query service packet includes an owner identifier and a data block identifier, and accordingly, the service providers belonging to the same group can search for a specified data block in their own shared memory.
[0118] For example, in the backup process, the data packet transmitted by the local device 160 includes the owner identifier 362 and the data block identifier 364. Accordingly, the backup service provider (i.e., the device 170a) stores the backup data, the owner identifier 362 and the data block identifier 364 (or the data segment 350 of the data packet) in the shared memory. In the subsequent restoration process, the restoration service provider (i.e., the device 170a) can use the owner identifier 362 and the data block identifier 364 as indexes for searching the backup data.
[0119] In step S420 , after receiving the service inquiry packet, the device 170 a and the device 170 b search for the backup data stored in their own shared memory according to the owner identifier 362 and the data block identifier 364 , respectively.
[0120] In step S422, when the device 170a determines that the data block stored in the shared memory matches the owner identifier 362 and the data block identifier 364, a reply packet is sent back to the local device 160. In one embodiment, if the backup data is stored in the shared memory in an encrypted state, the device 170a compares the encryption information 370 of the encrypted backup data, such as a hash value, to determine whether to send back a reply packet to the local device 160. On the other hand, when the shared memory of the device 170b does not contain backup data that meets the above conditions, the device 170b does not perform any action.
[0121] In step S424 , when the local device 160 decides to retrieve the backup data from the device 170 a , it sends a request packet to the device 170 a .
[0122] In step S430, in response to the request packet, the device 170a returns a data packet to the local device 160 to return the backup data stored in the shared memory. In one embodiment, the device 170a performs an encryption process on the backup data to generate a data packet. In one embodiment, the backup data is stored in the shared memory in an encrypted state, so the device 170a directly packs the encrypted backup data in the data packet.
[0123] In step S440, the local device 160 uses a preset encryption and decryption algorithm to decrypt the encrypted data of the data packet to restore the backup data. In one embodiment, the local device 160 can use the setting parameters, firmware program or device data of the backup data to perform a machine reset to restore to a previous setting state.
[0124] Figure 5 The present invention is a flowchart of a data synchronization process performed by a device according to an embodiment of the present disclosure. The synchronization process includes the following steps.
[0125] Step B51: Search for synchronization service providers based on the group identifier.
[0126] Step B52: Create a synchronization plan.
[0127] Step B53: Obtain shared memory.
[0128] Step B54: Receive a data packet including a group identifier from the shared memory.
[0129] Step B55: Record the synchronization result.
[0130] Step B56: Determine whether the synchronization plan has been executed. If so, end the synchronization process; if not, return to step B53.
[0131] In step B51, a local device (e.g., one of the upstream devices such as the workstation 150, HMI 130a-130b, and PLC 120a-120c) searches for a synchronization service provider based on the group identifier. Specifically, the local device sends a query service packet including the group identifier to at least one device to search for a synchronization service provider belonging to the same group. In response to the query service packet, the synchronization service provider returns a reply packet including the group identifier 324, the owner identifier 362, and the data block identifier 364.
[0132] In step B52, the local device formulates a synchronization plan according to the response packet sent back by the synchronization service provider. In one embodiment, the synchronization plan includes the data to be synchronized and the corresponding shared memory (also called a data pool).
[0133] In step B53, the local device obtains the shared memory. For example, the local device sends a synchronization request to the synchronization service provider to request synchronization of backup data (eg, newly backed-up data blocks) from the shared memory of the synchronization service provider.
[0134] In step B54 , the local device receives a data packet including a group identifier from the shared memory.
[0135] In step B55, the local device records the synchronization result. When the local device receives the data packet from the service provider and can correctly decrypt and interpret it, the data synchronization can be recorded as successful. On the other hand, when the local device receives a failure message from the synchronization service provider or does not receive a data packet within the valid period, the data synchronization failure can be recorded. In one embodiment, when the synchronization fails after several attempts (e.g., 3 times), the local device performs the next data synchronization of the synchronization plan.
[0136] In step B56, when the synchronization plan has not been fulfilled (gone through), the local device executes steps B53 to B55 again until the synchronization plan is fulfilled (for example, all the new versions of the backup data found have been tried to be synchronized). When the synchronization plan has been fulfilled, the local device ends the synchronization process.
[0137] In short, through the data synchronization process disclosed in the present invention, the upstream device can actively synchronize the backup data to serve as the data source for the downstream device to restore. Figure 1 The workstation 150 and multiple devices shown can form a data management system. Each device and workstation 150 of the data management system can execute the following operations according to user instructions, system schedules and access permissions: Figure 2A , Figure 4A and Figure 5 The process described above is used to realize data backup, restoration and synchronization.
[0138] Please refer to Figure 6 , which is a circuit block diagram of an electronic device according to an embodiment of the present disclosure. Figure 6 The electronic control equipment can be Figure 1 The device includes a setting interface 610, a processor 620, a communication module 630 and a memory 640. In terms of structure, the processor 620 is coupled to the setting interface 610, the communication module 630 and the memory 640.
[0139] like Figure 2A , Figure 4A and Figure 5 The above process can be compiled into program code 644 and stored in memory 640, and processor 620 executes program code 644 to perform data backup, restoration and synchronization. Processor 620 can be, but is not limited to, a central processing unit (CPU), a system on chip (SoC), an application processor, an audio processor, a digital signal processor, or a processing chip or controller with specific functions.
[0140] The setting interface 610 may be a control panel disposed on the device or an interface implemented by a software program, which provides a user with input data or instructions.
[0141] A portion of the memory 640 is configured as a shared memory 642. The shared memory 642 is used to store shared backup data of the local device and other devices. The memory 640 may be, but is not limited to, a random access memory (RAM) or a non-volatile memory (such as a flash memory, a read-only memory (ROM), a hard disk drive (HDD), a solid state drive (SSD) or an optical storage device, etc.).
[0142] The communication module 630 is configured to communicate with other devices to send or receive packets. The communication module 630 can support at least one of the RS-485 communication interface and the Ethernet communication interface (including the IEEE 802.3 communication protocol). In summary, through the data backup, restore and synchronization process disclosed in the present invention, the local device can be Figure 1In the hierarchical architecture or network topology shown, service providers with the same group identifier are searched, and multiple shared storages are used for data backup, restoration, and synchronization to achieve distributed backup, restoration, synchronization, and deployment. Furthermore, through flexible backup, restoration, and synchronization plans and encryption procedures, the present disclosure can fully utilize network nodes in a trusted local area network or an open network to transmit backup data and protect information security.
[0143] The above description is only a preferred specific example of the present disclosure, so all equivalent changes made using the contents of the present disclosure are equally included in the scope of the present disclosure and are hereby stated.
Claims
1. A method for backing up data between multiple devices, used for a local device among the multiple devices, the method comprising: 1) sending a query service packet including a group identifier to at least one of the plurality of devices to search for at least one backup service provider; 2) receiving at least one reply packet including the group identifier to formulate a backup plan; 3) According to the backup plan, prepare a data block and set a shared memory of the at least one backup service provider to generate a data packet including the group identifier and the data block; as well as 4) Sending the data packet to the at least one backup service provider to back up the data block to the shared memory.
2. The data backup method as claimed in claim 1, wherein each of the at least one reply packet further includes a device identifier, and step 2) comprises: 21) Creating a group device list based on the device identifier; 22) dividing a to-be-backed-up data into a plurality of data blocks according to at least one of data importance, data type, data volume, time stamp and serial number; as well as 23) Selecting the shared memory corresponding to the data block from the group device list according to at least one of a communication interface, a jump pass number, a device priority, and a memory capacity.
3. The data backup method as claimed in claim 2, wherein when multiple backup service providers in the group device list have multicast capabilities, after step 2), the method further comprises: Select multiple shared storages for the data block to formulate a multicast backup plan; According to the multicast backup plan, prepare the data block and set the multiple shared memories of the multiple backup service providers to generate the data packet including the group identifier and the data block; as well as The data packet is sent to the plurality of backup service providers to back up the data block to the plurality of shared memories.
4. The data backup method as claimed in claim 2, wherein step 3) comprises: The data block is packaged into the data packet according to a packet format, wherein the packet format includes: An operation section, including: a core information including an operation, the group identifier and a my identifier, wherein the my identifier is a device identifier of the local device; and an interface information including a checksum and a data size; and A data section, including: a data attribute, including an owner identifier, a data block identifier and an encryption tag, wherein the data block identifier is used to identify the data block; 1. Encrypted information; and 1. Content.
5. The data backup method according to claim 4, step 3) further comprising: An encryption process is performed on the data block to generate the data packet, wherein the encryption information indicates the encryption process and the content is the encrypted data block.
6. The data backup method according to claim 1, further comprising: 5) Determine whether the data backup is successful, including: When receiving a backup confirmation receipt from the at least one backup service provider, determining that the data backup is successful; and When a failure message is received from the at least one backup service provider, or the backup confirmation is not received within the validity period, return to step 2); and 6) When it is determined that the data backup is successful, determine whether the backup plan is completed, including: When the backup plan is not completed, executing step 3) to step 5) again until the backup plan is completed; and When the backup plan is completed, the data backup method ends.
7. The data backup method according to claim 1, wherein step 4) further comprises: The data packet is sent to the at least one backup service provider through at least one relay device among the plurality of devices to back up the data block to the shared memory.
8. A method for restoring data between multiple devices, used for a local device among the multiple devices, the method comprising: A1) sending a query service packet including a group identifier to at least one of the plurality of devices to search for at least one restoration service provider; A2) receiving at least one reply packet including the group identifier from the at least one restoration service provider to formulate a restoration plan; A3) issuing a restoration request to the at least one restoration service provider according to the restoration plan, so as to request to retrieve a data block from a shared memory of the at least one restoration service provider; as well as A4) receiving a data packet including the group identifier and the data block from the at least one restoration service provider.
9. The data recovery method as claimed in claim 8, wherein each of the at least one reply packet further includes a device identifier, and step A2) comprises: A21) establishing a group device list according to the device identifier; A22) selecting the data block from a to-be-restored data block including a plurality of data blocks according to at least one of data importance, data type, data volume, time stamp, and serial number; as well as A23) selecting the shared memory corresponding to the data block from the group device list according to at least one of a communication interface, a jump pass number, a device priority, and a memory capacity.
10. The data restoration method of claim 9, wherein when a plurality of restoration service providers in the group device list have multicast capabilities, after step A2), the method further comprises: Selecting a plurality of shared storages for the plurality of data blocks to formulate a multicast restoration plan; According to the multicast restoration plan, issuing a plurality of restoration requests to the plurality of restoration service providers to request to retrieve the plurality of data blocks from the plurality of shared memories of the plurality of restoration service providers; as well as A plurality of data packets including the group identifier and the plurality of data blocks are received from the plurality of restoration service providers.
11. The data restoration method as claimed in claim 8, wherein step A23) comprises: When the group device list has a plurality of shared memories available for selection by the data block, a priority sequence is set for each of the plurality of shared memories.
12. The data restoration method according to claim 8, wherein between step A3) and step A4): When the restoration service provider compares the group identifier with encryption information of the data block and finds that both are correct, the restoration service provider transmits the data packet to the local device; and When the restoration service provider compares the group identifier with one of the encrypted information of the data block and finds that the comparison is incorrect, the restoration service provider sends a failure message to the local device or does not respond.
13. The data restoration method according to claim 12, further comprising: A5) Determine whether the data restoration is successful, including: A51) when the data packet from the restoration service provider is received and can be correctly decrypted and interpreted, it is determined that the data restoration is successful; and A52) when the failure message is received from the restoration service provider, or the data packet is not received within the validity period, return to step A2); and A6) When it is determined that the data restoration is successful, determining whether the restoration plan is completed includes: When the restoration plan has not been completed, executing step A3) to step A5) again until the restoration plan is completed; and When the restoration plan is completed, the data restoration method ends.
14. The data restoration method according to claim 8, step A4) further comprising: The data packet including the group identifier and the data block is received from the at least one restoration service provider through at least one relay device among the plurality of devices.
15. A method for synchronizing data between multiple devices, used for a local device among the multiple devices, the method comprising: B1) sending a query service packet including a group identifier to at least one of the plurality of devices to search for at least one synchronization service provider; B2) receiving at least one reply packet including the group identifier from the at least one synchronization service provider to formulate a synchronization plan; B3) issuing a synchronization request to the at least one synchronization service provider to request synchronization of a data block from a shared memory of the at least one synchronization service provider; as well as B4) receiving a data packet including the group identifier and the data block from the at least one synchronization service provider.
16. The data synchronization method according to claim 15, further comprising: B5) Record the synchronization results, including: B51) when the data packet from the synchronization service provider is received and can be correctly decrypted and interpreted, recording that the data synchronization is successful; and B52) when a failure message is received from the synchronization service provider, or the data packet is not received within the validity period, recording the data synchronization failure; and B6) Determine whether the synchronization plan has been implemented, including: When the synchronization plan has not been fulfilled, executing step B3) to step B5) again until the synchronization plan is fulfilled; and When the synchronization plan has been executed, the data synchronization method ends.
17. The data synchronization method according to claim 15, wherein between step B3) and step B4): When the synchronization service provider compares the group identifier with encryption information of the data block and finds that both are correct, the synchronization service provider transmits the data packet to the local device; and When the synchronization service provider compares the group identifier with one of the encrypted information corresponding to the data block and finds that the two are incorrect, the synchronization service provider sends a failure message to the local device or does not respond.
18. The data synchronization method according to claim 17, step B5) further comprising: B53) when the failure message is received from the synchronization service provider, or the data packet is not received within the valid period, executing steps B3) to B5) to try to synchronize the data block again; as well as B54) When the synchronization fails after one attempt, the next data block synchronization of the synchronization plan is performed.
19. The data synchronization method as claimed in claim 15, wherein step B4) further comprises: The data packet including the group identifier and the data block is received from the at least one synchronization service provider through at least one relay device among the plurality of devices.
20. An electronic device, comprising: a memory configured to store a program code, wherein the data backup method of claim 1, the data restoration method of claim 8, and the data synchronization method of claim 15 are compiled into the program code; a communication module configured to connect to other devices; as well as A processor is coupled to the memory and the communication module and is configured to read and execute the program code to perform data backup, restoration and synchronization.
21. A data management system, comprising: A workstation for performing the data backup method of claim 1, the data restoration method of claim 8, and the data synchronization method of claim 15; A plurality of upstream devices connected to the workstation for performing the data backup method of claim 1, the data restoration method of claim 8, and the data synchronization method of claim 15; as well as A plurality of downstream devices connected to the plurality of upstream devices and connected to the workstation through the plurality of upstream devices, for performing the data backup method of claim 1 and the data restoration method of claim 8; wherein each of the workstation, the plurality of upstream devices, and the plurality of downstream devices has at least one group identifier and a shared memory, and one of the at least one group identifier is a preset group identifier; All devices belonging to the same group have the same group identifier and have access rights to all shared memories of all devices.
22. The data management system of claim 21, wherein The plurality of upstream devices are a homogeneous device, the plurality of downstream devices are another homogeneous device, and the workstation, the plurality of upstream devices, and the plurality of downstream devices are heterogeneous devices; and At least one of the plurality of upstream devices configures a plurality of shared memories to a plurality of downstream branches, the plurality of downstream branches including a portion of the plurality of downstream devices.
