CN110087372B - Lamp control method - Google Patents

Lamp control method Download PDF

Info

Publication number
CN110087372B
CN110087372B CN201910376418.5A CN201910376418A CN110087372B CN 110087372 B CN110087372 B CN 110087372B CN 201910376418 A CN201910376418 A CN 201910376418A CN 110087372 B CN110087372 B CN 110087372B
Authority
CN
China
Prior art keywords
equipment
instruction
lamp
controller
echo
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910376418.5A
Other languages
Chinese (zh)
Other versions
CN110087372A (en
Inventor
陈其佑
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Yiri Lighting Technology Co ltd
Original Assignee
Guangdong Yiri Lighting Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Yiri Lighting Technology Co ltd filed Critical Guangdong Yiri Lighting Technology Co ltd
Priority to CN201910376418.5A priority Critical patent/CN110087372B/en
Publication of CN110087372A publication Critical patent/CN110087372A/en
Application granted granted Critical
Publication of CN110087372B publication Critical patent/CN110087372B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H05ELECTRIC TECHNIQUES NOT OTHERWISE PROVIDED FOR
    • H05BELECTRIC HEATING; ELECTRIC LIGHT SOURCES NOT OTHERWISE PROVIDED FOR; CIRCUIT ARRANGEMENTS FOR ELECTRIC LIGHT SOURCES, IN GENERAL
    • H05B47/00Circuit arrangements for operating light sources in general, i.e. where the type of light source is not relevant
    • H05B47/10Controlling the light source
    • H05B47/175Controlling the light source by remote control

Abstract

The invention discloses a lamp control method, which comprises the following steps: s1, connecting the controller and the lamp equipment; s2, the controller randomly generates a session ID and broadcasts an initialization instruction; the lamp equipment receives the initialization instruction and then clears the original session ID and the equipment ID; s3, the controller broadcasts a discovery instruction; all the lamp devices which do not join in the conversation record the conversation ID after receiving the discovery instruction, and initialize the device ID to 0; s4, the controller broadcasts an address allocation instruction and allocates equipment IDs for each piece of light equipment; and S5, after the equipment ID is distributed, the controller sends a control instruction to each lamp equipment by the MAC address, and the lamp equipment responds according to the control instruction. By utilizing the method, the target lamp equipment does not need to be bound with the fixed UID in advance, the equipment IDs are uniformly distributed by the controller in the discovery process, and the relatively fixed MAC addresses are generated for each lamp equipment by taking the conversation as a unit, so that the preliminary preparation work can be effectively simplified, and the equipment discovery efficiency is higher.

Description

Lamp control method
Technical Field
The invention relates to the technical field of control communication, in particular to a lamp control method.
Background
In recent years, with the continuous development of science and technology and the continuous abundance of spiritual life of people, lamps and lanterns are not used as lighting equipment any more, and are also used for decoration and stage lamp effects more and more. For the lamps for building the stage effect, whether the lamps are effective or not is controlled to directly influence whether the lamps can quickly and effectively respond or not and cooperate to build the expected stage lamp effect. The existing lamp control system and method generally have the problems of complex preliminary preparation links and low equipment discovery efficiency.
Disclosure of Invention
Aiming at the defects of the prior art, the invention aims to provide the lamp control method, the target lamp equipment is not required to be bound with the fixed UID in advance, the preliminary preparation time is effectively saved, and the lamp equipment discovery efficiency is higher.
In order to achieve the purpose, the invention adopts the following technical scheme:
a lamp control method comprises the following steps:
s1, connecting the controller with each lamp device needing to be controlled;
s2, the controller creates a new performance;
the controller randomly generates a session ID and broadcasts an initialization instruction; the lamp equipment receives the initialization instruction and then clears the original session ID and the equipment ID;
s3, the controller broadcasts a discovery instruction; all the lamp devices which do not join in the conversation record the conversation ID after receiving the discovery instruction, and initialize the device ID of the lamp devices to 0;
s4, the controller broadcasts an address allocation instruction and allocates equipment IDs for each piece of light equipment;
s5, after the equipment ID is distributed, the controller sends control instructions to each lamp equipment by the MAC address, and the lamp equipment responds according to the control instructions; the MAC address is composed of a session ID and a device ID.
Further, step S4 is implemented by using a depth-first-based recursive search method, which includes the following specific steps:
s4.1, during search initialization, recording the global assignable equipment ID as M, and setting the initialization M to be 1;
s4.2, each layer of recursion needs to transmit two distributable device IDs, which are marked as A and B and are initially: a is 1, B is M + 1;
s4.3, the controller broadcasts an address allocation instruction, wherein the address allocation instruction comprises a device IDA and a device IDB, namely Search (A, B);
s4.4, generating a random number after the lamp equipment receives the address allocation instruction, if the generated random number is an odd number, receiving the equipment IDA, and otherwise, receiving the equipment IDB;
s4.5, the controller respectively unicasts an Echo instruction to the equipment IDA and the equipment IDB, and the lamp equipment matched with the equipment ID responds to the Echo instruction; the Echo instruction format is as follows:
Unicast(“echo”,A);
Unicast(“echo”,B);
s4.6, for Unicast ("echo", A), if more than one luminaire is responding, i.e. the channel is presenting noise, increment M by 1 and do a lower level recursion on device IDA, i.e. let M +1 and the controller broadcasts again the address assignment command, which again includes device IDA and M, i.e. Search (A, M); otherwise, roll calling the corresponding lamp equipment, the corresponding lamp equipment is regarded as being added to the conversation after receiving the roll calling instruction, enters a mute state, ignores all other finding instructions and ends the search;
for Unicast ("echo", B), if more than one luminaire device is responding, i.e. the channel is noisy, increment M by 1 and do a lower level recursion on device IDB, i.e. let M +1 and the controller re-broadcast the address assignment instructions, which re-broadcast the address assignment instructions including device IDB and M, i.e. Search (B, M); otherwise, the corresponding lamp equipment is called, the corresponding lamp equipment is regarded as being added to the conversation after receiving the calling instruction, the conversation enters a mute state, all other finding instructions are ignored, and the search is finished.
Further, in step S1, the controller directly or indirectly connects each of the lighting devices to be controlled through the hub.
The invention has the beneficial effects that: by utilizing the method, the bidirectional serial communication between the controller and the lamp equipment can be established, the target lamp equipment does not need to be bound with a fixed UID in advance, the equipment IDs are uniformly distributed by the controller in the discovery process, and a relatively fixed MAC address is generated for each lamp equipment by taking a session as a unit, so that the preliminary preparation work can be effectively simplified, and the equipment discovery efficiency is higher.
Drawings
FIG. 1 is a schematic flow chart of a method in an embodiment of the present invention;
fig. 2 is a schematic diagram of recursive search in an embodiment of the present invention.
Detailed Description
The present invention will be further described with reference to the accompanying drawings, and it should be noted that the present embodiment is based on the technical solution, and the detailed implementation and the specific operation process are provided, but the protection scope of the present invention is not limited to the present embodiment.
The present embodiment provides a lamp control method, as shown in fig. 1, including the following steps:
s1, connecting the controller with each light fixture needing to be controlled (directly or indirectly connected through a hub, and the hub transmits control instructions between the controller and the light fixtures);
s2, the controller creates a new performance;
the controller randomly generates a session ID and broadcasts an initialization instruction, such as Broadcast ("reset"); the lamp equipment receives the initialization instruction and then clears the original session ID and the equipment ID;
s3, the controller broadcasts a discovery instruction, such as Broadcast ("discovery"); all the lamp devices which do not join in the conversation record the conversation ID after receiving the discovery instruction, and initialize the device ID of the lamp devices to 0;
s4, the controller broadcasts an address allocation instruction and allocates equipment IDs for each piece of light equipment;
s5, after the equipment ID is distributed, the controller sends control instructions to each lamp equipment by the MAC address, and the lamp equipment responds according to the control instructions; the MAC address is composed of a session ID and a device ID.
Further, step S4 is implemented by using a depth-first-based recursive search method, which includes the following specific steps:
s4.1, during search initialization, recording the global assignable equipment ID as M, and setting the initialization M to be 1;
s4.2, each layer of recursion needs to transmit two distributable device IDs, which are marked as A and B and are initially: a is 1, B is M + 1;
s4.3, the controller broadcasts an address allocation instruction, wherein the address allocation instruction comprises a device IDA and a device IDB, namely Search (A, B);
s4.4, generating a random number after the lamp equipment receives the address allocation instruction, if the generated random number is an odd number, receiving the equipment IDA, and otherwise, receiving the equipment IDB;
s4.5, the controller respectively unicasts an Echo instruction to the equipment IDA and the equipment IDB, and the lamp equipment matched with the equipment ID responds to the Echo instruction; the Echo instruction format is as follows:
Unicast(“echo”,A);
Unicast(“echo”,B);
s4.6, for Unicast ("echo", A), if more than one luminaire is responding, i.e. the channel is presenting noise, increment M by 1 and do a lower level recursion on device IDA, i.e. let M +1 and the controller broadcasts again the address assignment command, which again includes device IDA and M, i.e. Search (A, M); otherwise, roll calling the corresponding lamp equipment, the corresponding lamp equipment is regarded as being added to the conversation after receiving the roll calling instruction, enters a mute state, ignores all other finding instructions and ends the search;
for Unicast ("echo", B), if more than one luminaire device is responding, i.e. the channel is noisy, increment M by 1 and do a lower level recursion on device IDB, i.e. let M +1 and the controller re-broadcast the address assignment instructions, which re-broadcast the address assignment instructions including device IDB and M, i.e. Search (B, M); otherwise, the corresponding lamp equipment is called, the corresponding lamp equipment is regarded as being added to the conversation after receiving the calling instruction, the conversation enters a mute state, all other finding instructions are ignored, and the search is finished.
In this embodiment, a schematic diagram of the recursive search is shown in fig. 2.
Various corresponding changes and modifications can be made by those skilled in the art based on the above technical solutions and concepts, and all such changes and modifications should be included in the protection scope of the present invention.

Claims (2)

1. A lamp control method is characterized by comprising the following steps:
s1, connecting the controller with each lamp device needing to be controlled;
s2, the controller creates a new performance;
the controller randomly generates a session ID and broadcasts an initialization instruction; the lamp equipment receives the initialization instruction and then clears the original session ID and the equipment ID;
s3, the controller broadcasts a discovery instruction; all the lamp devices which do not join in the conversation record the conversation ID after receiving the discovery instruction, and initialize the device ID of the lamp devices to 0;
s4, the controller broadcasts an address allocation instruction and allocates equipment IDs for each piece of light equipment;
s5, after the equipment ID is distributed, the controller sends control instructions to each lamp equipment by the MAC address, and the lamp equipment responds according to the control instructions; the MAC address consists of a session ID and a device ID;
step S4 is implemented by a recursive search method based on depth-first, and the specific process is as follows:
s4.1, during search initialization, recording the global assignable equipment ID as M, and setting the initialization M to be 1;
s4.2, each layer of recursion needs to transmit two distributable device IDs, which are marked as A and B and are initially: a is 1, B is M + 1;
s4.3, the controller broadcasts an address allocation instruction, wherein the address allocation instruction comprises a device ID A and a device ID B, namely Search (A, B);
s4.4, generating a random number after the lamp equipment receives the address allocation instruction, if the generated random number is an odd number, receiving the equipment ID A, and otherwise, receiving the equipment ID B;
s4.5, the controller respectively unicasts an Echo instruction to the equipment ID A and the equipment ID B, and the lamp equipment matched with the equipment ID responds to the Echo instruction; the Echo instruction format is as follows:
Unicast(“echo”,A);
Unicast(“echo”,B);
s4.6, for Unicast ("echo", A), if more than one luminaire is responding, i.e. the channel is noisy, increment M by 1 and do a lower level recursion on device ID A, i.e. let M +1 and the controller re-broadcast the address assignment instructions, the re-broadcast address assignment instructions including device ID A and M, i.e. Search (A, M); otherwise, roll calling the corresponding lamp equipment, the corresponding lamp equipment is regarded as being added to the conversation after receiving the roll calling instruction, enters a mute state, ignores all other finding instructions and ends the search;
for Unicast ("echo", B), if more than one luminaire device responds, i.e. the channel exhibits noise, increment M by 1 and do a lower level recursion on device ID B, i.e. let M +1 and the controller re-broadcast the address assignment instructions, which re-broadcast the address assignment instructions including device ID B and M, i.e. Search (B, M); otherwise, the corresponding lamp equipment is called, the corresponding lamp equipment is regarded as being added to the conversation after receiving the calling instruction, the conversation enters a mute state, all other finding instructions are ignored, and the search is finished.
2. The luminaire control method of claim 1, wherein in step S1, the controller is connected to each luminaire device to be controlled directly or indirectly through a hub.
CN201910376418.5A 2019-05-07 2019-05-07 Lamp control method Active CN110087372B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910376418.5A CN110087372B (en) 2019-05-07 2019-05-07 Lamp control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910376418.5A CN110087372B (en) 2019-05-07 2019-05-07 Lamp control method

Publications (2)

Publication Number Publication Date
CN110087372A CN110087372A (en) 2019-08-02
CN110087372B true CN110087372B (en) 2021-06-22

Family

ID=67419053

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910376418.5A Active CN110087372B (en) 2019-05-07 2019-05-07 Lamp control method

Country Status (1)

Country Link
CN (1) CN110087372B (en)

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102137049B1 (en) * 2013-07-25 2020-07-24 주식회사 에이텍에이피 The light device, light device system, and the registration method for the light device
CN104754795A (en) * 2013-12-26 2015-07-01 欧普照明股份有限公司 DMX512 control system and address allocation method
US11190926B2 (en) * 2016-11-09 2021-11-30 Ledvance Llc Radio based smart device identification tool for commissioning
CN107257599A (en) * 2017-06-06 2017-10-17 广东丰光科技有限公司 A kind of stage lamp automatic coding

Also Published As

Publication number Publication date
CN110087372A (en) 2019-08-02

Similar Documents

Publication Publication Date Title
CN104155929B (en) Stage performance scheduling device
CN102752675B (en) Method for realizing ONU (Optical Network Unit) service automatic opening on OLT (Optical Line Terminal) equipment
CN102625554A (en) Distributed DALI (Digital Addressable Lighting Interface) lighting control system and method thereof
JP6242396B2 (en) Immediate commissioning of lighting control systems
CN114271014A (en) Network formation for load control systems
CN101064631A (en) Method and system for scanning topological structure
WO2022174752A1 (en) Distributed scenario cluster interconnection central control system and control method
BRPI0418863A (en) Method for controlling wireless coverage in a wireless network with a multiple access scheme for carrier, wireless network, point of connection, and mobile station detection, wireless networking, computer program, and set for optimizing transmission coverage on a wireless network
CN110087372B (en) Lamp control method
US9641987B2 (en) Multicast packet reception reliability over Wi-Fi
CN110753138A (en) Equipment ID configuration method and system in CAN bus network
CN111211918A (en) Networking method for LoRa private protocol
US11602034B2 (en) Forming groups of devices by analyzing device control information
EP3857926A1 (en) Mobile device and method
CN111641454B (en) Indoor visible light communication system light source optimization method based on bat algorithm
CN113286313B (en) Hardware equipment layout method and device
CN107370792A (en) A kind of DALI extension systems and control method
CN111586917B (en) LED lamp string system and control method thereof
CN101030937A (en) Multilevel random accessing method based on packet
CN107172573B (en) zigbee terminal communication data processing method
CN108307335A (en) A kind of data transmission method, apparatus and system
EP2897360B1 (en) Method for getting a device online, address delivery method, peripheral unit and server
CN1852592A (en) Method for avoiding interference of residence multi-cast business
CN106815043A (en) A kind of group upgrade method of intelligent LED lamp
CN109286998B (en) LoRa module communication method compatible with network connection and direct connection

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 528400 No.55 Cuilan Road, Cuiheng New District, Zhongshan City, Guangdong Province (application for residence)

Applicant after: Guangdong Yi day lighting technology Co. Ltd.

Address before: 528400 Guangdong city of Zhongshan province Tsuiheng Coastal Industrial Park Road, building A building fifth Chui city waterfront area F

Applicant before: Guangdong Yi day lighting technology Co. Ltd.

GR01 Patent grant
GR01 Patent grant