CN109525621B - Data synchronization method, equipment and system based on ZigBee binding - Google Patents

Data synchronization method, equipment and system based on ZigBee binding Download PDF

Info

Publication number
CN109525621B
CN109525621B CN201710851221.3A CN201710851221A CN109525621B CN 109525621 B CN109525621 B CN 109525621B CN 201710851221 A CN201710851221 A CN 201710851221A CN 109525621 B CN109525621 B CN 109525621B
Authority
CN
China
Prior art keywords
attribute
coordinator
devices
identifiers
source devices
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
CN201710851221.3A
Other languages
Chinese (zh)
Other versions
CN109525621A (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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201710851221.3A priority Critical patent/CN109525621B/en
Publication of CN109525621A publication Critical patent/CN109525621A/en
Application granted granted Critical
Publication of CN109525621B publication Critical patent/CN109525621B/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

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

A data synchronization method, equipment and a system based on ZigBee binding are provided to solve the problem that in the prior art, the synchronous data volume is large after source equipment and target equipment are bound based on a ZigBee protocol. The method comprises the following steps: the coordinator receives attribute identifications and corresponding attribute values sent by m source devices; when the coordinator determines that the attribute identifiers sent by the M source devices are the attribute identifiers of the source devices in a binding relationship, acquiring the attribute values corresponding to the attribute identifiers of the remaining source devices except the M source devices in the binding relationship, wherein the binding relationship comprises the attribute identifiers of the M source devices, the attribute identifiers of the N target devices, the attribute values corresponding to the attribute identifiers of the N target devices and a second synchronization condition, and M is less than or equal to M; and the coordinator sends the attribute identifications of the N target devices and the corresponding attribute values to the corresponding target devices when determining that the attribute values corresponding to the attribute identifications of the M source devices meet a second synchronization condition.

Description

Data synchronization method, equipment and system based on ZigBee binding
Technical Field
The present application relates to the field of wireless communication technologies, and in particular, to a ZigBee-bound data synchronization method, device, and system.
Background
The ZigBee protocol (also called as the ZigBee protocol) has the characteristics of low cost, low power consumption, short distance, self-organization and the like, and is mainly applied to the field of automatic control, such as industries of intelligent home, industrial control and the like. A binding mechanism in the ZigBee protocol is used for supporting a scene of linkage among a plurality of devices in industries such as intelligent home and industrial control, and if the state of the device A changes, the device B is triggered to execute corresponding operation. The ZigBee protocol introduces the concepts of industry specification (profile), cluster (cluster) and attribute (attribute) to realize binding among multiple devices. An industry specification includes a plurality of clusters, a cluster includes a plurality of attributes, the industry specification is a set of regulations (e.g., a Home Automation (HA) application, a Telecommunications Application (TA), etc.) of a certain application, a specific application (e.g., a smart home) includes a large number of detailed small specifications (e.g., control of a lamp: turning on, turning off, turning on, etc.), these small specifications are called clusters, and the attributes are attributes corresponding to the clusters (e.g., brightness of the lamp). The source device and the target device to be bound correspond to different industry specifications, clusters and attributes according to different application scenes.
In the prior art, a binding mechanism based on a ZigBee protocol is initiated from a source device to a coordinator, the coordinator establishes a binding table between the source device and a target device according to a binding request sent by the source device, so as to implement the binding between the source device and the target device, and the source device can only implement the binding between the source device (or one object in the source device) and one target device (or one object in the target device) each time the source device sends the binding request, and the industry specifications and clusters corresponding to the source device (or one object in the source device) and one target device (or one object in the target device) must be the same. The following describes in detail a binding mechanism based on the ZigBee protocol in the prior art, taking as an example a process of establishing binding between a switch 1 in a device 1 to be bound and a lamp 1 in a device 2, as shown in fig. 1:
(1) the device 1 sends a binding request to the coordinator, wherein the binding request is realized by a primitive APSME-BIND.request shown as follows, and the industry standard identifier and the cluster identifier of the switch 1 are the same as those of the lamp 1;
APSME-BIND.request{
SrcAddr,
SrcEndpoint,
ClusterId,
DstAddr,
DstEndpoint
}
wherein, SrcAddr indicates the address of the source device, and the above primitive is specifically the device 1 address, which can be set to 0x 01. SrcEndpoint indicates a port number of the source device, and the above primitive, specifically, a port number of device 1, may be set to 0x02, corresponding to switch 1. The ClusterId indicates cluster identifiers to be bound by the source device and the target device, and the above primitives may be set to 0x0006, specifically, a protocol stack cluster to be bound by the device 1. DstAddrMode indicates the address mode of the target device, and in the above primitive, specifically device 2 address mode, may be set to 0x03 (indicating a 64-bit extended address). DstAddr represents the address of the target device, and in the above primitive, specifically, the device 2 address, may be set to 0x 02. DstEndpoint represents the port number of the target device, and in the above primitive, specifically, the port number of device 2, corresponding to lamp 1, may be set to 0x 01. Wherein, when the ClusterId is 0x0006, the cluster comprises the following components: an on/off (on/off) attribute, an on time (on _ time) attribute, etc., the on/off attribute identification (Attrid) being 0x00, and the on _ time attribute identification (Attrid) being 0x 4001.
(2) The coordinator establishes a binding table according to the binding request, binds the attribute included in the ClusterId corresponding to the port SrcEndpoint of the device 1 to the port dstenddpoint of the device 2, and stores the binding table into an application support layer information database (AIB) of the coordinator.
(3) The coordinator returns a binding acknowledgement message (response message of the binding request) to the device 1, which is implemented by the primitive APSME-bind.
APSME-BIND.confirm{
Status,
SrcAddr,
SrcEndpoint,
ClusterId,
DstAddrMode,
DstAddr,
DstEndpoint
}
Wherein Status is used for feeding back the result of the binding establishment. After the device 1 receives the binding acknowledgement message, the switch 1 in the device 1 completes binding with the lamp 1 in the device 2. After the switch 1 and the lamp 1 are bound, data synchronization can be performed, and when any one of the attributes included in the cluster corresponding to the switch 1 changes, the device 1 synchronizes the attribute value of the changed attribute to the device 2 through the coordinator. For example, when the switch 1 is turned on, the on/off attribute of the switch 1 is turned on, the device 1 sends an attribute value attrcval (ClusterId is 0x0006, attrcld is 0x00, attrcval is 1 in ZCLReport) of the on/off attribute to the coordinator through a ZigBee Cluster Library (ZCL) Report (Report) operation, the coordinator finds that there is a binding relationship between the switch 1 of the device 1 and the lamp 1 in the device 2 by querying a binding table in the AIB, finds DstAddr, and DstEndpoint according to the binding table, writes the ClusterId is 0x0006, attrcld is 0x00, attrcval is 1 in the device 2 through a ZCL Write operation, the lamp 1 is turned on, and completes a data synchronization process.
In summary, in the prior art, because the binding mechanism based on the ZigBee protocol is the cluster-level binding, after the source device and the target device are bound, when the attribute value of any attribute in the cluster bound by the source device and the target device changes, the source device needs to synchronize the changed attribute value to the target device through the coordinator, which results in a large amount of synchronized data.
Disclosure of Invention
The application provides a data synchronization method, equipment and a system based on ZigBee binding, which are used for solving the problem that in the prior art, the synchronous data volume is large after source equipment and target equipment are bound based on a ZigBee protocol.
In a first aspect, the present application provides a data synchronization method based on ZigBee binding, including: the coordinator receives attribute identifications and corresponding attribute values sent by m source devices; when the coordinator determines that the attribute identifiers sent by the m source devices are the attribute identifiers of the source devices in the binding relationship, acquiring the attribute values corresponding to the attribute identifiers of the remaining source devices in the binding relationship; and the coordinator sends the attribute identifications of the N target devices and the corresponding attribute values to the corresponding target devices when determining that the attribute values corresponding to the attribute identifications of the M source devices meet the first synchronization condition, wherein the binding relationship comprises the attribute identifications of the M source devices, the attribute identifications of the N target devices, the attribute values corresponding to the attribute identifications of the N target devices and the first synchronization condition, M, M and N are positive integers, and M is less than or equal to M.
By the method, when the coordinator determines that the received attribute identifications sent by the m source devices are the attribute identifications of the source devices in the binding relationship, the coordinator obtains the attribute values corresponding to the attribute identifications of the rest source devices in the binding relationship, when determining that the attribute values corresponding to the attribute identifications of the M source devices satisfy the first synchronization condition, sending the attribute identifications and the corresponding attribute values of the N target devices in the binding relationship to the corresponding target devices, wherein, the binding relationship comprises the attribute identifications of M source devices, the attribute identifications of N target devices, the attribute values corresponding to the attribute identifications of the N target devices and a first synchronization condition, M, M and N are positive integers, M is less than or equal to M, which can reduce the data volume sent to the target devices by the coordinator, and further, the synchronous data volume of the source device and the target device which establish the binding relationship through the coordinator can be reduced. And the data sent by the coordinator to the N target devices are the attribute identifiers and corresponding attribute values set in the binding relationship, so that the attributes sent by the M source devices to the coordinator and the attributes sent by the coordinator to the N target devices may be the same or different.
In one possible implementation manner, the coordinator determines that the attribute values corresponding to the attribute identifiers of the M source devices satisfy the first synchronization condition by: and the coordinator calculates the attribute values corresponding to the attribute identifications of the M source devices according to a preset operation rule to obtain a calculation result, and determines that the calculation result meets the first synchronization condition.
In a possible implementation manner, the binding relationship corresponds to a set port of the coordinator. And the coordinator receives the attribute identifications and the corresponding attribute values sent by the m source devices through the set port, and sends the attribute identifications and the corresponding attribute values of the N target devices to the corresponding target devices through the set port. And when the coordinator determines that the attribute values corresponding to the attribute identifications of the M source devices meet the first synchronization condition, calculating the attribute values corresponding to the attribute identifications of the M source devices in the binding relationship corresponding to the set port according to the preset operation rule.
According to the method, the coordinator calculates the attribute values corresponding to the attribute identifications of the M source devices in the binding relationship corresponding to the set port according to the preset operation rule, so that the calculation processes of the coordinator on the attribute values of the source devices in different binding relationships are kept relatively independent, and the accuracy of the calculation result is ensured.
In a possible implementation manner, when the attribute value corresponding to the attribute identifier sent by any one of the m source devices meets the second synchronization condition corresponding to the source device, that is, when it is determined by any one of the m source devices that the attribute value corresponding to the attribute identifier of the source device meets the second synchronization condition corresponding to the source device, the attribute identifier of the source device and the corresponding attribute value are sent to the coordinator.
According to the method, when the attribute values of the m source devices meet the corresponding second synchronization conditions, the m source devices send the attribute identifications and the corresponding attribute values of the m source devices to the coordinator, and compared with the prior art, the method can effectively reduce the data volume sent to the coordinator by the source devices and further reduce the synchronous data volume of the source devices and the target devices bound by the coordinator.
In a possible implementation manner, before the coordinator receives the attribute identifiers and the corresponding attribute values sent by the M source devices in the binding relationship established by the coordinator, the coordinator also establishes the binding relationship, so that the M source devices are bound with the N target devices through the coordinator. The process of binding the M source devices with the N target devices through the coordinator includes the following steps:
the coordinator obtains a first instruction for establishing the binding relationship, wherein the first instruction comprises identifiers of set ports of the coordinator corresponding to the binding relationship, binding parameters of the M source devices and binding parameters of the N target devices; wherein the binding parameters of the M source devices include: the identifiers of the M source devices, the attribute identifiers of the M source devices, the second synchronization conditions corresponding to the M source devices, the cluster identifiers corresponding to the attribute identifiers of the M source devices, and the industry specification identifiers corresponding to the cluster identifiers of the M source devices, where the binding parameters of the N target devices include: the identifiers of the N target devices, the attribute values corresponding to the attribute identifiers of the N target devices, the first synchronization condition, the cluster identifiers corresponding to the attribute identifiers of the N target devices, and the industry specification identifiers corresponding to the cluster identifiers of the N target devices;
the coordinator establishes and stores the binding relationship on the port corresponding to the identifier of the set port according to the first instruction, wherein the binding relationship comprises the identifier of the set port, the binding parameters of the M source devices and the binding parameters of the N target devices;
the coordinator sends binding establishment requests to the M source devices respectively, and aiming at any source device, the binding establishment requests carry the identification of the set port and the binding parameters of the source device in the binding relationship;
the M source devices generate binding establishment confirmation messages and send the binding establishment confirmation messages to the coordinator;
and the coordinator respectively receives the binding establishment confirmation messages sent by the M source devices and determines that the M source devices and the N target devices establish binding through the coordinator according to the binding establishment confirmation messages.
According to the method, the M source devices and the N target devices establish the binding of the attribute layer through the coordinator, so that the M source devices send the attribute identifications of the M source devices and the corresponding attribute values to the coordinator when the attribute values corresponding to the attribute identifications sent to the M source devices by the coordinator meet the corresponding second synchronization condition, and the coordinator sends the attribute identifications of the N target devices and the corresponding attribute values in the binding relationship to the corresponding target devices when the attribute values sent by the M source devices meet the first synchronization condition, so that the purpose of reducing the synchronous data volume of the M source devices and the N target devices establishing the binding relationship is achieved. And the binding relationship established by the coordinator further includes cluster identifiers corresponding to the attribute identifiers of the M source devices, industry standard identifiers corresponding to the cluster identifiers of the M source devices, cluster identifiers corresponding to the attribute identifiers of the N target devices, and industry standard identifiers corresponding to the cluster identifiers of the N target devices, so that the M source devices and the N target devices can be bound based on different industry standards and/or attributes under different clusters, and the binding is more flexible. In addition, the coordinator may establish a correspondence between the plurality of source devices and the one or more target devices according to the first instruction, and may reduce workload of binding deployment.
In a possible implementation manner, the identifiers of the M source devices include types of the M source devices, or the identifiers of the M source devices include addresses of the M source devices, port identifiers of the M source devices, and address types of the M source devices; the identifiers of the N target devices include types of the N target devices, or the identifiers of the N target devices include addresses of the N target devices, port identifiers of the N target devices, and address types of the N target devices.
In one possible embodiment, the coordinator saves the binding relationship in an application support layer information database AIB of the coordinator.
In one possible embodiment, after the coordinator establishes the binding relationship, the binding relationship may be released by: the coordinator acquires a second instruction for releasing the binding relationship; the coordinator sends unbinding requests to the M source devices respectively; and when the coordinator receives the binding removal confirmation messages sent by the M source devices or determines that the binding removal confirmation message sent by any one source device is not received within a set time length, deleting the binding relationship and releasing the set port of the coordinator corresponding to the binding relationship.
In a second aspect, the present application further provides a coordinator, where the coordinator has a function of implementing the coordinator behavior in the above method example. The functions can be realized by hardware, and the functions can also be realized by executing corresponding software by hardware. The hardware or software includes one or more modules corresponding to the above-described functions.
In a possible implementation manner, the structure of the coordinator includes a receiving unit, a processing unit, and a sending unit, and these units may execute corresponding functions in the foregoing method example, specifically refer to the detailed description in the method example, and are not described herein again.
In a possible implementation manner, the structure of the coordinator includes a transceiver, a memory, and a processor, and the processor is configured to support the coordinator to perform the corresponding functions in the above method. The memory is coupled to the processor and holds the program instructions and data necessary for the coordinator.
In a third aspect, the present application further provides a data synchronization system based on ZigBee binding, where the system includes: m source devices, a coordinator, and N target devices.
The M source devices are used for respectively sending the attribute identifications and the corresponding attribute values of the M source devices to the coordinator, wherein M is a positive integer;
the coordinator is configured to receive attribute identifiers and corresponding attribute values sent by M source devices of the M source devices, where M is a positive integer and is less than or equal to M; when determining that the attribute identifiers sent by the M source devices are the attribute identifiers of the source devices in a binding relationship, acquiring the attribute values corresponding to the attribute identifiers of the remaining source devices except the M source devices in the binding relationship, wherein the binding relationship comprises the attribute identifiers of the M source devices, the attribute identifiers of the N target devices, the attribute values corresponding to the attribute identifiers of the N target devices and a first synchronization condition, and N is a positive integer; and when determining that the attribute values corresponding to the attribute identifications of the M source devices meet the first synchronization condition, sending the attribute identifications of the N target devices and the corresponding attribute values to the corresponding target devices.
The N target devices are configured to receive the attribute identifier and the corresponding attribute value of the corresponding target device, which are sent by the coordinator when it is determined that the attribute value corresponding to the attribute identifier of the M source devices meets the first synchronization condition.
In a fourth aspect, the present application also provides a computer storage medium having stored thereon a software program that, when read and executed by one or more processors, implements the method provided by any of the designs of any of the aspects.
In a fifth aspect, the present application also provides a computer program product comprising instructions which, when run on a computer, cause the computer to perform any of the methods of the first aspect described above.
Drawings
Fig. 1 is a schematic diagram of a binding relationship between a device 1 and a device 2 in the prior art;
FIG. 2 is a schematic diagram of a ZigBee network architecture in the embodiment of the present application;
fig. 3 is a flowchart of a data synchronization method based on ZigBee binding according to an embodiment of the present application;
FIG. 4 is a flowchart of a method for establishing a binding between a source device and a target device through a coordinator according to an embodiment of the present application;
FIG. 5 is a flowchart of a method for unbinding a source device from a target device in an embodiment of the present application;
fig. 6 is a flowchart of a data synchronization method based on ZigBee binding in the embodiment of the present application;
fig. 7 is a schematic structural diagram of a coordinator provided in an embodiment of the present application;
fig. 8 is a schematic structural diagram of another coordinator provided in an embodiment of the present application;
fig. 9 is a schematic structural diagram of a data synchronization system based on ZigBee binding provided in an embodiment of the present application.
Detailed Description
In the prior art, a binding mechanism based on a ZigBee protocol is binding on a cluster level, so that after a source device and a target device are bound, if an attribute value of any attribute included in the cluster bound by the source device and the target device changes, the source device needs to synchronize the changed attribute value of the attribute to the target device through a coordinator, resulting in a large amount of synchronized data. In order to solve the problem that the source device and the target device are large in synchronous data volume after being bound based on a ZigBee protocol in the prior art, the application provides a data synchronization method, device and system based on ZigBee binding. The method and the device are based on the same inventive concept, and because the principles of solving the problems of the method and the device are similar, the implementation of the device and the method can be mutually referred, and repeated parts are not repeated.
In the embodiment of the application, a coordinator receives attribute identifications and corresponding attribute values sent by m source devices, wherein m is a positive integer; when the coordinator determines that the attribute identifiers sent by the M source devices are the attribute identifiers of the source devices in a binding relationship, acquiring the attribute values corresponding to the attribute identifiers of the remaining source devices in the binding relationship, wherein the binding relationship comprises the attribute identifiers of the M source devices, the attribute identifiers of the N target devices, the attribute values corresponding to the attribute identifiers of the N target devices, and a first synchronization condition, M, N is a positive integer, and M is less than or equal to M; and when determining that the attribute values corresponding to the attribute identifications of the M source devices meet the first synchronization condition, the coordinator sends the attribute identifications of the N target devices and the corresponding attribute values to the corresponding target devices.
Based on the method, the coordinator determines that the received attribute identifications sent by the M source devices are the same as the attribute identifications of the M source devices in the binding relationship, obtains the attribute values corresponding to the attribute identifications of the remaining source devices in the binding relationship, and sends the attribute identifications of the N target devices in the binding relationship and the corresponding attribute values to the corresponding target devices respectively when determining that the attribute values corresponding to the attribute identifications of the M source devices meet the first synchronization condition, so that the data amount sent to the target devices by the coordinator can be reduced, and further, the synchronous data amount of the source devices and the target devices establishing the binding relationship by the coordinator can be reduced. And the data sent by the coordinator to the N target devices are the attribute identifiers and corresponding attribute values set in the binding relationship, so that the attributes sent by the M source devices to the coordinator and the attributes sent by the coordinator to the N target devices may be the same or different. In the binding mechanism based on the ZigBee protocol in the prior art, the industry specifications and clusters corresponding to the source device and the target device must be the same, so that when a certain attribute of the source device changes, the attribute of the target device bound with the source device can only change the same, and the flexibility is poor. Therefore, compared with the prior art, the data synchronization between the source device and the target device, which is established through the coordinator, is more flexible.
Some terms referred to in the embodiments of the present application are explained below to facilitate understanding by those skilled in the art.
(1) The ZigBee protocol is a low power consumption lan protocol based on the Institute of Electrical and Electronics Engineers (IEEE) 802.15.4 standard. The ZigBee protocol includes, from bottom to top, a physical layer (PHY), a Media Access Control (MAC) layer, a network layer (NWK), an application layer (APL), and the like, where the APL includes an Application Framework (AF), a ZigBee Device Object (ZDO) layer, and an application support sub-layer (APS).
(2) Binding, which refers to a control mechanism of information flow between a plurality of terminal devices (source device and target device), is called resource binding in the release version of ZigBee 2006.
(3) The binding establishment request refers to a message which is sent by the coordinator and used for indicating the source device to establish a binding relationship with the target device through the coordinator.
(4) And the binding establishment confirmation message is a response message generated by the source equipment according to the binding establishment request and is used for indicating the binding relationship establishment result.
(5) The unbinding request is a message sent by the coordinator and used for indicating the source device to release the binding relationship with the target device.
(6) And the unbinding confirmation message is a response message generated by the source device according to the unbinding request and is used for indicating whether the source device is unbound.
(7) The binding parameter refers to a parameter related to the source device and the target device, which is required when the source device and the target device establish a binding relationship. The binding parameters of the source device include, but are not limited to, an attribute identifier of the source device, a cluster identifier of the source device, an industry specification identifier of the source device, and a second synchronization condition corresponding to the source device, and the binding parameters of the target device include, but are not limited to, an attribute identifier of the target device, a cluster identifier of the target device, an industry specification identifier of the target device, and the first synchronization condition.
(8) Plural means two or more.
(9) And/or, describing the association relationship of the associated objects, indicating that three relationships may exist. For example, a and/or B, may represent: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship.
In addition, it is to be understood that the terms first, second, etc. used in the description of the present application are used for distinguishing between descriptions and not necessarily for describing a sequential or chronological order.
An application scenario and a system architecture of the embodiment of the present application are described below with reference to the drawings.
The system architecture of the ZigBee network is shown in fig. 2, and mainly includes a coordinator and terminal devices (a source device and a target device), and can form networks with different structures such as star, tree, mesh, and the like. The coordinator is a core node of the ZigBee network, has strong communication capacity and processing capacity, is responsible for building, maintaining and managing the network and realizing data transmission of each node in the ZigBee network, and the terminal equipment is specifically executed data acquisition and transmission equipment in the ZigBee network. For the tree-type and mesh networks, the ZigBee network system further includes a router, and the router is a device supporting association and can implement a message forwarding function of other nodes.
The ZigBee network is initiated and established by a coordinator, after the coordinator initiates a process of establishing a new network, channel scanning is firstly carried out, a proper channel for establishing the new network is determined, then a personal area network identifier (PAN ID) and a network address are selected for the new network to complete network initialization, other equipment is waited to be added into the network, and a terminal device and a router are added into the new network through the coordinator, so that the establishment of the new network is completed.
Based on the ZigBee network architecture shown in fig. 2, an embodiment of the present application provides a data synchronization method based on ZigBee binding, referring to fig. 3, where M source devices and N target devices that establish a binding relationship through a coordinator are a source device 1, a source device 2 …, a source device M …, a target device 1, and a target device 2 …, respectively, and the data synchronization method based on ZigBee binding specifically includes the following steps:
s301: and the m source devices in the binding relationship established by the coordinator send the attribute identifications of the m source devices and the corresponding attribute values to the coordinator.
The binding relationship comprises attribute identifications of M source devices, attribute identifications of N target devices, attribute values corresponding to the attribute identifications of the N target devices and a first synchronization condition, wherein M, M and N are positive integers, and M is less than or equal to M.
Correspondingly, the coordinator receives the attribute identifications and the corresponding attribute values sent by the m source devices in the binding relationship.
Optionally, an attribute value corresponding to the attribute identifier sent by any one of the m source devices meets a second synchronization condition corresponding to the source device, that is, the m source devices send the attribute values of the m source devices and the corresponding attribute identifiers to the coordinator only when the attribute values of the m source devices meet the corresponding second synchronization condition.
In implementation, the second synchronization conditions corresponding to the m source devices may be the same or different. For any source device, the second synchronization condition corresponding to the source device may be a size relationship between an attribute value corresponding to the set attribute identifier of the source device and a preset value. Specifically, the second synchronization condition corresponding to the source device may be that an attribute value corresponding to the attribute identifier of the source device is greater than a preset value, or an attribute value corresponding to the attribute identifier of the source device is smaller than a preset value, or an attribute value corresponding to the attribute identifier of the source device is not equal to a preset value, or an attribute value corresponding to the attribute identifier of the source device is not smaller than a preset value, or an attribute value corresponding to the attribute identifier of the source device is not greater than a preset value, or an attribute value corresponding to the attribute identifier of the source device is equal to a preset value, and the like. For example, assuming that the M source devices are lamp 1, lamp 2 …, lamp M, the second synchronization condition for lamp 1 may be that the stream brightness is greater than 40, the second synchronization condition for lamp 2 may be that the stream brightness is greater than 50, the second synchronization condition for lamp M may be that the stream brightness is less than 80, or the second synchronization conditions for lamp 1, lamp 2 …, lamp M are both greater than 60.
S302: and when determining that the attribute identifiers sent by the M source devices are the attribute identifiers of the source devices in the binding relationship, the coordinator acquires the attribute values corresponding to the attribute identifiers of the remaining source devices except the M source devices in the binding relationship, and determines that the attribute values corresponding to the attribute identifiers of the M source devices meet the second synchronization condition.
In implementation, for a received attribute value corresponding to an attribute identifier that is sent by any source device and is the same as the attribute identifier of the source device in the binding relationship, the coordinator stores the attribute identifier sent by the source device and the corresponding attribute value, and if the attribute value of the source device already exists in the coordinator, the attribute value of the source device is updated.
In implementation, the coordinator may determine whether the attribute values sent by the M source devices satisfy the first synchronization condition by: the coordinator calculates attribute values corresponding to the attribute identifications of the M source devices according to a preset operation rule to obtain a calculation result; the coordinator determines that the calculation result satisfies the first synchronization condition.
Wherein, the preset operation rule includes but is not limited to any one of the following operation rules: calculating an average value of the attribute values corresponding to the attribute identifications of the M source devices, calculating a maximum value of the attribute values corresponding to the attribute identifications of the M source devices, and calculating a minimum value of the attribute values corresponding to the attribute identifications of the M source devices, where the first synchronization condition includes, but is not limited to, any one of the following relationships: the method comprises the steps that a calculation result obtained by the coordinator according to a preset operation rule is larger than a set value, a calculation result obtained by the coordinator according to the preset operation rule is smaller than the set value, a calculation result obtained by the coordinator according to the preset operation rule is equal to the set value, a calculation result obtained by the coordinator according to the preset operation rule is not smaller than the set value, and a calculation result obtained by the coordinator according to the preset operation rule is not larger than the set value.
In a specific embodiment, the binding relationship established by the coordinator corresponds to a set port of the coordinator, and the coordinator calculates the attribute values corresponding to the attribute identifiers of the M source devices in the binding relationship corresponding to the set port according to the preset operation rule, so that the calculation processes of the coordinator on the attribute values of the source devices in different binding relationships are kept relatively independent, and the accuracy of the calculation result is ensured. And the coordinator receives the attribute identifications and the corresponding attribute values sent by the m source devices through the set port, and sends the attribute identifications and the corresponding attribute values of the N target devices to the corresponding target devices through the set port.
S303: and the coordinator sends the attribute identifications of the N target devices and the attribute values corresponding to the attribute identifications of the N target devices to the corresponding target devices.
Correspondingly, for any one target device in the N target devices, the target device receives the attribute identifier of the target device and the attribute value corresponding to the attribute identifier of the target device, which are sent by the coordinator, and updates the attribute value corresponding to the corresponding attribute identifier in the target device to the attribute value sent by the coordinator.
In implementation, the coordinator sends the attribute identifiers of the N target devices and the attribute values corresponding to the attribute identifiers of the N target devices in the binding relationship to the corresponding target devices only when the attribute values corresponding to the attribute identifiers of the M source devices satisfy the first synchronization condition.
By the method, the coordinator determines that the received attribute identifications sent by the M source devices are the same as the attribute identifications of the M source devices in the binding relationship, obtains the attribute values corresponding to the attribute identifications of the remaining source devices in the binding relationship, and sends the attribute identifications of the N target devices in the binding relationship and the corresponding attribute values to the corresponding target devices respectively when the attribute values corresponding to the attribute identifications of the M source devices meet a first synchronization condition, so that the synchronous data volume of the source devices and the target devices establishing the binding relationship through the coordinator can be effectively reduced. And the data sent by the coordinator to the N target devices are the attribute identifiers and corresponding attribute values set in the binding relationship, that is, the attributes sent by the M source devices to the coordinator may be the same as or different from the attributes sent by the coordinator to the N target devices, so that the data synchronization between the source device and the target device that establish the binding relationship through the coordinator is more flexible, for example, the attribute of the source device in the binding relationship established by the coordinator may be a stream brightness, and the attribute of the target device bound to the source device may be an on/off attribute.
In implementation, before the coordinator receives the attribute identifiers and the corresponding attribute values sent by the M source devices in the binding relationship established by the coordinator, the coordinator also establishes the binding relationship, so that the M source devices are bound with the N target devices through the coordinator. Specifically, a process of binding the M source devices with the N target devices through the coordinator is shown in fig. 4, and includes the following steps:
s401: the coordinator obtains a first instruction for establishing the binding relationship, where the first instruction includes the identifier of the set port of the coordinator corresponding to the binding relationship, the binding parameters of the M source devices, and the binding parameters of the identifiers of the N target devices.
Wherein the binding parameters of the M source devices include: the identifiers of the M source devices, the attribute identifiers of the M source devices, the second synchronization conditions corresponding to the M source devices, the cluster identifiers corresponding to the attribute identifiers of the M source devices, and the industry specification identifiers corresponding to the cluster identifiers of the M source devices, and the binding parameters of the identifiers of the N target devices: the identifiers of the N target devices, the attribute values corresponding to the attribute identifiers of the N target devices, the first synchronization condition, the cluster identifiers corresponding to the attribute identifiers of the N target devices, and the industry specification identifiers corresponding to the cluster identifiers of the N target devices.
In a specific embodiment, the first instruction is issued to the coordinator by the user through the server, or is generated by the coordinator according to an operation of establishing the binding relationship input by the user. And after the coordinator obtains the first instruction, generating a response message of the first instruction, wherein the response message is used for indicating whether the coordinator can establish the binding relationship.
Optionally, the port identifier of the coordinator corresponding to the binding relationship carried in the first instruction may be an identifier of an idle port of the coordinator that is applied by the coordinator before the coordinator acquires the first instruction, or may be an identifier of a port of the coordinator set by a server that sends the first instruction. The port identifier of the coordinator corresponding to the binding relationship may be a port number of the coordinator, and a value range is represented by 0x01-0xff by hexadecimal.
Optionally, the identifiers of the M source devices include types of the M source devices, or the identifiers of the M source devices include addresses of the M source devices, port identifiers of the M source devices, and address types of the M source devices; the identifiers of the N target devices include types of the N target devices, or the identifiers of the N target devices include addresses of the N target devices, port identifiers of the N target devices, and address types of the N target devices. The address type of any source device and the address type of any target device may be 64-bit IEEE addresses or other address types recognizable by the coordinator, the 64-bit IEEE addresses may be represented by 0x00, and other address types may be represented by values in 0x01-0 xff. Specifically, if the identifiers of the M source devices carried in the first instruction are the types of the M source devices, the coordinator sets, as the source devices, the M terminal devices having the same device type as the types of the M source devices according to the device types of the terminal devices on line in the network; if the identifier of the N target devices carried in the first instruction is the type of the N target devices, the coordinator sets, as the target devices, the N terminal devices having the same device type as the type of the N target devices according to the device type of the terminal device on line in the network.
Specifically, the attribute identifiers of the M source devices, the cluster identifiers corresponding to the attribute identifiers of the M source devices, the industry standard identifiers corresponding to the cluster identifiers of the M source devices, the attribute identifiers of the N target devices, the cluster identifiers corresponding to the attribute identifiers of the N target devices, and the industry standard identifiers corresponding to the cluster identifiers of the N target devices may be represented by numerical values, and a value range is 0x0000-0 xffff.
In a specific embodiment, the first instruction may be implemented by an APSME-CC-bind request primitive as follows:
Figure GDA0002488304970000091
Figure GDA0002488304970000101
wherein ccendpointrepresents the set port identifier of the coordinator corresponding to the binding relationship, SrcAddrMode represents the address Type of the source device, each element in the array SrcAddr [1 … M ] represents the address of the M source devices, each element in the array SrcEndpoint [1 … M ] represents the port number of the M source devices, SrcProfileId represents the industry specification identifier of the M source devices, srclsterid represents the cluster identifier of the M source devices, SrcAttrId represents the attribute identifier of the M source devices, each element in the array srcatrsyncflag [1 … M ] represents the logical relationship (such as equal to, less than or greater than, etc.) in the second synchronization Condition corresponding to the M source devices, each element in srcatrsyncval [1 … M ] represents the preset value in the second synchronization Condition corresponding to the M source devices, and the Type of the operation rule in the second synchronization Condition, ConditionOp represents a logical relationship (such as equal to, less than or greater than or equal to) in a first synchronization condition, ConditionVal represents a set value in the first synchronization condition, DstAddrMode represents an address type of a target device, an array DstAddr [1 … N ] represents addresses of the N target devices, each element in the array DstEndpoint [1 … N ] represents a port number of the N target devices respectively, DstProfileId represents an industry specification identifier of the N target devices, DstClusterId represents a cluster identifier of the N target devices, DstAtttrId represents an attribute identifier of the N target devices, and each element in the array DstAtttrVal [1 … N ] represents an attribute value corresponding to the attribute identifier of the N target devices respectively.
Specifically, the values of SrcProfileid, SrcClusterId, SrcAttrId, DstProfileid, DstClusterId and DstAttrid range from 0x0000 to 0 xffff. The values of the elements in srcattsyncflag [1 … M ] and ConditionOp range from 0x00 to 0xff, 0x00 is smaller than 0x01 is larger than 0x02, 0x03 is smaller than or equal to 0x04, 0x05 is not equal to 0x05-0xff is a reserved item, and the subsequent extension is performed, for example, when the first element in srcatrsyncflag [1 … M ] is 0x00 and the first element in srcatrsyncval [1 … M ] is 50, the second synchronization condition corresponding to the source device indicated by the first element in srcatdsyncflag [1 … M ] and SrcEndpoint [1 … M ] is that the attribute value corresponding to the srcatrtrid is smaller than 50. The value range of the Condition Type is 0x00-0xff, 0x00 represents that the maximum value of the attribute values corresponding to the attribute identifications of the M source devices is calculated, 0x01 represents that the minimum value of the attribute values corresponding to the attribute identifications of the M source devices is calculated, 0x02 represents that the average value of the attribute values corresponding to the attribute identifications of the M source devices is calculated, 0x03-0xff is a reserved item, and the following extension is performed, for example, when the Condition Type is 0x02, the Condition val is 60, and the Condition op is 0x03, the first synchronization Condition is that the average value of the attribute values corresponding to the attribute identifications of the M source devices is less than or equal to 60.
The response message of the first instruction may be implemented by an APSME-CC-bind.
Figure GDA0002488304970000102
The Status is used for feeding back whether the coordinator can establish the binding relationship according to the first instruction, and may be "SUCCESS", "NOT _ SUPPORT", "illearl _ REQUEST", or "TABLE _ FULL". When Status is "SUCCESS", it indicates that the configuration of the binding parameter in the first instruction is correct, and the coordinator may establish the binding relationship according to the first instruction; when Status is "NOT _ SUPPORT", it indicates that the coordinator does NOT SUPPORT the first instruction (e.g. a binding parameter configuration error in the first instruction), and the coordinator cannot establish the binding relationship; when Status is "ILLEGAL _ REQUEST," it indicates that the first instruction is an ILLEGAL REQUEST; when Status is "TABLE _ FULL", it indicates that the AIB of the coordinator is FULL, the binding relationship established according to the first instruction cannot be saved, and the binding relationship cannot be established.
S402: and the coordinator establishes and stores the binding relationship on a port corresponding to the identifier of the set port of the coordinator according to the first instruction, wherein the binding relationship comprises the identifier of the set port, the binding parameters of the M source devices, the attribute identifier pairs of the N target devices, the cluster identifiers corresponding to the attribute identifiers of the N target devices, the industry standard identifiers corresponding to the cluster identifiers of the N target devices, and the first synchronization condition binding parameter.
Specifically, the coordinator saves the binding relationship in the AIB of the coordinator.
S403: the coordinator sends binding establishment requests to the M source devices respectively, and for any one source device, the binding establishment requests carry the identifier of the set port and the binding parameters of the source device in the binding relationship (the attribute identifier of the source device, the cluster identifier corresponding to the attribute identifier of the source device, the industry standard identifier corresponding to the cluster identifier of the source device, and the second synchronization condition corresponding to the source device).
Correspondingly, for any source device, after receiving the binding request, the source device stores the attribute identifier of the source device, the cluster identifier corresponding to the attribute identifier of the source device, the industry standard identifier corresponding to the cluster identifier of the source device, the second synchronization condition corresponding to the source device, and the identifier of the set port of the coordinator corresponding to the binding relationship, which are carried in the binding establishment request. Specifically, the source device stores the parameters carried in the binding request in the AIB.
In a specific embodiment, the binding establishment request sent by the coordinator to any source DEVICE may be implemented by an END _ DEVICE _ CC _ BIND _ REQ primitive as follows:
Figure GDA0002488304970000111
wherein SrcEndpoint represents a port number of the source device in the binding relationship (i.e., an element corresponding to the source device in the array SrcEndpoint [1 … M ]), profield represents an industry specification identifier of the source device in the binding relationship, ClusterId represents a cluster identifier of the source device in the binding relationship, AttrId represents an attribute identifier of the source device in the binding relationship, attrcsyncflag represents a logical relationship in a second synchronization condition corresponding to the source device in the binding relationship (i.e., an element corresponding to the source device in the array srcatrsyncflag [1 … M ]), and attrcval represents a set value in the second synchronization condition corresponding to the source device in the binding relationship (i.e., an element corresponding to the source device in the array srcatrcval [1 … M ]).
S404: and the M source devices generate binding establishment confirmation messages and send the binding establishment confirmation messages to the coordinator.
In a specific embodiment, the binding establishment confirmation message generated by any one of the M source DEVICEs may be implemented by END _ DEVICE _ CC _ BIND _ RSP as follows:
Figure GDA0002488304970000112
the Status is used to feedback whether the source device is successfully bound, and may be "SUCCESS", "NOT _ SUPPORT", "ilegal _ REQUEST", or "TABLE _ FULL". When Status is "SUCCESS", it indicates that the source device is successfully bound; when Status is "NOT _ SUPPORT", it indicates that the source device does NOT SUPPORT the binding establishment request (e.g., the binding request carries an erroneous parameter) sent by the coordinator to the source device, and the source device fails to bind; when Status is "ILLEGAL _ REQUEST", it indicates that the binding establishment REQUEST sent by the coordinator to the source device is an ILLEGAL REQUEST, and the source device binding fails; when Status is "TABLE _ FULL", it indicates that the AIB of the source device is FULL, the binding parameter carried in the binding establishment request sent to the source device by the coordinator cannot be saved, and the binding of the source device fails.
S405: and the coordinator respectively receives the binding establishment confirmation messages sent by the M source devices, and determines that the M source devices and the N target devices establish binding through the coordinator according to the binding establishment requests.
Through the above S401-S404, the M source devices and the N target devices establish binding in an attribute layer through the coordinator, so that the M source devices send the attribute identifiers of the M source devices and the corresponding attribute values to the coordinator when the attribute values corresponding to the attribute identifiers sent to the M source devices by the coordinator satisfy the corresponding second synchronization conditions, and the coordinator sends the attribute identifiers of the N target devices and the corresponding attribute values in the binding relationship to the corresponding target devices when the attribute values sent by the M source devices satisfy the first synchronization conditions, so as to achieve the purpose of reducing the amount of synchronization data of the M source devices and the N target devices establishing the binding relationship. And the binding relationship established by the coordinator further includes cluster identifiers corresponding to the attribute identifiers of the M source devices, industry standard identifiers corresponding to the cluster identifiers of the M source devices, cluster identifiers corresponding to the attribute identifiers of the N target devices, and industry standard identifiers corresponding to the cluster identifiers of the N target devices, so that the M source devices and the N target devices can be bound based on different industry standards and/or attributes under different clusters, and the binding is more flexible. In addition, the coordinator may establish a correspondence between the plurality of source devices and the one or more target devices according to the first instruction, and may reduce workload of binding deployment.
In implementation, after the M source devices establish the binding relationship with the N target devices through the coordinator, the binding relationship may be released according to a second instruction for releasing the binding relationship, as shown in fig. 5, which specifically includes the following steps:
s501: the coordinator obtains a second instruction for releasing the binding relationship.
Optionally, the second instruction carries a port identifier of the coordinator corresponding to the binding relationship or binding parameters related to the M source devices and the N target devices included in the binding relationship, so as to indicate the binding relationship to be released.
In implementation, after acquiring the second instruction, the coordinator generates a response message of the second instruction to indicate whether the coordinator can release the binding relationship.
In a specific embodiment, the second instruction may be implemented by an APSME-CC-unknown.
APSME-CC-UNBIND.request{
CCEndpoint,
}
The response message of the second instruction may be implemented by an APSME-CC-unknown.
Figure GDA0002488304970000121
The Status is used for feeding back whether the coordinator can release the binding relationship, and may be "SUCCESS", "NOT _ SUPPORT", "ilegal _ REQUEST", or "TABLE _ FULL". When Status is "SUCCESS", it indicates that the coordinator can release the binding relationship; when Status is "NOT _ SUPPORT", it indicates that the coordinator does NOT SUPPORT the second instruction (e.g. a parameter error carried in the second instruction); when Status is "ILLEGAL _ REQUEST," it indicates that the second instruction is an ILLEGAL REQUEST; when Status is "TABLE _ FULL", it indicates that the AIB of the coordinator is FULL. When Status is "NOT _ SUPPORT", "ILLEGAL _ REQUEST", the binding relationship may NOT be released.
S502: and the coordinator respectively sends unbinding requests to the M source devices.
Optionally, the unbinding request carries the port identifier of the coordinator corresponding to the binding relationship or the binding parameters related to the M source devices included in the binding relationship, so as to indicate the binding relationship to be unbound.
In a specific embodiment, the unbinding request sent by the coordinator to any source DEVICE may be implemented by an END _ DEVICE _ CC _ UNBIND _ REQ primitive as follows:
END_DEVICE_CC_UNBIND_REQ{
CCEndpoint,
}
s503: and for any source device in the M source devices, deleting the binding parameters stored by the M source devices and generating a binding release confirmation message by the source device. For any source device, the binding parameters stored by the source device include a property identifier of the source device, a cluster identifier corresponding to the property identifier of the source device, an industry specification identifier corresponding to the cluster identifier of the source device, a second synchronization condition corresponding to the source device, and an identifier of a set port of the coordinator corresponding to the binding relationship.
In a specific embodiment, the generation of the binding release acknowledgement message by any source DEVICE may be implemented by an END _ DEVICE _ CC _ unbound _ RSP primitive as follows:
Figure GDA0002488304970000131
the Status is used to feed back whether the source device is unbound, and may be "SUCCESS", "NOT _ SUPPORT", "ilegal _ REQUEST", or "TABLE _ FULL". When Status is "SUCCESS", it indicates that the source device successfully releases the binding relationship; when Status is "NOT _ SUPPORT", it indicates that the source device does NOT SUPPORT a unbinding request sent by the coordinator to the source device (e.g., a parameter error carried in the unbinding request); when Status is "ILLEGAL _ REQUEST", it indicates that the unbinding REQUEST sent by the coordinator to the source device is an ILLEGAL REQUEST; when Status is "TABLE _ FULL", it indicates that the AIB of the source device is FULL. When Status is "SUCCESS", "NOT _ SUPPORT", "ILLEGAL _ REQUEST", or "TABLE _ FULL", the coordinator may delete the stored binding relationship.
S504: for any one of the M source devices, the source device sends a generation binding release confirmation message to the coordinator.
S505: and the coordinator deletes the binding relationship and releases the port of the coordinator corresponding to the binding relationship.
Or after the coordinator executes S501 and S502, if it is determined that the binding release confirmation message sent by any one of the source devices is not received within the set time duration, the binding relationship is directly deleted, and the port of the coordinator corresponding to the binding relationship is released. The set time period can be set according to actual needs, for example, the set time period can be set to 24 hours.
In this case, the plurality of source devices may be physically integrated into one source device, and the plurality of target devices may also be physically integrated into one target device, where the plurality of source devices are a plurality of objects in the integrated source device, and the plurality of target devices are a plurality of objects in the integrated target device.
The data synchronization method based on ZigBee binding provided by the present application is described in detail below with a specific embodiment. Fig. 6 shows a data synchronization process after a source device 1 and a source device 2 establish a binding relationship with a target device 1 through a coordinator, where in the binding relationship, attribute identifiers of the source device 1 and the source device 2 are identifiers of stream brightness, an attribute identifier of the target device 1 is an identifier of an on/off attribute, an attribute value corresponding to the identifier of the on/off attribute is an attribute value of an off attribute, a first synchronization condition is that an average value of the stream brightness of the source device 1 and the stream brightness of the source device 2 is greater than 60, a second synchronization condition corresponding to the source device 1 and the source device 2 is that a lumen degree is greater than 40, a port of the coordinator corresponding to the binding relationship is a CCEndpoint port, and the data synchronization process specifically includes the following steps:
s601: the source device 1 obtains its own value of the stream brightness, and determines that the lumen level of the source device 1 satisfies the second synchronization condition corresponding to the source device 1, that is, determines that the value of the stream brightness of the source device 1 is greater than 40, that is, the source device 1 determines that the lumen level of the source device 1 satisfies the second synchronization condition corresponding to the source device 1.
Wherein the second synchronization condition corresponding to the source device 1 is stored in the AIB of the source device 1.
S602: the source device 1 sends the indication and the value of the lumen degree of the source device 1 to the coordinator through the CCEndpoint port.
Specifically, the source device 1 reads the binding parameters stored in the AIB to obtain the CCENDPOINT port of the coordinator corresponding to the binding relationship, and writes the value of the stream brightness of the source device 1 into the CCENDPOINT port of the coordinator through the ZCL operation.
S603: source device 2 obtains its own lumen level and determines that the lumen level of source device 2 satisfies the second synchronization condition corresponding to source device 2, i.e., source device 2 determines that its own stream brightness value is greater than 40.
Wherein the second synchronization condition corresponding to the source device 2 is stored in the AIB of the source device 2.
S604: the source device 2 sends the indication and the value of the lumen degree of the source device 2 to the coordinator through the CCEndpoint port.
Specifically, the source device 2 reads the binding parameters stored in the AIB to obtain the CCEndpoint port of the coordinator corresponding to the binding relationship, and writes the value of the stream brightness of the source device 2 into the CCEndpoint port of the coordinator through the ZCL operation.
It should be noted that, in the embodiment of the present application, it is not limited to the sequence in which the source device 1 and the source device 2 obtain the attribute values corresponding to their own attribute identifiers and send the attribute identifiers meeting the first condition and the corresponding attribute values to the coordinator, and it is two mutually independent processes that the source device 1 obtains the attribute values corresponding to its own attribute identifiers and sends the attribute identifiers meeting the first condition and the corresponding attribute values to the coordinator and the source device 2 obtains the attribute values corresponding to its own attribute identifiers and sends the attribute identifiers meeting the first condition and the corresponding attribute values to the coordinator.
S605: the coordinator calculates an average of the stream lightness of the source device 1 and the stream lightness of the source device 2, and determines that the average of the stream lightness of the source device 1 and the stream lightness of the source device 2 satisfies a first synchronization condition, that is, the average of the stream lightness of the source device 1 and the stream lightness of the source device 2 is greater than 60.
It should be noted that, in this embodiment, it is not limited that the coordinator determines whether the attribute value corresponding to the attribute identifier of the source device 1 and the attribute value corresponding to the attribute identifier of the source device 2 satisfy the first synchronization condition only when receiving the attribute identifier and the corresponding attribute value sent by the source device 1 and the attribute identifier and the corresponding attribute value sent by the source device 2, and the coordinator may also determine whether the attribute value corresponding to the attribute identifier of the source device 1 and the attribute value corresponding to the attribute identifier of the source device 2 satisfy the first synchronization condition when receiving the attribute identifier and the corresponding attribute value sent by the source device 1 or the attribute identifier and the corresponding attribute value sent by the source device 2. If the coordinator only receives the attribute identifier and the corresponding attribute value sent by the source device 1, acquiring the attribute value corresponding to the attribute identifier of the source device 2 stored in the coordinator, and judging whether the attribute value corresponding to the attribute identifier of the source device 1 and the attribute value corresponding to the attribute identifier of the source device 2 meet a first synchronization condition; if the coordinator receives only the attribute identifier and the corresponding attribute value sent by the source device 2, the attribute value corresponding to the attribute identifier of the source device 1 stored in the coordinator is obtained, and whether the attribute value corresponding to the attribute identifier of the source device 1 and the attribute value corresponding to the attribute identifier of the source device 2 meet the first synchronization condition is judged.
S606: the coordinator sends the attribute value corresponding to the off attribute of the target device 1 stored in the AIB to the target device 1.
Specifically, the coordinator writes an attribute value corresponding to the off attribute of the target device 1 into the target device 1 of the coordinator by the ZCL operation.
Based on the above embodiments, an embodiment of the present application further provides a coordinator, where the coordinator is configured to implement the data synchronization method based on ZigBee binding as shown in fig. 3, and referring to fig. 7, the coordinator 700 includes: a receiving unit 701, a processing unit 702 and a transmitting unit 703.
A receiving unit 701, configured to receive attribute identifiers and corresponding attribute values sent by m source devices, where m is a positive integer;
a processing unit 702, configured to, when determining that the attribute identifiers sent by the M source devices are the attribute identifiers of the source devices in a binding relationship, obtain attribute values corresponding to the attribute identifiers of the remaining source devices except the M source devices in the binding relationship, and when determining that the attribute values corresponding to the attribute identifiers of the M source devices satisfy a first synchronization condition, instruct a sending unit 703 to send the attribute identifiers of the N target devices and the corresponding attribute values to corresponding target devices; wherein, the binding relationship includes attribute identifiers of M source devices, attribute identifiers of N target devices, attribute values corresponding to the attribute identifiers of the N target devices, and the first synchronization condition, M, N is a positive integer, and M is less than or equal to M;
a sending unit 703, configured to send the attribute identifiers of the N target devices and the corresponding attribute values to the corresponding target devices according to the instruction of the processing unit 702.
Optionally, the processing unit 702 is specifically configured to: and calculating the attribute values corresponding to the attribute identifications of the M source devices according to a preset operation rule to obtain a calculation result, and determining that the calculation result meets the first synchronization condition.
Optionally, the binding relationship corresponds to a set port of the coordinator; the receiving unit 701 is specifically configured to: receiving the attribute identifications and the corresponding attribute values sent by the m source devices through the set port; the processing unit 702 is specifically configured to: calculating attribute values corresponding to the attribute identifications of the M source devices in the binding relationship corresponding to the set port according to the preset operation rule; the sending unit 703 is specifically configured to: and sending the attribute identifications and the corresponding attribute values of the N target devices to the corresponding target devices through the set ports according to the instruction of the processing unit 702.
Optionally, an attribute value corresponding to the attribute identifier sent by any one of the m source devices meets a second synchronization condition corresponding to the source device.
Optionally, before the receiving unit 701 receives the attribute identifications and the corresponding attribute values sent by the m source devices, the processing unit 702 is further configured to: acquiring a first instruction for establishing the binding relationship, wherein the first instruction comprises the identifier of the set port, the binding parameters of the M source devices and the binding parameters of the N target devices; wherein the binding parameters of the M source devices include identifiers of the M source devices, attribute identifiers of the M source devices, second synchronization conditions corresponding to the M source devices, cluster identifiers corresponding to the attribute identifiers of the M source devices, and industry specification identifiers corresponding to the cluster identifiers of the M source devices, and the binding parameters of the N target devices include: the identifiers of the N target devices, the attribute values corresponding to the attribute identifiers of the N target devices, the first synchronization condition, the cluster identifiers corresponding to the attribute identifiers of the N target devices, and the industry specification identifiers corresponding to the cluster identifiers of the N target devices;
according to the first instruction, establishing and storing the binding relationship on the port corresponding to the identifier of the set port, wherein the binding relationship comprises the identifier of the set port, the binding parameters of the M source devices and the binding parameters of the N target devices;
the sending unit 703 is further configured to: sending binding establishment requests to the M source devices respectively according to the instruction of the processing unit 702, where the binding establishment requests carry the identifier of the set port and the binding parameters of the source device for any one source device;
the receiving unit 701 is further configured to: respectively receiving binding establishment confirmation messages sent by the M source devices; the processing unit 702 is further configured to determine, according to the binding establishment confirmation message received by the receiving unit 701, that the M source devices and the N target devices establish binding through the coordinator.
Optionally, the identifiers of the M source devices include types of the M source devices, or the identifiers of the M source devices include addresses of the M source devices, port identifiers of the M source devices, and address types of the M source devices; the identifiers of the N target devices include types of the N target devices, or the identifiers of the N target devices include addresses of the N target devices, port identifiers of the N target devices, and address types of the N target devices.
Optionally, the processing unit 702 is further configured to: acquiring a second instruction for removing the binding relationship;
the sending unit 703 is further configured to: sending unbinding requests to the M source devices respectively according to the instruction of the processing unit 702;
the processing unit 702 is further configured to: when determining that the receiving unit 701 receives the binding release confirmation messages sent by the M source devices or when determining that the binding release confirmation message sent by any one of the source devices is not received within a set time length, deleting the binding relationship, and releasing the port of the coordinator corresponding to the binding relationship.
It should be noted that the division of the unit in the embodiment of the present application is schematic, and is only a logic function division, and there may be another division manner in actual implementation. The functional modules in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, a network device, or the like) or a processor (processor) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a read-only memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
Based on the above embodiments, the present application further provides a coordinator, which is configured to implement the data synchronization method based on ZigBee binding as shown in fig. 3, and has the function of the coordinator 700 as shown in fig. 7. Referring to fig. 8, the coordinator 800 includes: a transceiver 801, a memory 802, and a processor 803. The processor 803 is interconnected with the transceiver 801 and the memory 802.
A transceiver 801, configured to receive attribute identifiers and corresponding attribute values sent by m source devices, where m is a positive integer;
a memory 802 for storing program instructions;
a processor 803, for calling the program instructions stored in the memory 802, and executing:
when determining that the attribute identifiers sent by the M source devices are the attribute identifiers of the source devices in a binding relationship, obtaining the attribute values corresponding to the attribute identifiers of the remaining source devices except the M source devices in the binding relationship, where the binding relationship includes the attribute identifiers of the M source devices, the attribute identifiers of the N target devices, the attribute values corresponding to the attribute identifiers of the N target devices, and a first synchronization condition, M, N is a positive integer, and M is less than or equal to M;
when determining that the attribute values corresponding to the attribute identifiers of the M source devices satisfy the first synchronization condition, instructing the transceiver 801 to send the attribute identifiers and the corresponding attribute values of the N target devices to the corresponding target devices.
Alternatively, memory 802 may include volatile memory (volatile memory), such as random-access memory (RAM); the memory may also include a non-volatile memory (non-volatile) such as a flash memory (flash memory), a Hard Disk Drive (HDD) or a solid-state drive (SSD); the memory 802 may also comprise a combination of the above-described types of memory.
Alternatively, the processor 803 may be a Central Processing Unit (CPU), a Network Processor (NP), or a combination of a CPU and an NP. The processor 803 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a Programmable Logic Device (PLD), or a combination thereof. The PLD may be a Complex Programmable Logic Device (CPLD), a field-programmable gate array (FPGA), a General Array Logic (GAL), or any combination thereof.
Alternatively, the processor 803 and the transceiver 801, the memory 802 may be interconnected by a bus 804. The bus 804 may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 8, but this is not intended to represent only one bus or type of bus.
Optionally, the memory 802 is further configured to store the binding relationship established by the processor 803, the attribute identifiers and the corresponding attribute values sent by the m source devices, and the like. The memory 802 may comprise RAM, and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
Optionally, an attribute value corresponding to the attribute identifier sent by any one of the m source devices meets a second synchronization condition corresponding to the source device.
Optionally, the processor 803 is specifically configured to call the program instructions stored in the memory 802 to perform:
and calculating the attribute values corresponding to the attribute identifications of the M source devices according to a preset operation rule to obtain a calculation result, and determining that the calculation result meets the first synchronization condition.
Optionally, the binding relationship corresponds to a set port of the coordinator;
the transceiver 801 is specifically configured to: receiving the attribute identifications and the corresponding attribute values sent by the m source devices through the set port;
the processor 803 is specifically configured to call the program instructions stored in the memory 802 to perform: calculating attribute values corresponding to the attribute identifications of the M source devices in the binding relationship corresponding to the set port according to the preset operation rule;
the transceiver 801 is specifically configured to: and sending the attribute identifications and the corresponding attribute values of the N target devices to the corresponding target devices through the set port according to the instruction of the processor 803.
Optionally, before the transceiver 801 receives the attribute identifications and the corresponding attribute values sent by the m source devices, the processor 803 is further configured to call the program instructions stored in the memory 802 to perform:
acquiring a first instruction for establishing the binding relationship, wherein the first instruction comprises the identifier of the set port of the coordinator corresponding to the binding relationship, the binding parameters of the M source devices and the binding parameters of the N target devices; wherein the binding parameters of the M source devices include: the identifiers of the M source devices, the attribute identifiers of the M source devices, the second synchronization conditions corresponding to the M source devices, the cluster identifiers corresponding to the attribute identifiers of the M source devices, and the industry specification identifiers corresponding to the cluster identifiers of the M source devices, where the binding parameters of the N target devices include: the identifiers of the N target devices, the attribute values corresponding to the attribute identifiers of the N target devices, the first synchronization condition, the cluster identifiers corresponding to the attribute identifiers of the N target devices, and the industry specification identifiers corresponding to the cluster identifiers of the N target devices;
according to the first instruction, establishing and storing the binding relationship on the port corresponding to the identifier of the set port, wherein the binding relationship comprises the identifier of the set port, the binding parameters of the M source devices and the binding parameters of the N target devices;
the transceiver 801 is instructed to send binding establishment requests to the M source devices, and for any source device, the binding establishment requests carry the identifier of the set port of the coordinator corresponding to the binding relationship and the binding parameters of the source device in the binding relationship;
the transceiver 801 is also used to: respectively receiving binding establishment confirmation messages sent by the M source devices; the processor 803 is also configured to: and determining that the M source devices and the N target devices establish binding through the coordinator according to the binding establishment confirmation message.
Optionally, the processor 803 is further configured to call the program instructions stored in the memory 802 to perform:
acquiring a second instruction for removing the binding relationship;
instructing the transceiver 801 to send an unbinding request to the M source devices, respectively;
and when determining that the transceiver 801 receives the binding release confirmation messages sent by the M source devices or determines that the binding release confirmation message sent by any one of the source devices is not received within a set time length, deleting the binding relationship and releasing the port of the coordinator corresponding to the binding relationship.
Optionally, an attribute value corresponding to the attribute identifier sent by any one of the m source devices meets a second synchronization condition corresponding to the source device.
The embodiment of the application provides a coordinator, and the coordinator determines that when attribute values corresponding to attribute identifiers of M source devices in a binding relationship meet a first synchronization condition, the attribute identifiers of N target devices and the corresponding attribute values in the binding relationship are respectively sent to the corresponding target devices, so that the data volume sent to the target devices by the coordinator can be reduced, and further, the synchronous data volume of the source devices and the target devices which establish the binding relationship through the coordinator is reduced.
Based on the above embodiments, the embodiment of the present application further provides a data synchronization system based on ZigBee binding, which is used to implement the data synchronization method based on ZigBee binding as shown in fig. 3. Referring to fig. 9, the system 900 includes: 901. a coordinator 902 and N target devices 903, wherein M, N is a positive integer.
Any one of the M source devices is configured to send the attribute identifier and the corresponding attribute value of the source device 902 to the coordinator 902.
A coordinator 902, configured to receive attribute identifiers and corresponding attribute values sent by M source devices in the M source devices 901, where M is a positive integer and is not greater than M; when determining that the attribute identifiers sent by the M source devices are the attribute identifiers of the source devices in a binding relationship, acquiring the attribute values corresponding to the attribute identifiers of the remaining source devices except the M source devices in the binding relationship, where the binding relationship includes the attribute identifiers of the M source devices, the attribute identifiers of the N target devices, the attribute values corresponding to the attribute identifiers of the N target devices 903, and a first synchronization condition, and N is a positive integer; and when determining that the attribute values corresponding to the attribute identifiers of the M source devices satisfy the first synchronization condition, sending the attribute identifiers and the corresponding attribute values of the N target devices 903 to the corresponding target devices.
The N target devices 903 are configured to receive the attribute identifiers and the corresponding attribute values of the corresponding target devices, which are sent by the coordinator 902 when determining that the attribute values corresponding to the attribute identifiers of the M source devices satisfy the first synchronization condition.
Optionally, the coordinator 902 is specifically configured to: and calculating the attribute values corresponding to the attribute identifications of the M source devices according to a preset operation rule to obtain a calculation result, and determining that the calculation result meets the first synchronization condition.
Optionally, the binding relationship corresponds to a set port of the coordinator;
the coordinator 902 is specifically configured to: receiving the attribute identifications and the corresponding attribute values sent by the m source devices through the set port; calculating attribute values corresponding to the attribute identifications of the M source devices in the binding relationship corresponding to the set port according to the preset operation rule to obtain a calculation result, and determining that the calculation result meets the first synchronization condition; and sending the attribute identifications of the N target devices and the corresponding attribute values to the corresponding target devices through the set ports.
Optionally, any source device 901 of the m source devices is specifically configured to: and sending the attribute value and the corresponding attribute identifier meeting the second synchronization condition corresponding to the source device to the coordinator 902.
Optionally, before the coordinator 902 receives the attribute identifications and the corresponding attribute values sent by the m source devices, it is further configured to: acquiring a first instruction for establishing the binding relationship, wherein the first instruction comprises the identifier of the set port, the binding parameters of the M source devices and the binding parameters of the N target devices; the binding parameters of the M source devices include identifiers of the M source devices, attribute identifiers of the M source devices, second synchronization conditions corresponding to the M source devices, cluster identifiers corresponding to the attribute identifiers of the M source devices, and industry specification identifiers corresponding to the cluster identifiers of the M source devices, and the attribute parameters of the N target devices include identifiers of the N target devices, attribute values corresponding to the attribute identifiers of the N target devices, the first synchronization condition, cluster identifiers corresponding to the attribute identifiers of the N target devices, and industry specification identifiers corresponding to the cluster identifiers of the N target devices;
according to the first instruction, establishing and storing the binding relationship on a port corresponding to the identifier of the set port, wherein the binding relationship comprises the identifier of the set port of the coordinator corresponding to the binding relationship, the binding parameters of the M source devices and the binding parameters of the N target devices;
sending binding establishment requests to the M source devices 901, respectively, where the binding establishment requests carry the identifier of the set port and the binding parameter of the source device in the binding relationship, for any one source device;
receiving the binding establishment confirmation messages sent by the M source devices 901, respectively, and determining that the M source devices 901 and the N target devices 903 establish binding through the coordinator according to the binding establishment confirmation messages.
Optionally, the coordinator 902 is further configured to: acquiring a second instruction for removing the binding relationship;
sending unbinding requests to the M source devices 901, respectively;
and deleting the binding relationship and releasing the set port of the coordinator corresponding to the binding relationship when determining that the binding release confirmation messages sent by the M source devices are received or determining that the binding release confirmation message sent by any one source device is not received within a set time length.
Optionally, the M source devices 901 are further configured to: receiving a unbinding request sent by the coordinator 902, generating the unbinding confirmation message, and sending the unbinding confirmation message to the coordinator 902.
To sum up, in the method, a coordinator determines that received attribute identifiers sent by M source devices are the same as attribute identifiers of M source devices in a binding relationship, obtains attribute values corresponding to the attribute identifiers of the remaining source devices in the binding relationship, and sends the attribute identifiers of N target devices in the binding relationship and the corresponding attribute values to corresponding target devices respectively when it is determined that the attribute values corresponding to the attribute identifiers of the M source devices satisfy a first synchronization condition, so that the amount of data sent to the target devices by the coordinator can be reduced, and further, the amount of synchronous data between the source devices and the target devices establishing the binding relationship through the coordinator is reduced. And the data sent by the coordinator to the N target devices are the attribute identifiers and corresponding attribute values set in the binding relationship, so that the attributes sent by the M source devices to the coordinator and the attributes sent by the coordinator to the N target devices may be the same or different.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications may be made in the embodiments of the present application without departing from the scope of the embodiments of the present application. Thus, if such modifications and variations of the embodiments of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to encompass such modifications and variations.

Claims (13)

1. A data synchronization method based on ZigBee binding is characterized by comprising the following steps:
the coordinator receives attribute identifications and corresponding attribute values sent by m source devices, wherein m is a positive integer;
when the coordinator determines that the attribute identifiers sent by the M source devices are the attribute identifiers of the source devices in a binding relationship, acquiring the attribute values corresponding to the attribute identifiers of the remaining source devices except the M source devices in the binding relationship, wherein the binding relationship comprises the attribute identifiers of the M source devices, the attribute identifiers of the N target devices, the attribute values corresponding to the attribute identifiers of the N target devices, and a first synchronization condition, M, N is a positive integer, and M is less than or equal to M;
and the coordinator sends the attribute identifications of the N target devices and the corresponding attribute values to the corresponding target devices when determining that the attribute values corresponding to the attribute identifications of the M source devices meet the first synchronization condition.
2. The method of claim 1, wherein the coordinator determining that the attribute values corresponding to the attribute identifications of the M source devices satisfy the first synchronization condition comprises:
the coordinator calculates attribute values corresponding to the attribute identifications of the M source devices according to a preset operation rule to obtain a calculation result;
the coordinator determines that the calculation result satisfies the first synchronization condition.
3. The method of claim 2, wherein the binding corresponds to a set port of the coordinator;
the method for receiving the attribute identifications and the corresponding attribute values sent by the m source devices by the coordinator comprises the following steps:
the coordinator receives the attribute identifications and the corresponding attribute values sent by the m source devices through the set port;
the coordinator calculates attribute values corresponding to the attribute identifications of the M source devices according to a preset operation rule, including:
the coordinator calculates the attribute values corresponding to the attribute identifications of the M source devices in the binding relationship corresponding to the set port according to the preset operation rule;
the coordinator sends the attribute identifications of the N target devices and the corresponding attribute values to the corresponding target devices, including:
and the coordinator sends the attribute identifications of the N target devices and the corresponding attribute values to the corresponding target devices through the set ports.
4. The method according to any one of claims 1 to 3, wherein the attribute value corresponding to the attribute identifier sent by any one of the m source devices satisfies the second synchronization condition corresponding to the source device.
5. The method of claim 3, wherein before the coordinator receives the attribute identifications and the corresponding attribute values sent by the m source devices, the method further comprises:
the coordinator acquires a first instruction for establishing the binding relationship, wherein the first instruction comprises the identifier of the set port, the binding parameters of the M source devices and the binding parameters of the N target devices; the binding parameters of the M source devices include identifiers of the M source devices, attribute identifiers of the M source devices, second synchronization conditions corresponding to the M source devices, cluster identifiers corresponding to the attribute identifiers of the M source devices, and industry specification identifiers corresponding to the cluster identifiers of the M source devices, and the attribute parameters of the N target devices include identifiers of the N target devices, attribute values corresponding to the attribute identifiers of the N target devices, the first synchronization condition, cluster identifiers corresponding to the attribute identifiers of the N target devices, and industry specification identifiers corresponding to the cluster identifiers of the N target devices;
the coordinator establishes and stores the binding relationship on the port corresponding to the identifier of the set port according to the first instruction, wherein the binding relationship comprises the identifier of the set port of the coordinator corresponding to the binding relationship, the binding parameters of the M source devices and the binding parameters of the N target devices;
the coordinator sends binding establishment requests to the M source devices respectively, and aiming at any source device, the binding establishment requests carry the identification of the set port and the binding parameters of the source device in the binding relationship;
and the coordinator respectively receives the binding establishment confirmation messages sent by the M source devices and determines that the M source devices and the N target devices establish binding through the coordinator according to the binding establishment confirmation messages.
6. The method of any one of claims 1-3, further comprising:
the coordinator acquires a second instruction for releasing the binding relationship;
the coordinator sends unbinding requests to the M source devices respectively;
and when the coordinator receives the binding removal confirmation messages sent by the M source devices or determines that the binding removal confirmation message sent by any one source device is not received within a set time length, deleting the binding relationship and releasing the set port of the coordinator corresponding to the binding relationship.
7. A coordinator, comprising: a receiving unit, a processing unit and a transmitting unit;
the receiving unit is configured to receive attribute identifiers and corresponding attribute values sent by m source devices, where m is a positive integer;
the processing unit is configured to, when it is determined that the attribute identifiers sent by the M source devices are the attribute identifiers of the source devices in the binding relationship, obtain attribute values corresponding to the attribute identifiers of the remaining source devices except the M source devices in the binding relationship, and when it is determined that the attribute values corresponding to the attribute identifiers of the M source devices satisfy a first synchronization condition, instruct the sending unit to send the attribute identifiers of the N target devices and the corresponding attribute values to the corresponding target devices; wherein, the binding relationship includes the attribute identifiers of the M source devices, the attribute identifiers of the N target devices, the attribute values corresponding to the attribute identifiers of the N target devices, and the first synchronization condition, M, N is a positive integer, and M is less than or equal to M;
and the sending unit is used for sending the attribute identifications of the N target devices and the corresponding attribute values to the corresponding target devices according to the indication of the processing unit.
8. The coordinator of claim 7, wherein the processing unit is specifically configured to:
and calculating the attribute values corresponding to the attribute identifications of the M source devices according to a preset operation rule to obtain a calculation result, and determining that the calculation result meets the first synchronization condition.
9. The coordinator of claim 8, wherein the binding corresponds to a set port of the coordinator;
the receiving unit is specifically configured to: receiving the attribute identifications and the corresponding attribute values sent by the m source devices through the set port;
the processing unit is specifically configured to: calculating attribute values corresponding to the attribute identifications of the M source devices in the binding relationship corresponding to the set port according to the preset operation rule;
the sending unit is specifically configured to: and sending the attribute identifications and the corresponding attribute values of the N target devices to the corresponding target devices through the set port according to the indication of the processing unit.
10. The coordinator according to any one of claims 7 to 9, wherein an attribute value corresponding to the attribute identifier sent by any one of the m source devices satisfies a second synchronization condition corresponding to the source device.
11. The coordinator of claim 9, wherein the processing unit is further to:
before the receiving unit receives the attribute identifiers and the corresponding attribute values sent by the M source devices in the binding relationship established by the coordinator, acquiring a first instruction for establishing the binding relationship, wherein the first instruction comprises the identifiers of the set ports, the binding parameters of the M source devices and the binding parameters of the N target devices; wherein the binding parameters of the M source devices include: the identifiers of the M source devices, the attribute identifiers of the M source devices, the second synchronization conditions corresponding to the M source devices, the cluster identifiers corresponding to the attribute identifiers of the M source devices, and the industry specification identifiers corresponding to the cluster identifiers of the M source devices, where the binding parameters of the N target devices include: the identifiers of the N target devices, the attribute values corresponding to the attribute identifiers of the N target devices, the first synchronization condition, the cluster identifiers corresponding to the attribute identifiers of the N target devices, and the industry specification identifiers corresponding to the cluster identifiers of the N target devices;
according to the first instruction, establishing and storing the binding relationship on the port corresponding to the identifier of the set port, wherein the binding relationship comprises the identifier of the set port, the binding parameters of the M source devices and the binding parameters of the N target devices;
the sending unit is instructed to send binding establishment requests to the M source devices respectively, and the binding establishment requests carry the identification of the set port and the binding parameters of the source devices in the binding relationship aiming at any source device;
the receiving unit is further configured to: respectively receiving binding establishment confirmation messages sent by the M source devices; the processing unit is further to: and determining that the M source devices and the N target devices establish binding through the coordinator according to the binding establishment confirmation message.
12. A coordinator according to any one of claims 7-9, wherein the processing unit is further to: acquiring a second instruction for removing the binding relationship;
the sending unit is further configured to: sending unbinding requests to the M source devices respectively according to the indication of the processing unit;
the processing unit is further to: and deleting the binding relationship and releasing the port of the coordinator corresponding to the binding relationship when the receiving unit is determined to receive the binding release confirmation messages sent by the M source devices or when the receiving unit is determined not to receive the binding release confirmation message sent by any one source device within a set time length.
13. A data synchronization system based on ZigBee binding is characterized by comprising: m source devices, a coordinator and N target devices;
the M source devices are used for respectively sending the attribute identifications and the corresponding attribute values of the M source devices to the coordinator, wherein M is a positive integer;
the coordinator is configured to receive attribute identifiers and corresponding attribute values sent by M source devices of the M source devices, where M is a positive integer and is less than or equal to M; when determining that the attribute identifiers sent by the M source devices are the attribute identifiers of the source devices in a binding relationship, acquiring the attribute values corresponding to the attribute identifiers of the remaining source devices except the M source devices in the binding relationship, wherein the binding relationship comprises the attribute identifiers of the M source devices, the attribute identifiers of the N target devices, the attribute values corresponding to the attribute identifiers of the N target devices and a first synchronization condition, and N is a positive integer; when determining that the attribute values corresponding to the attribute identifications of the M source devices meet the first synchronization condition, sending the attribute identifications of the N target devices and the corresponding attribute values to the corresponding target devices;
the N target devices are configured to receive the attribute identifier and the corresponding attribute value of the corresponding target device, which are sent by the coordinator when it is determined that the attribute value corresponding to the attribute identifier of the M source devices meets the first synchronization condition.
CN201710851221.3A 2017-09-20 2017-09-20 Data synchronization method, equipment and system based on ZigBee binding Active CN109525621B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710851221.3A CN109525621B (en) 2017-09-20 2017-09-20 Data synchronization method, equipment and system based on ZigBee binding

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710851221.3A CN109525621B (en) 2017-09-20 2017-09-20 Data synchronization method, equipment and system based on ZigBee binding

Publications (2)

Publication Number Publication Date
CN109525621A CN109525621A (en) 2019-03-26
CN109525621B true CN109525621B (en) 2020-09-18

Family

ID=65768659

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710851221.3A Active CN109525621B (en) 2017-09-20 2017-09-20 Data synchronization method, equipment and system based on ZigBee binding

Country Status (1)

Country Link
CN (1) CN109525621B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110161990A (en) * 2019-04-28 2019-08-23 安恩达科技(深圳)有限公司 The control method and its device and readable storage medium storing program for executing of Intelligent switch controller
CN110971495B (en) * 2019-10-24 2021-12-24 青岛海尔科技有限公司 Equipment binding method and device of intelligent household system and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103188821A (en) * 2011-12-29 2013-07-03 华为技术有限公司 Network equipment binding method and communication method and communication device and communication system
CN106209932A (en) * 2015-04-30 2016-12-07 中国电信股份有限公司 The remote communication method of ZigBee node and system, gateway device and ZigBee node
CN106506287A (en) * 2016-09-29 2017-03-15 杭州鸿雁智能科技有限公司 Scenery control method and system based on ZigBee
CN106878140A (en) * 2017-03-23 2017-06-20 南京工程学院 The method that internet and Zigbee Sensor Networks are connected by Internet Zigbee gateways

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7826395B2 (en) * 2008-04-22 2010-11-02 Samsung Electronics Co., Ltd. Communication system using zigbee and method of controlling the same
US10404832B2 (en) * 2015-08-31 2019-09-03 Ayla Networks, Inc. Management of gateway device using virtual gateway device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103188821A (en) * 2011-12-29 2013-07-03 华为技术有限公司 Network equipment binding method and communication method and communication device and communication system
CN106209932A (en) * 2015-04-30 2016-12-07 中国电信股份有限公司 The remote communication method of ZigBee node and system, gateway device and ZigBee node
CN106506287A (en) * 2016-09-29 2017-03-15 杭州鸿雁智能科技有限公司 Scenery control method and system based on ZigBee
CN106878140A (en) * 2017-03-23 2017-06-20 南京工程学院 The method that internet and Zigbee Sensor Networks are connected by Internet Zigbee gateways

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"基于Zigbee的2.4GHZ的RFID系统的研究";董毅;《数字技术与应用》;20140115;第61-62、65页 *

Also Published As

Publication number Publication date
CN109525621A (en) 2019-03-26

Similar Documents

Publication Publication Date Title
JP6624619B2 (en) Resource subscription method, resource subscription device, and resource subscription system
WO2018024121A1 (en) Network function (nf) management method and nf management device
CN113300877A (en) Network slice management method and equipment
WO2017107473A1 (en) Method for controlling network access of intelligent instrument, master station and data concentration unit
WO2019129089A1 (en) Method and apparatus for monitoring zigbee node network status
CN106559332B (en) Method and system for quickly establishing fully-connected server cluster
CN111182659B (en) Mode switching method and mode switching device of Mesh equipment and Mesh equipment
US10931529B2 (en) Terminal device management method, server, and terminal device for managing terminal devices in local area network
CN106506717A (en) A kind of automatic discovering method and equipment
CN109525621B (en) Data synchronization method, equipment and system based on ZigBee binding
CN105101412A (en) Notification message sending method and device
CN109041086B (en) Configuration method and device of OpenFlow instance
WO2012097566A1 (en) Method and apparatus for upgrading version of radio transmit receive (rtr) single-board
EP3174318B1 (en) Method for realizing resource attribute notification, and common service entity
CN110267251A (en) Wireless access capability information processing method and relevant device
CN112202877A (en) Gateway linkage method, gateway, cloud server and user terminal
WO2016074412A1 (en) Compatibility administration method based on network configuration protocol, storage medium and device
EP3253030B1 (en) Method and device for reporting openflow switch capability
CN107465621A (en) A kind of router finds method, SDN controllers, router and network system
CN105281941A (en) Data transmission method, first CSE, intermediate CSE, and second CSE
CN112714010A (en) Network topology management method, device, expansion unit and storage medium
CN109976868A (en) DApp method for customizing, device and electronic equipment
EP3174322A1 (en) Method for deleting notification resource, and common service entity
WO2018010448A1 (en) File transmission method and apparatus
CN108737265B (en) Software defined wireless network system and management method thereof

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