Lamp control method, device, communication equipment and storage medium
By receiving the monitoring parameter table and switching to the monitoring mode of the lamp control method, the target gateway identifier and the lamp identifier are used to decrypt the control signal, which solves the problem of the limited number of gateway communication ports and achieves more efficient lamp control and lower control costs.
Patent Information
- Application Number
- CN202211726472.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-30
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2042-12-30
AI Technical Summary
Traditional lighting control devices have a limited number of gateway communication ports, which results in a limited number of controllable lamps, increasing the cost of lighting control.
By receiving the monitoring parameter table sent by the target gateway, the lamp is switched from direct connection mode to monitoring mode, and the target gateway identifier and lamp identifier are used to determine the target control signal. The control signal is decrypted using the key information to perform the corresponding action, thereby realizing the control of the lamp by the lamp control device.
Without directly connecting to the target gateway, the number of lamps controlled by the lamp control device is increased, the cost of lamp control is reduced, and the accuracy of the control signal is improved.
Smart Images

Figure CN116055522B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of lamp communication technology, and in particular to a lamp control method, apparatus, communication device and storage medium. Background Art
[0002] With the development of Ethernet technology and gateway devices, in performances involving a large number of lighting fixtures, Ethernet and gateways are often used to enable lighting control devices to control lighting fixtures.
[0003] In a traditional lamp control method, a lamp control device sends a control signal including control information to a gateway, and the gateway sends the control signal to the lamp through the gateway communication port corresponding to each lamp, so that the lamp control device controls each lamp.
[0004] However, due to factors such as the gateway's hardware resources and memory, the number of gateway communication ports is limited, resulting in a limited number of lamps that can be controlled by the lamp control device. Summary of the Invention
[0005] Based on this, it is necessary to provide a lamp control method, apparatus, communication device and storage medium that can increase the number of lamps controlled by a lamp control device in order to address the above technical problems.
[0006] In a first aspect, the present application provides a method for controlling a lamp. The method comprises:
[0007] Receive a monitoring parameter table sent by a target gateway, and switch the first lamp from a direct connection mode with the target gateway to a monitoring mode; the monitoring parameter table includes a target gateway identifier of the target gateway, a target lamp identifier and key information of the target lamp;
[0008] When the first lamp is in the monitoring mode, determining, according to the target gateway identifier and the target lamp identifier, a target control signal sent by the target gateway to the target lamp; the target control signal is a signal sent by a lamp control device to the target gateway, and the target lamp is directly connected to the target gateway;
[0009] The target control signal is decrypted using the key information to obtain control information, and an action corresponding to the control information is executed.
[0010] In one embodiment, when the first lamp is in the monitoring mode, determining the control signal sent by the target gateway to the target lamp according to the target gateway identifier and the target lamp identifier includes:
[0011] When the first lamp is in the monitoring mode, obtaining a control signal sent by at least one gateway to a second lamp; the control signal includes a gateway identifier of the gateway and a lamp identifier of the second lamp;
[0012] If the gateway identifier is consistent with the target gateway identifier, and the lamp identifier is consistent with the target lamp identifier, determining that the signal sent by the gateway corresponding to the gateway identifier consistent with the target gateway identifier to the third lamp is the target control signal;
[0013] The third lamp is a second lamp corresponding to a lamp identifier that is consistent with the target lamp identifier.
[0014] In one embodiment, decrypting the target control signal using the key information to obtain control information, and performing an action corresponding to the control information, includes:
[0015] Decrypting the target control signal using the key information to obtain a target data packet;
[0016] The target data packet is parsed to obtain the control information, and an action corresponding to the control information is executed.
[0017] In a second aspect, the present application also provides a lamp control method. The method includes:
[0018] Establish a connection with the lamp through the gateway communication port of the target gateway;
[0019] If the monitoring parameter table does not exist in the target gateway, the lamp is taken as the target lamp, and the monitoring parameter table is generated according to the target gateway identifier of the target gateway and the lamp identifier of the lamp;
[0020] The monitoring parameter table is sent to the first lamp; the first lamp includes a lamp that establishes a direct connection with the target gateway, then disconnects the direct connection and switches to the monitoring mode, and the monitoring parameter table is used for the first lamp to determine the target control signal sent by the target gateway to the target lamp, and the target control signal is a signal sent by the lamp control device to the target gateway.
[0021] In one embodiment, the method further comprises:
[0022] If the monitoring parameter table exists in the target gateway, the connection with the lamp is disconnected, and the monitoring parameter table is sent to the lamp, so that the lamp switches from the direct connection mode to the monitoring mode.
[0023] In one embodiment, the method further includes: counting each lamp that has established a direct connection with the target gateway;
[0024] The lamp information of each lamp is stored; the lamp information includes an identification of each lamp and a state corresponding to each lamp, and the state includes a direct connection mode and a monitoring mode.
[0025] In a third aspect, the present application further provides a lighting control device. The device comprises:
[0026] a receiving module, configured to receive a monitoring parameter table sent by a target gateway, and switch the first lamp from a direct connection mode with the target gateway to a monitoring mode; the monitoring parameter table includes a target gateway identifier of the target gateway, a target lamp identifier of the target lamp, and key information;
[0027] a determination module, configured to determine, when the first lamp is in the monitoring mode, a target control signal sent by the target gateway to the target lamp based on the target gateway identifier and the target lamp identifier; the target control signal is a signal sent by a lamp control device to the target gateway, and the target lamp is directly connected to the target gateway;
[0028] The decryption module is used to decrypt the target control signal using the key information to obtain control information, and execute an action corresponding to the control information.
[0029] In a fourth aspect, the present application further provides a lighting control device. The device includes:
[0030] A connection module, used to establish a connection with the lamp through the gateway communication port of the target gateway;
[0031] a generating module configured to, if the monitoring parameter table does not exist in the target gateway, use the lamp as a target lamp and generate the monitoring parameter table according to the target gateway identifier of the target gateway and the lamp identifier of the lamp;
[0032] A first sending module is used to send the monitoring parameter table to the first lamp; the first lamp includes a lamp that establishes a direct connection with the target gateway, then disconnects the direct connection and switches to monitoring mode. The monitoring parameter table is used for the first lamp to determine the target control signal sent by the target gateway to the target lamp, and the target control signal is a signal sent by the lamp control device to the target gateway.
[0033] In a fifth aspect, the present application further provides a communication device, wherein the communication device includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the method described in the first and second aspects above when executing the computer program.
[0034] In a sixth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in the first aspect and the method described in the second aspect.
[0035] In a seventh aspect, the present application further provides a computer program product, comprising a computer program, which, when executed by a processor, implements the method described in the first aspect and the method described in the second aspect.
[0036] In the above-mentioned lamp control method, device, communication equipment and storage medium, the first lamp switches the direct connection mode between the first lamp and the target gateway to the monitoring mode by receiving the monitoring parameter table sent by the target gateway, and when the first lamp is in the monitoring mode, it can determine the target control signal sent by the target gateway to the target lamp according to the target gateway identifier and the target lamp identifier, thereby using the key information to decrypt the target control signal to obtain control information, and then execute the action corresponding to the control information. Compared with the traditional technology, the first lamp can obtain the target control signal sent by the target gateway to the target lamp through the monitoring mode in a mode not directly connected to the target gateway. The target control signal sent by the lamp ensures that the first lamp can obtain the target control signal of the lamp control device. Further, the lamp control device can realize the control operation of the lamp according to the obtained target control signal, which solves the problem that the number of gateway communication ports is limited, resulting in a limited number of lamps that can be controlled by the lamp control device, thereby increasing the number of lamps controlled by the lamp control device and reducing the cost of lamp control; in addition, the first lamp can determine the target control signal through the target gateway identifier and the target lamp identifier, avoiding monitoring of the wrong control signal, thereby improving the accuracy of the target control signal obtained by the first lamp. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 A diagram showing an application environment of a lamp control method according to an embodiment;
[0038] Figure 2 1 is a flow chart of a lamp control method according to an embodiment;
[0039] Figure 3 is a flow chart of a lamp control method according to another embodiment;
[0040] Figure 4 is a flow chart of a lamp control method according to another embodiment;
[0041] Figure 5 is a flow chart of a lamp control method according to another embodiment;
[0042] Figure 6is a flow chart of a lamp control method according to another embodiment;
[0043] Figure 7 is a flow chart of a lamp control method according to another embodiment;
[0044] Figure 8 is a structural block diagram of a lighting control device in one embodiment;
[0045] Figure 9 is a structural block diagram of a lighting control device in one embodiment;
[0046] Figure 10 is a structural block diagram of a lighting control device in one embodiment;
[0047] Figure 11 is a structural block diagram of a lighting control device in one embodiment;
[0048] Figure 12 FIG. 4 is a diagram showing the internal structure of a communication device in one embodiment. DETAILED DESCRIPTION
[0049] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0050] The lamp control method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown, the lamp 102 communicates with the gateway 104 via a communication network. The lamp 102 may be a smart lamp with communication capabilities and support monitoring mode, and the gateway 104 may be implemented as an independent gateway or a gateway cluster composed of multiple gateways.
[0051] In one embodiment, Figure 2 As shown, a lamp control method is provided, which is applied to Figure 1 The lamp in the figure is used as an example to illustrate the process, including the following steps:
[0052] S201, receiving a monitoring parameter table sent by a target gateway, and switching a first lamp from a direct connection mode with the target gateway to a monitoring mode; the monitoring parameter table includes a target gateway identifier of the target gateway, a target lamp identifier of the target lamp, and key information.
[0053] Among them, the direct connection mode refers to the connection mode in which the lamp establishes direct communication with the gateway through the gateway communication port, and the monitoring mode refers to the connection mode in which the lamp does not establish direct communication with the gateway through the gateway communication port, but obtains the communication information between the gateway and the target lamp through monitoring.
[0054] Optionally, in this embodiment, the gateway that establishes connections with the target lamp and the first lamp can be referred to as the target gateway, the lamp connected to the target gateway in direct connection mode can be referred to as the target lamp, and the lamp connected to the target gateway in monitoring mode can be referred to as the first lamp. It should be noted that in actual use, due to the influence of the hardware resources and memory of the gateway, the number of lamps commonly connected to the gateway is generally between 30 and 200. To ensure the connectivity of the gateway, in this embodiment, the number of target lamps can be set to 1, and all other lamps communicating with the gateway can be referred to as first lamps, without limiting the number of first lamps.
[0055] After the target gateway determines the target lamp, the target gateway can generate a monitoring parameter table based on the target gateway identifier, the target lamp identifier, and the key information for decrypting the communication data between the target gateway and the target lamp. The generated monitoring parameter table can be shown in the following table, which includes the MAC address value and gateway channel value in the target gateway identifier, the MAC address value in the target lamp identifier, and the key information, wherein the target gateway identifier may include the Media Access Control Address (MAC address) value of the target gateway and the target gateway channel used for the first lamp to monitor in the monitoring mode, and the target lamp identifier may include the MAC address value of the target lamp and the device identity document (ID) information of the target lamp.
[0056]
[0057] In this embodiment, after the first lamp receives the monitoring parameter table sent by the target gateway, the first lamp switches the connection mode with the target gateway from the direct connection mode to the monitoring mode, and monitors the communication information when the target gateway and the target lamp communicate.
[0058] S202, when the first lamp is in monitoring mode, determine the target control signal sent by the target gateway to the target lamp according to the target gateway identifier and the target lamp identifier; the target control signal is a signal sent by the lamp control device to the target gateway, and the target lamp and the target gateway are directly connected.
[0059] The term "lamp control device" refers to a device that can send preset control information to the gateway and lamps. Optionally, the control signal sent by the lamp control device can use an Ethernet protocol based on the TCP / IP protocol stack. The gateway forwards the control signal carrying the lighting control information to the lamps connected to the gateway. Optionally, the signal sent by the lamp control device to the target gateway is called a target control signal. The target gateway forwards the received target control signal to the target lamp.
[0060] In this embodiment, when the first lamp is in monitoring mode, when the target gateway communicates with the target lamp, the first lamp can monitor the communication information between the target gateway and the target lamp, and filter and screen the monitored communication information according to the target gateway identifier and the target lamp identifier in the received monitoring parameter table, so as to obtain the target control signal sent by the target gateway to the target lamp.
[0061] Exemplarily, the first lamp may use the target gateway channel of the target gateway identifier as a filtering condition to filter out signals sent by other gateway channels in the monitored signals.
[0062] S203: Decrypt the target control signal using the key information to obtain control information, and execute an action corresponding to the control information.
[0063] The key information refers to the key corresponding to the encryption information of the target control signal, and the control information is the light control instruction information of the lamp control device to the lamp.
[0064] In this embodiment, the first lamp can decrypt the encrypted data in the acquired target control signal through the key information to obtain the decrypted original data packet, and obtain the corresponding lighting control action according to the lighting control instruction information in the original data packet, and execute the lighting control action to realize the lighting control of the first lamp by the lamp control device.
[0065] In the above-mentioned lamp control method, the first lamp switches the first lamp from a direct connection mode with the target gateway to a monitoring mode by receiving a monitoring parameter table sent by the target gateway. When the first lamp is in the monitoring mode, the first lamp can determine the target control signal sent by the target gateway to the target lamp based on the target gateway identifier and the target lamp identifier, thereby decrypting the target control signal using the key information to obtain the control information, and then executing the action corresponding to the control information. Compared with the traditional technology, the first lamp can obtain the target control signal sent by the target gateway to the target lamp through the monitoring mode without being directly connected to the target gateway, thereby ensuring that the first lamp can obtain the target control signal of the lamp control device. Furthermore, the lamp control device can implement the control operation of the lamp based on the obtained target control signal, solving the problem that the number of communication ports of the target gateway is limited, resulting in a limited number of lamps that can be controlled by the lamp control device, thereby increasing the number of lamps controlled by the lamp control device and reducing the cost of lamp control. In addition, the first lamp can determine the target control signal based on the target gateway identifier and the target lamp identifier, avoiding monitoring of erroneous control signals, thereby improving the accuracy of the target control signal obtained by the first lamp.
[0066] In the above scenario of determining the target control signal, the first lamp can determine the target control signal according to whether the target gateway identifier is consistent with the monitored gateway identifier, and whether the target lamp identifier is consistent with the monitored lamp identifier. In one embodiment, Figure 3 As shown, the above S202 includes:
[0067] S301: When a first lamp is in a monitoring mode, obtain a control signal sent by at least one gateway to a second lamp; the control signal includes a gateway identifier of the gateway and a lamp identifier of the second lamp.
[0068] It is understood that in a control scenario involving a large number of lamps, there may be multiple gateways and multiple lamps, and the connection mode between the gateway and the lamps can be a direct connection mode or a monitoring mode. Optionally, in this embodiment, the lamp connected to the gateway in the direct connection mode can be referred to as the second lamp, and the signal sent by the gateway to the second lamp is referred to as the control signal, wherein the gateway identifier includes the MAC address value of the gateway, and the lamp identifier includes the MAC address value of the second lamp.
[0069] In this embodiment, when the first lamp is in monitoring mode, the first lamp can obtain a control signal sent by a gateway to a second lamp through monitoring, or obtain control signals sent by multiple gateways to multiple second lamps, which is not limited in this embodiment.
[0070] S302, if the gateway identifier is consistent with the target gateway identifier, and the lamp identifier is consistent with the target lamp identifier, then determine that the signal sent by the gateway corresponding to the gateway identifier consistent with the target gateway identifier to the third lamp is the target control signal, wherein the third lamp is the second lamp corresponding to the lamp identifier consistent with the target lamp identifier.
[0071] Optionally, in this embodiment, the gateway identifier in the acquired control signal can be compared with the target gateway identifier in the monitoring parameter table acquired by the first lamp, and whether the gateway identifier and the target gateway identifier are consistent can be determined based on the comparison result to determine whether the gateway is the target gateway; the lamp identifier in the acquired control signal can also be compared with the target lamp identifier in the monitoring parameter table acquired by the first lamp, and whether the lamp identifier and the target lamp identifier are consistent can be determined based on the comparison result to determine whether the second lamp is the target lamp. Exemplarily, the MAC address value of the gateway identifier can be compared with the MAC address value of the target gateway identifier. Optionally, the MAC address value can be converted into binary, and the two converted binary numbers can be subjected to an AND logic operation, and whether the two MAC address values are consistent can be determined based on the logic operation result.
[0072] Optionally, in this embodiment, if the gateway identifier is consistent with the target gateway identifier, the gateway can be determined to be the target gateway. Further, the lamp identifier of the second lamp in direct connection mode with the gateway is compared to see whether it is consistent with the target lamp identifier. If they are consistent, the second lamp corresponding to the lamp identifier consistent with the target lamp identifier can be determined as the third lamp. Further, it can be determined that the signal sent by the gateway corresponding to the gateway identifier consistent with the target gateway identifier to the third lamp is the target control signal.
[0073] In this embodiment, when the first lamp is in the monitoring mode, a control signal including the gateway identifier of the gateway and the lamp identifier of the second lamp sent by at least one gateway to the second lamp can be obtained. If the gateway identifier is consistent with the target gateway identifier, and the lamp identifier is consistent with the target lamp identifier, it can be determined that the second lamp corresponding to the lamp identifier consistent with the target lamp identifier is the third lamp, so that it can be determined that the signal sent by the gateway corresponding to the gateway identifier consistent with the target gateway identifier to the third lamp is the target control signal, thereby improving the accuracy of the target control signal obtained by the first lamp.
[0074] In the above scenario of obtaining control information, the first lamp can parse the determined target control signal to obtain the control information. Figure 4 As shown, the above S203 includes:
[0075] S401: Decrypt the target control signal using the key information to obtain a target data packet.
[0076] Among them, the target data packet contains a data packet containing preset control instruction information issued by the lighting control device. It should be noted that, based on the DMX512 protocol standard for communication between lighting control devices and lighting fixtures, each data packet supports the transmission of a maximum of 512 frames of data at a time. Since the OpOutput data packet in the light control signal carrying control information forwarded by the lighting control device to the lighting fixture through the gateway is unidirectional and can only be sent from the gateway to the lighting fixture, the lighting fixture only needs to obtain the OpOutput data packet in the light control signal to meet the control requirements of the lighting control device on the lighting fixture.
[0077] Optionally, in this embodiment, the first lamp may extract a data packet from the acquired target control signal, and then decrypt the extracted data packet according to the key information in the received monitoring parameter table to obtain the original target data packet.
[0078] S402: parse the target data packet to obtain control information, and execute an action corresponding to the control information.
[0079] The control information refers to lighting control instruction information. Optionally, the control information may include the on and off of the lamp, the light color, the light brightness, etc.
[0080] In this embodiment, the first lamp can parse the obtained original data packet to obtain lighting control instruction information. Optionally, different lighting control instructions represent different control information. Further, the first lamp can perform a lighting change action corresponding to the control information based on the obtained control information.
[0081] In this embodiment, the first lamp can use the key information to decrypt the target control signal to obtain the target data packet, thereby parsing the target data packet to obtain control information, and executing the action corresponding to the control information, thereby realizing the control of the lamp by the lamp control device. Since the first lamp obtains the control information by decrypting the obtained target control signal according to the key information in the monitoring parameter table sent by the target gateway, the accuracy of the obtained control information is guaranteed.
[0082] In one embodiment, Figure 5 As shown, a lamp control method is provided, which is applied to Figure 1 The following steps are used as an example to illustrate the gateway in the example:
[0083] S501: Establish a connection with the lamp through the gateway communication port of the target gateway.
[0084] In this embodiment, the target gateway can receive connection requests sent by each lamp, thereby allocating an idle gateway communication port to the lamp requesting connection and establishing a connection with the lamp. Optionally, each lamp requesting connection can be allocated an idle gateway communication port.
[0085] S502: If the monitoring parameter table does not exist in the target gateway, the lamp is taken as the target lamp, and a monitoring parameter table is generated according to the target gateway identifier of the target gateway and the lamp identifier of the lamp.
[0086] In this embodiment, after the target gateway is connected to the lamp, it needs to first query whether there is a monitoring parameter table in the target gateway. If the monitoring parameter table does not exist, it means that there are no other lamps directly connected to the target gateway before the target gateway is connected to the lamp. In this case, the target gateway can use the lamp as the target lamp, maintain the connection with the lamp, and generate a monitoring parameter table based on the target gateway identifier and the lamp identifier of the lamp. Optionally, after the target gateway determines the target lamp, it can send the target control signal to the target lamp after receiving the target control signal sent by the lamp control device. It is understandable that during the lamp control process, the target gateway can send different target control signals to the target lamp multiple times.
[0087] S503, sending a monitoring parameter table to the first lamp; the first lamp includes a lamp that establishes a direct connection with the target gateway, disconnects the direct connection, and switches to monitoring mode. The monitoring parameter table is used for the first lamp to determine the target control signal sent by the target gateway to the target lamp. The target control signal is a signal sent by the lamp control device to the target gateway.
[0088] In an optional embodiment, if the target gateway has a monitoring parameter table, the connection with the lamp is disconnected and the monitoring parameter table is sent to the lamp, so that the lamp switches from direct connection mode to monitoring mode. In this optional embodiment, if the monitoring parameter table exists in the target gateway, it means that before the target gateway connects to the lamp, there are other lamps directly connected to the target gateway. Therefore, the target gateway can disconnect from the lamp and send the monitoring parameter table to the lamp. After the lamp receives the monitoring parameter table, it can switch from direct connection mode to monitoring mode.
[0089] In this embodiment, when the target gateway determines that the lamp connected to the target gateway is not the target lamp, it can send a monitoring parameter table to the first lamp connected to the target gateway, so that the first lamp can determine the target control signal sent by the target gateway to the target lamp based on the received monitoring parameter table. Optionally, when the target gateway sends the target control signal to the target lamp, the first lamp in monitoring mode can obtain the target control signal through monitoring.
[0090] In this embodiment, a connection is established with the lamp through the gateway communication port of the target gateway. If the monitoring parameter table does not exist in the target gateway, the lamp is used as the target lamp, and a monitoring parameter table is generated based on the target gateway identifier of the target gateway and the lamp identifier of the lamp. The monitoring parameter table is sent to the first lamp. Compared with traditional technologies, the number of lamps directly connected to the target gateway can be reduced, thereby increasing the number of lamps that can be controlled by the lamp control device. In addition, by sending the monitoring parameter table to the first lamp, the first lamp can determine the target control signal sent by the target gateway to the target lamp according to the monitoring parameter table, thereby ensuring that the first lamp can obtain the target control signal of the lamp control device. Moreover, the monitoring parameter table contains the target gateway identifier of the target gateway and the lamp identifier of the lamp directly connected to the target gateway, so that the first lamp can filter the correct target control signal according to the target gateway identifier and the lamp identifier, thereby improving the accuracy of the target control signal obtained by the first lamp.
[0091] After the above-mentioned lamps are connected to the target gateway, the information of each lamp can be counted and stored. Figure 6 As shown, the above method also includes:
[0092] S601: Count the lamps that have established direct connections with the target gateway.
[0093] Optionally, the lamp that has established a direct connection with the target gateway may be a target lamp that is connected to the target gateway in a direct connection mode, or may be a first lamp that is connected to the target gateway in a monitoring mode.
[0094] In this embodiment, after each lamp is successfully connected to the target gateway, the target gateway may automatically register the device information of the lamp to count the lamps that have established direct connections with the target gateway.
[0095] S602, storing lamp information of each lamp; the lamp information includes an identification of each lamp and a corresponding state of each lamp, and the state includes a direct connection mode and a monitoring mode.
[0096] Among them, the identification of each lamp may include the MAC address value of each lamp, and may also include the device ID information of each lamp, and may also include the status of each lamp and the target gateway. For example, if the connection mode between the lamp and the target gateway is direct connection mode, then the corresponding status of the lamp is direct connection mode, which can be recorded as 1. If the connection mode between the lamp and the target gateway is monitoring mode, then the corresponding status of the lamp is monitoring mode, which can be recorded as 0.
[0097] In this embodiment, by counting the lamps that have established direct connections with the target gateway and storing the lamp information of each lamp, the current working status of the target gateway can be intuitively described, and the lamp information and the number of lamps controlled by the lamp control device through the target gateway can be quickly obtained.
[0098] In conjunction with a specific embodiment below, Figure 7 As shown in the figure, the lamp control method is introduced, including the following steps:
[0099] S1, the lamp sends a connection request to the gateway.
[0100] S2: The gateway receives the connection request, allocates an idle gateway communication port to the lamp requesting connection, and establishes a connection with the lamp.
[0101] S3: The gateway checks whether a generated monitoring parameter table exists.
[0102] S4: If there is no generated monitoring parameter table, the lamp is used as the target lamp, and a monitoring parameter table is generated according to the gateway identifier and the lamp identifier. The connection mode between the lamp and the gateway is a direct connection mode.
[0103] S5: The gateway sends a target control signal to the lamp.
[0104] S6: If there is a generated monitoring parameter table, the monitoring parameter table is sent to the lamp.
[0105] S7, after the lamp receives the monitoring parameter table, the lamp disconnects from the gateway and switches the connection mode with the gateway from the direct connection mode to the monitoring mode.
[0106] S8, when the gateway sends a target control signal to the target lamp, the lamp obtains the target control signal by monitoring.
[0107] It should be understood that, although the steps in the flowcharts of the above embodiments are shown in sequence as indicated by the arrows, these steps are not necessarily performed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be performed in other orders. Moreover, at least a portion of the steps in the flowcharts of the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily to be performed in sequence, but can be performed in turn or alternately with other steps or at least a portion of steps or stages in other steps.
[0108] Based on the same inventive concept, embodiments of the present application further provide a lighting control device for implementing the aforementioned lighting control method. The solution provided by this device is similar to the solution described in the aforementioned method. Therefore, the specific limitations of one or more lighting control device embodiments provided below can be found in the above-described limitations of the lighting control method and will not be further elaborated here.
[0109] In one embodiment, Figure 8 As shown, a lighting control device is provided, including: a receiving module 10, a determining module 11 and a decryption module 12, wherein:
[0110] The receiving module 10 is configured to receive a monitoring parameter table sent by a target gateway and switch the first lamp from a direct connection mode with the target gateway to a monitoring mode; the monitoring parameter table includes a target gateway identifier of the target gateway, a target lamp identifier of the target lamp, and key information;
[0111] The determination module 11 is used to determine the target control signal sent by the target gateway to the target lamp according to the target gateway identifier and the target lamp identifier when the first lamp is in the monitoring mode; the target control signal is a signal sent by the lamp control device to the target gateway, and the target lamp and the target gateway are directly connected.
[0112] The decryption module 12 is configured to decrypt the target control signal using the key information to obtain control information, and execute an action corresponding to the control information.
[0113] The lighting control device provided in this embodiment can execute the embodiment of the method of the first aspect described above. Its implementation principle and technical effects are similar and will not be described in detail here.
[0114] In one embodiment, Figure 9 As shown, the above-mentioned determination module 11 includes: an acquisition unit 111 and a determination unit 112, wherein:
[0115] The acquiring unit 111 is configured to acquire, when the first lamp is in a monitoring mode, a control signal sent by at least one gateway to the second lamp; the control signal includes a gateway identifier of the gateway and a lamp identifier of the second lamp.
[0116] The determination unit 112 is used to determine that if the gateway identifier is consistent with the target gateway identifier and the lamp identifier is consistent with the target lamp identifier, the signal sent by the gateway corresponding to the gateway identifier consistent with the target gateway identifier to the third lamp is the target control signal; wherein the third lamp is the second lamp corresponding to the lamp identifier consistent with the target lamp identifier.
[0117] The lighting control device provided in this embodiment can execute the embodiment of the method of the first aspect described above. Its implementation principle and technical effects are similar and will not be described in detail here.
[0118] In one embodiment, please refer to Figure 9 The decryption module 12 includes a decryption unit 121 and an execution unit 122, wherein:
[0119] The decryption unit 121 is used to decrypt the target control signal using the key information to obtain a target data packet;
[0120] The execution unit 122 is configured to parse the target data packet to obtain control information and execute an action corresponding to the control information.
[0121] The lighting control device provided in this embodiment can execute the embodiment of the method of the first aspect described above. Its implementation principle and technical effects are similar and will not be described in detail here.
[0122] In one embodiment, Figure 10 As shown, a lighting control device is provided, including: a connection module 20, a generation module 21 and a sending module 22, wherein:
[0123] The connection module 20 is used to establish a connection with the lamp through the gateway communication port of the target gateway;
[0124] A generating module 21 is configured to, if the monitoring parameter table does not exist in the target gateway, use the lamp as the target lamp and generate a monitoring parameter table according to the target gateway identifier of the target gateway and the lamp identifier of the lamp;
[0125] The first sending module 22 is used to send a monitoring parameter table to the first lamp; the first lamp includes a lamp that establishes a direct connection with the target gateway, then disconnects the direct connection and switches to the monitoring mode. The monitoring parameter table is used for the first lamp to determine the target control signal sent by the target gateway to the target lamp. The target control signal is a signal sent by the lamp control device to the target gateway.
[0126] The lighting control device provided in this embodiment can execute the embodiment of the method of the second aspect described above. Its implementation principle and technical effects are similar and will not be described in detail here.
[0127] In one embodiment, please refer to Figure 11 , the above method further includes:
[0128] The second sending module 23 is configured to disconnect the lamp if the target gateway has a monitoring parameter table, and send the monitoring parameter table to the lamp, so that the lamp switches from the direct connection mode to the monitoring mode.
[0129] The lighting control device provided in this embodiment can execute the embodiment of the method of the second aspect described above. Its implementation principle and technical effects are similar and will not be described in detail here.
[0130] In one embodiment, please refer to Figure 11 The above method further includes: a statistics module 24 and a storage module 25, wherein:
[0131] The statistics module 24 is used to count the lamps that have established direct connections with the target gateway.
[0132] The storage module 25 is used to store the lamp information of each lamp; the lamp information includes the identification of each lamp and the corresponding status of each lamp, and the status includes a direct connection mode and a monitoring mode.
[0133] The lighting control device provided in this embodiment can execute the embodiment of the method of the second aspect described above. Its implementation principle and technical effects are similar and will not be described in detail here.
[0134] Each module in the aforementioned lighting control device may be implemented in whole or in part through software, hardware, or a combination thereof. Each module may be embedded in or independent of a processor in a computer device in the form of hardware, or may be stored in a computer device memory in the form of software, so that the processor can call and execute the corresponding operations of each module.
[0135] In one embodiment, a communication device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0136] Receive a monitoring parameter table sent by the target gateway, and switch the first lamp from a direct connection mode with the target gateway to a monitoring mode; the monitoring parameter table includes a target gateway identifier of the target gateway, a target lamp identifier of the target lamp, and key information;
[0137] When the first lamp is in monitoring mode, determining the target control signal sent by the target gateway to the target lamp according to the target gateway identifier and the target lamp identifier; the target control signal is a signal sent by the lamp control device to the target gateway, and the target lamp and the target gateway are directly connected;
[0138] The target control signal is decrypted using the key information to obtain control information, and an action corresponding to the control information is executed.
[0139] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0140] When the first lamp is in a monitoring mode, obtaining a control signal sent by at least one gateway to the second lamp; the control signal includes a gateway identifier of the gateway and a lamp identifier of the second lamp;
[0141] If the gateway identifier is consistent with the target gateway identifier, and the lamp identifier is consistent with the target lamp identifier, determining that the signal sent by the gateway corresponding to the gateway identifier consistent with the target gateway identifier to the third lamp is the target control signal;
[0142] The third lamp is the second lamp corresponding to the lamp identifier that is consistent with the target lamp identifier.
[0143] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0144] Decrypting the target control signal using the key information to obtain the target data packet;
[0145] Parse the target data packet to obtain control information and execute actions corresponding to the control information.
[0146] In one embodiment, the processor implements the following steps when executing the computer program:
[0147] Establish a connection with the lamp through the gateway communication port of the target gateway;
[0148] If the monitoring parameter table does not exist in the target gateway, the lamp is taken as the target lamp, and a monitoring parameter table is generated according to the target gateway identifier of the target gateway and the lamp identifier of the lamp;
[0149] A monitoring parameter table is sent to the first lamp; the first lamp includes a lamp that establishes a direct connection with the target gateway, disconnects the direct connection, and switches to monitoring mode. The monitoring parameter table is used for the first lamp to determine the target control signal sent by the target gateway to the target lamp. The target control signal is a signal sent by the lamp control device to the target gateway.
[0150] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0151] If the target gateway has a monitoring parameter table, the connection with the lamp is disconnected, and the monitoring parameter table is sent to the lamp, so that the lamp switches from direct connection mode to monitoring mode.
[0152] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0153] Count all lamps that have established direct connections with the target gateway;
[0154] Stores the fixture information of each fixture; the fixture information includes the identification of each fixture and the corresponding status of each fixture, and the status includes direct connection mode and monitoring mode.
[0155] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0156] Receive a monitoring parameter table sent by the target gateway, and switch the first lamp from a direct connection mode with the target gateway to a monitoring mode; the monitoring parameter table includes a target gateway identifier of the target gateway, a target lamp identifier of the target lamp, and key information;
[0157] When the first lamp is in monitoring mode, determining the target control signal sent by the target gateway to the target lamp according to the target gateway identifier and the target lamp identifier; the target control signal is a signal sent by the lamp control device to the target gateway, and the target lamp and the target gateway are directly connected;
[0158] The target control signal is decrypted using the key information to obtain control information, and an action corresponding to the control information is executed.
[0159] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0160] When the first lamp is in a monitoring mode, obtaining a control signal sent by at least one gateway to the second lamp; the control signal includes a gateway identifier of the gateway and a lamp identifier of the second lamp;
[0161] If the gateway identifier is consistent with the target gateway identifier, and the lamp identifier is consistent with the target lamp identifier, determining that the signal sent by the gateway corresponding to the gateway identifier consistent with the target gateway identifier to the third lamp is the target control signal;
[0162] The third lamp is the second lamp corresponding to the lamp identifier that is consistent with the target lamp identifier.
[0163] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0164] Decrypting the target control signal using the key information to obtain the target data packet;
[0165] Parse the target data packet to obtain control information and execute actions corresponding to the control information.
[0166] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: establishing a connection with the lamp through the gateway communication port of the target gateway;
[0167] If the monitoring parameter table does not exist in the target gateway, the lamp is taken as the target lamp, and a monitoring parameter table is generated according to the target gateway identifier of the target gateway and the lamp identifier of the lamp;
[0168] A monitoring parameter table is sent to the first lamp; the first lamp includes a lamp that establishes a direct connection with the target gateway, disconnects the direct connection, and switches to monitoring mode. The monitoring parameter table is used for the first lamp to determine the target control signal sent by the target gateway to the target lamp. The target control signal is a signal sent by the lamp control device to the target gateway.
[0169] In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: if a monitoring parameter table exists in the target gateway, the connection with the lamp is disconnected, and the monitoring parameter table is sent to the lamp, so that the lamp switches from the direct connection mode to the monitoring mode.
[0170] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0171] Count all lamps that have established direct connections with the target gateway;
[0172] Stores the fixture information of each fixture; the fixture information includes the identification of each fixture and the corresponding status of each fixture, and the status includes direct connection mode and monitoring mode.
[0173] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0174] Receive a monitoring parameter table sent by the target gateway, and switch the first lamp from a direct connection mode with the target gateway to a monitoring mode; the monitoring parameter table includes a target gateway identifier of the target gateway, a target lamp identifier of the target lamp, and key information;
[0175] When the first lamp is in monitoring mode, determining the target control signal sent by the target gateway to the target lamp according to the target gateway identifier and the target lamp identifier; the target control signal is a signal sent by the lamp control device to the target gateway, and the target lamp and the target gateway are directly connected;
[0176] The target control signal is decrypted using the key information to obtain control information, and an action corresponding to the control information is executed.
[0177] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0178] When the first lamp is in a monitoring mode, obtaining a control signal sent by at least one gateway to the second lamp; the control signal includes a gateway identifier of the gateway and a lamp identifier of the second lamp;
[0179] If the gateway identifier is consistent with the target gateway identifier, and the lamp identifier is consistent with the target lamp identifier, determining that the signal sent by the gateway corresponding to the gateway identifier consistent with the target gateway identifier to the third lamp is the target control signal;
[0180] The third lamp is the second lamp corresponding to the lamp identifier that is consistent with the target lamp identifier.
[0181] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0182] Decrypting the target control signal using the key information to obtain the target data packet;
[0183] Parse the target data packet to obtain control information and execute actions corresponding to the control information.
[0184] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0185] Establish a connection with the lamp through the gateway communication port of the target gateway;
[0186] If the monitoring parameter table does not exist in the target gateway, the lamp is taken as the target lamp, and a monitoring parameter table is generated according to the target gateway identifier of the target gateway and the lamp identifier of the lamp;
[0187] A monitoring parameter table is sent to the first lamp; the first lamp includes a lamp that establishes a direct connection with the target gateway, disconnects the direct connection, and switches to monitoring mode. The monitoring parameter table is used for the first lamp to determine the target control signal sent by the target gateway to the target lamp. The target control signal is a signal sent by the lamp control device to the target gateway.
[0188] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0189] If the target gateway has a monitoring parameter table, the connection with the lamp is disconnected, and the monitoring parameter table is sent to the lamp, so that the lamp switches from direct connection mode to monitoring mode.
[0190] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:
[0191] Count all lamps that have established direct connections with the target gateway;
[0192] Stores the fixture information of each fixture; the fixture information includes the identification of each fixture and the corresponding status of each fixture, and the status includes direct connection mode and monitoring mode.
[0193] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0194] Those skilled in the art will appreciate 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, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processor involved in the various embodiments provided herein may be, but are not limited to, a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, and the like.
[0195] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0196] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.
Claims
1. A lamp control method, characterized in that: The method comprises: Receive a monitoring parameter table sent by a target gateway, and switch a first lamp from a direct connection mode with the target gateway to a monitoring mode; the monitoring parameter table includes a target gateway identifier of the target gateway, a target lamp identifier and key information of the target lamp; the target lamp is the only lamp that maintains a direct connection with the target gateway, the first lamp is connected to the gateway through the monitoring mode, and the number of the first lamp is at least one; the direct connection mode is a connection mode in which the first lamp establishes direct communication with the gateway through the gateway communication port, and the monitoring mode is a connection mode in which the first lamp does not directly establish communication with the gateway through the gateway communication port, but obtains communication information between the gateway and the target lamp by monitoring; When the first lamp is in the monitoring mode, a control signal sent by at least one gateway to the second lamp is obtained; the control signal includes a gateway identifier of the gateway and a lamp identifier of the second lamp; if the gateway identifier is consistent with the target gateway identifier, and the lamp identifier is consistent with the target lamp identifier, then it is determined that the signal sent by the gateway corresponding to the gateway identifier consistent with the target gateway identifier to the third lamp is the target control signal; the third lamp is the second lamp corresponding to the lamp identifier consistent with the target lamp identifier; the target control signal is a signal sent by a lamp control device to the target gateway, and the target lamp and the target gateway are directly connected; The target control signal is decrypted using the key information to obtain control information, and an action corresponding to the control information is executed.
2. The method according to claim 1, characterized in that The decrypting the target control signal using the key information to obtain control information, and executing an action corresponding to the control information, includes: Decrypting the target control signal using the key information to obtain a target data packet; The target data packet is parsed to obtain the control information, and an action corresponding to the control information is executed.
3. The method according to claim 1, characterized in that The method further comprises: The target gateway channel identified by the target gateway is used as a filtering condition to filter out signals sent by other gateway channels in at least one control signal.
4. A lamp control method, characterized in that: The method comprises: Establish a connection with the lamp through the gateway communication port of the target gateway; If the monitoring parameter table does not exist in the target gateway, the lamp is taken as the target lamp, and the monitoring parameter table is generated according to the target gateway identifier of the target gateway and the lamp identifier of the lamp; The monitoring parameter table is sent to a first lamp; the first lamp includes a lamp that establishes a direct connection with the target gateway and then disconnects the direct connection and switches to the monitoring mode, the monitoring parameter table is used for the first lamp to determine the target control signal sent by the target gateway to the target lamp, and the target control signal is a signal sent by a lamp control device to the target gateway; the target lamp is the only lamp that maintains a direct connection with the target gateway, the first lamp is connected to the gateway through the monitoring mode, and the number of the first lamp is at least one; the monitoring mode is a connection mode in which the first lamp does not directly establish communication with the gateway through the gateway communication port, and obtains the communication information between the gateway and the target lamp through monitoring.
5. The method according to claim 4, characterized in that The method further comprises: If the monitoring parameter table exists in the target gateway, the connection with the lamp is disconnected, and the monitoring parameter table is sent to the lamp, so that the lamp switches from the direct connection mode to the monitoring mode.
6. The method according to claim 4 or 5, characterized in that The method further comprises: Count all lamps that have established direct connections with the target gateway; The lamp information of each lamp is stored; the lamp information includes an identification of each lamp and a state corresponding to each lamp, and the state includes a direct connection mode and a monitoring mode.
7. A lighting control device, characterized in that: The device comprises: A receiving module, configured to receive a monitoring parameter table sent by a target gateway, and switch a first lamp from a direct connection mode with the target gateway to a monitoring mode; the monitoring parameter table includes a target gateway identifier of the target gateway, a target lamp identifier and key information of a target lamp; the target lamp is the only lamp that maintains a direct connection with the target gateway, the first lamp is connected to the gateway via the monitoring mode, and the number of the first lamp is at least one; the direct connection mode is a connection mode in which the first lamp establishes direct communication with the gateway via a gateway communication port, and the monitoring mode is a connection mode in which the first lamp does not directly establish communication with the gateway via the gateway communication port, but obtains communication information between the gateway and the target lamp by monitoring; A determination module, configured to, when the first lamp is in the monitoring mode, obtain a control signal sent by at least one gateway to a second lamp; the control signal includes a gateway identifier of the gateway and a lamp identifier of the second lamp; if the gateway identifier is consistent with the target gateway identifier, and the lamp identifier is consistent with the target lamp identifier, determine that a signal sent by a gateway corresponding to a gateway identifier consistent with the target gateway identifier to a third lamp is a target control signal; the third lamp is a second lamp corresponding to a lamp identifier consistent with the target lamp identifier; the target control signal is a signal sent by a lamp control device to the target gateway, and the target lamp and the target gateway are directly connected; The decryption module is used to decrypt the target control signal using the key information to obtain control information, and execute an action corresponding to the control information.
8. A lighting control device, characterized in that: The device comprises: A connection module, used to establish a connection with the lamp through the gateway communication port of the target gateway; a generating module configured to, if the monitoring parameter table does not exist in the target gateway, use the lamp as a target lamp and generate the monitoring parameter table according to the target gateway identifier of the target gateway and the lamp identifier of the lamp; A first sending module is used to send the monitoring parameter table to a first lamp; the first lamp includes a lamp that establishes a direct connection with the target gateway and then disconnects the direct connection and switches to the monitoring mode, the monitoring parameter table is used for the first lamp to determine the target control signal sent by the target gateway to the target lamp, and the target control signal is a signal sent by the lamp control device to the target gateway; the target lamp is the only lamp that maintains a direct connection with the target gateway, the first lamp is connected to the gateway through the monitoring mode, and the number of the first lamp is at least one; the monitoring mode is a connection mode in which the first lamp does not directly establish communication with the gateway through the gateway communication port, and obtains the communication information between the gateway and the target lamp through monitoring.
9. A communication device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
DALI expansion system and control method
CN107370792A