CN112532729B - Data synchronization method and device for edge device and cloud end - Google Patents

Data synchronization method and device for edge device and cloud end Download PDF

Info

Publication number
CN112532729B
CN112532729B CN202011377911.8A CN202011377911A CN112532729B CN 112532729 B CN112532729 B CN 112532729B CN 202011377911 A CN202011377911 A CN 202011377911A CN 112532729 B CN112532729 B CN 112532729B
Authority
CN
China
Prior art keywords
edge
data
shadow
cloud
sub
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011377911.8A
Other languages
Chinese (zh)
Other versions
CN112532729A (en
Inventor
谢敬儒
陆丹峰
赵鑫
陈�胜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202011377911.8A priority Critical patent/CN112532729B/en
Publication of CN112532729A publication Critical patent/CN112532729A/en
Application granted granted Critical
Publication of CN112532729B publication Critical patent/CN112532729B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a data synchronization method for edge equipment, relates to the field of data synchronization, and can be used in the fields of Internet of things, edge calculation and the like. The specific implementation scheme is as follows: acquiring reported data, wherein the reported data comprises data reported to the edge equipment by the edge sub-equipment associated with the edge equipment; updating storage data in an edge shadow based on the acquired reported data, wherein the edge shadow is a data storage model created in the edge device; and periodically reporting the storage data in the edge shadow to a cloud end, so that the cloud end performs data synchronization on the cloud end shadow and/or informs the edge device to perform data synchronization on the edge shadow based on difference data between the storage data and the storage data in the cloud end shadow, wherein the edge shadow is a data storage model created at the cloud end aiming at the edge device and an edge sub-device associated with the edge device.

Description

Data synchronization method and device for edge device and cloud end
Technical Field
The present application relates to the field of data synchronization, and more particularly, to a data synchronization method and apparatus, an electronic device, and a storage medium for an edge device and a cloud.
Background
Conventional edge sub-device management schemes include: directly managing the connection information of the edge sub-equipment connected with the edge gateway or the data uploaded by the edge sub-equipment on the edge gateway; the edge gateway sends the connection information and the data acquired from the edge sub-equipment to a cloud end in real time so that the cloud end can complete data updating; and after receiving the data from the cloud, the edge gateway controls the edge sub-equipment to complete data updating.
In the process of implementing the embodiment of the present application, the inventor finds that the management scheme of the edge sub-device has the following problems: the edge sub-devices are directly managed through the edge gateway, so that a large number of edge sub-devices are inconvenient to manage in a unified mode. The management scheme has high requirement on network stability, and once a weak network or a network disconnection condition occurs, the edge sub-device may be inconsistent with cloud data.
Disclosure of Invention
The application provides a data synchronization method and device for edge equipment, a data synchronization method and device for a cloud end, electronic equipment and a storage medium.
According to a first aspect, there is provided a data synchronization method for an edge device, comprising: acquiring reported data, wherein the reported data comprises data reported to the edge device by the edge sub-device associated with the edge device; updating storage data in an edge shadow based on the acquired reported data, wherein the edge shadow is a data storage model created in the edge device; and periodically reporting the storage data in the edge shadow to a cloud, so that the cloud performs data synchronization on the cloud shadow and/or notifies the edge device to perform data synchronization on the edge shadow based on difference data between the storage data and the storage data in the cloud shadow, wherein the cloud shadow is a data storage model created at the cloud for the edge device and an edge sub-device associated with the edge device.
According to a second aspect, there is provided a data synchronization apparatus for an edge device, comprising: a first obtaining module, configured to obtain reporting data, where the reporting data includes data reported to the edge device by an edge sub device associated with the edge device; the updating module is used for updating the stored data in an edge shadow based on the acquired reported data, wherein the edge shadow is a data storage model established in the edge device; and the uploading module is used for regularly reporting the storage data in the edge shadow to a cloud end, so that the cloud end performs data synchronization on the cloud end shadow and/or informs the edge device of performing data synchronization on the edge shadow based on difference data between the storage data and the storage data in the cloud end shadow, wherein the cloud end shadow is a data storage model created in the cloud end aiming at the edge device and an edge sub-device associated with the edge device.
According to a third aspect, there is provided a data synchronization method for a cloud, including: acquiring first storage data in an edge shadow, wherein the edge shadow is created in an edge device and is used for storing current state information of an edge sub-device associated with the edge device and the currently acquired data of the edge sub-device; comparing the first stored data with second stored data in a cloud shadow, wherein the cloud shadow is created in the cloud and corresponds to the edge shadow, and the cloud shadow is used for storing expected state information of the edge sub-device and data acquired before the edge sub-device; and in response to there being difference data between the first stored data and the second stored data, performing one or more of: performing data synchronization on the cloud shadow; and informing the edge device to perform data synchronization on the edge shadow.
According to a fourth aspect, there is provided a data synchronization apparatus for a cloud, including: a second obtaining module, configured to obtain first stored data in an edge shadow, where the edge shadow is created in an edge device and is used to store current state information of an edge sub-device associated with the edge device and data currently obtained by the edge sub-device; a comparison module, configured to compare the first stored data with second stored data in a cloud shadow, where the cloud shadow is created in the cloud and corresponds to the edge shadow, and the cloud shadow is used to store expected state information of the edge sub-device and data previously acquired by the edge sub-device; and a synchronization module, configured to, in response to difference data existing between the first stored data and the second stored data, perform one or more of: performing data synchronization on the cloud shadow; and informing the edge device to perform data synchronization on the edge shadow.
According to a fifth aspect, there is provided an electronic device comprising: at least one processor; and a memory communicatively coupled to the at least one processor; the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method of the embodiment of the present application.
According to a sixth aspect, there is provided a non-transitory computer readable storage medium having computer instructions stored thereon, comprising: the computer instructions are used for causing the computer to execute the method of the embodiment of the application.
According to the technical scheme provided by the embodiment of the application, the edge shadow is created on the edge device and used for storing the current connection state information and the current running state information of the edge sub device and the data currently acquired and reported by the edge sub device, meanwhile, the cloud end creation node is used as the mapping object of the edge device and used for creating the mapping object of the edge sub device associated with the edge device, meanwhile, the cloud end shadow is created in the node and used for storing the expected connection state information and the expected running state information of the edge sub device and the data acquired and reported by the edge sub device, therefore, the data synchronization between the edge sub device and the cloud end is converted into the data synchronization between the edge shadow and the cloud end shadow, the data synchronization between the two shadows is carried out through a report/destination mechanism, the network stability is not required to be high, and the final consistency of the edge sub device and the cloud end data can be realized even if the network is unstable.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present application, nor do they limit the scope of the present application. Other features of the present application will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not intended to limit the present application. Wherein:
fig. 1 illustrates a system architecture of a data synchronization method and apparatus for an edge device and a cloud according to an embodiment of the present application;
FIG. 2 illustrates a flow chart of a data synchronization method for an edge device according to an embodiment of the present application;
FIG. 3 illustrates a shadow mechanism based edge cloud data synchronization diagram according to an embodiment of the present application;
FIG. 4 illustrates a flow diagram of edge cloud data synchronization according to an embodiment of the present application;
fig. 5 is a flowchart illustrating a data synchronization method for a cloud according to an embodiment of the present application;
FIG. 6 is a block diagram illustrating a data synchronization apparatus for an edge device according to an embodiment of the application;
fig. 7 is a block diagram illustrating an example of a data synchronization apparatus for a cloud according to an embodiment of the present disclosure; and
fig. 8 is a block diagram illustrating an electronic device for implementing a data synchronization method for an edge device (or cloud end) according to an embodiment of the present disclosure.
Detailed Description
The following description of the exemplary embodiments of the present application, taken in conjunction with the accompanying drawings, includes various details of the embodiments of the application to assist in understanding, which are to be considered exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
In a conventional edge sub-device management scheme, an edge gateway needs to directly manage connection information of an edge sub-device connected to the edge gateway or data uploaded by the edge sub-device. Specifically, the edge gateway needs to upload connection information between the edge gateway and the edge sub-device and data acquired from the edge sub-device to the cloud in real time, so that the cloud completes data updating, and the cloud controls the edge sub-device after sending the control to the edge gateway and then controlling the edge sub-device by the edge gateway to complete data updating. The scheme is inconvenient for uniformly managing a large number of edge sub-devices, has high requirement on network stability, and may cause inconsistency between the edge sub-devices and cloud data once a weak network or a network disconnection occurs. For example, the cloud end has modified the on-off state of a certain edge sub-device into the on-off state, and when network abnormal conditions such as network disconnection or network jitter occur in the process of sending the data to the edge device, the data may not be sent to the edge device, so that the edge device cannot control the edge sub-device to turn on the on-off state. In this case, the cloud displays that the edge sub-device is already in the switch-on state, and actually, the edge sub-device end is still in the switch-off state, so that the cloud and the edge sub-device are inconsistent in data.
In view of the above, an embodiment of the present application provides an improved data synchronization method for an edge device and a cloud, that is, a method for managing an edge sub-device based on a shadow. The method converts the data synchronization between the cloud and the edge sub-device into the data synchronization between the cloud shadow and the edge shadow, and can overcome the defects in the traditional scheme.
It should be appreciated that in the case where the non-direct edge kid device is managed by an edge device (e.g., an edge gateway), the edge kid device needs to synchronize data with the cloud. However, when the edge device is connected with the cloud, problems of unstable connection or network disconnection exist, so that the edge sub-device fails to report data to the cloud or to synchronize data to the edge sub-device, and the edge sub-device and the cloud data are inconsistent.
By using a report/default mechanism based on a cloud shadow and an edge shadow, connection state information and running state information of edge sub-devices managed by the edge devices and other data (such as environment temperature and other information acquired by the edge sub-devices) acquired from the edge sub-devices can be stored in the edge shadow, and the edge shadow is changed when the edge sub-devices upload data to the edge devices; meanwhile, a corresponding cloud shadow is created in the cloud, and the cloud shadow is changed by changing the connection state or the running state of the edge sub-device through the cloud (for example, controlling the switch of the edge sub-device to be turned off). Therefore, in the embodiment of the present application, data synchronization between the edge child device and the cloud may be abstracted as data synchronization between the edge shadow and the cloud shadow.
In the embodiment of the application, after the storage data in the cloud shadow is changed, the edge device can be notified to update the edge shadow, and then the edge device notifies the edge sub-device managed by the edge device to update the data. The edge device may synchronize the stored data in the edge shadow to the cloud periodically, so that the cloud can update the cloud shadow based on some changed data (such as the current temperature obtained by the edge child device). Therefore, the port/destination mechanism based on the shadow can ensure that the data of the edge sub-device end and the cloud data are consistent finally while realizing the autonomy of the edge device and the edge sub-device.
The present application will be described in detail below with reference to specific examples.
A system architecture of the method and apparatus for a data synchronization method for an edge device suitable for the embodiments of the present application is described as follows.
Fig. 1 illustrates a system architecture of a method and apparatus for a data synchronization method for an edge device suitable for an embodiment of the present application. It should be noted that fig. 1 is only an example of a system architecture to which the embodiments of the present application may be applied to help those skilled in the art understand the technical content of the present application, but does not mean that the embodiments of the present application may not be used in other environments or scenarios.
As shown in fig. 1, the system architecture 100 may include an edge gateway 101, edge sub-devices 102, 103, and 104 managed by the edge gateway 101, and a cloud server 105 (cloud end). In this embodiment, the edge gateway 101 and the edge sub-devices 102, 103, and 104 may be connected through the internet of things, and the edge gateway 101 and the cloud server 105 may be connected through the internet.
An edge shadow may be created in the edge gateway 101 to store, as a data storage model, current connection status information of the edge sub-devices 102, 103, and 104 and data acquired from the edge sub-devices 102, 103, and 104 (including current operation status information of the edge sub-devices 102, 103, and 104 and data currently acquired and uploaded by the edge sub-devices 102, 103, and 104 (e.g., data such as ambient temperature currently acquired and uploaded by the edge sub-device 102)).
Similarly, a cloud shadow corresponding to the edge shadow may be created at the cloud server 105, and used as a data storage model to store the expected connection state information and the expected operation state information of the edge sub-devices 102, 103, and 104 and data previously acquired and uploaded by the edge sub-devices 102, 103, and 104 (e.g., data such as the ambient temperature previously acquired and uploaded by the edge sub-device 102).
After the connection state information and/or the operation state information of any edge sub-device managed by the edge gateway 101 and/or other acquired and uploaded data are changed, edge shadow change is caused; similarly, changing the connection state and/or the operation state of any edge sub-device at the cloud server 105 also causes a cloud shadow change. And after the storage data in the cloud shadow is changed, the edge gateway 101 may be notified to update the edge shadow, and then the edge gateway 101 notifies the corresponding edge sub-device managed by the edge gateway to perform data update. The edge gateway 101 may then synchronize the stored data in the edge shadow to the cloud server 105 periodically, so that the cloud server 105 can update the cloud shadow based on some changed data (such as information of the current temperature acquired by the edge child device). Therefore, the shadow-based report/default mechanism can implement autonomy of the edge gateway 101 and the edge sub-devices 102, 103, and 104, and can ensure that the data consistency between the edge sub-devices 102, 103, and 104 and the cloud server 105 is finally achieved.
It should be understood that the number of edge gateways, edge sub-devices, cloud servers in fig. 1 is merely illustrative. Any number of edge gateways, edge sub-devices, cloud servers may be present, as desired for implementation.
An application scenario of the method and the apparatus for the data synchronization method for the edge device according to the embodiment of the present application is described as follows.
It should be noted that the data synchronization scheme provided in the embodiment of the present application may be used in the scenarios such as the internet of things, edge computing, edge sub-device management, and the like, and the embodiment of the present application is not limited herein.
According to an embodiment of the present application, a method for a data synchronization method of an edge device is provided.
Fig. 2 illustrates a flowchart of a data synchronization method for an edge device according to an embodiment of the present application.
As shown in fig. 2, the method 200 may include operations S210 to S230.
In operation S210, report data is obtained, where the report data includes data reported to the edge device by the edge sub device associated with the edge device.
In operation S220, the storage data in the edge shadow is updated based on the obtained reported data, where the edge shadow is a data storage model created in the edge device.
In operation S230, the storage data in the edge shadow is periodically reported to the cloud, so that the cloud performs data synchronization on the cloud shadow and/or notifies the edge device to perform data synchronization on the edge shadow based on difference data between the storage data and the storage data in the cloud shadow, where the cloud shadow is a data storage model created at the cloud for the edge device and an edge sub-device associated with the edge device.
In the embodiment of the present application, a data storage model, that is, an edge shadow, may be created at the edge device side. In one embodiment, the edge sub-device may report the running state information of the edge sub-device and the acquired related data to the edge device managing the edge sub-device periodically or in real time. After the edge device acquires data from the edge sub device managed by the edge device, the stored data in the edge shadow is directly updated, or whether a difference exists between the acquired data and the related data stored in the edge shadow is compared, the difference exists between the acquired data and the related data in the edge shadow is determined by responding to the comparison, and then the stored data in the edge shadow is updated based on the data acquired from the edge sub device.
In addition, in this embodiment of the application, a node (node) may be further created at the cloud end to serve as a mapping object of an edge device, and since the edge device may manage one or more edge sub devices at the same time, the cloud end may also manage a connection state and an operation state of the edge sub device(s), and therefore, a corresponding sub-node may also be created at the cloud end, that is, one or more sub-nodes may be created to serve as a mapping object of at least one edge sub device associated with the edge device. Where each child node corresponds to an edge child device. And simultaneously, a cloud shadow corresponding to the edge shadow created in the edge device can be created in the node, and the cloud shadow is used for storing expected connection state information and expected running state information of the edge sub-device and data acquired and reported by the edge sub-device. The user can change the connection relation between the edge sub-equipment and the edge equipment through the cloud end, and/or change the running state of the edge sub-equipment. After the user changes the information through the cloud, the stored data in the cloud shadow is changed.
It should be understood that, in the embodiment of the present application, each child node may include two parts of data, one part of the data is related to the connection state between the edge child device and the edge device and related to the operation state of the edge child device, and the other part of the data is related to the data acquired by the edge child device itself. A plurality of child nodes of the cloud are associated with the same node and are managed in a unified mode by the node, and a plurality of corresponding edge child devices are associated with the same edge device and are managed in a unified mode by the edge device.
In the embodiment of the application, shadows can be used as storage models of data in both the cloud and the edge device. Information such as control (for example, control of a connection state, a running state and the like) of child nodes (namely edge child devices) through the cloud can be stored in a cloud shadow. Correspondingly, the connection state and the running state of the edge sub-device can be managed by the edge shadow.
Specifically, the connection state information and the running state information of the multiple pieces of sub-equipment can be stored in the cloud shadow in advance, and after the edge equipment is initialized and connected to the cloud, the edge shadow can synchronously acquire the connection state information and the running state information of the edge sub-equipment stored in the cloud shadow. The edge device can establish connection with the corresponding edge sub-device through the synchronously acquired connection state information, and meanwhile, the edge device can inform the edge sub-device of updating the operation state through the synchronously acquired operation state information. Then, the edge sub-device may send data (e.g., collected ambient temperature information) acquired by itself to the edge device, and save the data in the edge shadow. The edge device may report the stored data in the edge shadow to the cloud periodically to update the edge sub-device data (i.e., the data acquired and reported by the edge sub-device) in the cloud shadow, which is a report process. When the connection state information or the running state information of the edge sub-device managed by the cloud needs to be changed, the corresponding data in the cloud shadow can be changed. After the cloud monitors that data in the cloud shadow is changed, the cloud can notify the edge device, and the latest connection state information and the latest running state information are synchronized into the edge shadow, which is a destination process. The edge device may reconnect the corresponding edge sub-device using the updated connection state information in the edge shadow and synchronize the latest running state information to the edge sub-device to inform it to update its running state based on the latest running state information.
Through the embodiment of the application, the shadow-based report/destination process does not require real-time connection between the edge device and the cloud, so that the network is stable and unstable, and the influence on data synchronization between the edge sub-device and the cloud is not large. Even in weak network or broken network environments, the edge kid device can send the data it has acquired last to the edge gateway and save in the edge shadow. The cloud end does not require that the edge sub-device is connected to the cloud end in real time when the data of the sub-nodes are changed (including changes of the running state and the connection state), the cloud end can save the modification of the sub-nodes in the cloud end shadow, after the edge device is connected with the cloud end in a network mode, the latest data change in the edge shadow can be periodically synchronized into the cloud end shadow, the latest data change in the cloud end shadow can also be updated into the edge shadow in a synchronous or asynchronous mode, and then the latest data change is applied to the edge sub-device. Therefore, the data consistency between the edge sub-equipment and the cloud end can be finally achieved while the autonomy of the edge equipment is realized.
It should be understood that, in the embodiment of the present application, the edge device autonomy refers to handing the edge sub-device over to the edge device for management, and may store, in an edge shadow, relevant data currently acquired by the edge sub-device, current connection state information of the edge sub-device, current running state information, and the like, so as to solve a data synchronization problem in an internet of things weak network environment, and further achieve an objective of the edge device autonomy.
As an alternative embodiment, the method may further comprise: in response to the cloud notifying the edge device of data synchronization to the edge shadow, performing one or more of the following operations based on the difference data:
the connection status between the edge device and the associated edge sub-device is updated.
And updating the running state of the edge sub-equipment with changed running state in the edge sub-equipment associated with the edge equipment.
In this embodiment of the application, the edge device may upload the storage data in the edge shadow to the cloud periodically. And the cloud acquires the data uploaded by the edge device and then compares the data with the stored data in the cloud shadow. In response to determining that there is a difference in the stored data in the two shadows (i.e., the edge shadow and the cloud shadow) through the comparison, further determining whether to perform a data update operation on the cloud shadow based on the difference, and determining whether to notify the edge device to perform the data update operation on the edge shadow.
Specifically, when the difference data between the two shadows includes change data which is acquired and uploaded by the edge sub-device itself and is unrelated to both the running state and the connection state, it is determined that a data updating operation is performed on the cloud shadow, and otherwise, it is determined that the data updating operation is not performed on the cloud shadow. And in the event that the difference data between the two shadows contains change data regarding the operational and connection states of the edge sub-device, determining to notify the edge device to perform a data update operation on the edge shadow.
In response to the cloud notifying the edge device to perform a data update operation on the edge shadow, the edge device may perform the following operations in addition to updating the edge shadow based on the state update data (including the connection state change data and the running state change data) included in the difference data: when the state update data includes connection state change data, updating connection states between the edge device and all the associated edge sub-devices based on the connection state change data, or updating connection states between the edge sub-devices of which the connection states are changed and the edge device; when the state update data includes operation state change data, the operation state of the edge sub-device whose operation state has changed among the edge sub-devices associated with the edge device is updated.
Through the embodiment of the application, the data consistency between the edge sub-equipment and the cloud end can be finally realized.
As an alternative embodiment, in the case that the difference data includes the connection state information, it indicates that there is a case that the current connection state of the edge sub-device is inconsistent with the expected connection state, that is, the user modifies the connection state between one or some edge sub-devices and the edge device through the cloud, so that in this case, the connection state between the edge sub-device and the edge device with the changed connection state with the edge device can be updated.
According to the embodiment of the application, the connection state of the edge sub-equipment with the changed connection state is updated, and the connection state of all the edge sub-equipment is not updated, so that the data synchronization efficiency can be improved.
As an optional embodiment, in the case that the difference data includes the operation state information, it indicates that there is a case that the current operation state of the edge sub-device is inconsistent with the expected operation state, that is, the user modifies the operation state of one or some edge sub-devices through the cloud, so that in this case, the operation state of the edge sub-device with a changed operation state may be updated.
According to the embodiment of the application, the running state of the edge sub-equipment with the changed running state is updated, not all the edge sub-equipment, and the data synchronization can be accurately and efficiently performed.
As an alternative embodiment, the method may further comprise: in response to the cloud notifying the edge device to perform data synchronization on the edge shadow, obtaining stored data in the cloud shadow and performing one or more of the following operations based on difference data between the obtained stored data and the stored data in the edge shadow:
the connection status between the edge device and the associated edge sub-device is updated.
And updating the running state of the edge sub-equipment with changed running state in the edge sub-equipment associated with the edge equipment.
As an alternative embodiment, the method may further comprise: the stored data in the edge shadow is updated based on the connection status between the edge device and its associated edge child device.
In the embodiment of the present application, after a connection is established or disconnected between an edge device and an edge sub-device managed by the edge device, storage data in an edge shadow may be updated synchronously, and specifically, data related to a connection state in the edge shadow may be updated synchronously.
According to the embodiment of the application, the storage data in the edge shadow is updated based on the connection state between the edge device and the edge sub-device related to the edge device, and after data synchronization is performed on the cloud based on the update, the mapping object, namely the sub-node, of the newly connected edge sub-device can be created in the cloud in time, so that a user can manage all the edge sub-devices through the cloud.
As shown in fig. 3, the shadow mechanism-based edge cloud data synchronization principle is as follows. The edge side comprises an edge gateway and edge sub-devices 1 to 3 connected with the edge gateway, wherein an edge shadow is created in the edge gateway and is used for the edge gateway to manage relevant data of the edge sub-devices 1 to 3. And a node and sub-nodes sub-1 to sub-3 bound with the node are created in the cloud aiming at the edge gateway, and a cloud shadow is created in the node. The node is the mapping of the edge gateway on the cloud, the cloud shadow is the mapping of the edge shadow on the cloud, and the sub-node1 to the sub-node3 are the mapping of the edge sub-device 1 to the edge sub-device 3 on the cloud respectively. The cloud shadow is used for cloud management of relevant data of the edge sub-devices 1 to 3. Specifically, as shown in fig. 3, in the report process, the edge gateway may report the storage data in the edge shadow to the cloud periodically, so that the cloud updates the cloud shadow. In the destination process, the cloud end can send the storage data in the cloud end shadow to the edge gateway in a synchronous or asynchronous mode when the data reported by the edge gateway are sent, so as to inform the edge gateway to update the edge shadow, wherein after the edge gateway updates the edge shadow, the edge gateway can inform the corresponding edge sub-device to synchronously update the connection state or the running state. Therefore, the shadow-based report/destination mechanism can finally realize data synchronization between the cloud and the edge sub-device even if the network is unstable.
As shown in fig. 4, the complete flow of implementing edge child device management by the shadow-based report/default mechanism may be as follows:
in operation S410, an edge gateway is modeled on the cloud, and a node is created as a mapping object of the corresponding edge gateway in the cloud, where the node includes a cloud shadow for managing data that needs to be synchronized by the edge gateway.
In operation S420, the edge gateway is initialized, an edge shadow is created for the edge gateway, the edge shadow corresponds to the cloud shadow, and a connection channel is established with the cloud.
In operation S430, the edge sub-device is connected to the edge gateway, and a sub-node is created in the cloud as a mapping object of the edge sub-device in the cloud, and the sub-node is associated with a node corresponding to the edge gateway.
In operation S440, the edge gateway obtains relevant data of each sub-node stored in the cloud shadow, and establishes a connection with a corresponding edge sub-device based on connection state information therein.
In operation S450, after the edge sub-device is connected to the edge gateway, the edge sub-device may send the collected data and the running state information thereof to the edge gateway, and the edge gateway may compare the received data and information with the data stored in the edge shadow, and update only the changed data.
In operation S460, the edge gateway may report the data in the edge shadow to the cloud periodically, and after the related data information of the connection or running state of the child node sub-node in the cloud shadow is changed, obtain the latest data in the cloud shadow in a synchronous (obtained immediately when the edge gateway reports the data) or asynchronous (obtained after the edge gateway reports the data) manner, and update the data in the edge shadow.
In operation S470, the edge gateway may update the connection using the latest edge sub-device data in the edge shadow, and notify the edge sub-devices of the relevant data with status change in each edge sub-device, so that the edge gateway updates the relevant data.
It should be noted that, when a node is newly created in the cloud in operation S410, a cloud shadow may be created at the same time as the data management model. The storage mode of the cloud shadow may include, but is not limited to, mySQL, SQLite, oracle, SQLServer, etcd, and the like.
Further, in operation S420, when the edge gateway is initialized, an edge shadow is created at the edge gateway, and is used as a unified management model for the edge sub-device data, and meanwhile, the edge gateway autonomy is implemented. The storage mode can include but is not limited to SQLite, etcd, mySQL, boltDB, etc.
Further, there may be a plurality of ways for the edge sub-device to connect with the edge gateway in operation S430, using a plurality of different protocols, which may include, but are not limited to, MQTT, modbus, OPC, bluetooth, etc. The sub-node and node association created by the cloud can be realized by configuring a node id for the sub-node, can also be realized by using the same label, and can be realized by binding the node and the sub-node with each other when the node and the sub-node have the same label.
Further, in operation S440, the edge gateway may periodically send the data in the edge shadow to the cloud for updating, and the used protocol may include, but is not limited to, HTTP, HTTPs, GRPC, MQTT, websocket, QUIC, and the like. The synchronization data includes the identifier of the edge sub-device, the connection information of the relevant protocol, the report data of the edge sub-device, and the like.
Further, in operation S450, after the edge gateway collects the relevant data of the edge sub-device through various protocols, the edge shadow may be updated by using a uniform data update interface, and the update mode may include, but is not limited to, MQTT, AMQP, GRPC, HTTP, and the like.
Further, after the edge shadow is reported to the cloud in operation S460, the cloud may compare the edge shadow with the cloud shadow, and if the data is found to be changed, the edge gateway may be notified in a synchronous or asynchronous manner. Synchronization informs the edge gateway while the edge gateway reports data. And the asynchronous mode does not depend on whether the edge gateway reports data or not, and after the cloud shadow is changed, the cloud actively informs the edge gateway to update the edge shadow.
Further, in operation S470, after receiving the shadow data change notification from the cloud, the edge gateway may compare the data in the cloud shadow with the data in the edge shadow, and if the data of the edge child device is found to change, notify the edge child device to update the corresponding data through the existing connection channel between the edge gateway and the edge child device, thereby ensuring that the data in the edge child device and the data in the cloud child node sub-node have consistency.
According to an embodiment of the application, a method for a data synchronization method for a cloud is provided.
Fig. 5 is a flowchart illustrating a data synchronization method for a cloud according to an embodiment of the present application.
As shown in fig. 5, the method 500 may include operations S510 to S530.
In operation S510, first stored data in an edge shadow is obtained, where the edge shadow is created in an edge device and is used to store current state information of an edge sub-device associated with the edge device and data currently obtained by the edge sub-device.
In operation S520, the first stored data is compared with second stored data in a cloud shadow, where the cloud shadow is created in a cloud and corresponds to an edge shadow, and the cloud shadow is used to store expected state information of the edge sub-device and data previously acquired by the edge sub-device.
In operation S530, in response to there being difference data between the first storage data and the second storage data, one or more of the following are performed: carrying out data synchronization on the cloud shadow; and informing the edge device to perform data synchronization on the edge shadow.
It should be noted that the current status information includes current connection status information and current operation status information of the edge sub-device. The expected state information includes connection state information and running state information of the edge sub-device changed through the cloud. For example, a certain edge sub-device is currently in a switch-on state, if the state of the user is modified to be the switch-off state in the cloud, the switch-off state is the expected running state, and the switch state of the edge sub-device can be updated to be the switch-off state based on the information.
It should be understood that, in the embodiment of the present application, each operation step in the data synchronization method for the cloud and each operation step in the data synchronization method for the edge device are the same or similar, and are not described herein again.
Through the embodiment of the application, the shadow-based report/destination process does not require real-time connection between the edge device and the cloud, so that the network is stable and unstable, and the influence on data synchronization between the edge device and the cloud is not large. Even in weak network or broken network environments, the edge kid device can send the data it has acquired last to the edge gateway and save in the edge shadow. The cloud side does not require that the edge sub-device is connected to the cloud side in real time when changing the sub-node data (including changes of the running state and the connection state, and the like), the cloud side can save the modification of the sub-node data in the cloud side in a cloud side shadow, after the edge device is connected with the cloud side in a network, the latest data change in the edge shadow can be periodically synchronized to the cloud side shadow, the latest data change in the cloud side shadow can also be updated to the edge shadow in a synchronous or asynchronous mode, and then the latest data change is applied to the edge sub-device. Therefore, the data consistency between the edge sub-equipment and the cloud end can be finally achieved while the autonomy of the edge equipment is realized.
As an alternative embodiment, the method may further include the following operations. And creating a node of a mapping object representing the edge device at the cloud end. And creating child nodes of the mapping objects for representing the edge child devices at the cloud end. A cloud shadow is created within a node. And managing the edge device and the edge sub-device through the nodes at the cloud. And managing the edge sub-equipment through the sub-nodes in the cloud. It should be understood that, in the embodiment of the present application, each operation step in the data synchronization method for the cloud is the same as or similar to each operation step in the data synchronization method for the edge device, and details of the embodiment of the present application are not repeated herein.
As an alternative embodiment, the edge device may be notified of data synchronization to the edge shadow by performing at least one of the following operations: sending the second storage data to the edge device; sending the expected state information to the edge device; the difference data is sent to the edge device.
In an embodiment of the present application, all data stored in the cloud shadow may be sent to the edge device, and the edge device updates data related to the connection status and the running status in the edge shadow by comparing differences between the data in the edge shadow and the data in the cloud shadow. This approach requires the edge device to compare the data difference between the two shadows, and thus data synchronization is inefficient.
Alternatively, in another embodiment of the present application, all information related to the expected status (including, but not limited to, expected connection status information, expected running status information, and the like) stored in the cloud shadow may be sent to the edge device, and the edge device may change all information whose current status information is different from the expected status information by comparing the difference between the current status information in the edge shadow and the expected status information in the cloud shadow to the corresponding expected status information. This approach requires the edge device to compare the difference between the expected state information in the two shadows, somewhat more efficiently than the previous approach, but the data synchronization efficiency is also compromised because the comparison operation still needs to be performed.
Or, in another embodiment of the present application, all information different from the corresponding current state information in the expected state information stored in the cloud shadow may be sent to the edge device, and the edge device updates all the received expected state information to the edge shadow. This approach does not require comparing data differences between two shadows and thus data synchronization is most efficient compared to the first two approaches.
As an alternative embodiment, in the case that the difference data includes difference data between currently acquired data and previously acquired data, the cloud shadow is subjected to data synchronization. For example, the previous acquired ambient temperature of a certain edge sub-device is 18 ℃, and the current acquired ambient temperature is 20 ℃, which indicates that there is a difference between the current acquired data of the edge sub-device and the previous acquired data thereof, and thus it is necessary to perform data synchronization on the cloud shadow, specifically, the current acquired ambient temperature of 20 ℃ may be used to be updated in the cloud shadow in an overlay manner.
Through the embodiment of the application, the cloud and the edge sub-equipment can finally keep data synchronization.
As an optional embodiment, the data synchronization of the cloud shadow may include at least one of the following: updating the currently acquired data to a cloud shadow; and updating difference data of the currently acquired data relative to the previously acquired data into a cloud shadow.
In one embodiment of the present application, all of the parts related to the "currently acquired data" of the edge child device in the edge shadow may be updated as the latest acquired data into the cloud shadow. This approach does not need to screen out the difference between the two shadows related to the "data acquired by the edge sub-device", but the "data acquired by the edge sub-device" needs to be updated in full, which also affects the efficiency of data synchronization.
Alternatively, in another embodiment of the present application, a portion of the edge shadow relating to "currently acquired data" of the edge child device may be compared with a portion of the cloud shadow relating to "previously acquired data" of the edge child device, and the difference data between the edge shadow and the cloud shadow may be updated into the cloud shadow. This approach does not require a full update of the "data acquired by the edge child device", but the difference between the two shadows related to the "data acquired by the edge child device" needs to be filtered out, which also affects the efficiency of data synchronization.
It should be understood that, in the embodiment of the present application, a node (node) created in the cloud may manage a corresponding edge gateway and all edge sub-devices managed by the edge gateway as a control plane. The edge gateway can be used as a management center of edge sub-equipment to manage various edge sub-equipment and communicate with a cloud. Each sub-node (sub-node) created in the cloud can be used as a control surface of each corresponding edge sub-device in the cloud, and stores expected state information and expected running state information of the corresponding edge sub-device, so that data updating is performed on the edge sub-device through a destination process. The edge sub-equipment is not directly connected to the cloud, but reports data to the edge equipment which actually manages the edge sub-equipment after completing various functions, and then reports the data to the cloud again by the edge equipment in the mode of edge shadow data. The cloud shadow is a storage model of data managed by the edge gateway at the cloud end, and the edge shadow is a storage model of the data managed by the edge gateway at the edge side.
According to an embodiment of the present application, there is also provided an apparatus for data synchronization of an edge device.
Fig. 6 is a block diagram illustrating an example of a data synchronization apparatus for an edge device according to an embodiment of the present application.
As shown in fig. 6, the data synchronization apparatus 600 may include: a first acquisition module 610, an update module 620, and an upload module 630.
A first obtaining module 610, configured to obtain reporting data, where the reporting data includes data reported to the edge device by the edge sub device associated with the edge device.
An updating module 620, configured to update the stored data in the edge shadow based on the obtained reported data, where the edge shadow is a data storage model created in the edge device.
The uploading module 630 is configured to periodically report the storage data in the edge shadow to a cloud, so that the cloud performs data synchronization on the cloud shadow and/or notifies the edge device of performing data synchronization on the edge shadow based on difference data between the storage data and the storage data in the cloud shadow, where the cloud shadow is a data storage model created at the cloud for the edge device and an edge child device associated with the edge device.
It should be noted that, the data synchronization method for the edge device in the embodiment of the present application is the same as or similar to the data synchronization apparatus for the edge device in the embodiment of the present application, and details of the present application are not repeated herein.
According to the embodiment of the application, the application further provides a device for data synchronization of the cloud.
Fig. 7 is a block diagram illustrating an example of a data synchronization apparatus for a cloud according to an embodiment of the present application.
As shown in fig. 7, the data synchronization apparatus 700 may include: a second acquisition module 710, a comparison module 720, and a synchronization module 730.
A second obtaining module 710, configured to obtain first stored data in an edge shadow, where the edge shadow is created in an edge device and is used to store current state information of an edge sub-device associated with the edge device and data currently obtained by the edge sub-device.
A comparing module 720, configured to compare the first stored data with second stored data in a cloud shadow, where the cloud shadow is created at the cloud and corresponds to the edge shadow, and the cloud shadow is used to store expected status information of the edge sub-device and data obtained before the edge sub-device.
A synchronization module 730, configured to, in response to storing difference data between the first stored data and the second stored data, perform one or more of: performing data synchronization on the cloud shadow; and informing the edge device to perform data synchronization on the edge shadow.
It should be noted that, the data synchronization method for the cloud in the embodiment of the present application is the same as or similar to the data synchronization device for the cloud in the embodiment of the present application, and details are not repeated herein.
According to an embodiment of the application, the application also provides an electronic device and a readable storage medium.
Fig. 8 is a block diagram of an electronic device for a data synchronization method of an edge device (or cloud end) according to an embodiment of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic devices may also represent various forms of mobile devices, such as personal digital processors, cellular telephones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the present application that are described and/or claimed herein.
As shown in fig. 8, the electronic apparatus includes: one or more processors 801, memory 802, and interfaces for connecting the various components, including a high speed interface and a low speed interface. The various components are interconnected using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions for execution within the electronic device, including instructions stored in or on the memory to display graphical information of a GUI on an external input/output apparatus (such as a display device coupled to the interface). In other embodiments, multiple processors and/or multiple buses may be used, along with multiple memories and multiple memories, if desired. Also, multiple electronic devices may be connected, with each device providing portions of the necessary operations (e.g., as a server array, a group of blade servers, or a multi-processor system). Fig. 8 illustrates an example of a processor 801.
The memory 802 is a non-transitory computer readable storage medium as provided herein. The memory stores instructions executable by at least one processor to cause the at least one processor to perform the data synchronization method for an edge device (or cloud end) provided herein. The non-transitory computer-readable storage medium of the present application stores computer instructions for causing a computer to perform the data synchronization method for an edge device (or cloud) provided herein.
The memory 802 is a non-transitory computer readable storage medium, and can be used to store non-transitory software programs, non-transitory computer executable programs, and modules, such as program instructions/modules corresponding to the data synchronization method for the edge device (or cloud) in the embodiments of the present application (for example, the first obtaining module 610, the updating module 620, and the uploading module 630 shown in fig. 6). The processor 801 executes various functional applications and data processing of the server by running non-transitory software programs, instructions and modules stored in the memory 802, that is, implements the data synchronization method for the edge device (or cloud) in the above method embodiments.
The memory 802 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to use of the electronic device for the data synchronization method of the edge device (or cloud), and the like. Further, the memory 802 may include high speed random access memory and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory 802 optionally includes memory located remotely from the processor 801, which may be connected over a network to an electronic device for data synchronization methods for edge devices (or cloud-based). Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The electronic device for implementing the data synchronization method for the edge device (or cloud) may further include: an input device 803 and an output device 804. The processor 801, the memory 802, the input device 803, and the output device 804 may be connected by a bus or other means, and are exemplified by a bus in fig. 8.
The input device 803 may receive input numeric or character information and generate key signal inputs related to user settings and function control of the electronic device for the data synchronization method of the edge device (or cloud), such as an input device like a touch screen, a keypad, a mouse, a track pad, a touch pad, a pointing stick, one or more mouse buttons, a track ball, a joystick, etc. The output devices 804 may include a display device, auxiliary lighting devices (e.g., LEDs), and haptic feedback devices (e.g., vibrating motors), among others. The display device may include, but is not limited to, a Liquid Crystal Display (LCD), a Light Emitting Diode (LED) display, and a plasma display. In some implementations, the display device can be a touch screen.
Various implementations of the systems and techniques described here can be realized in digital electronic circuitry, integrated circuitry, application specific ASICs (application specific integrated circuits), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
These computer programs (also known as programs, software applications, or code) include machine instructions for a programmable processor, and may be implemented using high-level procedural and/or object-oriented programming languages, and/or assembly/machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or device (e.g., magnetic discs, optical disks, memory, programmable Logic Devices (PLDs)) used to provide machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user may provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other; the server may be a server of a distributed system or a server incorporating a blockchain. The server can also be a cloud server, or an intelligent cloud computing server or an intelligent cloud host with artificial intelligence technology.
According to the technical scheme provided by the embodiment of the application, the edge shadow is created on the edge device and used for storing the current connection state information and the current running state information of the edge sub device and the data currently acquired and reported by the edge sub device, meanwhile, the cloud creation node is used as the mapping object of the edge device and used for creating the sub node as the mapping object of the edge sub device associated with the edge device, meanwhile, the cloud shadow is created in the node and used for storing the expected connection state information and the expected running state information of the edge sub device and the data acquired and reported by the edge sub device, therefore, the data synchronization between the edge sub device and the cloud is converted into the data synchronization between the edge shadow and the cloud shadow, the data synchronization between the two shadows is performed through a report/destination mechanism, the high network stability is not required, and the final consistency of the edge sub device and the cloud data can be realized even under the unstable network.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present application may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired results of the technical solutions disclosed in the present application can be achieved.
The above-described embodiments should not be construed as limiting the scope of the present application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (15)

1. A data synchronization method for an edge device, comprising:
acquiring reported data, wherein the reported data comprises data reported to the edge equipment by the edge sub-equipment associated with the edge equipment;
updating storage data in an edge shadow based on the acquired reported data, wherein the edge shadow is a data storage model established in the edge device;
periodically reporting the stored data in the edge shadow to a cloud end, so that the cloud end performs data synchronization on the cloud end shadow and/or informs the edge device of performing data synchronization on the edge shadow based on difference data between the stored data from the edge shadow and the stored data in the cloud end shadow, wherein the cloud end shadow is a data storage model created at the cloud end aiming at the edge device and an edge sub-device associated with the edge device, the cloud end comprises a node corresponding to the edge device and a sub-node corresponding to the edge sub-device, the sub-node is associated with the node, the sub-node comprises first related data aiming at the edge sub-device, and the cloud end shadow stores the first related data;
responding to the change of the first related data stored in the cloud shadow, and acquiring the updated first related data stored in the cloud shadow;
updating second relevant data aiming at the edge sub-equipment in the edge shadow based on the updated first relevant data; and
updating the edge sub-device based on the updated second correlation data.
2. The method of claim 1, further comprising: in response to the cloud notifying the edge device of data synchronization to the edge shadow, performing one or more of the following operations based on the difference data:
updating a connection status between the edge device and an associated edge sub-device;
and updating the running state of the edge sub-equipment with changed running state in the edge sub-equipment associated with the edge equipment.
3. The method of claim 2, wherein:
and updating the connection state between the edge sub-device and the edge device, the connection state of which changes with the connection state of the edge device, when the difference data comprises the connection state information.
4. The method of claim 2, wherein:
and updating the operation state of the edge sub-equipment with changed operation state in the edge sub-equipment associated with the edge equipment under the condition that the difference data comprises the operation state information.
5. The method of claim 1, further comprising: in response to the cloud notifying the edge device of data synchronization to the edge shadow, obtain storage data in the cloud shadow and perform one or more of the following operations based on difference data between the obtained storage data and the storage data in the edge shadow:
updating a connection status between the edge device and the associated edge sub-device;
and updating the running state of the edge sub-equipment with changed running state in the edge sub-equipment associated with the edge equipment.
6. The method of claim 1, further comprising:
updating the stored data in the edge shadow based on a connection status between the edge device and an associated edge child device.
7. A data synchronization method for a cloud end comprises the following steps:
acquiring first storage data in an edge shadow, wherein the edge shadow is created in an edge device and is used for storing current state information of an edge sub-device associated with the edge device and the currently acquired data of the edge sub-device;
comparing the first stored data with second stored data in a cloud shadow, wherein the cloud shadow is created in the cloud and corresponds to the edge shadow, and the cloud shadow is used for storing expected state information of the edge sub-device and data acquired before the edge sub-device; and
in response to there being difference data between the first stored data and the second stored data, performing one or more of:
performing data synchronization on the cloud shadow;
informing the edge device to perform data synchronization on the edge shadow;
wherein the cloud comprises a node corresponding to the edge device and a child node corresponding to the edge child device, the child node being associated with the node, the child node comprising first relevant data for the edge child device, the cloud shadow storing the first relevant data;
after the first related data stored in the cloud shadow is changed to obtain updated first related data, the updated first related data is used for updating second related data, which is in the edge shadow and is directed to the edge sub-device, to obtain updated second related data, and the updated second related data is used for updating the edge sub-device.
8. The method of claim 7, further comprising:
creating a node of a mapping object representing the edge device at the cloud end;
creating child nodes of mapping objects representing the edge child devices at the cloud end;
creating the cloud shadow within the node;
managing the edge device and the edge sub-device through the node at the cloud; and
and managing the edge child equipment through the child nodes at the cloud.
9. The method of claim 7, wherein the edge device is notified of data synchronization to the edge shadow by performing at least one of:
sending the second storage data to the edge device;
sending the expected state information to the edge device;
sending the difference data to the edge device.
10. The method of claim 7, wherein:
and under the condition that the difference data comprises difference data between the currently acquired data and the previously acquired data, performing data synchronization on the cloud shadow.
11. The method of claim 10, wherein data synchronizing the cloud shadow comprises at least one of:
updating the currently acquired data to the cloud shadow;
and updating the difference data of the currently acquired data relative to the previously acquired data into the cloud shadow.
12. A data synchronization apparatus for an edge device, comprising:
a first obtaining module, configured to obtain reporting data, where the reporting data includes data reported to the edge device by an edge sub-device associated with the edge device;
the updating module is used for updating the stored data in an edge shadow based on the acquired reported data, wherein the edge shadow is a data storage model created in the edge device; and
the cloud side comprises a node corresponding to the edge device and a child node corresponding to the edge device, the child node is associated with the node, the child node comprises first related data for the edge device, and the cloud side shadow stores the first related data;
the update module is further to:
responding to the change of the first related data stored in the cloud shadow, and acquiring the updated first related data stored in the cloud shadow;
updating second related data aiming at the edge sub-equipment in the edge shadow based on the updated first related data; and
updating the edge sub-device based on the updated second correlation data.
13. A data synchronization apparatus for a cloud, comprising:
a second obtaining module, configured to obtain first stored data in an edge shadow, where the edge shadow is created in an edge device, and is used to store current state information of an edge sub device associated with the edge device and data currently obtained by the edge sub device;
a comparison module, configured to compare the first stored data with second stored data in a cloud shadow, where the cloud shadow is created in the cloud and corresponds to the edge shadow, and the cloud shadow is used to store expected state information of the edge sub-device and data previously acquired by the edge sub-device; and
a synchronization module to perform one or more of the following in response to difference data between the first stored data and the second stored data:
performing data synchronization on the cloud shadow;
informing the edge device to perform data synchronization on the edge shadow;
wherein the cloud comprises a node corresponding to the edge device and a child node corresponding to the edge child device, the child node being associated with the node, the child node comprising first relevant data for the edge child device, the cloud shadow storing the first relevant data;
after the first related data stored in the cloud shadow is changed to obtain updated first related data, the updated first related data is used for updating second related data, which is in the edge shadow and is directed to the edge sub-device, to obtain updated second related data, and the updated second related data is used for updating the edge sub-device.
14. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-11.
15. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-11.
CN202011377911.8A 2020-11-30 2020-11-30 Data synchronization method and device for edge device and cloud end Active CN112532729B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011377911.8A CN112532729B (en) 2020-11-30 2020-11-30 Data synchronization method and device for edge device and cloud end

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011377911.8A CN112532729B (en) 2020-11-30 2020-11-30 Data synchronization method and device for edge device and cloud end

Publications (2)

Publication Number Publication Date
CN112532729A CN112532729A (en) 2021-03-19
CN112532729B true CN112532729B (en) 2023-04-18

Family

ID=74996021

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011377911.8A Active CN112532729B (en) 2020-11-30 2020-11-30 Data synchronization method and device for edge device and cloud end

Country Status (1)

Country Link
CN (1) CN112532729B (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112887433B (en) * 2021-04-12 2021-07-27 网络通信与安全紫金山实验室 Cloud access edge service method and system based on QUIC protocol
CN113452772B (en) * 2021-06-24 2023-10-27 青岛海尔科技有限公司 Intelligent scene processing method and device, storage medium and electronic equipment
CN113676510A (en) * 2021-07-13 2021-11-19 阿里巴巴新加坡控股有限公司 Cloud storage method, system, equipment and storage medium
CN113992675A (en) * 2021-10-26 2022-01-28 云知声(上海)智能科技有限公司 IOT cloud platform and edge gateway cooperative work method, system and storage medium
CN114553849A (en) * 2022-02-22 2022-05-27 北京百度网讯科技有限公司 Drive update method, device, apparatus, medium, and program product
CN114629907B (en) * 2022-03-25 2024-06-25 广州助蜂网络科技有限公司 Management and control method and device for parking equipment
CN115225697B (en) * 2022-06-16 2024-04-09 阿里云计算有限公司 State synchronization method, device, equipment and storage medium
CN115378787A (en) * 2022-08-19 2022-11-22 深圳前海环融联易信息科技服务有限公司 Cloud edge cooperation-based equipment management method, device, equipment and medium
CN115563144B (en) * 2022-10-26 2023-10-03 山东浪潮新基建科技有限公司 Method and system for updating dynamic data of Internet of things platform
CN117896035B (en) * 2024-03-14 2024-06-04 杭州义益钛迪信息技术有限公司 Data acquisition method and equipment of edge controller

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020168207A1 (en) * 2019-02-14 2020-08-20 Intel Corporation Establishing cloud-to-cloud access for internet of things (iot) devices

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10229134B2 (en) * 2013-06-25 2019-03-12 Box, Inc. Systems and methods for managing upgrades, migration of user data and improving performance of a cloud-based platform
US9391801B2 (en) * 2013-08-13 2016-07-12 Vmware, Inc. Virtual private networks distributed across multiple cloud-computing facilities
US20190199751A1 (en) * 2017-12-21 2019-06-27 Forcepoint, LLC Shadow IT Discovery Using Traffic Signatures
US10742489B2 (en) * 2018-11-01 2020-08-11 Hewlett Packard Enterprise Development Lp Validating network configuration using shadow databases
CN111163002B (en) * 2019-12-31 2022-06-10 广州智光电气股份有限公司 Container-based edge gateway system and energy data processing method
CN111966651B (en) * 2020-09-21 2024-01-09 北京百度网讯科技有限公司 Data synchronization method, device, electronic equipment and storage medium
CN111930521A (en) * 2020-09-23 2020-11-13 北京百度网讯科技有限公司 Method and device for deploying application, electronic equipment and readable storage medium

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020168207A1 (en) * 2019-02-14 2020-08-20 Intel Corporation Establishing cloud-to-cloud access for internet of things (iot) devices

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Nam Ky Giang et al.."Fog at the Edge: Experiences Building an Edge Computing Platform".《2018 IEEE International Conference on Edge Computing (EDGE)》.2018,全文. *
孔震 ; .基于泛在电力物联网的智慧物联体系研究.中国信息化.2020,(第03期),全文. *

Also Published As

Publication number Publication date
CN112532729A (en) 2021-03-19

Similar Documents

Publication Publication Date Title
CN112532729B (en) Data synchronization method and device for edge device and cloud end
CN111966651B (en) Data synchronization method, device, electronic equipment and storage medium
EP3929825A1 (en) Distributed training method and system, device and storage medium
CN111770169A (en) Method, device, equipment and storage medium for upgrading equipment firmware
CN112202746B (en) RPC member information acquisition method, device, electronic equipment and storage medium
CN112925651B (en) Application resource deployment method, device, electronic equipment and medium
CN111290768B (en) Updating method, device, equipment and medium of containerized application system
CN114089974B (en) Cloud code development system, method, device, equipment and storage medium
CN111324417A (en) Kubernetes cluster component control method and device, electronic equipment and medium
CN111913884A (en) Distributed test method, device, equipment, system and readable storage medium
EP3816802A2 (en) Method and device for processing mini program data
CN112771928B (en) Method and device for determining satellite return information
CN111371629B (en) Network construction and out-of-band management method, device, equipment, medium and cloud platform
CN111782229A (en) Applet starting method and device and electronic equipment
CN106411574B (en) Management control method and device
CN114721686A (en) Configuration data updating method and device, electronic equipment and storage medium
CN112559498B (en) Method and device for constructing distributed architecture of time sequence space-time database system
CN112084000A (en) Container cluster testing method and device
CN110851186A (en) Network equipment restarting method and device, electronic equipment and readable storage medium
CN112085471A (en) Task distribution method and device, electronic equipment and storage medium
CN112099933A (en) Task operation and query method and device, electronic equipment and storage medium
CN112286441A (en) Method, apparatus and computer medium for providing a visual representation
CN114222167B (en) Cloud screen projection control method, device, server, system and readable storage medium
CN112527368B (en) Cluster kernel version updating method and device, electronic equipment and storage medium
CN111131935B (en) OTN switching method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant