A method and apparatus for synchronizing attribute values
By classifying the attribute values of sub-devices into two categories and using digest values to determine updates, synchronization is performed only when necessary, thus solving the link congestion and latency problems caused by the large number of data packets in narrowband power line communication systems and improving the efficiency and reliability of the system.
Patent Information
- Application Number
- CN202310036572.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-10
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2043-01-10
AI Technical Summary
In narrowband power line communication systems, when the central control host queries all attribute values of the sub-devices, it leads to increased latency, link congestion, and increased packet loss probability, especially when the sub-devices report all attribute values, resulting in a large number of data packets.
By dividing the attribute values of sub-devices into two categories: Type 1 attributes and Type 2 attributes, synchronization is performed only when there are updated attribute values, based on the different update frequencies of the attributes. The digest value is used to determine whether the attribute value has been updated, and data packet transmission is reduced by querying commands and indication information.
It effectively reduces link resource consumption and the probability of conflicts, shortens the online time of sub-devices, avoids link congestion and delay, and improves the system response speed.
Smart Images

Figure CN118337794B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communications, and more particularly to an attribute value synchronization method and device. Background Technology
[0002] Narrowband power line communication (PLC) whole-house smart home systems can consist of a central control unit and multiple sub-devices. For example, in a typical environment, a central control unit can connect to 384 sub-devices.
[0003] In narrowband PLC systems with bandwidth below 500kbps, if the central control host needs to retrieve the attributes of a sub-device from the cloud server via a query command, it will inevitably lead to increased latency and a poor user experience. Therefore, the central control host currently caches the attributes of all sub-devices for immediate querying.
[0004] Furthermore, the central control host also needs to synchronize the latest attribute values of the sub-devices. However, since the central control host is unsure which attribute values of the sub-devices will change, it needs to query the corresponding attribute values of all attributes of the sub-devices each time. The sub-devices need to report the attribute values of all attributes through multiple data packets. The large number of data packets will lead to longer online times for the sub-devices, and will also easily cause link congestion and increase the probability of packet loss. Summary of the Invention
[0005] This application provides an attribute value synchronization method and device to solve the problem that the number of data packets required for a sub-device to report the corresponding attribute values of all attributes is too large, which can easily lead to link congestion.
[0006] The first aspect provides a method for synchronizing attribute values, which includes:
[0007] The control device sends a query command to the sub-device. The query command includes first information, which is determined based on the corresponding attribute values of n attributes of the first type of the sub-device stored by the control device, where n is an integer greater than or equal to 1. The control device receives the corresponding attribute values of the n attributes of the first type stored by the sub-device, or a first indication, which indicates that the corresponding attribute value of each of the n attributes of the first type has not been updated.
[0008] With the above design, the control device needs to receive the corresponding attribute values of the n attributes of the first type stored by the sub-device only when the corresponding attribute value of at least one of the n attributes of the first type is updated. When the corresponding attribute value of each of the n attributes of the first type is not updated, the control device receives the first indication information from the sub-device. Therefore, it can effectively reduce the link resource occupation and link conflict probability caused by transmitting a large number of data packets carrying attribute values, and shorten the sub-device online time.
[0009] In one possible design, when the control device receives the corresponding attribute values of n attributes of the first type stored by the sub-device, the corresponding attribute value of at least one of the n attributes of the first type stored by the sub-device differs from the corresponding attribute value of at least one of the n attributes of the first type stored by the control device. That is, when the corresponding attribute value of at least one attribute of the n attributes of the first type is updated, and the corresponding attribute value of at least one attribute of the first type stored by the sub-device differs from the corresponding attribute value of at least one attribute of the first type stored by the control device, it is necessary to synchronize the corresponding attribute values of the n attributes of the first type stored by the sub-device to the control device.
[0010] In one possible design, the query command further includes second information, which is determined based on the corresponding attribute values of m attributes of the second type of the sub-device stored by the control device, where m is an integer greater than or equal to 1; the control device receives from the sub-device the corresponding attribute values of the m attributes of the second type stored by the sub-device, or second indication information, which indicates that the corresponding attribute value of each attribute in the second type of attributes has not been updated.
[0011] With the above design, the control device only needs to receive the corresponding attribute values of the m attributes of the second type stored by the sub-device when the corresponding attribute value of at least one of the m attributes of the second type is updated. When the corresponding attribute value of each of the m attributes of the second type is not updated, the control device receives the second indication information from the sub-device. Therefore, it can effectively reduce the link resource occupation and link conflict probability caused by transmitting a large number of data packets carrying attribute values, and shorten the sub-device online time.
[0012] In one possible design, when the control device receives the corresponding attribute values of m attributes of the second type stored in the sub-device, the corresponding attribute value of at least one of the m attributes of the second type stored in the sub-device differs from the corresponding attribute value of at least one of the m attributes of the second type stored in the control device. That is, when the corresponding attribute value of at least one of the m attributes of the second type is updated, and the corresponding attribute value of at least one of the m attributes of the second type stored in the sub-device differs from the corresponding attribute value of at least one of the m attributes of the second type stored in the control device, it is necessary to synchronize the corresponding attribute value of the m attributes of the second type stored in the sub-device to the control device.
[0013] In one possible design, the update frequency of the m attributes of the second type is lower than the update frequency of the n attributes of the first type. Using this design, the attributes of the sub-device can be divided into first-type attributes and second-type attributes based on their update frequency.
[0014] In one possible design, the first information includes a summary value calculated by the control device based on the corresponding attribute values of n attributes of the first type stored in the control device, and the second information includes a summary value calculated by the control device based on the corresponding attribute values of m attributes of the second type stored in the control device.
[0015] In one possible design, before the control device sends a query command to the sub-device, the control device receives attribute information sent by the sub-device. The attribute information includes multiple attributes of the sub-device and the attribute type of each attribute, wherein the attribute type of each attribute is either the first type or the second type.
[0016] With the above design, the control device can know the attribute type of each attribute.
[0017] In one possible design, the n attributes of the first type include at least one of button name, position information, height information, and coordinate information; the m attributes of the second type include at least one of ambient light intensity, on / off status, and humidity.
[0018] A second aspect provides an attribute value synchronization method, the method comprising: a sub-device receiving a query command sent by a control device, the query command including first information, the first information being determined based on the corresponding attribute values of n attributes of a first type stored by the control device, where n is an integer greater than or equal to 1; in response to the query command, the sub-device determining, based on the first information and the corresponding attribute values of the n attributes of the first type stored by the sub-device, whether there is an attribute whose attribute value has been updated among the n attributes of the first type; when there is an attribute whose attribute value has been updated among the n attributes of the first type, the sub-device sending the corresponding attribute values of the n attributes of the first type stored by the sub-device to the control device; or, when there is no attribute whose attribute value has been updated among the n attributes of the first type, the sub-device sending first indication information to the control device, the first indication information indicating that the corresponding attribute value of each of the n attributes of the first type has not been updated.
[0019] With the above design, the sub-device needs to send the corresponding attribute values of the n attributes of the first type stored by the sub-device to the control device only when the corresponding attribute value of at least one of the n attributes of the first type is updated, that is, when there is an attribute whose attribute value has been updated among the n attributes of the first type. When the corresponding attribute value of each of the n attributes of the first type has not been updated, that is, when there is no attribute whose attribute value has been updated among the n attributes of the first type, the sub-device sends the first indication information to the control device. Therefore, it can effectively reduce the link resource occupation and link collision probability caused by transmitting a large number of data packets carrying attribute values, and shorten the sub-device online time.
[0020] In one possible design, the corresponding attribute value of at least one of the n attributes of the first type stored in the sub-device is different from the corresponding attribute value of at least one of the n attributes of the first type stored in the control device.
[0021] In one possible design, the first information includes a summary value calculated by the control device based on the corresponding attribute values of n attributes of the first type stored in the control device; when the sub-device determines whether there is an attribute whose attribute value has been updated among the n attributes of the first type based on the first information and the corresponding attribute values of the n attributes of the first type stored in the sub-device, the sub-device calculates a first summary value based on the corresponding attribute values of the n attributes of the first type stored in itself; if the sub-device determines that the first summary value is the same as the summary value included in the first information, then it determines that there is no attribute whose attribute value has been updated among the n attributes of the first type; otherwise, it determines that there is an attribute whose attribute value has been updated among the n attributes of the first type.
[0022] Using the above design, the sub-device can determine whether there is an attribute whose attribute value has been updated among the n attributes of the first type based on the first digest value calculated by the corresponding attribute values of the n attributes of the first type stored by itself and the digest value included in the first information. The solution is simple and easy to implement.
[0023] In one possible design, the query command further includes second information, which is determined based on the corresponding attribute values of m attributes of the second type of the sub-device stored by the control device, where m is an integer greater than or equal to 1; the sub-device determines whether there is an attribute whose attribute value has been updated among the m attributes of the second type based on the second information and the corresponding attribute values of the m attributes of the second type stored by the sub-device; if there is an attribute whose attribute value has been updated among the m attributes of the second type, the sub-device sends the corresponding attribute values of the m attributes of the second type stored by the sub-device to the control device; or, if there is no attribute whose attribute value has been updated among the m attributes of the second type, the sub-device sends second indication information to the control device, the second indication information indicating that the corresponding attribute value of each of the m attributes of the second type has not been updated.
[0024] With the above design, the sub-device needs to send the corresponding attribute values of the m attributes of the second type stored by the sub-device to the control device only when the corresponding attribute value of at least one of the m attributes of the second type has been updated, that is, when there is an attribute whose attribute value has been updated among the m attributes of the second type. When the corresponding attribute value of each of the m attributes of the second type has not been updated, that is, when there is no attribute whose attribute value has been updated among the m attributes of the second type, the sub-device sends the second indication information to the control device. Therefore, it can effectively reduce the link resource occupation and link collision probability caused by transmitting a large number of data packets carrying attribute values, and shorten the sub-device online time.
[0025] In one possible design, the corresponding attribute value of at least one of the m attributes of the second type stored in the sub-device is different from the corresponding attribute value of at least one of the m attributes of the second type stored in the control device.
[0026] In one possible design, the second information includes a summary value calculated by the control device based on the corresponding attribute values of m attributes of the second type stored in the control device; when the sub-device determines whether there is an attribute whose attribute value has been updated among the m attributes of the second type based on the second information and the corresponding attribute values of the m attributes of the second type stored in the sub-device, the sub-device calculates a second summary value based on the corresponding attribute values of the m attributes of the second type stored in itself; if the sub-device determines that the second summary value is the same as the summary value included in the second information, then it determines that there is no attribute whose attribute value has been updated among the m attributes of the second type; otherwise, it determines that there is an attribute whose attribute value has been updated among the m attributes of the second type.
[0027] Using the above design, the sub-device can determine whether there are any attributes whose attribute values have been updated among the m attributes of the second type based on the second digest value calculated from the corresponding attribute values of the m attributes of the second type stored in itself and the digest value included in the second information. The solution is simple and easy to implement.
[0028] In one possible design, the update frequency of the m attributes of the second type is lower than the update frequency of the m attributes of the second type.
[0029] In one possible design, before the sub-device receives a query command from the control device, the sub-device sends attribute information to the control device. The attribute information includes multiple attributes of the sub-device and the attribute type of each attribute, wherein the attribute type of each attribute is either the first type or the second type.
[0030] In one possible design, the m attributes of the second type include at least one of button name, position information, height information, and coordinate information; the m attributes of the second type include at least one of ambient light intensity, on / off status, and humidity.
[0031] A third aspect provides an attribute value synchronization device, which is a control device or a chip inside the control device. The device includes a processing module and a transceiver module. The processing module calls the transceiver module to perform: sending a query command to a sub-device, the query command including first information, the first information being determined based on the corresponding attribute values of n attributes of a first type of the sub-device stored in the control device, where n is an integer greater than or equal to 1; receiving the corresponding attribute values of the n attributes of the first type stored in the sub-device sent by the sub-device, or, first indication information, the first indication information indicating that the corresponding attribute value of each of the n attributes of the first type has not been updated.
[0032] In one possible design, when the control device receives the corresponding attribute values of n attributes of the first type stored in the sub-device from the sub-device, the corresponding attribute value of at least one of the n attributes of the first type stored in the sub-device is different from the corresponding attribute value of at least one of the n attributes of the first type stored in the control device.
[0033] In one possible design, the query command further includes second information, which is determined based on the corresponding attribute values of m attributes of the second type of the sub-device stored by the control device, where m is an integer greater than or equal to 1; the transceiver module is configured to receive from the sub-device the corresponding attribute values of the m attributes of the second type stored by the sub-device, or second indication information, which indicates that the corresponding attribute value of each attribute in the second type of attributes has not been updated.
[0034] In one possible design, when the control device receives the corresponding attribute values of m attributes of the second type stored in the sub-device, the corresponding attribute value of at least one of the m attributes of the second type stored in the sub-device is different from the corresponding attribute value of at least one of the m attributes of the second type stored in the control device.
[0035] In one possible design, the update frequency of the m attributes of the second type is lower than the update frequency of the n attributes of the first type.
[0036] In one possible design, the first information includes a summary value calculated by the control device based on the corresponding attribute values of n attributes of the first type stored in the control device, and the second information includes a summary value calculated by the control device based on the corresponding attribute values of m attributes of the second type stored in the control device.
[0037] In one possible design, the transceiver module is configured to receive attribute information sent by the sub-device before sending a query command to the sub-device. The attribute information includes multiple attributes of the sub-device and the attribute type of each attribute, wherein the attribute type of each attribute is either the first type or the second type.
[0038] In one possible design, the n attributes of the first type include at least one of button name, position information, height information, and coordinate information; the m attributes of the second type include at least one of ambient light intensity, on / off status, and humidity.
[0039] A fourth aspect provides an attribute value synchronization device, wherein the device is a sub-device or a chip within a sub-device, the device comprising: a processing module and a transceiver module; the transceiver module is configured to receive a query command sent by a control device, the query command including first information, the first information being determined based on the corresponding attribute values of n attributes of a first type of the sub-device stored by the control device, where n is an integer greater than or equal to 1; the processing module is configured to, in response to the query command, determine whether there is an attribute whose attribute value has been updated among the n attributes of the first type, based on the first information and the corresponding attribute values of the n attributes of the first type stored by the sub-device; when there is an attribute whose attribute value has been updated among the n attributes of the first type, the transceiver module is configured to send the corresponding attribute values of the n attributes of the first type stored by the sub-device to the control device; or, when there is no attribute whose attribute value has been updated among the n attributes of the first type, the transceiver module is configured to send first indication information to the control device, the first indication information indicating that the corresponding attribute value of each of the n attributes of the first type has not been updated.
[0040] In one possible design, the corresponding attribute value of at least one of the n attributes of the first type stored in the sub-device is different from the corresponding attribute value of at least one of the n attributes of the first type stored in the control device.
[0041] In one possible design, the first information includes a summary value calculated by the control device based on the corresponding attribute values of n attributes of the first type stored in the control device; the processing module is configured to calculate a first summary value based on the corresponding attribute values of the n attributes of the first type stored in itself when determining whether there is an attribute whose attribute value has been updated among the n attributes of the first type according to the first information and the corresponding attribute values of the n attributes of the first type stored in the sub-device; if the first summary value is determined to be the same as the summary value included in the first information, then it is determined that there is no attribute whose attribute value has been updated among the n attributes of the first type; otherwise, it is determined that there is an attribute whose attribute value has been updated among the n attributes of the first type.
[0042] In one possible design, the query command further includes second information, which is determined based on the corresponding attribute values of m attributes of the second type of the sub-device stored by the control device, where m is an integer greater than or equal to 1; the processing module is configured to determine, based on the second information and the corresponding attribute values of the m attributes of the second type stored by the sub-device, whether there is an attribute whose attribute value has been updated among the m attributes of the second type; if there is an attribute whose attribute value has been updated among the m attributes of the second type, the transceiver module is configured to send the corresponding attribute values of the m attributes of the second type stored by the sub-device to the control device; or, if there is no attribute whose attribute value has been updated among the m attributes of the second type, the transceiver module is configured to send second indication information to the control device, the second indication information indicating that the corresponding attribute value of each of the m attributes of the second type has not been updated.
[0043] In one possible design, the corresponding attribute value of at least one of the m attributes of the second type stored in the sub-device is different from the corresponding attribute value of at least one of the m attributes of the second type stored in the control device.
[0044] In one possible design, the second information includes a summary value calculated by the control device based on the corresponding attribute values of m attributes of the second type stored in the control device; the processing module is configured to calculate a second summary value based on the corresponding attribute values of the m attributes of the second type stored in itself when determining whether there is an attribute whose attribute value has been updated among the m attributes of the second type according to the second information and the corresponding attribute values of the m attributes of the second type stored in the sub-device; if the second summary value is determined to be the same as the summary value included in the second information, then it is determined that there is no attribute whose attribute value has been updated among the m attributes of the second type; otherwise, it is determined that there is an attribute whose attribute value has been updated among the m attributes of the second type.
[0045] In one possible design, the update frequency of the m attributes of the second type is lower than the update frequency of the m attributes of the second type.
[0046] In one possible design, the transceiver module is configured to send attribute information to the control device before receiving a query command from the control device. The attribute information includes multiple attributes of the sub-device and the attribute type of each attribute, wherein the attribute type of each attribute is either the first type or the second type.
[0047] In one possible design, the m attributes of the second type include at least one of button name, position information, height information, and coordinate information; the m attributes of the second type include at least one of ambient light intensity, on / off status, and humidity.
[0048] The technical effects of the third and fourth aspects mentioned above can be referenced with the corresponding technical effects of the first and second aspects.
[0049] The fifth aspect also provides an apparatus. This apparatus can perform the above-described method design. The apparatus can be a chip or circuit capable of performing the functions corresponding to the above-described method, or an apparatus including the chip or circuit.
[0050] In one possible implementation, the device includes: a memory for storing computer-executable program code; and a processor coupled to the memory. The program code stored in the memory includes instructions that, when executed by the processor, cause the device or a device equipped with the device to perform any of the methods described above.
[0051] The device may also include a communication interface, which may be a transceiver, or, if the device is a chip or circuit, the communication interface may be the chip's input / output interface, such as input / output pins.
[0052] In one possible design, the device includes corresponding functional modules, each used to implement the steps in the above method. The functions can be implemented in hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the functions described above.
[0053] A sixth aspect provides a readable storage medium storing a computer program that, when run on a device, performs the methods in any of the possible designs described above.
[0054] A seventh aspect provides a program product comprising a computer program that, when run on a device, executes the methods in any of the possible designs described above.
[0055] An eighth aspect provides a communication system comprising: a control device and at least one sub-device, wherein the control device performs a method as in any possible design of the first aspect, and the sub-device performs a method as in any possible design of the second aspect. Attached Figure Description
[0056] Figure 1 This is a schematic diagram illustrating the synchronization of attribute values between the control device and its sub-devices in this application.
[0057] Figure 2 This is a schematic diagram showing the partitioning results of all attributes in this application;
[0058] Figure 3 This is a schematic diagram illustrating the initial query of the attributes of a sub-device by the control device in this application.
[0059] Figure 4 Here is a flowchart outlining the attribute value synchronization method in this application;
[0060] Figure 5A This is one of the schematic diagrams illustrating the corresponding attribute values of n attributes of the first type and m attributes of the second type of the control device in this application when the control device queries the sub-device for the first time.
[0061] Figure 5B This is the second illustration of the corresponding attribute values of n attributes of the first type and m attributes of the second type of the control device querying the sub-device for the first time in this application.
[0062] Figure 6 This is a schematic diagram of the structure of one of the devices in this application;
[0063] Figure 7 This is a schematic diagram of another device in this application. Detailed Implementation
[0064] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. The terms "first," "second," and corresponding reference numerals in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms can be used interchangeably where appropriate; this is merely a way of distinguishing objects with the same attributes in the embodiments of this application. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, so that a process, method, system, product, or device that comprises a series of modules is not necessarily limited to those modules, but may include other modules not explicitly listed or inherent to these processes, methods, products, or devices.
[0065] In the description of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B. "And / or" in this application is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Furthermore, in the description of this application, "at least one" refers to one or more items, and "multiple" refers to two or more items. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or multiple items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.
[0066] To facilitate understanding of the embodiments of this application, a few basic concepts involved in the embodiments of this application will be briefly explained.
[0067] Handover: After all sub-devices have been added and the scenes have been pre-configured on the application (APP), the system is handed over to the user. In one possible scenario, sub-devices such as smart switches, smart curtains, and smart sensors are configured on the control device. After configuring the linkage scenes between the various sub-devices, the entire system is handed over to the user.
[0068] Group control: Controls all sub-devices within a group.
[0069] Scene controller: Controls all related sub-devices within a scene.
[0070] Full profile: Each sub-device provides one or more services, and each service consists of one or more profiles. The full profile of a sub-device refers to all the profiles of the sub-device.
[0071] Attribute Values: The attribute value for each attribute of a sub-device, including service identifier, attribute identifier, data type, data length, and data value. For example, the lighting service has three attributes: brightness, color temperature, and hue. For instance, the attribute value for brightness includes: lighting service identifier 0x21, attribute identifier 0x0e, data type 0x01, data length 0x04, and data value 0x100.
[0072] In this application, a control device and at least one sub-device together constitute a communication system. Exemplarily, this communication system can be a smart home system, a smart home control system, a whole-house smart control system, or a whole-house smart system, etc., and this application does not limit this. The control device is used to connect to and control the sub-devices. The control device can also be referred to as a central control host, a central control system control device, an intelligent control device, a whole-house smart control device, a whole-house PLC home system gateway, etc., and the sub-devices can be referred to as PLC sub-devices, and this application does not limit this.
[0073] In a typical environment, the control device can connect to 384 sub-devices. The control device manages all attributes of these 384 sub-devices and reports them to the cloud, providing query services. When the control device is handed over to a new building, during group control, scene control, or when sub-devices are powered on, the control device needs to synchronize attribute values with the sub-devices.
[0074] It's understandable that each sub-device has multiple attributes. The total attributes of a sub-device refer to all of its attributes. In scenarios where a sub-device is powered on or the control device is handed over, the control device queries the corresponding attribute values of all sub-device attributes using a query command. In scenarios where the sub-device is controlled by a group or scene, because the control device is unsure which attributes' corresponding values will change, it also queries the corresponding values of all attributes.
[0075] like Figure 1 As shown, when the control device and the sub-device synchronize attribute values, the control device queries the corresponding attribute values of all attributes of the sub-device through a query command. The sub-device needs to send multiple data packets to the control device. The total number of data packets corresponding to the corresponding attribute value of each attribute can be one or more, or it can be described that the attribute value of an attribute can be carried by one or more data packets.
[0076] Taking a PLC-based human presence sensor or a whole-house artificial intelligence (AI) human presence sensor as an example, the total data volume of all attributes currently reaches 1.5KB. A single data packet in a narrowband PLC is limited to 136 bytes. After deducting the bytes occupied by the bus protocol, only 97 bytes are usable. The total number of data packets corresponding to all attributes can reach more than 15. Given the large number of data packets, when the control device needs to synchronize attribute values with the sub-device, if the control device queries the corresponding attribute value of the sub-device's full attributes, the following problem arises:
[0077] (1) This results in a longer data packet reporting time for all attributes, and a longer total online time for sub-devices, which is not conducive to energy saving for sub-devices.
[0078] (2) It can easily cause link congestion and increase the transmission delay of data packets.
[0079] (3) The probability of packet loss increases, which causes the corresponding attribute values of one or more attributes to be lost or the attribute values of some attributes to not match the actual attribute values when displayed on the APP interface of the control device.
[0080] Currently, some attributes of a sub-device do not change frequently, while others are more prone to change. In other words, for a sub-device's multiple attributes, some attributes are updated less frequently, while others are updated more frequently.
[0081] In one possible scenario, the sub-device is a smart switch, which may include the following attributes: the name of the switch and the state of the switch, wherein the name of the switch is updated less frequently and the state of the switch is updated more frequently.
[0082] In one possible scenario, the sub-device is a smart sensor, which may include the following attributes: the sensor's installation location, the sensor's detection range, and the sensor's real-time detection results. Among these, the sensor's installation location and the sensor's detection range are updated at a low frequency, while the sensor's real-time detection results are updated at a high frequency.
[0083] Based on the above characteristics, this application divides the attributes of the sub-device into two categories: a first type of attribute and a second type of attribute. The update frequency of the second type of attribute is lower than that of the first type of attribute; that is, the update frequency of the attribute values of the second type of attribute is lower than that of the first type of attribute. The second type of attribute can also be referred to as stable attribute, while the first type of attribute can be referred to as volatile attribute, such as... Figure 2 As shown.
[0084] For example, when a sub-device undergoes an over-the-air (OTA) upgrade, the attribute values of the sub-device may be updated. Alternatively, the attribute values of the sub-device may be updated due to user control of the sub-device.
[0085] For example, the second type of attribute may include, but is not limited to, at least one of button name, location information, height information, and coordinate information; the first type of attribute may include, but is not limited to, at least one of ambient light intensity, on / off status, and humidity.
[0086] For example, attributes of a sub-device can be categorized into a first type and a second type based on their update frequency. For instance, attributes with an update frequency higher than a preset threshold are classified as first-type attributes, while attributes with an update frequency less than or equal to the preset threshold are classified as second-type attributes.
[0087] When a sub-device registers with the control device for the first time, it reports attribute information. This attribute information includes multiple attributes of the sub-device, namely all its attributes, and the attribute type for each attribute. Each attribute can be classified as either Type 1 or Type 2. Furthermore, the attribute information also includes the attribute value for each attribute; please refer to the relevant descriptions above for details, which will not be repeated here.
[0088] When the control device queries the attributes of the sub-device for the first time, the sub-device sends attribute information to the control device. At this time, for each attribute, in addition to the previous... Figure 1 In addition to the content to be reported (i.e., the attribute value of each attribute), the attribute type of the attribute also needs to be reported.
[0089] For example, such as Figure 3 As shown, if a sub-device has multiple attributes, it needs to send the corresponding attribute values and attribute types of the multiple attributes to the control device. The sub-device needs to send a total of N data packets.
[0090] Based on this, this application provides an attribute value synchronization method to solve the problem that the large number of data packets required for a sub-device to report the corresponding attribute values of all attributes can easily lead to link congestion. Figure 4 As shown, the method includes:
[0091] S400: The control device sends a query command to the sub-device.
[0092] The query command includes first information, which is determined based on the corresponding attribute values of n attributes of the first type of the sub-device stored in the control device, where n is an integer greater than or equal to 1.
[0093] The query command can be used to query whether there is an attribute whose value has been updated among n attributes of the first type, or it can be used to query the attribute value of an attribute of a sub-device. It should be noted that the query command can also be called a query request or a query message, etc., and this application does not limit it to these terms.
[0094] For example, the first information includes a summary value calculated by the control device based on the corresponding attribute values of n attributes of a first type stored in the control device.
[0095] In one possible implementation, the control device performs a digest calculation based on the attribute values of the corresponding attribute values of n attributes of the first type stored in its own memory to obtain a digest value. For example, algorithms such as secure hash algorithm 1 (SHA1) or message-digest algorithm (MD5) can be used for digest calculation, and this application does not limit the specific implementation.
[0096] S410: In response to the query command, the sub-device determines whether there is an attribute whose attribute value has been updated among the n attributes of the first type based on the first information and the corresponding attribute values of the n attributes of the first type stored in the sub-device.
[0097] If there is an attribute whose value has been updated among the n attributes of the first type, then execute S420A; if there is no attribute whose value has been updated among the n attributes of the first type, then execute S420B.
[0098] For example, when the sub-device determines whether there is an attribute whose attribute value has been updated among the n attributes of the first type based on the first information and the corresponding attribute values of the n attributes of the first type stored by the sub-device, the sub-device can calculate a first digest value based on the corresponding attribute values of the n attributes of the first type stored by itself. If the sub-device determines that the first digest value is the same as the digest value included in the first information, it determines that there is no attribute whose attribute value has been updated among the n attributes of the first type and executes S420B; otherwise, it determines that there is an attribute whose attribute value has been updated among the n attributes of the first type and executes S420A.
[0099] In one possible implementation, the sub-device performs a digest calculation based on the corresponding attribute values of n attributes of the first type stored within itself to obtain a digest value. For example, algorithms such as SHA1 or MD5 can be used for digest calculation, and this application does not limit this to any particular algorithm.
[0100] It should be noted that the control device and the sub-device need to use the same algorithm for digest calculation, and the n attributes of the first type stored by the control device for the sub-device must be the same as the n attributes of the first type stored by the sub-device itself. However, the attribute values of the same attributes stored by the two may be the same or different. That is, there may be attributes whose attribute values have been updated among the n attributes of the first type, or there may be no attributes whose attribute values have been updated among the n attributes of the first type.
[0101] If the first digest value and the first information contain different digest values, it indicates that among the corresponding attribute values of the n attributes of the first type stored in both, there are attribute values with the same attribute that are different, meaning that among the n attributes of the first type, there are attributes whose attribute values have been updated. If the first digest value and the first information contain the same digest value, it indicates that among the corresponding attribute values of the n attributes of the first type stored in both, the attribute values of the same attribute are all the same, meaning that among the n attributes of the first type, there are no attributes whose attribute values have been updated.
[0102] It should be noted that by determining whether the digest values are consistent, the sub-device can determine whether there are any attributes whose attribute values have been updated among the n attributes of the first type. At this time, there may be one or more attributes whose corresponding attribute values have been updated among the n attributes of the first type, but the sub-device cannot specifically determine which attribute among the n attributes of the first type has had its attribute value updated.
[0103] For example, the control device stores three attributes of the first type for the sub-device, including ambient light intensity, on / off status, and humidity. The sub-device itself also stores three attributes of the first type, including ambient light intensity, on / off status, and humidity. For example, the control device stores an ambient light intensity attribute value of 80%, an on / off status attribute value of "on," and a humidity attribute value of 50%. The sub-device itself stores an ambient light intensity attribute value of 50%, an on / off status attribute value of "on," and a humidity attribute value of 45%.
[0104] The control device calculates a digest value 'a' using the SHA1 algorithm based on the corresponding attribute values of the three attributes of the first type stored in the sub-device. The control device then sends a query command to the sub-device, which includes the digest value 'a'. The sub-device calculates a digest value 'b' using the SHA1 algorithm based on the corresponding attribute values of the three attributes of the first type stored in the sub-device. The sub-device determines whether digest value 'a' and digest value 'b' are the same. If they are the same, it executes step S420B; otherwise, it executes step S420A. As can be seen from the above, the stored ambient light intensity and humidity attribute values are different; therefore, digest value 'a' and digest value 'b' are different, and the sub-device continues to execute step S420A.
[0105] S420A: When there is an attribute whose attribute value has been updated among the n attributes of the first type, the sub-device sends the corresponding attribute values of the n attributes of the first type stored in the sub-device to the control device.
[0106] As the above analysis shows, the sub-device cannot specifically determine which of the n attributes of the first type has been updated. Therefore, the sub-device sends the corresponding attribute values of the n attributes of the first type stored within it to the control device.
[0107] For example, the control device stores three attributes of the first type of sub-device, including ambient light intensity, on / off status, and humidity. The sub-device itself also stores three attributes of the first type, including ambient light intensity, on / off status, and humidity. When the sub-device determines that there is an attribute whose attribute value has been updated among the three attributes of the first type, the sub-device sends the corresponding attribute values of the three attributes of the first type stored by the sub-device to the control device, that is, the attribute values of ambient light intensity, on / off status, and humidity stored by the sub-device itself.
[0108] S420B: When there is no attribute whose attribute value has been updated among the n attributes of the first type, the sub-device sends a first indication message to the control device, the first indication message indicating that the corresponding attribute value of each of the n attributes of the first type has not been updated.
[0109] When there is no updated attribute among the n attributes of the first type, the sub-device sends a first indication message to the control device, so that the sub-device does not need to send a large number of data packets, shortens the total online time of the sub-device, and avoids link congestion caused by transmitting too many data packets.
[0110] In addition, in one possible design, the query command also includes second information, which is determined based on the corresponding attribute values of m attributes of the second type of the sub-device stored in the control device, where m is an integer greater than or equal to 1.
[0111] Understandably, since the update frequency of the second type of attributes is lower than that of the first type of attributes—for example, when the second type of attribute includes a button name, the button name generally does not change—the control device can choose to reduce the number of times it sends the second information, thereby shortening the total online time of the sub-device and avoiding link congestion caused by transmitting too many data packets.
[0112] In one example, the query command may include first information and second information. That is, the control device can simultaneously query whether there are any updated attribute values among the n attributes of the first type, and whether there are any updated attribute values among the m attributes of the second type. Alternatively, the control device can simultaneously query the corresponding attribute values of the n attributes of the first type and the corresponding attribute values of the m attributes of the second type of the sub-device.
[0113] In another example, the query command may include either first information or second information. That is, the control device can choose to query whether there exists an updated attribute value among n attributes of a first type, or whether there exists an updated attribute value among m attributes of a second type. Alternatively, the control device can choose to query the corresponding attribute values of the corresponding n attributes of the first type, or the corresponding attribute values of the corresponding m attributes of the second type of the sub-device. The control device may send the first information more frequently than it may send the second information.
[0114] Similar to the above method of determining whether there are any updated attribute values among the n attributes of the first type, the sub-device determines whether there are any updated attribute values among the m attributes of the second type based on the second information and the corresponding attribute values of the m attributes of the second type stored in the sub-device. If there are updated attribute values among the m attributes of the second type, the sub-device sends the corresponding attribute values of the m attributes of the second type stored in the sub-device to the control device. If there are no updated attribute values among the m attributes of the second type, the sub-device sends second indication information to the control device, indicating that the corresponding attribute value of each of the m attributes of the second type has not been updated.
[0115] For example, the second information may include a summary value calculated by the control device based on the corresponding attribute values of m attributes of the second type stored by the control device. When the sub-device determines whether there is an attribute whose attribute value has been updated among the m attributes of the second type based on the second information and the corresponding attribute values of the m attributes of the second type stored by the sub-device, the sub-device calculates a second summary value based on the corresponding attribute values of the m attributes of the second type stored by itself. If the sub-device determines that the second summary value is the same as the summary value included in the second information, it determines that there is no attribute whose attribute value has been updated among the m attributes of the second type; otherwise, it determines that there is an attribute whose attribute value has been updated among the m attributes of the second type.
[0116] For example, the control device stores three attributes of the second type for the sub-device, including button name, location information, height information, and coordinate information. The sub-device itself also stores three attributes of the second type, including button name, location information, height information, and coordinate information. In this case, the control device stores the button name as "living room light switch," the location information as "living room," the height information as 3 meters, and the coordinate information as (20cm, 20cm). The sub-device itself stores the button name as "living room light switch," the location information as "living room," the height information as 3 meters, and the coordinate information as (20cm, 20cm).
[0117] The control device calculates a digest value *c* using the SHA1 algorithm based on the corresponding attribute values of the three attributes of the second type stored in the sub-device. The control device then sends a query command to the sub-device, which includes the digest value *c*. The sub-device calculates a digest value *d* using the SHA1 algorithm based on the corresponding attribute values of the three attributes of the second type stored in the control device. The sub-device checks if digest value *c* and digest value *d* are the same. If they are the same, it determines that no attribute among the three attributes of the second type has an updated value; otherwise, it determines that no attribute among the three attributes of the second type has an updated value. Therefore, if the attribute values of the same second type stored in both the control device and the sub-device are identical, and no attribute among the three attributes of the second type has an updated value, the sub-device sends a second indication message to the control device.
[0118] like Figure 5A and Figure 5B The diagram shows the corresponding attribute values of n attributes of the first type and m attributes of the second type of the control device when querying the sub-device for the first time.
[0119] exist Figure 5A In the process, the sub-device determines that the first digest value is consistent with the digest value included in the first information, and that the second digest value is consistent with the digest value included in the second information, and then sends the first instruction information and the second instruction information to the control device.
[0120] Among them, Figure 5AIn this application, the first instruction information and the second instruction information can be carried by two data packets. Alternatively, the first instruction information and the second instruction information can also be carried by one data packet. This application does not limit this.
[0121] exist Figure 5B In the process, if the sub-device determines that the first digest value is inconsistent with the digest value included in the first information, and that the second digest value is consistent with the digest value included in the second information, the sub-device sends the corresponding attribute values of n attributes of the first type stored in the sub-device and the second indication information to the control device. The attribute value of each attribute of the first type can be carried by one or more data packets. Figure 5B For example, the sub-device needs to send a total of K+1 data packets. Among them, K data packets are used to carry the corresponding attribute values of n attributes of the first type, and one data packet is used to carry the second indication information, where K is a positive integer.
[0122] The above design can reduce the number of data packets that need to be sent to synchronize attribute values between the control device and the sub-device, avoid link congestion caused by transmitting too many data packets, effectively reduce the link resource occupation and link conflict probability caused by transmitting a large number of data packets carrying attribute values, and shorten the total time for the sub-device to come online.
[0123] In one example, taking a PLC-based human presence sensor or a whole-house AI human presence sensor as the sub-device, using existing techniques, when the control device needs to synchronize attribute values with the sub-device, if the sub-device reports the corresponding attribute values of all attributes each time, assuming the total number of data packets corresponding to all attributes is 15. Using the solution provided in this application embodiment, in most cases, the sub-device only needs to report 1 data packet. In a typical scenario, there are 15 sensors in 3 PLC loops. Using existing techniques, a total of 15 x 15 = 225 data packets need to be transmitted. Using the solution provided in this application embodiment, only 15 x 1 = 15 data packets need to be transmitted.
[0124] In another example, the control device can connect 384 sub-devices. On average, each sub-device needs to transmit 5 data packets. If the attribute values of 10% of the sub-devices change, using existing methods, the total number of data packets to be transmitted would be 384 x 5 = 1920. However, using the solution provided in this application, since the attribute values of 10% of the sub-devices have changed, only each of these 10% of sub-devices needs to transmit 5 data packets. The attributes of the remaining 90% of sub-devices remain unchanged, and each of these 90% of sub-devices needs to transmit 1 data packet. Therefore, the total number of data packets to be transmitted is 384 x 0.9 x 1 + 384 x 0.1 x 5 = 538, saving 1382 packets and reducing link resource usage by 70%. This effectively reduces the probability of link collisions and improves user experience.
[0125] Figure 6 This illustration shows a possible exemplary block diagram of a device 600 according to an embodiment of this application. The device 600 includes a transceiver module 620 and a processing module 610. The transceiver module 620 may include a receiving module and a sending module. The processing module 610 is used to control and manage the actions of the device 600. The transceiver module 620 is used to support communication between the device 600 and other network entities. Optionally, the device 600 may further include a storage module for storing the program code and data of the device 600.
[0126] Optionally, each module in the device 600 can be implemented by software.
[0127] Optionally, the processing module 610 may be a processor or controller, such as a general-purpose central processing unit (CPU), a general-purpose processor, a digital signal processing unit (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with the embodiments of this application. The processor may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc. The transceiver module 620 may be a communication interface, transceiver, or transceiver circuit, etc., wherein the communication interface is a general term, and in a specific implementation, the communication interface may include multiple interfaces; the storage module may be a memory.
[0128] When device 600 is a control device or a chip in a control device, the processing module 610 in device 600 can support device 600 in performing the actions of the control device in the method examples above.
[0129] The transceiver module 620 enables communication between device 600 and sub-devices. For example, the transceiver module 620 enables device 600 to perform... Figure 4 The S400, S420A and S420B are among them.
[0130] For example, the processing module 610 calls the transceiver module 620 to perform: sending a query command to the sub-device, the query command including first information, the first information being determined based on the corresponding attribute values of n attributes of the first type of the sub-device stored by the control device, where n is an integer greater than or equal to 1; receiving the corresponding attribute values of the n attributes of the first type stored by the sub-device, or, first indication information, the first indication information indicating that the corresponding attribute value of each of the n attributes of the first type has not been updated.
[0131] In one possible design, when the control device receives the corresponding attribute values of n attributes of the first type stored in the sub-device from the sub-device, the corresponding attribute value of at least one of the n attributes of the first type stored in the sub-device is different from the corresponding attribute value of at least one of the n attributes of the first type stored in the control device.
[0132] In one possible design, the query command further includes second information, which is determined based on the corresponding attribute values of m attributes of the second type of the sub-device stored by the control device, where m is an integer greater than or equal to 1; the transceiver module 620 is used to receive from the sub-device the corresponding attribute values of the m attributes of the second type stored by the sub-device, or second indication information, which indicates that the corresponding attribute value of each attribute in the second type of attributes has not been updated.
[0133] In one possible design, when the control device receives the corresponding attribute values of m attributes of the second type stored in the sub-device, the corresponding attribute value of at least one of the m attributes of the second type stored in the sub-device is different from the corresponding attribute value of at least one of the m attributes of the second type stored in the control device.
[0134] In one possible design, the update frequency of the m attributes of the second type is lower than the update frequency of the n attributes of the first type.
[0135] In one possible design, the first information includes a summary value calculated by the control device based on the corresponding attribute values of n attributes of the first type stored in the control device, and the second information includes a summary value calculated by the control device based on the corresponding attribute values of m attributes of the second type stored in the control device.
[0136] In one possible design, the transceiver module 620 is configured to receive attribute information sent by the sub-device before sending a query command to the sub-device. The attribute information includes multiple attributes of the sub-device and the attribute type of each attribute, wherein the attribute type of each attribute is either the first type or the second type.
[0137] In one possible design, the n attributes of the first type include at least one of button name, position information, height information, and coordinate information; the m attributes of the second type include at least one of ambient light intensity, on / off status, and humidity.
[0138] It should be understood that the device 600 according to the embodiments of this application can correspond to the control device in the foregoing method embodiments, and the operation and / or function of each module in the device 600 are respectively the corresponding steps of the method of controlling the device in the foregoing method embodiments. Therefore, the beneficial effects in the foregoing method embodiments can also be achieved. For the sake of brevity, it will not be elaborated here.
[0139] When device 600 is a sub-device or a chip within a sub-device, the processing module 610 in device 600 can support device 600 in executing the actions of the sub-device in the method examples above. For example, it can support device 600 in executing... Figure 4 S410 in the middle.
[0140] The transceiver module 620 enables communication between device 600 and control device. For example, the transceiver module 620 enables device 600 to perform... Figure 4 The S400, S420A and S420B are among them.
[0141] For example, transceiver module 620 is used to receive a query command sent by control device. The query command includes first information, which is determined based on the corresponding attribute values of n attributes of the first type of the sub-device stored by control device, where n is an integer greater than or equal to 1. Processing module 610 is used to respond to the query command by determining, based on the first information and the corresponding attribute values of the n attributes of the first type stored by the sub-device, whether there is an attribute whose attribute value has been updated among the n attributes of the first type. If there is an attribute whose attribute value has been updated among the n attributes of the first type, transceiver module 620 is used to send the corresponding attribute values of the n attributes of the first type stored by the sub-device to control device. Alternatively, if there is no attribute whose attribute value has been updated among the n attributes of the first type, transceiver module 620 is used to send first indication information to control device, which indicates that the corresponding attribute value of each of the n attributes of the first type has not been updated.
[0142] In one possible design, the corresponding attribute value of at least one of the n attributes of the first type stored in the sub-device is different from the corresponding attribute value of at least one of the n attributes of the first type stored in the control device.
[0143] In one possible design, the first information includes a summary value calculated by the control device based on the corresponding attribute values of n attributes of the first type stored in the control device; the processing module 610 is configured to calculate a first summary value based on the corresponding attribute values of the n attributes of the first type stored in itself when determining whether there is an attribute whose attribute value has been updated among the n attributes of the first type according to the first information and the corresponding attribute values of the n attributes of the first type stored in the sub-device; if the first summary value is determined to be the same as the summary value included in the first information, then it is determined that there is no attribute whose attribute value has been updated among the n attributes of the first type; otherwise, it is determined that there is an attribute whose attribute value has been updated among the n attributes of the first type.
[0144] In one possible design, the query command further includes second information, which is determined based on the corresponding attribute values of m attributes of the second type of the sub-device stored by the control device, where m is an integer greater than or equal to 1; the processing module 610 is used to determine whether there is an attribute whose attribute value has been updated among the m attributes of the second type based on the second information and the corresponding attribute values of the m attributes of the second type stored by the sub-device; when there is an attribute whose attribute value has been updated among the m attributes of the second type, the transceiver module 620 is used to send the corresponding attribute values of the m attributes of the second type stored by the sub-device to the control device; or, when there is no attribute whose attribute value has been updated among the m attributes of the second type, the transceiver module 620 is used to send second indication information to the control device, the second indication information indicating that the corresponding attribute value of each of the m attributes of the second type has not been updated.
[0145] In one possible design, the corresponding attribute value of at least one of the m attributes of the second type stored in the sub-device is different from the corresponding attribute value of at least one of the m attributes of the second type stored in the control device.
[0146] In one possible design, the second information includes a summary value calculated by the control device based on the corresponding attribute values of the m attributes of the second type stored in the control device; the processing module 610 is configured to calculate a second summary value based on the corresponding attribute values of the m attributes of the second type stored in itself when determining whether there is an attribute whose attribute value has been updated among the m attributes of the second type according to the second information and the corresponding attribute values of the m attributes of the second type stored in the sub-device; if the second summary value is determined to be the same as the summary value included in the second information, then it is determined that there is no attribute whose attribute value has been updated among the m attributes of the second type; otherwise, it is determined that there is an attribute whose attribute value has been updated among the m attributes of the second type.
[0147] In one possible design, the update frequency of the m attributes of the second type is lower than the update frequency of the m attributes of the second type.
[0148] In one possible design, the transceiver module 620 is configured to send attribute information to the control device before receiving a query command from the control device. The attribute information includes multiple attributes of the sub-device and the attribute type of each attribute, wherein the attribute type of each attribute is either the first type or the second type.
[0149] In one possible design, the m attributes of the second type include at least one of button name, position information, height information, and coordinate information; the m attributes of the second type include at least one of ambient light intensity, on / off status, and humidity.
[0150] It should be understood that the device 600 according to the embodiments of this application may correspond to the sub-device in the foregoing method embodiments, and the operation and / or function of each module in the device 600 are respectively the corresponding steps of the method of the sub-device in the foregoing method embodiments. Therefore, the beneficial effects in the foregoing method embodiments can also be achieved. For the sake of brevity, it will not be elaborated here.
[0151] Figure 7 A schematic structural diagram of a device 700 according to an embodiment of this application is shown. Figure 7 As shown, the device 700 includes a processor 701.
[0152] When device 700 is a control device or a chip within a control device, in one possible implementation, when processor 701 is used to call an interface to perform the following actions:
[0153] Send a query command to the sub-device, the query command including first information, the first information being determined based on the corresponding attribute values of n attributes of the first type of the sub-device stored by the control device, where n is an integer greater than or equal to 1; receive the corresponding attribute values of the n attributes of the first type stored by the sub-device, or, first indication information, the first indication information indicating that the corresponding attribute value of each of the n attributes of the first type has not been updated.
[0154] It should be understood that the device 700 can also be used to perform other steps and / or operations on the control device side in the previous embodiments, which will not be described in detail here for the sake of brevity.
[0155] When device 700 is a sub-device or a chip within a sub-device, in one possible implementation, when processor 701 is used to call an interface to perform the following actions:
[0156] The system receives a query command sent by a control device. The query command includes first information, which is determined based on the corresponding attribute values of n attributes of the first type of the sub-device stored by the control device, where n is an integer greater than or equal to 1. In response to the query command, the system determines whether there is an attribute whose attribute value has been updated among the n attributes of the first type, based on the first information and the corresponding attribute values of the n attributes of the first type stored by the sub-device. If there is an attribute whose attribute value has been updated among the n attributes of the first type, the system sends the corresponding attribute values of the n attributes of the first type stored by the sub-device to the control device. Alternatively, if there is no attribute whose attribute value has been updated among the n attributes of the first type, the system sends first indication information to the control device, indicating that the corresponding attribute value of each of the n attributes of the first type has not been updated.
[0157] It should be understood that the device 700 can also be used to perform other steps and / or operations on the sub-device side in the previous embodiments, which will not be described in detail here for the sake of brevity.
[0158] It should be understood that the processor 701 can call an interface to perform the above-mentioned sending and receiving operations. The called interface can be a logical interface or a physical interface, and there is no limitation on this. Optionally, the physical interface can be implemented using a transceiver. Optionally, the device 700 further includes a transceiver 703.
[0159] Optionally, the device 700 further includes a memory 702, which may store the program code in the above method embodiments for the processor 701 to call.
[0160] Specifically, if the device 700 includes a processor 701, a memory 702, and a transceiver 703, then the processor 701, memory 702, and transceiver 703 communicate with each other through internal connection paths to transmit control and / or data signals. In one possible design, the processor 701, memory 702, and transceiver 703 can be implemented using chips. The processor 701, memory 702, and transceiver 703 may be implemented in the same chip, or they may be implemented in different chips, or any two of their functions may be combined into one chip. The memory 702 can store program code, and the processor 701 calls the program code stored in the memory 702 to implement the corresponding functions of the device 700.
[0161] The methods disclosed in the embodiments of this application can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method embodiments can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, a system-on-a-chip (SoC), a central processing unit (CPU), a network processor (NP), a digital signal processor (DSP), a microcontroller unit (MCU), a programmable logic device (PLD), or other integrated chips. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this application can be directly manifested as being executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.
[0162] It should be understood that in the embodiments of this application, the designations "first", "second", etc. are only for distinguishing different objects, such as for distinguishing different parameter information or messages, and do not constitute a limitation on the scope of the embodiments of this application. The embodiments of this application are not limited thereto.
[0163] It should also be understood that, in the various embodiments of this application, the sequence numbers of the above processes do not imply the order of execution; the execution order of each process should be determined by its function and internal logic. The various numerical numbers or sequence numbers involved in the above processes are merely for descriptive convenience and should not constitute any limitation on the implementation process of the embodiments of this application.
[0164] Those skilled in the art will recognize that the modules and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0165] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and modules described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0166] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or modules may be electrical, mechanical, or other forms.
[0167] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0168] In addition, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module.
[0169] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a personal computer, server, device, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
Claims
1. A method for synchronizing attribute values, characterized in that, The method is applied to a narrowband power line communication PLC system, and the method includes: The control device sends a query command to the sub-device. The query command includes first information, which is determined based on the corresponding attribute values of n attributes of the first type of the sub-device stored by the control device, where n is an integer greater than or equal to 1. The first information is used to determine whether there are any attributes among the n attributes of the first type whose attribute values have been updated. When there is no attribute whose attribute value has been updated among the n attributes of the first type, the control device receives a first indication information sent by the sub-device, the first indication information indicating that the corresponding attribute value of each of the n attributes of the first type has not been updated; The query command further includes second information, which is determined based on the corresponding attribute values of m attributes of the second type of the sub-device stored in the control device, where m is an integer greater than or equal to 1; the first information is sent more frequently than the second information; the second information is used to determine whether there are any attributes among the m attributes of the second type whose attribute values have been updated. The method further includes: When there is no attribute whose value has been updated among the m attributes of the second type, the control device receives a second indication information from the sub-device. The second indication information indicates that the corresponding attribute value of each of the m attributes of the second type has not been updated; the update frequency of the m attributes of the second type is lower than the update frequency of the n attributes of the first type.
2. The method as described in claim 1, characterized in that, The method further includes: When there is an attribute whose attribute value has been updated among the n attributes of the first type, the control device receives the corresponding attribute values of the n attributes of the first type stored in the sub-device sent by the sub-device. The attribute whose attribute value has been updated among the n attributes of the first type is determined based on the first information and the corresponding attribute values of the n attributes of the first type stored in the sub-device.
3. The method as described in claim 2, characterized in that, When the control device receives the corresponding attribute values of n attributes of the first type stored in the sub-device from the sub-device, the corresponding attribute value of at least one of the n attributes of the first type stored in the sub-device is different from the corresponding attribute value of at least one of the n attributes of the first type stored in the control device.
4. The method according to any one of claims 1-3, characterized in that, The method further includes: When there is an attribute whose attribute value has been updated among the m attributes of the second type, the control device receives the corresponding attribute values of the m attributes of the second type stored in the sub-device. The attribute whose attribute value has been updated among the m attributes of the second type is determined based on the second information and the corresponding attribute values of the m attributes of the second type stored in the sub-device.
5. The method as described in claim 4, characterized in that, When the control device receives the corresponding attribute values of m attributes of the second type stored in the sub-device, the corresponding attribute value of at least one of the m attributes of the second type stored in the sub-device is different from the corresponding attribute value of at least one of the m attributes of the second type stored in the control device.
6. The method according to any one of claims 1-5, characterized in that, The first information includes a summary value calculated by the control device based on the corresponding attribute values of n attributes of the first type stored in the control device, and the second information includes a summary value calculated by the control device based on the corresponding attribute values of m attributes of the second type stored in the control device.
7. The method according to any one of claims 1-6, characterized in that, Before the control device sends a query command to the sub-device, it also includes: The control device receives attribute information sent by the sub-device. The attribute information includes multiple attributes of the sub-device and the attribute type of each attribute, wherein the attribute type of each attribute is either the first type or the second type.
8. The method according to any one of claims 1-7, characterized in that, The first type of n attributes includes at least one of button name, location information, height information, and coordinate information; the second type of m attributes includes at least one of ambient light intensity, on / off status, and humidity.
9. A method for synchronizing attribute values, characterized in that, The method is applied to a narrowband PLC system, and the method includes: The sub-device receives a query command sent by the control device. The query command includes first information, which is determined based on the corresponding attribute values of n attributes of the sub-device of a first type stored by the control device, where n is an integer greater than or equal to 1. The first information is used to determine whether there are any attributes of the first type whose attribute values have been updated. In response to the query command, the sub-device determines whether there is an attribute whose attribute value has been updated among the n attributes of the first type based on the first information and the corresponding attribute values of the n attributes of the first type stored in the sub-device; When there is no attribute whose attribute value has been updated among the n attributes of the first type, the sub-device sends a first indication message to the control device, the first indication message indicating that the corresponding attribute value of each of the n attributes of the first type has not been updated; The query command further includes second information, which is determined based on the corresponding attribute values of m attributes of the second type of the sub-device stored in the control device, where m is an integer greater than or equal to 1; the first information is sent more frequently than the second information; the second information is used to determine whether there are any attributes among the m attributes of the second type whose attribute values have been updated. The method further includes: The sub-device determines whether there is an attribute whose attribute value has been updated among the m attributes of the second type based on the second information and the corresponding attribute values of the m attributes of the second type stored in the sub-device; When there is no attribute whose attribute value has been updated among the m attributes of the second type, the sub-device sends a second indication message to the control device, the second indication message indicating that the corresponding attribute value of each of the m attributes of the second type has not been updated; The update frequency of the m attributes of the second type is lower than the update frequency of the n attributes of the first type.
10. The method as described in claim 9, characterized in that, The method further includes: When there is an attribute whose value has been updated among the n attributes of the first type, the sub-device sends the corresponding attribute values of the n attributes of the first type stored in the sub-device to the control device.
11. The method as described in claim 10, characterized in that, The corresponding attribute value of at least one of the n attributes of the first type stored in the sub-device is different from the corresponding attribute value of at least one of the n attributes of the first type stored in the control device.
12. The method according to any one of claims 9-11, characterized in that, The first information includes a summary value calculated by the control device based on the corresponding attribute values of n attributes of the first type stored in the control device; The sub-device determines whether there is an attribute whose attribute value has been updated among the n attributes of the first type based on the first information and the corresponding attribute values of the n attributes of the first type stored in the sub-device, including: The sub-device calculates a first digest value based on the corresponding attribute values of the n attributes of the first type stored in its own memory; If the sub-device determines that the first digest value and the digest value included in the first information are the same, then it determines that there is no attribute whose attribute value has been updated among the n attributes of the first type; otherwise, it determines that there is an attribute whose attribute value has been updated among the n attributes of the first type.
13. The method according to any one of claims 9-12, characterized in that, The method further includes: When there is an attribute whose value has been updated among the m attributes of the second type, the sub-device sends the corresponding attribute values of the m attributes of the second type stored in the sub-device to the control device.
14. The method as described in claim 13, characterized in that, The corresponding attribute value of at least one of the m attributes of the second type stored in the sub-device is different from the corresponding attribute value of at least one of the m attributes of the second type stored in the control device.
15. The method according to any one of claims 9-14, characterized in that, The second information includes a summary value calculated by the control device based on the corresponding attribute values of m attributes of the second type stored in the control device; The sub-device determines whether there is an attribute whose attribute value has been updated among the m attributes of the second type based on the second information and the corresponding attribute values of the m attributes of the second type stored in the sub-device, including: The sub-device calculates a second digest value based on the corresponding attribute values of the m attributes of the second type stored in its own memory; If the sub-device determines that the second digest value and the digest value included in the second information are the same, then it determines that there is no attribute whose attribute value has been updated among the m attributes of the second type; otherwise, it determines that there is an attribute whose attribute value has been updated among the m attributes of the second type.
16. The method according to any one of claims 9-15, characterized in that, Before the sub-device receives the query command from the control device, it also includes: The sub-device sends attribute information to the control device. The attribute information includes multiple attributes of the sub-device and the attribute type of each attribute, wherein the attribute type of each attribute is either the first type or the second type.
17. The method according to any one of claims 9-16, characterized in that, The first type of n attributes includes at least one of button name, location information, height information, and coordinate information; the second type of m attributes includes at least one of ambient light intensity, on / off status, and humidity.
18. A communication device, characterized in that, Including processor and memory; The memory is used to store programs; The processor is configured to execute a program stored in the memory to cause the device to perform the method as described in any one of claims 1 to 8, or the method as described in any one of claims 9 to 17.
19. A chip, characterized in that, The chip is coupled to a memory, and the chip reads a program stored in the memory to execute the method according to any one of claims 1 to 8, or the method according to any one of claims 9 to 17.
20. A readable storage medium, characterized in that, The storage medium stores a program or instructions that, when executed by the device, implement the method as described in any one of claims 1 to 8, or the method as described in any one of claims 9 to 17.
21. A computer program product, characterized in that, The computer program product includes instructions that, when executed on a device, perform the method as described in any one of claims 1 to 8, or the method as described in any one of claims 9 to 17.
22. A communication system, characterized in that, The system includes a control device and at least one sub-device, wherein the control device performs the method as described in any one of claims 1 to 8, and the sub-device performs the method as described in any one of claims 9 to 17.
Citation Information
Patent Citations
Equipment state query method and device and server
CN111698335A
Property grouping for change detection in distributed storage systems
CN113767390A
Configuration issuing method, configuration processing method and related equipment
CN115438254A
