An Internet of Things control method, device and intelligent terminal in a power carrier environment
By allocating individual, group, and scenario configuration and control instructions in a power carrier environment, the problem of power carrier communication technology lacking grouping and scenario functions is solved, and efficient and unified configuration and control of IoT devices are achieved, reducing engineering costs and improving data transmission reliability.
Patent Information
- Application Number
- CN202211620560.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-15
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2042-12-15
AI Technical Summary
Existing power line carrier communication technology lacks grouping and scenario functions and cannot adapt to the application scale and real-time requirements of the Internet of Things. The bandwidth of DALI digital lighting technology is too narrow and the cost of laying and debugging data lines is high.
By distributing individual, group, and scenario configuration and control instructions in a power carrier environment, the grouping and scenario setting of IoT devices can be achieved, and the response and cache technology is used to implement a retransmission mechanism to improve reliability.
It realizes unified configuration and control of IoT devices, reduces engineering costs, and improves the reliability and adaptability of data transmission.
Smart Images

Figure CN115914312B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of power line carrier communications, and in particular to an Internet of Things control method, device, and intelligent terminal in a power line carrier environment. Background Art
[0002] With the rapid development of the internet, more and more isolated information islands have been connected. The Internet of Things is an information carrier based on the internet, traditional telecommunications networks, and other technologies. It allows all ordinary physical objects that can be independently addressed to form an interconnected network.
[0003] In the wired communications field of the Internet of Things, existing power carrier technology can transmit data without the need for a data bus. It is more commonly used in the power industry or street lighting. It has a broadcast function and can send instructions to many devices at once, but lacks grouping and scene functions, making it inconvenient for intelligent control. While DALI (Digital Addressable Lighting Interface) digital lighting technology has grouping and scene functions, its bandwidth is too narrow, with a maximum of 16 groups and 16 scenes. This cannot adapt to the application scale and real-time requirements of the Internet of Things. In addition, the laying and debugging of data cables are very demanding, and the cost and time are difficult to control.
[0004] Therefore, the existing technology still needs to be improved and developed. Summary of the Invention
[0005] The technical problem to be solved by the present invention is to provide an Internet of Things control method, device and intelligent terminal in a power line carrier environment in response to the above-mentioned defects of the existing technology, aiming to solve the problem that power line carrier communication in the existing technology lacks grouping and scene functions, and the problem that the bandwidth of DALI digital lighting technology is too narrow to adapt to the application scale and real-time requirements of the Internet of Things.
[0006] The technical solutions adopted by the present invention to solve the technical problems are as follows:
[0007] In a first aspect, the present invention provides an Internet of Things control method in a power line carrier environment, wherein the method comprises:
[0008] Obtaining power carrier instructions broadcast on the Internet of Things; wherein the power carrier instructions include configuration instructions and control instructions, the configuration instructions include individual configuration instructions, group configuration instructions and scene configuration instructions, and the control instructions include individual control instructions, group control instructions and scene control instructions;
[0009] Perform configuration or control actions according to the power carrier instruction and send a response instruction;
[0010] According to the response instruction, the power carrier instruction is controlled to be retransmitted.
[0011] In one implementation, configuring or executing a control action according to the power carrier instruction, sending a response instruction, and obtaining a response instruction include:
[0012] If the power carrier instruction is the individual configuration instruction, the designated IoT device individual is obtained according to the individual ID in the individual configuration instruction; wherein the individual configuration instruction includes an individual configuration instruction code, a serial number, an individual ID, a number of configuration parameters, a configuration parameter name, and a configuration parameter value;
[0013] Setting the parameters of the individual IoT device according to the configuration parameter name and configuration parameter value in the individual configuration instruction;
[0014] According to the serial number and individual ID, the designated IoT device is controlled to issue a response instruction; wherein the response instruction includes a response instruction code, the serial number, the individual ID and status information.
[0015] In one implementation, performing configuration or executing a control action according to the power carrier instruction and sending a response instruction includes:
[0016] If the power carrier instruction is the group configuration instruction, the designated IoT device individual is obtained according to the individual ID in the group configuration instruction; wherein the group configuration instruction includes a group configuration instruction code, a serial number, a group number, a number of configured individuals, and the individual ID;
[0017] Compiling the designated IoT device individual into the IoT device group corresponding to the group number;
[0018] According to the serial number and individual ID, the designated IoT device is controlled to issue a response instruction; wherein the response instruction includes a response instruction code, the serial number, the individual ID and status information.
[0019] In one implementation, performing configuration or executing a control action according to the power carrier instruction and sending a response instruction includes:
[0020] If the power carrier instruction is the scenario configuration instruction, the specified IoT device group is obtained according to the group number in the scenario configuration instruction; wherein the scenario configuration instruction includes a scenario configuration instruction code, a serial number, a scenario number, a number of configuration groups, the group number and configuration parameters;
[0021] Grouping the specified IoT devices into the IoT device scene corresponding to the scene number;
[0022] According to the IoT device grouping, the IoT device individuals contained in the IoT device grouping are obtained, and the IoT device individuals are controlled to issue a response instruction; wherein the response instruction includes a response instruction code, the serial number, the individual ID and status information of the IoT device individual.
[0023] In one implementation, performing configuration or executing a control action according to the power carrier instruction and sending a response instruction includes:
[0024] If the power carrier instruction is the control instruction, then according to the control parameter name and control parameter value in the control instruction, the IoT device individual corresponding to the individual ID / group number / scene number is controlled to perform a control action and issue a response instruction; wherein the response instruction includes a response instruction code, a serial number, the individual ID and status information of the IoT device individual, and the control instruction includes a control instruction code, a serial number, the individual ID / group number / scene number, the number of control parameters, the control parameter name, and the control parameter value.
[0025] In one implementation, controlling the power carrier instruction to be retransmitted according to the response instruction includes:
[0026] If the power carrier instruction is the individual configuration instruction or the control instruction containing the control individual ID, then according to the serial number and individual ID in the power carrier instruction, the corresponding individual ID of each serial number is obtained and stored in the system hash cache;
[0027] If the power carrier instruction is the group configuration instruction, the scene configuration instruction, or the control instruction containing the group number / scene number, the individual ID is obtained according to the group number and the scene number, and then the corresponding individual ID of each sequence number is obtained according to the individual ID and the sequence number in the power carrier instruction and stored in the system hash cache;
[0028] According to the serial number and individual ID in the response instruction, the responding individual ID of each serial number corresponding to the serial number and individual ID in the response instruction is deleted from the system hash cache;
[0029] If the system Hash cache is not empty, the power carrier instructions corresponding to the serial numbers in the system Hash cache are reorganized and sent in batches according to a preset retransmission number threshold or retransmission time threshold, and a response instruction corresponding to the serial number is obtained.
[0030] In one implementation, the method further includes:
[0031] If the response instruction corresponding to the sequence number is not obtained after the retransmission number threshold or the retransmission time threshold is reached, the individual ID is set as abnormal, and the individual configuration instruction and the individual control instruction are no longer sent to the individual ID.
[0032] In a second aspect, an embodiment of the present invention further provides an Internet of Things control device in a power line carrier environment, wherein the device includes:
[0033] A power carrier instruction acquisition module, configured to acquire power carrier instructions broadcast on the Internet of Things; wherein the power carrier instructions include configuration instructions and control instructions, the configuration instructions include individual configuration instructions, group configuration instructions, and scene configuration instructions, and the control instructions include individual control instructions, group control instructions, and scene control instructions;
[0034] An execution and response module, configured to perform configuration or execute control actions according to the power carrier instruction and send a response instruction;
[0035] A retransmission module is used to control the power carrier instruction to be retransmitted according to the response instruction.
[0036] In a third aspect, an embodiment of the present invention further provides an intelligent terminal, wherein the intelligent terminal includes a memory, a processor, and an Internet of Things control program in a power carrier environment stored in the memory and runnable on the processor. When the processor executes the Internet of Things control program in the power carrier environment, the steps of the Internet of Things control method in the power carrier environment as described in any one of the above items are implemented.
[0037] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores an Internet of Things control program in a power carrier environment. When the Internet of Things control program in a power carrier environment is executed by a processor, the steps of the Internet of Things control method in a power carrier environment as described in any one of the above items are implemented.
[0038] Beneficial effects: Compared with the prior art, the present invention provides an Internet of Things control method in a power carrier environment. The present invention first obtains the power carrier instructions broadcast on the Internet of Things, and divides the power carrier instructions into configuration instructions and control instructions for individuals, groups and scenes, thereby realizing grouping and scene setting of batches of Internet of Things terminal devices, and realizing unified configuration and control of multiple devices in one group or scene. Then, configuration or control actions are performed according to the power carrier instructions, and a response instruction is sent. Then, according to the response instruction, the power carrier instruction is controlled to be retransmitted. The present invention utilizes response and caching technology to make the power carrier group and scene data instructions more reliable through a retransmission mechanism for specific batches of individuals. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0040] Figure 1 The figure is a flow chart of an Internet of Things control method in a power line carrier environment provided by an embodiment of the present invention.
[0041] Figure 2 This is a principle block diagram of an Internet of Things control device in a power line carrier environment provided by an embodiment of the present invention.
[0042] Figure 3 This is a block diagram of the internal structure of the smart terminal provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0043] In order to make the purpose, technical solution and effect of the present invention clearer and more specific, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0044] It will be understood by those skilled in the art that, unless expressly stated otherwise, the singular forms "a", "an", "said" and "the" used herein may also include the plural forms. It should be further understood that the term "comprising" used in the description of the present invention refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be intermediate elements. In addition, "connected" or "coupled" as used herein may include wireless connections or wireless couplings. The term "and / or" used herein includes all or any units and all combinations of one or more associated listed items.
[0045] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by those skilled in the art in the art to which the present invention belongs. It should also be understood that terms such as those defined in common dictionaries should be understood to have meanings consistent with their meanings in the context of the prior art and will not be interpreted in an idealized or overly formal sense unless specifically defined as herein.
[0046] In the wired communications field of the Internet of Things, existing power carrier technology can transmit data without the need for a data bus. It is more commonly used in the power industry or street lighting. It has a broadcast function and can send instructions to many devices at once, but lacks grouping and scene functions, making it inconvenient for intelligent control. While DALI (Digital Addressable Lighting Interface) digital lighting technology has grouping and scene functions, its bandwidth is too narrow, with a maximum of 16 groups and 16 scenes. This cannot adapt to the application scale and real-time requirements of the Internet of Things. In addition, the laying and debugging of data cables are very demanding, and the cost and time are difficult to control.
[0047] Therefore, in order to solve the above problems, the present invention provides an Internet of Things control method in a power carrier environment. The present invention first obtains the power carrier instructions broadcast on the Internet of Things. By dividing the power carrier instructions into configuration instructions and control instructions for individuals, groups, and scenarios, batches of Internet of Things terminal devices can be grouped and scenarios can be set, and multiple devices can be uniformly configured and controlled in one group or scenario. Then, configuration or control actions are performed according to the power carrier instructions, and a response instruction is sent. Then, based on the response instruction, the power carrier instruction is controlled to be retransmitted. The present invention uses response and caching technology to make the power carrier group and scenario data instructions more reliable through a retransmission mechanism for specific batches of individuals.
[0048] Exemplary Methods
[0049] This embodiment provides an Internet of Things control method under a power line carrier environment, and this embodiment can be applied to Internet of Things devices. Figure 1 As shown, the method includes the following steps:
[0050] Step S100: Acquire a power carrier instruction broadcasted on the Internet of Things; wherein the power carrier instruction includes a configuration instruction and a control instruction, the configuration instruction includes an individual configuration instruction, a group configuration instruction, and a scene configuration instruction, and the control instruction includes an individual control instruction, a group control instruction, and a scene control instruction;
[0051] Power line communication (PLC), short for Power Line Communication, is a communication method unique to power systems. It utilizes existing power lines to transmit analog or digital signals at high speed via carrier waves. The key advantage of PLC is that it eliminates the need for a new network; data transmission can be performed as long as there are power lines. This embodiment integrates grouping and scene functions into the power line carrier environment and leverages the broadband characteristics of the power line carrier to expand digital lighting technology to various IoT sensors and actuators. This eliminates the need for additional physical bus deployment and reduces construction requirements, significantly saving engineering manpower and resources. This embodiment adapts digital lighting grouping and scene technologies to the power line carrier system, adding features such as simultaneous multi-target command transmission and accurate data response and confirmation. This creates an IoT control method suitable for a variety of specialized applications, including lighting, curtains, various alarms, and valve adjustment.
[0052] Specifically, this embodiment configures and controls IoT devices by broadcasting power carrier commands over the power grid. Configuration commands configure individual IoT devices, groups, and scenarios, enabling batches of IoT devices to be grouped and set up for specific scenarios. Control commands control individual IoT devices, groups, and scenarios to complete specific control actions.
[0053] For example, power carrier commands broadcast on the IoT include individual configuration commands A1, used to configure the parameters of individual IoT devices; group configuration commands A2, used to assign individual IoT devices to specific IoT device groups; and scenario configuration commands A3, used to group IoT devices into specific scenarios. Control commands include individual control commands B1, used to control individual IoT devices; group control commands B2, used to control all IoT devices in a specific IoT device group; and scenario control commands B3, used to control all IoT devices in a specific IoT device scenario.
[0054] Step S200: performing configuration or executing control actions according to the power carrier instruction, and sending a response instruction;
[0055] Specifically, after an IoT device receives a power carrier instruction broadcast from a power carrier communication network, if it determines that it is the target of the power carrier instruction, it needs to configure or execute control actions according to the power carrier instruction, and send a response instruction to the sender of the power carrier instruction to declare that it has received the power carrier instruction, so as to improve the reliability of instruction transmission.
[0056] For example, when the IoT device C1 receives the individual configuration instruction A1 broadcast on the IoT, it executes A1 and sends a response instruction D1 to the sender of the power carrier instruction to declare that the IoT device C1 has received the individual configuration instruction A1 and executed the A1 instruction.
[0057] In one implementation, step S200 in this embodiment includes the following steps:
[0058] Step S201, the Internet of Things control method in a power carrier environment according to claim 1, characterized in that the configuration or execution of the control action according to the power carrier instruction, the sending of the response instruction, and the obtaining of the response instruction include:
[0059] Step S202: If the power carrier instruction is the individual configuration instruction, obtain the designated IoT device individual according to the individual ID in the individual configuration instruction; wherein the individual configuration instruction includes an individual configuration instruction code, a serial number, an individual ID, a number of configuration parameters, a configuration parameter name, and a configuration parameter value;
[0060] Step S203: setting the parameters of the individual IoT device according to the configuration parameter name and configuration parameter value in the individual configuration instruction;
[0061] Step S204: Control the designated IoT device to issue a response instruction based on the serial number and the individual ID; wherein the response instruction includes a response instruction code, the serial number, the individual ID, and status information.
[0062] Specifically, the format of the individual configuration instruction in this embodiment is individual configuration instruction code + serial number + individual ID + number of configuration parameters + multiple (configuration parameter name: configuration parameter value). The individual configuration instruction code is SET, which represents the instruction to set the individual. The serial number is a numerical identifier uniquely assigned to each power carrier instruction, which is used to distinguish which instruction it is. The individual ID is a unique identification code for each individual IoT device. The number of configuration parameters is used to indicate how many configuration parameter pairs consisting of configuration parameter name: configuration parameter value are contained in this individual configuration instruction. Configuration parameter name: configuration parameter value indicates the parameter name and corresponding parameter value that are required to be added to the individual IoT device in the individual configuration instruction. It can be single or multiple. The configuration parameter name and parameter value are defined by the actual IoT professional. If there are multiple parameter names and corresponding parameter values, and they are not equal to the number in the number of configuration parameters, the larger number between the number of configuration parameters and the actual number of configuration parameter names: configuration parameter values determines the number of parameters that need to be configured for the individual IoT device. The IoT device determines whether it needs to execute this configuration instruction through the individual ID in the individual configuration instruction. When its individual ID is the same as the individual ID in the individual configuration instruction, it needs to execute this individual configuration instruction and update its own configuration parameters by further parsing the configuration parameter name: configuration parameter value.
[0063] For example, in this example, the individual configuration command is SET 1 20 2 (Brightness: 10 Color Temperature: 3000). This indicates that the configuration command with command sequence number 1 configures two parameters for the IoT device with ID 20: brightness 10 and color temperature 3000. Thus, when the individual configuration command is broadcast, only the IoT device with ID 20 executes this individual configuration command, setting the brightness to 10 and the color temperature to 3000.
[0064] After executing an individual configuration command, an IoT device sends a response to the sender of the individual configuration command. The response format is: response code + sequence number + individual ID + status information. The response code is ACK, the sequence number is the sequence number of the received individual configuration command, which is used to distinguish the received individual configuration command, the individual ID is the unique identifier of each IoT device, and the status information indicates the specific status of the received individual configuration command.
[0065] For example, ACK 1 20 "OK" means that device No. 20 responded to command No. 1 and the status is received. "OK" can also be represented by 1.
[0066] In one implementation, step S200 in this embodiment includes the following steps:
[0067] Step S204: If the power carrier instruction is the group configuration instruction, obtaining the designated IoT device individual according to the individual ID in the group configuration instruction; wherein the group configuration instruction includes a group configuration instruction code, a serial number, a group number, a number of configured individuals, and the individual ID;
[0068] Step S205: assigning the designated IoT device to the IoT device group corresponding to the group number;
[0069] Step S206: Control the designated IoT device to issue a response instruction based on the serial number and the individual ID; wherein the response instruction includes a response instruction code, the serial number, the individual ID, and status information.
[0070] Specifically, the format of the group configuration instruction is group configuration instruction code + serial number + group number + number of configured individuals + multiple (individual IDs). The group configuration instruction code is GSET, which represents the instruction for setting the group, the serial number is a numerical identifier uniquely assigned to each power carrier instruction, which is used to distinguish which instruction it is, the individual ID is a unique identification code for each IoT device individual, the group number is a numerical identifier uniquely assigned to each IoT device group, the number of configured individuals is the number of IoT device individuals to be added to the group, and the individual ID is the unique identity identifier of the IoT device individual to be added to the specified group. Through the group configuration instruction, a single or multiple IoT device individuals can be added to the IoT device group to achieve unified control of the same group. If the number of configured individuals is multiple and is not equal to the total number of individual IDs in the group configuration instruction, the number of IoT device individuals that need to be configured is determined by the larger number between the number of configured individuals and the total number of actual individual IDs in the group configuration instruction. Each IoT device uses its individual ID in the group configuration instruction to determine whether it needs to execute this configuration instruction. When its individual ID is the same as the individual ID in the group configuration instruction, it needs to execute this individual configuration instruction, update its own group, and send a response instruction to the sender of the group configuration instruction.
[0071] For example, consider the group configuration instruction GSET 3 15 4 (1 3 5 10), which is a group configuration instruction with a sequence number of 3. This instruction places the four devices with ID numbers 1, 3, 5, and 10 into group 15. Thus, the four IoT devices with individual ID numbers 1, 3, 5, and 10 associate themselves with group 3. When the control terminal controls IoT device group 3, the four IoT devices with individual ID numbers 1, 3, 5, and 10 will respond simultaneously. For another example, the group configuration instruction GSET 4 -15 4 (1 3510), which is a group configuration instruction with a sequence number of 4, removes the four devices with individual ID numbers 1, 3, 5, and 10 from group 15.
[0072] In one implementation, step S200 in this embodiment includes the following steps:
[0073] Step S207: If the power carrier instruction is the scenario configuration instruction, obtaining the designated IoT device group according to the group number in the scenario configuration instruction; wherein the scenario configuration instruction includes a scenario configuration instruction code, a serial number, a scenario number, a number of configuration groups, the group number, and configuration parameters;
[0074] Step S208: grouping the designated IoT devices into the IoT device scene corresponding to the scene number;
[0075] Step S209: According to the IoT device grouping, obtain the IoT device individuals included in the IoT device grouping, and control the IoT device individuals to issue a response instruction; wherein the response instruction includes a response instruction code, the serial number, the individual ID of the IoT device individual, and status information.
[0076] Specifically, the format of the scene configuration instruction in this example is: scene configuration instruction code + serial number + scene number + number of configuration groups + multiple (group number: configuration parameters). The scene configuration instruction code is SSET, which represents the instruction for setting the scene, the serial number is a numerical identifier uniquely assigned to each power carrier instruction, which is used to distinguish which instruction it is, the scene number is a numerical identifier uniquely assigned to each IoT device group, the number of configuration groups is the number of IoT device groups to be added to the group, the group number is a numerical identifier uniquely assigned to each IoT device group, which is used to indicate which groups are to be added to the scene, and the configuration parameter is the configuration parameter name and configuration parameter value configured by the group number. Through the scene configuration instruction, a single or multiple IoT device groups can be added to the IoT device scene to achieve unified configuration and control of the same sub-scene. If the number of configuration groups is not equal to the total number of actual group numbers in the scene configuration instruction, the larger number between the number of configuration groups and the total number of actual group numbers in the group configuration instruction is used to determine the number of groups that the individual IoT device needs to configure. Each IoT device uses the group number in the scene configuration instruction to confirm whether it belongs to this group and needs to execute this configuration instruction. When its group number is the same as the group number in the group configuration instruction, it needs to execute this scene configuration instruction, update its own scene, and send a response instruction to the sender of the scene configuration instruction.
[0077] For example, if the scene configuration command is SSET 5 7 2 (6: "Light brightness: 0.8", 9: "Curtain up: 0.5"), the scene configuration command with sequence number 5 sets two parameters in scene number 7, namely, setting the light brightness in group 6 to 80% (0.8) and the curtain up in group 9 to 50%.
[0078] In one implementation, step S200 in this embodiment includes the following steps:
[0079] Step S210: If the power carrier instruction is the control instruction, then according to the control parameter name and control parameter value in the control instruction, the IoT device individual corresponding to the individual ID / group number / scene number is controlled to perform a control action and issue a response instruction; wherein the response instruction includes a response instruction code, a serial number, the individual ID and status information of the IoT device individual, and the control instruction includes a control instruction code, a serial number, the individual ID / group number / scene number, the number of control parameters, the control parameter name, and the control parameter value.
[0080] Specifically, the format of the control instruction is control instruction code + serial number + individual ID / group number / scene number + number of control parameters + multiple (control parameter name: control parameter value). Among them, when the control instruction is an individual control instruction, the control instruction code is CTRL, when the control instruction is a group control instruction, the control instruction code is GCTRL, when the control instruction is a scene control instruction, the control instruction code is SCTRL, the control parameter name is one of switch or adjustment value, and the control parameter value is: When the control parameter name is switch: it is a digital expression of one of on / off, such as 0 / 1, TRUE / FALSE, when the control parameter value is an adjustment value: the parameter value is the integer, floating point number, Boolean quantity or string to be set. The IoT device individual corresponding to the control individual ID / group number / scene number executes the control action and issues a response instruction.
[0081] For example, the individual control command CTRL 2 20 1 (Switch: 1) indicates that the setup command with command sequence number 2 sets an action for light ID 20, setting the switch value to 1 (on). If the switch value is set to 0, it is off. Another example is the group control command GCTRL 4 15 (Switch: 1) indicating that the group control command with command sequence number 4 turns on the devices in group 15. Another example is the scene control command SCTRL 7 5 1 indicating that the scene control command with sequence number 7 turns on scene 5 and sets the value to 1.
[0082] Step S300: Control the power carrier instruction to be retransmitted according to the response instruction.
[0083] Specifically, because all commands are broadcast over the power carrier line, all power carrier terminal devices determine whether the individual ID / group number / scene number in the command matches their previously configured one, and then execute the configuration and control actions. However, because power carriers are subject to significant interference from strong currents, some terminal devices may not receive the command. A response command can be used to determine whether the power carrier command has been received by the relevant device. If not, a retransmission mechanism is required to ensure delivery of the power carrier command.
[0084] In one implementation, step S300 in this embodiment includes the following steps:
[0085] Step S301: If the power carrier instruction is the individual configuration instruction or the control instruction containing the control individual ID, then according to the serial number and individual ID in the power carrier instruction, the corresponding individual ID of each serial number is obtained and stored in the system hash cache;
[0086] Step S302: If the power carrier instruction is the group configuration instruction, the scene configuration instruction, or the control instruction containing the group number / scene number, the individual ID is obtained according to the group number and the scene number, and then the corresponding individual ID for each sequence number is obtained according to the individual ID and the sequence number in the power carrier instruction and stored in the system hash cache;
[0087] Step S303: based on the serial number and individual ID in the response instruction, delete the responding individual ID of each serial number corresponding to the serial number and individual ID in the response instruction from the system hash cache;
[0088] Step S304: If the system Hash cache is not empty, reorganize and send the power carrier instructions corresponding to the serial numbers in the system Hash cache in batches according to a preset retransmission number threshold or retransmission time threshold, and obtain a response instruction corresponding to the serial number.
[0089] Specifically, the instruction sender maintains a system hash cache to record which terminal entities have received the instruction and which have not. Those that have received the instruction are deleted from the cache. For those that have not received the power carrier instruction, the instruction is resent using the same sequence number until a certain number of retransmissions or a certain time has passed. If all entities respond, the instruction is no longer resent.
[0090] In one implementation, the method of this embodiment further includes the following steps:
[0091] Step M100: If no response instruction corresponding to the sequence number is obtained after the retransmission number threshold or the retransmission time threshold is reached, the individual ID is set as abnormal, and the individual configuration instruction and the individual control instruction are no longer sent to the individual ID.
[0092] Specifically, if there is always no response from an individual, it means that there is a problem with the individual, and the individual ID status is recorded and the cache is cleared. This ensures that all equipment on site works reliably.
[0093] It should be noted that the individual configuration instructions, group configuration instructions and scene configuration instructions in this embodiment, the control instructions include individual control instructions, group control instructions and scene control instructions and the response instructions may also include an extended check code, version number or other attribute fields.
[0094] Exemplary devices
[0095] like Figure 2 As shown in , this embodiment also provides an Internet of Things control device in a power line carrier environment, the device comprising:
[0096] The power carrier instruction acquisition module 10 is used to acquire the power carrier instructions broadcast on the Internet of Things; wherein the power carrier instructions include configuration instructions and control instructions, the configuration instructions include individual configuration instructions, group configuration instructions and scene configuration instructions, and the control instructions include individual control instructions, group control instructions and scene control instructions;
[0097] An execution and response module 20, configured to perform configuration or execute control actions according to the power carrier instruction and send a response instruction;
[0098] The retransmission module 30 is configured to control the power carrier instruction to be retransmitted according to the response instruction.
[0099] In one implementation, the execution and response module 20 includes:
[0100] a first IoT device individual acquisition unit, configured to obtain a designated IoT device individual according to an individual ID in the individual configuration instruction if the power carrier instruction is the individual configuration instruction; wherein the individual configuration instruction includes an individual configuration instruction code, a serial number, an individual ID, a number of configuration parameters, a configuration parameter name, and a configuration parameter value;
[0101] A first configuration unit, configured to set parameters of the individual IoT device according to a configuration parameter name and a configuration parameter value in the individual configuration instruction;
[0102] The first response unit is used to control the designated IoT device to issue a response instruction according to the serial number and the individual ID; wherein the response instruction includes a response instruction code, the serial number, the individual ID and status information.
[0103] In one implementation, the execution and response module 20 includes:
[0104] a second IoT device individual acquisition unit, configured to obtain a designated IoT device individual according to an individual ID in the group configuration instruction if the power carrier instruction is the group configuration instruction; wherein the group configuration instruction includes a group configuration instruction code, a serial number, a group number, a number of configured individuals, and the individual ID;
[0105] A second configuration unit is configured to assign the designated IoT device to the IoT device group corresponding to the group number;
[0106] The second response unit is used to control the designated IoT device to issue a response instruction according to the serial number and the individual ID; wherein the response instruction includes a response instruction code, the serial number, the individual ID and status information.
[0107] In one implementation, the execution and response module 20 includes:
[0108] An IoT device group acquisition unit, configured to obtain a specified IoT device group according to the group number in the scenario configuration instruction if the power carrier instruction is the scenario configuration instruction; wherein the scenario configuration instruction includes a scenario configuration instruction code, a serial number, a scenario number, a number of configuration groups, the group number, and configuration parameters;
[0109] a third configuration unit, configured to group the specified IoT devices into an IoT device scene corresponding to the scene number;
[0110] The third response unit is used to obtain the individual IoT devices contained in the IoT device group according to the IoT device group, and control the individual IoT devices to issue a response instruction; wherein the response instruction includes a response instruction code, the serial number, the individual ID and status information of the individual IoT device.
[0111] In one implementation, the execution and response module 20 includes:
[0112] A control and response unit, configured to, if the power carrier instruction is the control instruction, control the IoT device individual corresponding to the individual ID / group number / scene number to perform a control action and issue a response instruction according to the control parameter name and control parameter value in the control instruction; wherein the response instruction includes a response instruction code, a serial number, the individual ID and status information of the IoT device individual, and the control instruction includes a control instruction code, a serial number, the individual ID / group number / scene number, the number of control parameters, the control parameter name, and the control parameter value.
[0113] In one implementation, the retransmission module 30 includes:
[0114] a first system hash cache storing unit, configured to obtain a corresponding individual ID for each serial number according to the serial number and individual ID in the power carrier instruction and store the corresponding individual ID in the system hash cache if the power carrier instruction is the individual configuration instruction or the control instruction including the control individual ID;
[0115] a second system hash cache storing unit, configured to obtain the individual ID according to the group number and the scene number if the power carrier instruction is the group configuration instruction, the scene configuration instruction, or the control instruction including the group number / scene number, and then obtain the corresponding individual ID for each sequence number according to the individual ID and the sequence number in the power carrier instruction and store the obtained individual ID in the system hash cache;
[0116] a system hash cache deletion unit, configured to delete, from the system hash cache, the responding individual ID of each serial number corresponding to the serial number and individual ID in the response instruction according to the serial number and individual ID in the response instruction;
[0117] a retransmission unit configured to, if the system Hash cache is not empty, reorganize and send in batches the power carrier instructions corresponding to the serial numbers in the system Hash cache according to a preset retransmission number threshold or retransmission time threshold, and obtain a response instruction corresponding to the serial number.
[0118] In one implementation, the apparatus further includes:
[0119] The exception management unit is used to set the individual ID as abnormal and no longer send the individual configuration instruction and the individual control instruction to the individual ID if the response instruction corresponding to the sequence number is not obtained after the retransmission number threshold or the retransmission time threshold is reached.
[0120] Based on the above embodiment, the present invention also provides an intelligent terminal, whose principle block diagram can be shown as follows: Figure 3As shown. The smart terminal includes a processor, memory, and a network interface connected via a system bus. The processor of the smart terminal is used to provide computing and control capabilities. The memory of the smart terminal includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The network interface of the smart terminal is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, it implements an Internet of Things control method in a power carrier environment.
[0121] Those skilled in the art will understand that Figure 3 The principle block diagram shown in the figure is only a block diagram of a partial structure related to the solution of the present invention and does not constitute a limitation on the smart terminal to which the solution of the present invention is applied. The specific smart terminal may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0122] In one embodiment, a smart terminal is provided. The smart terminal includes a memory, a processor, and an Internet of Things control program in a power line carrier environment stored in the memory and executable on the processor. When the processor executes the Internet of Things control program in the power line carrier environment, the processor implements the following operating instructions:
[0123] Obtaining power carrier instructions broadcast on the Internet of Things; wherein the power carrier instructions include configuration instructions and control instructions, the configuration instructions include individual configuration instructions, group configuration instructions and scene configuration instructions, and the control instructions include individual control instructions, group control instructions and scene control instructions;
[0124] Perform configuration or control actions according to the power carrier instruction and send a response instruction;
[0125] According to the response instruction, the power carrier instruction is controlled to be retransmitted.
[0126] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, operating database or other media used in the embodiments provided by the present invention may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct RAMbus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.
[0127] In summary, the present invention discloses a method for controlling an Internet of Things in a power carrier environment, the method comprising: obtaining power carrier instructions broadcast on the Internet of Things; wherein the power carrier instructions include configuration instructions and control instructions, the configuration instructions include individual configuration instructions, group configuration instructions and scene configuration instructions, and the control instructions include individual control instructions, group control instructions and scene control instructions; configuring or executing control actions according to the power carrier instructions, and sending response instructions; controlling the power carrier instructions to be retransmitted according to the response instructions. The present invention groups batches of Internet of Things terminal devices and sets scenes, realizing unified configuration and control of multiple devices in one group or scene, and utilizing response and cache technology to make the power carrier group and scene data instructions more reliable through a retransmission mechanism for specific batches of individuals.
[0128] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A method for controlling the Internet of Things in a power line carrier environment, characterized in that: The method comprises: Obtaining power carrier instructions broadcast on the Internet of Things; wherein the power carrier instructions include configuration instructions and control instructions, the configuration instructions include individual configuration instructions, group configuration instructions and scene configuration instructions, and the control instructions include individual control instructions, group control instructions and scene control instructions; Perform configuration or control actions according to the power carrier instruction and send a response instruction; According to the response instruction, controlling the power carrier instruction to be retransmitted; The configuring or executing the control action according to the power carrier instruction and sending the response instruction includes: If the power carrier instruction is the group configuration instruction, the designated IoT device individual is obtained according to the individual ID in the group configuration instruction; wherein the group configuration instruction includes a group configuration instruction code, a serial number, a group number, a number of configured individuals, and the individual ID; Compiling the designated IoT device individual into the IoT device group corresponding to the group number; Controlling the designated IoT device to issue a response instruction according to the serial number and the individual ID; wherein the response instruction includes a response instruction code, the serial number, the individual ID, and status information; If there are multiple configured individuals and they are not equal to the total number of individual IDs in the group configuration instruction, the larger number between the number of configured individuals and the total number of actual individual IDs in the group configuration instruction determines the number of individuals that the IoT device needs to configure. The IoT device individual determines whether it needs to execute this configuration instruction based on the individual ID in the group configuration instruction. When its individual ID is the same as the individual ID in the group configuration instruction, it needs to execute this individual configuration instruction, update its own group, and send a response instruction to the sender of the group configuration instruction.
2. The Internet of Things control method under the power carrier environment according to claim 1 is characterized in that: The configuring or executing the control action according to the power carrier instruction, sending the response instruction, and obtaining the response instruction include: If the power carrier instruction is the individual configuration instruction, the designated IoT device individual is obtained according to the individual ID in the individual configuration instruction; wherein the individual configuration instruction includes an individual configuration instruction code, a serial number, an individual ID, a number of configuration parameters, a configuration parameter name, and a configuration parameter value; Setting the parameters of the individual IoT device according to the configuration parameter name and configuration parameter value in the individual configuration instruction; According to the serial number and individual ID, the designated IoT device is controlled to issue a response instruction; wherein the response instruction includes a response instruction code, the serial number, the individual ID and status information.
3. The Internet of Things control method under the power carrier environment according to claim 1, characterized in that: The configuring or executing the control action according to the power carrier instruction and sending the response instruction includes: If the power carrier instruction is the scenario configuration instruction, the specified IoT device group is obtained according to the group number in the scenario configuration instruction; wherein the scenario configuration instruction includes a scenario configuration instruction code, a serial number, a scenario number, a number of configuration groups, the group number and configuration parameters; Grouping the specified IoT devices into the IoT device scene corresponding to the scene number; According to the IoT device grouping, the IoT device individuals contained in the IoT device grouping are obtained, and the IoT device individuals are controlled to issue a response instruction; wherein the response instruction includes a response instruction code, the serial number, the individual ID and status information of the IoT device individual.
4. The Internet of Things control method under the power carrier environment according to claim 1, characterized in that: The configuring or executing the control action according to the power carrier instruction and sending the response instruction includes: If the power carrier instruction is the control instruction, then according to the control parameter name and control parameter value in the control instruction, the IoT device individual corresponding to the individual ID / group number / scene number is controlled to perform a control action and issue a response instruction; wherein the response instruction includes a response instruction code, a serial number, the individual ID and status information of the IoT device individual, and the control instruction includes a control instruction code, a serial number, the individual ID / group number / scene number, the number of control parameters, the control parameter name, and the control parameter value.
5. The Internet of Things control method under the power carrier environment according to claim 1, characterized in that: The controlling the power carrier instruction to be retransmitted according to the response instruction includes: If the power carrier instruction is the individual configuration instruction or the control instruction containing the control individual ID, then according to the serial number and individual ID in the power carrier instruction, the corresponding individual ID of each serial number is obtained and stored in the system hash cache; If the power carrier instruction is the group configuration instruction, the scene configuration instruction, or the control instruction containing the group number / scene number, the individual ID is obtained according to the group number and the scene number, and then the corresponding individual ID of each sequence number is obtained according to the individual ID and the sequence number in the power carrier instruction and stored in the system hash cache; According to the serial number and individual ID in the response instruction, the responding individual ID of each serial number corresponding to the serial number and individual ID in the response instruction is deleted from the system hash cache; If the system Hash cache is not empty, the power carrier instructions corresponding to the serial numbers in the system Hash cache are reorganized and sent in batches according to a preset retransmission number threshold or retransmission time threshold, and a response instruction corresponding to the serial number is obtained.
6. The Internet of Things control method under the power carrier environment according to claim 5, characterized in that: The method further comprises: If the response instruction corresponding to the sequence number is not obtained after the retransmission number threshold or the retransmission time threshold is reached, the individual ID is set as abnormal, and the individual configuration instruction and the individual control instruction are no longer sent to the individual ID.
7. An Internet of Things control device in a power line carrier environment, characterized in that: The device comprises: A power carrier instruction acquisition module, configured to acquire power carrier instructions broadcast on the Internet of Things; wherein the power carrier instructions include configuration instructions and control instructions, the configuration instructions include individual configuration instructions, group configuration instructions, and scene configuration instructions, and the control instructions include individual control instructions, group control instructions, and scene control instructions; An execution and response module, configured to perform configuration or execute control actions according to the power carrier instruction and send a response instruction; a retransmission module, configured to control the power carrier instruction to be retransmitted according to the response instruction; The execution and response module includes: a second IoT device individual acquisition unit, configured to obtain a designated IoT device individual according to an individual ID in the group configuration instruction if the power carrier instruction is the group configuration instruction; wherein the group configuration instruction includes a group configuration instruction code, a serial number, a group number, a number of configured individuals, and the individual ID; A second configuration unit is configured to assign the designated IoT device to the IoT device group corresponding to the group number; A second response unit, configured to control the designated IoT device to issue a response instruction based on the serial number and the individual ID; wherein the response instruction includes a response instruction code, the serial number, the individual ID, and status information; If there are multiple configured individuals and they are not equal to the total number of individual IDs in the group configuration instruction, the larger number between the number of configured individuals and the total number of actual individual IDs in the group configuration instruction determines the number of individuals that the IoT device needs to configure. The IoT device individual determines whether it needs to execute this configuration instruction based on the individual ID in the group configuration instruction. When its individual ID is the same as the individual ID in the group configuration instruction, it needs to execute this individual configuration instruction, update its own group, and send a response instruction to the sender of the group configuration instruction.
8. An intelligent terminal, characterized in that: The smart terminal includes a memory, a processor, and an Internet of Things control program in a power carrier environment stored in the memory and runnable on the processor. When the processor executes the Internet of Things control program in the power carrier environment, the steps of the Internet of Things control method in a power carrier environment as described in any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores an Internet of Things control program in a power carrier environment. When the Internet of Things control program in a power carrier environment is executed by a processor, the steps of the Internet of Things control method in a power carrier environment according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Method a nd device for controlling internet of things equipment, server, mobile equipment
CN107018165A