A DALI address configuration method

CN122601645APending Publication Date: 2026-08-18CHENGDU ANLIPUS TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610910816.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-23
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

[0004]本申请目的在于提供一种DALI地址配置方法,以解决现有DALI技术进行地址分配时,存在的效率低和/或稳定性差的问题

Benefits of technology

本申请提供一种DALI地址配置方法,通过DALI主机获取总线上从设备状态信息,确定从设备数量;数量为1时直接配置DALI短地址,数量大于1时采用三层级搜索机制确定唯一随机地址并配置DALI短地址。三层级搜索将24位随机地址按字节分为高、中、低三层级,各层级采用动态调整搜索策略逐步逼近目标地址,通过拼接得到唯一随机地址。该方法提升了配置效率,减少了交互数据量与资源占用,提高了配置准确性,适用于大型照明系统。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122601645A_ABST
    Figure CN122601645A_ABST
Patent Text Reader

Abstract

The application discloses a DALI address configuration method, and belongs to the technical field of digital lighting. The method comprises the following steps: acquiring the state information of slave devices on a bus through a DALI host, and determining the number of the slave devices; when the number is 1, directly configuring a DALI short address; when the number is greater than 1, adopting a three-level search mechanism to determine a unique random address and configure the DALI short address. The three-level search divides a 24-bit random address into high, middle and low three levels according to bytes, each level adopts a dynamic adjustment search strategy to gradually approach a target address, and the unique random address is obtained through splicing. The method improves the configuration efficiency, reduces the interactive data amount and resource occupation, improves the configuration accuracy, and is suitable for large lighting systems.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of digital lighting technology, specifically relating to a DALI address configuration method. Background Technology

[0002] Digital lighting technology is an important basic communication and control technology in smart cities. By configuring and managing the addresses of various distributed lighting drivers, flexible and intelligent control can be achieved.

[0003] Among related technologies, DALI technology is relatively widely used; however, the address configuration of traditional DALI devices has many pain points, making it difficult to meet the requirements of efficient engineering configuration processes. For example, address allocation adopts a linear allocation method, resulting in a large amount of interactive data and long processing time during the configuration process. Incomplete allocation requires separate reallocation of missing drivers, and duplicate allocation requires driver replacement. In public spaces with large-scale lighting, these problems can lead to a huge workload and a lot of debugging time. To address these pain points, how to achieve address configuration more efficiently, accurately, and stably has become an urgent problem to be solved. Summary of the Invention

[0004] The purpose of this application is to provide a DALI address configuration method to solve the problems of low efficiency and / or poor stability in the address allocation of existing DALI technologies.

[0005] This application provides a DALI address configuration method, including: Determine a pre-defined address configuration mode; the address configuration mode is to configure DALI short addresses for all slave devices or to configure DALI short addresses only for unconfigured slave devices. When the address configuration mode is to configure a DALI short address for an unconfigured slave device, the DALI short address is queried to determine the configured slave device, and a three-level search mechanism is used to search for unconfigured slave devices to determine the unique random address corresponding to the unconfigured slave device, and a DALI short address is configured for the unconfigured slave device corresponding to the unique random address. When the address configuration mode is to configure DALI short addresses for all slave devices, a three-level search mechanism is used to search all slave devices, determine the unique random address corresponding to the slave device, and configure the DALI short address for the slave device corresponding to the unique random address, thus completing the DALI address configuration.

[0006] Furthermore, the slave devices communicate using the DALI protocol. In the DALI protocol, each slave device is assigned a unique 24-bit random address during initialization. This random address is randomly generated within the range of 0x000000 and is unique to each device.

[0007] Furthermore, a three-level search mechanism is employed to search all slave devices to determine the unique random address corresponding to each slave device, including: The 24-bit random address space is divided into three levels according to bytes; the three levels include the first level where the high 8 bits are located, the second level where the middle 8 bits are located, and the third level where the low 8 bits are located. For the first level, a dynamic adjustment search strategy is adopted to gradually approach the target random address in the first level to obtain the high-order random address value in the unique random address corresponding to the device. For the second level, a dynamic adjustment search strategy is adopted to gradually approach the target random address in the second level to obtain the median random address value in the unique random address corresponding to the device. For the third level, a dynamic adjustment search strategy is adopted to gradually approach the target random address in the third level, so as to obtain the low-order random address value in the unique random address corresponding to the device. The low-order random address value, the middle-order random address value, and the high-order random address value are sequentially concatenated to form a unique random address.

[0008] Furthermore, for the first level, a dynamic adjustment search strategy is adopted to gradually approach the target random address in the first level, obtaining the high-order random address value in the unique random address corresponding to the device, including: The search start address for the initial high-order address value is set to 0xFF, and the search step size is set to the preset initial value of 125; 0xFF represents the maximum address value of the first level. Send a comparison command to the DALI bus, which contains the high-order address value currently being searched; Real-time acquisition of the response status of slave devices to determine whether there is a response from a slave device; If there is a response from the device, the search address is moved in the decreasing direction, and the search step size is dynamically adjusted according to the device response. If there is no response from the device, the search address will be moved in the incrementing direction, and the search step size will be dynamically adjusted according to the device response. Repeat the search until the search step size is reduced to 1 to obtain the high-order random address value corresponding to the first level; Shift the high-order random address value of the completed search to the left by 16 bits to obtain the high-order random address value in the unique random address corresponding to the device.

[0009] Furthermore, for the second level, a dynamic adjustment search strategy is adopted to gradually approach the target random address in the second level, obtaining the median random address value from the unique random address corresponding to the device, including: The initial search start address for the median address value is set to 0xFF, and the search step size is set to the preset initial value of 125; 0xFF represents the maximum address value of the second level. Send a comparison command to the DALI bus, which contains the median address value currently being searched; Real-time acquisition of the response status of slave devices to determine whether there is a response from a slave device; If there is a response from the device, the search address is moved in the decreasing direction, and the search step size is dynamically adjusted according to the device response. If there is no response from the device, the search address will be moved in the incrementing direction, and the search step size will be dynamically adjusted according to the device response. Repeat the search until the search step size is reduced to 1 to obtain the median random address value corresponding to the second level; The median random address value after the search is completed is shifted left by 8 bits to become the median part of the complete 24-bit random address, thus obtaining the median random address value in the unique random address corresponding to the device.

[0010] Furthermore, for the third level, a dynamic adjustment search strategy is adopted to gradually approach the target random address in the third level, obtaining the low-order random address value in the unique random address corresponding to the device, including: The search start address for the initial low-order address value is set to 0xFF, and the search step size is set to the preset initial value of 125. Send a comparison command to the DALI bus, which contains the low-order address value currently being searched; Real-time acquisition of the response status of slave devices to determine whether there is a response from a slave device; If there is a response from the device, the search address is moved in the decreasing direction, and the search step size is dynamically adjusted according to the device response. If there is no response from the device, the search address will be moved in the incrementing direction, and the search step size will be dynamically adjusted according to the device response. Repeat the search until the search step size is reduced to 1 to obtain the low-order random address value corresponding to the third level; The low-order random address value obtained after the search is used as the low-order part of the complete 24-bit random address to obtain the low-order random address value in the unique random address corresponding to the device.

[0011] Furthermore, the method also includes: Record the unique random address of the last slave device that has been configured with a DALI short address; Each time a search for a new slave device's unique random address begins, the search start address for the new slave device's unique random address is set to the first value after the unique random address of the previous slave device with a configured DALI short address.

[0012] Furthermore, the search step size is dynamically adjusted based on the device response, and also includes: During the search process, the host senses the response status of the slave devices on the DALI bus in real time; the response status includes no response, normal response, or abnormal response. If the response status is an abnormal response status, the search step size is adjusted.

[0013] Furthermore, the method also includes: When the edge interrupt count value exceeds the preset interrupt count threshold, it is determined to be a multi-slave device conflict, that is, the currently searched random address value is greater than the random address values ​​of multiple slave devices, and the response status is determined to be an abnormal response status.

[0014] Furthermore, the search step size is adjusted as follows: ; ; in, This indicates the adjusted search step size. This indicates an adjustment to the previous search step size. Represents the acceleration factor. This represents the difference exceeding the break count threshold. Denotes the convergent function. Represents the natural constant. represents the convergence coefficient, and k represents the current search count.

[0015] The beneficial effects of this application are as follows: This application provides a DALI address configuration method. The method obtains slave device status information from the DALI host to determine the number of slave devices. When the number is one, a short DALI address is directly configured. When the number is greater than one, a three-level search mechanism is used to determine a unique random address and configure the short DALI address. The three-level search divides the 24-bit random address into high, medium, and low levels byte-by-byte. Each level uses a dynamically adjusted search strategy to gradually approach the target address, and a unique random address is obtained by concatenation. This method improves configuration efficiency, reduces the amount of interactive data and resource consumption, and improves configuration accuracy, making it suitable for large-scale lighting systems. Attached Figure Description

[0016] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0017] Figure 1 A flowchart illustrating a DALI address configuration method provided in this application; Figure 2Example diagram of a DALI address configuration method provided in this application; Figure 3 A schematic diagram of the structure of a DALI address configuration device provided in this application; Among them, 301-Status acquisition unit, 302-Three-level search unit, 303-Conflict detection unit, 304-Step size adjustment unit, and 305-Address allocation verification unit; The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0018] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0019] The embodiments of this application are described in detail below with reference to the accompanying drawings.

[0020] Example 1 like Figure 1 As shown, this application provides a DALI address configuration method, including: S101. Determine a pre-set address configuration mode; the address configuration mode is to configure DALI short addresses for all slave devices or to configure DALI short addresses only for unconfigured slave devices. S102. When the address configuration mode is to configure a DALI short address for an unconfigured slave device, query the DALI short address to determine the configured slave device, and use a three-level search mechanism to search for unconfigured slave devices to determine the unique random address corresponding to the unconfigured slave device, and configure a DALI short address for the unconfigured slave device corresponding to the unique random address. For example, configured slave devices can be identified by polling DALI short addresses 0-63. Slave devices that already have DALI short addresses will not enter addressing mode. Then, a three-level search mechanism is used to search for and configure unconfigured slave devices until the host sends a 0xFFFFFF (address configuration query message). If no slave device responds, the configuration is complete. By identifying configured slave devices, the amount of configuration can be reduced.

[0021] S103. When the address configuration mode is to configure DALI short addresses for all slave devices, a three-level search mechanism is used to search for all slave devices, determine the unique random address corresponding to the slave device, and configure the DALI short address for the slave device corresponding to the unique random address to complete the DALI address configuration.

[0022] In some possible embodiments, the slave devices communicate using the DALI protocol, in which each slave device is assigned a unique 24-bit random address during initialization. This random address is randomly generated in the range of 0x000000 and is unique to each device.

[0023] In some possible embodiments, a three-level search mechanism is used to search all slave devices to determine the unique random address corresponding to the slave device, including: The 24-bit random address space is divided into three levels according to bytes; the three levels include the first level where the high 8 bits are located, the second level where the middle 8 bits are located, and the third level where the low 8 bits are located. For the first level, a dynamic adjustment search strategy is adopted to gradually approach the target random address in the first level to obtain the high-order random address value in the unique random address corresponding to the device. For the second level, a dynamic adjustment search strategy is adopted to gradually approach the target random address in the second level to obtain the median random address value in the unique random address corresponding to the device. For the third level, a dynamic adjustment search strategy is adopted to gradually approach the target random address in the third level, so as to obtain the low-order random address value in the unique random address corresponding to the device. The low-order random address value, the middle-order random address value, and the high-order random address value are sequentially concatenated to form a unique random address.

[0024] In some possible embodiments, for the first level, a dynamic adjustment search strategy is used to gradually approach the target random address in the first level to obtain the high-order random address value in the unique random address corresponding to the device, including: The search start address for the initial high-order address value is set to 0xFF, and the search step size is set to the preset initial value of 125; 0xFF represents the maximum address value of the first level. Send a comparison command to the DALI bus, which contains the high-order address value currently being searched; Real-time acquisition of the response status of slave devices to determine whether there is a response from a slave device; If there is a response from the device, the search address is moved in the decreasing direction, and the search step size is dynamically adjusted according to the device response. If there is no response from the device, the search address will be moved in the incrementing direction, and the search step size will be dynamically adjusted according to the device response. Repeat the search until the search step size is reduced to 1 to obtain the high-order random address value corresponding to the first level; Shift the high-order random address value of the completed search to the left by 16 bits to obtain the high-order random address value in the unique random address corresponding to the device.

[0025] In some possible embodiments, for the second level, a dynamically adjusted search strategy is used to gradually approach the target random address in the second level to obtain the median random address value among the unique random addresses corresponding to the device, including: The initial search start address for the median address value is set to 0xFF, and the search step size is set to the preset initial value of 125; 0xFF represents the maximum address value of the second level. Send a comparison command to the DALI bus, which contains the median address value currently being searched; Real-time acquisition of the response status of slave devices to determine whether there is a response from a slave device; If there is a response from the device, the search address is moved in the decreasing direction, and the search step size is dynamically adjusted according to the device response. If there is no response from the device, the search address will be moved in the incrementing direction, and the search step size will be dynamically adjusted according to the device response. Repeat the search until the search step size is reduced to 1 to obtain the median random address value corresponding to the second level; The median random address value after the search is completed is shifted left by 8 bits to become the median part of the complete 24-bit random address, thus obtaining the median random address value in the unique random address corresponding to the device.

[0026] In some possible embodiments, for the third level, a dynamic adjustment search strategy is used to gradually approach the target random address in the third level to obtain the low-order random address value in the unique random address corresponding to the device, including: The search start address for the initial low-order address value is set to 0xFF, and the search step size is set to the preset initial value of 125. Send a comparison command to the DALI bus, which contains the low-order address value currently being searched; Real-time acquisition of the response status of slave devices to determine whether there is a response from a slave device; If there is a response from the device, the search address is moved in the decreasing direction, and the search step size is dynamically adjusted according to the device response. If there is no response from the device, the search address will be moved in the incrementing direction, and the search step size will be dynamically adjusted according to the device response. Repeat the search until the search step size is reduced to 1 to obtain the low-order random address value corresponding to the third level; The low-order random address value obtained after the search is used as the low-order part of the complete 24-bit random address to obtain the low-order random address value in the unique random address corresponding to the device.

[0027] In some possible embodiments, the method further includes: Record the unique random address of the last slave device that has been configured with a DALI short address; Each time a search for a new slave device's unique random address begins, the search start address for the new slave device's unique random address is set to the first value after the unique random address of the previous slave device with a configured DALI short address.

[0028] In some possible embodiments, the search step size is dynamically adjusted based on the device response, and further includes: During the search process, the host senses the response status of the slave devices on the DALI bus in real time; the response status includes no response, normal response, or abnormal response. If the response status is an abnormal response status, the search step size is adjusted.

[0029] In some possible embodiments, the method further includes: When the edge interrupt count value exceeds the preset interrupt count threshold, it is determined to be a multi-slave device conflict, that is, the currently searched random address value is greater than the random address values ​​of multiple slave devices, and the response status is determined to be an abnormal response status.

[0030] In some possible embodiments, the search step size is adjusted as follows: ; ; in, This indicates the adjusted search step size. This indicates an adjustment to the previous search step size. Represents the acceleration factor. This represents the difference exceeding the break count threshold. Denotes the convergent function. Represents the natural constant. represents the convergence coefficient, and k represents the current search count.

[0031] The DALI address configuration method provided in this invention has the following significant advantages compared with the prior art: 1. Configuration efficiency is significantly improved; Existing technologies typically employ linear search methods, resulting in long configuration times and low efficiency. This invention utilizes a three-level search mechanism, dividing the 24-bit random address space into three levels for searching. This requires a maximum of approximately 24 interactions to complete the address configuration of a slave device, significantly improving search efficiency. Furthermore, by leveraging historical node information from the previous slave device, the search range is reduced, further narrowing the search space and substantially shortening the configuration time. This makes it particularly suitable for scenarios with a large number of slave devices, such as large lighting systems.

[0032] 2. Resource consumption has been significantly reduced; Traditional linear search methods require frequent data exchanges between the host and slave devices, generating a large amount of communication traffic and consuming significant bus bandwidth and host resources. The three-level search mechanism of this invention significantly reduces the amount of interactive data during configuration, lowers bus bandwidth usage, and also reduces the processing burden on the host, enabling it to handle more other tasks simultaneously and improving overall system performance.

[0033] 3. Higher configuration accuracy; Existing technologies are prone to issues such as incomplete address allocation and duplicate allocation during address configuration, requiring extensive debugging and correction work. This invention, by real-time sensing of the slave device's response status, can accurately determine situations such as no response, normal response, and abnormal response during the search process. Based on a convergence function, it dynamically adjusts the search step size, achieving smooth convergence of the search interval. This allows for precise location of the unique slave device address, effectively avoiding problems such as incomplete address allocation and duplicate allocation, and improving the accuracy and reliability of configuration.

[0034] 4. More adaptable; The address configuration method and apparatus of this invention can adapt to DALI systems of different sizes and complexities, whether small home lighting systems or large commercial lighting systems, and can efficiently and accurately complete the address configuration task. Meanwhile, the dynamic step size adjustment strategy of this invention can adjust the search step size in real time according to the response status of slave devices, adapting to different network environments and device characteristics, and has strong robustness and adaptability.

[0035] 5. The system is more maintainable; The address configuration method and apparatus of this invention adopt a modular design, with each functional unit operating independently, facilitating system maintenance and upgrades. Furthermore, the configuration process of this invention is simple and efficient, reducing the need for manual intervention and lowering system maintenance costs.

[0036] In summary, the DALI address configuration method provided by this invention, through a three-level search mechanism, response status awareness, and dynamic step size adjustment based on a convergence function, achieves efficient and rapid configuration of DALI slave device addresses, effectively solving the technical problems of long configuration time, large amount of interactive data, and incomplete allocation in traditional methods.

[0037] Example 2 This embodiment is a further example based on Embodiment 1, as detailed below.

[0038] like Figure 2 As shown, this application provides a DALI address configuration method, including: Obtain the status information data of all slave devices on the DALI bus from the DALI master device; Based on the status information data of all slave devices on the DALI bus, determine the number of slave devices on the DALI bus; wherein there is at least one slave device. The three-level search mechanism is activated based on the number of slave devices on the DALI bus. For each level of the search process, the following is executed: Based on the historical node information data of the previous slave device, and combined with the current slave device response status, the address configuration and verification of the slave device are completed; The specific details of the three-tier search mechanism are as follows: In the DALI protocol, each slave device is assigned a 24-bit random address during initialization. This random address is randomly generated within the range of 0x000000 to 0xFFFFFF and is unique to each device. Address configuration essentially involves searching this 24-bit random address space between the master and slave devices to find each slave device's unique random address and assigning it a short DALI address between 0 and 63.

[0039] The three-level search mechanism proposed in this invention divides the 24-bit random address space into three levels according to bytes: high 8 bits (H), middle 8 bits (M), and low 8 bits (L). The search process is carried out sequentially from high to low, and the search strategy is dynamically adjusted to gradually approach the target random address in each level.

[0040] The first level involves searching the high 8 bits, and the specific steps are as follows: a) Initialize the search start address to 0xFF (the maximum value of this level), and set the search step size to the preset initial value of 125; b) Send a COMPARE command to the DALI bus, which contains the high-order address value currently being searched; c) Obtain the response status of the slave device in real time to determine whether the slave device has responded; d) If there is a response from the device, the search address is moved in the decreasing direction, and the search step size is dynamically adjusted according to the device response; e) If there is no response from the slave device, the search address is moved in the incrementing direction, and the search step size is dynamically adjusted according to the device response; f) Repeat steps b to e until the search step size is reduced to 1 to obtain the high-order precise random address value of this level; g) Shift the high-order address value of the completed search to the left by 16 bits to obtain the high-order part of the complete 24-bit address.

[0041] The second level is a median 8-bit search, which is performed after the first level search is completed. The search method is the same as the first level, and the search range is 0x00 to 0xFF. After the search is completed, the median address value is shifted left by 8 bits to become the median part of the complete 24-bit address.

[0042] The third level is a low-order 8-bit search, which is performed after the second level search is completed. The search method is the same as the first level, and the search range is 0x00 to 0xFF. After the search is completed, the low-order address value is directly used as the low-order part of the complete 24-bit address.

[0043] Through the aforementioned three-level search mechanism, the three levels search independently yet interconnected, ultimately combining to form a complete 24-bit random address. Compared to traditional linear search methods, the three-level search mechanism of this invention reduces the number of searches to a maximum of approximately 24, significantly reducing the amount of interactive data and search time during the configuration process.

[0044] In some possible embodiments, the present invention also includes a technical solution for reducing the search range based on historical node information of the previous slave device: During DALI address configuration, each slave device's random address is generated independently, therefore there is no necessary size relationship between the random address values ​​of different slave devices. However, embodiments of the present invention have found that once a slave device completes address allocation, its random address is marked as occupied. In subsequent search processes, the range following this address value can be searched first, thereby effectively avoiding repeated searches for already allocated addresses.

[0045] The specific implementation method is as follows: record the random address search node information of the previously configured slave device, and set the starting address of the current search range to the value after the address of the previous node each time a new slave device search begins, thereby reducing the search space from 0x000000 to 0xFFFFFF in the previous round to a smaller range, which significantly improves the search efficiency.

[0046] In some possible embodiments, the present invention also includes a technical solution for real-time sensing of the slave device's response status: During the search process, the host senses the response status of the slave devices on the DALI bus in real time. The response status includes three types: no response, normal response, and abnormal response.

[0047] No response state: This means that the host does not detect any Backward Frame within the expected time (i.e., the slave device does not respond). Normal response status: This means that the host has received a valid 8-bit Backward Frame data of 0xFF, indicating that the search address value is greater than the random address of the slave device; Abnormal response status: This indicates that the host has received invalid data or the Backward Frame waveform is abnormal, indicating that there is a data verification error.

[0048] The detection of abnormal response states also involves a general scenario: when multiple DALI slave devices respond simultaneously, the different transmission delays between each slave device and the master cause a phase difference in the arrival time of the Backward Frame signal edges sent by each slave device to the master. This phase difference causes the level signals to be superimposed on the bus, and the master end will capture multiple edges, triggering an interrupt.

[0049] This invention determines whether multiple slave devices respond simultaneously by counting the number of edge-triggered interrupts. Specifically, when the detected edge interrupt count exceeds a preset interrupt count threshold, it is determined to be a multi-slave device conflict, meaning that the currently searched random address value is greater than the random address values ​​of multiple slave devices.

[0050] In some possible embodiments, the present invention further includes a collision detection-based dynamic step size adjustment strategy: When a multi-device conflict is detected, it indicates that the current searched random address value is too large, requiring a larger step size to skip more conflicting devices. This invention proposes a dynamic step size adjustment formula based on a convergence function: Define parameter: n: edge-triggered interrupt count value; Interrupt count threshold; δ: the difference exceeding the threshold, δ=n- ; : Current search step size; : Initial search step size; k: Current search count; When n> When this is determined to be a conflict between multiple slave devices, the search step size is dynamically adjusted: ; in, Let be a convergent function, expressed as: Parameter description: δ=n- , represents the difference exceeding the threshold; α is the acceleration factor, with a value range of 1.5≤α≤3.0; β is the convergence coefficient, with a value range of 0.1≤β≤0.5; e is the natural constant, approximately equal to 2.71828; Using the above convergence function, as the number of search iterations k increases, the convergence function... As the search step size approaches zero, it automatically decreases, achieving smooth convergence of the search interval and thus accurately locating the unique slave device address.

[0051] Example 3 like Figure 3 As shown, based on Embodiments 1 and 2, this application also provides a DALI address configuration device, including: Status acquisition unit 301 is used to read status information data of slave devices on the DALI bus; The three-level search unit 302 is used to perform approximation searches at high, medium and low levels. The collision detection unit 303 is used to detect multiple slave device response collisions by counting edge interrupts; Step size adjustment unit 304 is used to dynamically adjust the search step size based on the convergence function; Address allocation verification unit 305 is used to allocate and verify a DALI short address to the slave device; In summary, the DALI address configuration method and apparatus provided in this embodiment of the invention achieve efficient and rapid configuration of DALI slave device addresses through technical solutions such as a three-level search mechanism, response status awareness, and dynamic step size adjustment based on convergence functions. This effectively solves the technical problems of long configuration time, large amount of interactive data, and incomplete allocation in traditional methods.

[0052] It should be noted that the structures illustrated in the embodiments of this specification do not constitute a specific limitation on the DALI address configuration device. In other embodiments of this specification, the DALI address configuration device may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0053] The information interaction and execution process between the various units in the above-mentioned device are based on the same concept as the method embodiments in this specification, and the specific details can be found in the descriptions in the method embodiments in this specification, so they will not be repeated here.

[0054] This invention also provides a computer-readable storage medium storing a computer program thereon, which, when executed in a computer, causes the computer to perform the method described in any of the above embodiments.

[0055] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0056] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media that can store program code, such as ROM, RAM, magnetic disk, or optical disk.

[0057] Finally, it should be noted that the above description is merely a preferred embodiment of the present invention and is only used to illustrate the technical solution of the present invention, and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention are included within the scope of protection of the present invention.

Claims

1. A DALI address configuration method, characterized in that, include: Determine a pre-defined address configuration mode; the address configuration mode is to configure DALI short addresses for all slave devices or to configure DALI short addresses only for unconfigured slave devices. When the address configuration mode is to configure a DALI short address for an unconfigured slave device, the DALI short address is queried to determine the configured slave device, and a three-level search mechanism is used to search for unconfigured slave devices to determine the unique random address corresponding to the unconfigured slave device, and a DALI short address is configured for the unconfigured slave device corresponding to the unique random address. When the address configuration mode is to configure DALI short addresses for all slave devices, a three-level search mechanism is used to search all slave devices, determine the unique random address corresponding to the slave device, and configure the DALI short address for the slave device corresponding to the unique random address, thus completing the DALI address configuration.

2. The DALI address configuration method according to claim 1, characterized in that, The slave devices communicate using the DALI protocol. In the DALI protocol, each slave device is assigned a unique 24-bit random address during initialization. This random address is randomly generated in the range of 0x000000 to 0xFFFFFF and is unique to each device.

3. The DALI address configuration method according to claim 2, characterized in that, A three-level search mechanism is used to search all slave devices to determine the unique random address corresponding to each slave device, including: The 24-bit random address space is divided into three levels according to bytes; the three levels include the first level where the high 8 bits are located, the second level where the middle 8 bits are located, and the third level where the low 8 bits are located. For the first level, a dynamic adjustment search strategy is adopted to gradually approach the target random address in the first level to obtain the high-order random address value in the unique random address corresponding to the device. For the second level, a dynamic adjustment search strategy is adopted to gradually approach the target random address in the second level to obtain the median random address value in the unique random address corresponding to the device. For the third level, a dynamic adjustment search strategy is adopted to gradually approach the target random address in the third level, so as to obtain the low-order random address value in the unique random address corresponding to the device. The low-order random address value, the middle-order random address value, and the high-order random address value are sequentially concatenated to form a unique random address.

4. The DALI address configuration method according to claim 3, characterized in that, For the first level, a dynamic adjustment search strategy is adopted to gradually approach the target random address in the first level, obtaining the high-order random address value in the unique random address corresponding to the device, including: The search start address for the initial high-order address value is set to 0xFF, and the search step size is set to the preset initial value of 125; 0xFF represents the maximum address value of the first level. Send a comparison command to the DALI bus, which contains the high-order address value currently being searched; Real-time acquisition of the response status of slave devices to determine whether there is a response from a slave device; If there is a response from the device, the search address is moved in the decreasing direction, and the search step size is dynamically adjusted according to the device response. If there is no response from the device, the search address will be moved in the incrementing direction, and the search step size will be dynamically adjusted according to the device response. Repeat the search until the search step size is reduced to 1 to obtain the high-order random address value corresponding to the first level; Shift the high-order random address value of the completed search to the left by 16 bits to obtain the high-order random address value in the unique random address corresponding to the device.

5. The DALI address configuration method according to claim 4, characterized in that, For the second level, a dynamic adjustment search strategy is used to gradually approach the target random address in the second level, obtaining the median random address value from the unique random address corresponding to the device, including: The initial search start address for the median address value is set to 0xFF, and the search step size is set to the preset initial value of 125; 0xFF represents the maximum address value of the second level. Send a comparison command to the DALI bus, which contains the median address value currently being searched; Real-time acquisition of the response status of slave devices to determine whether there is a response from a slave device; If there is a response from the device, the search address is moved in the decreasing direction, and the search step size is dynamically adjusted according to the device response. If there is no response from the device, the search address will be moved in the incrementing direction, and the search step size will be dynamically adjusted according to the device response. Repeat the search until the search step size is reduced to 1 to obtain the median random address value corresponding to the second level; The median random address value after the search is completed is shifted left by 8 bits to become the median part of the complete 24-bit random address, thus obtaining the median random address value in the unique random address corresponding to the device.

6. The DALI address configuration method according to claim 5, characterized in that, For the third level, a dynamic adjustment search strategy is adopted to gradually approach the target random address in the third level, obtaining the low-order random address value in the unique random address corresponding to the device, including: The search start address for initializing the low-order address value is set to 0xFF, and the search step size is set to the preset initial value of 125. Send a comparison command to the DALI bus, which contains the low-order address value currently being searched; Real-time acquisition of the response status of slave devices to determine whether there is a response from a slave device; If there is a response from the device, the search address is moved in the decreasing direction, and the search step size is dynamically adjusted according to the device response. If there is no response from the device, the search address will be moved in the incrementing direction, and the search step size will be dynamically adjusted according to the device response. Repeat the search until the search step size is reduced to 1 to obtain the low-order random address value corresponding to the third level; The low-order random address value obtained after the search is used as the low-order part of the complete 24-bit random address to obtain the low-order random address value in the unique random address corresponding to the device.

7. The DALI address configuration method according to claim 6, characterized in that, Also includes: Record the unique random address of the last slave device that has been configured with a DALI short address; Each time a search for a new slave device's unique random address begins, the search start address for the new slave device's unique random address is set to the first value after the unique random address of the previous slave device with a configured DALI short address.

8. The DALI address configuration method according to claim 6, characterized in that, The search step size is dynamically adjusted based on the device response, and also includes: During the search process, the host senses the response status of the slave devices on the DALI bus in real time; the response status includes no response, normal response, or abnormal response. If the response status is an abnormal response status, the search step size is adjusted.

9. The DALI address configuration method according to claim 8, characterized in that, Also includes: When the edge interrupt count value exceeds the preset interrupt count threshold, it is determined to be a multi-slave device conflict, that is, the currently searched random address value is greater than the random address values ​​of multiple slave devices, and the response status is determined to be an abnormal response status.

10. The DALI address configuration method according to claim 8, characterized in that, The search step size is adjusted as follows: ; ; in, This indicates the adjusted search step size. This indicates an adjustment to the previous search step size. Represents the acceleration factor. This represents the difference exceeding the break count threshold. Denotes the convergent function. Represents the natural constant. represents the convergence coefficient, and k represents the current search count.