Lamp UID identification method, device, equipment and medium based on address range
By gradually subdividing the search range through subdivision rules based on address intervals, the complexity and low efficiency of traditional lamp UID search algorithms are solved, and more efficient UID identification and precise positioning are achieved.
Patent Information
- Application Number
- CN202210618631.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-01
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2042-06-01
AI Technical Summary
The traditional lamp UID search algorithm has many recursive nesting levels and a large amount of data, resulting in high complexity, long search time, large resource usage, high power consumption, and low efficiency.
Adopt subdivision rules based on address intervals and gradually subdivide the search range through predetermined low and high boundary values until the lamp UID identification termination condition is met, reducing the complexity of the search algorithm, improving search efficiency and saving resources.
It effectively reduces the search time of lamp UID, improves search efficiency, reduces resource space occupation and power consumption, and improves search accuracy.
Smart Images

Figure CN115037718B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method, device, equipment and medium for identifying a lamp UID based on an address interval. Background Art
[0002] In traditional technology, when dimming control is performed, the color light of the lamp is usually controlled based on the lighting control protocol, and on this basis, the lamp UID (User Identification) is searched according to the technical standards of Remote Device Management (RDM) to achieve accurate positioning of the lamp.
[0003] However, the search source code provided by the RDM technical standard uses a multi-layer recursive nesting algorithm. This algorithm has a high complexity due to the large number of recursive nesting layers and the large amount of data involved, which makes the lamp UID search time longer, the search efficiency is low, and the resource space is more occupied, resulting in high power consumption. Summary of the invention
[0004] The present invention provides a method, device, equipment and medium for identifying lamp UID based on address interval, which can effectively reduce the complexity of the search algorithm, reduce the search time of the lamp UID, improve the search efficiency, and at the same time save resource space and reduce power consumption.
[0005] According to one aspect of the present invention, a method for identifying a lamp UID based on an address interval is provided, the method comprising:
[0006] If a lamp UID identification trigger event is detected, the current cycle address interval is determined based on a predetermined subdivision rule; wherein the address interval includes a low boundary value and an upper boundary value;
[0007] If the detection of all the UID values of the lamps in the address interval of the current cycle is completed, the high boundary value of the current cycle is assigned as the low boundary value of the next cycle;
[0008] The high boundary value of the next cycle is determined according to the characteristic bit of the low boundary value of the next cycle, so as to detect all the UID values of the lamps in the address range of the next cycle, and assign values to the next cycle one by one until the lamp UID identification termination condition is met.
[0009] Optionally, the lower boundary value and the upper boundary value included in the address range are represented in binary.
[0010] Optionally, determining the next cycle high boundary value according to the characteristic bit of the next cycle low boundary value includes:
[0011] Identify the characteristic bit of the lower boundary value of the next cycle;
[0012] Determine the range of the address interval of the next cycle according to the characteristic bit;
[0013] The lower boundary value of the next cycle is summed with the range to obtain the upper boundary value of the next cycle.
[0014] Optionally, the characteristic bit is the lowest bit with a value of 1 in the lower boundary value of the next cycle.
[0015] Optionally, determining a range of an address interval of a next cycle according to the characteristic bit includes:
[0016] According to the lowest bit with a value of 1 in the lower boundary value of the next cycle, a binary value in which the value of the lowest bit is 1 and the values of other bits are 0 is determined as the range of the address interval of the next cycle.
[0017] Optionally, the process of detecting UID values of all lamps within the current cycle address interval includes:
[0018] Send a detection command to all lamp UID values within the current cycle address range;
[0019] If a lamp reply instruction is received and the lamp reply instruction is parsed successfully, it is determined that the detection of all lamp UID values within the current cycle address interval is completed.
[0020] Optionally, after sending a detection instruction to all lamp UID values within the current cycle address interval, the method further includes:
[0021] If a lamp reply instruction is received and the lamp reply instruction fails to be parsed, the current cycle address interval is subdivided into at least two sub-address intervals, and the lamp UID values are detected in the at least two sub-address intervals.
[0022] According to another aspect of the present invention, a lamp UID identification device based on address interval is provided, comprising:
[0023] A current cycle address interval determination module, used to determine the current cycle address interval based on a predetermined subdivision rule if a lamp UID identification triggering event is detected; wherein the address interval includes a low boundary value and an upper boundary value;
[0024] A boundary assignment module, for assigning the high boundary value of the current cycle as the low boundary value of the next cycle if the detection of all the UID values of the lamps in the address interval of the current cycle is completed;
[0025] The lamp detection module is used to determine the high boundary value of the next cycle according to the characteristic bit of the low boundary value of the next cycle, so as to detect all the lamp UID values in the address range of the next cycle, and assign values to the next cycle one by one until the lamp UID identification termination condition is met.
[0026] According to another aspect of the present invention, there is provided an electronic device for identifying a lamp UID based on an address interval, the electronic device comprising:
[0027] at least one processor; and
[0028] a memory communicatively connected to the at least one processor; wherein,
[0029] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the lamp UID identification method based on address interval described in any embodiment of the present invention.
[0030] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the lamp UID identification method based on address interval described in any embodiment of the present invention when executed.
[0031] The technical solution of the embodiment of the present invention, if a lamp UID identification triggering event is detected, the current cycle address interval is determined based on a predetermined subdivision rule; wherein the address interval includes a low boundary value and a high boundary value; if all lamp UID values within the current cycle address interval are detected, the high boundary value of the current cycle is assigned as the low boundary value of the next cycle; the high boundary value of the next cycle is determined according to the characteristic bit of the low boundary value of the next cycle, so as to detect all lamp UID values within the address interval of the next cycle, and successively assign values to the next cycle until the lamp UID identification termination condition is met. This technical solution can effectively reduce the complexity of the search algorithm, thereby reducing the search time of the lamp UID, improving the search efficiency, and at the same time saving resource space and reducing power consumption.
[0032] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0034] Figure 1 is a flow chart of a lamp UID identification method based on address intervals provided according to Embodiment 1 of the present invention;
[0035] Figure 2 is a flow chart of a lamp UID identification method based on address intervals provided according to Embodiment 2 of the present invention;
[0036] Figure 3 is a structural schematic diagram of a lamp UID identification device based on address intervals provided according to Embodiment 3 of the present invention;
[0037] Figure 4 It is a structural schematic diagram of an electronic device for implementing a lamp UID identification method based on an address interval according to an embodiment of the present invention. DETAILED DESCRIPTION
[0038] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0039] It should be noted that the terms "first", "second", "target", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0040] Embodiment 1
[0041] Figure 1This is a flowchart of a lamp UID identification method based on address intervals provided in the first embodiment of the present invention. This embodiment is applicable to the case where the lamp UID is identified according to the address interval. The method can be executed by a lamp UID identification device based on address intervals. The lamp UID identification device based on address intervals can be implemented in the form of hardware and / or software. The lamp UID identification device based on address intervals can be configured in an electronic device with data processing capabilities. Figure 1 As shown, the method includes:
[0042] S110, if a lamp UID identification triggering event is detected, the current cycle address interval is determined based on a predetermined subdivision rule; wherein the address interval includes a low boundary value and an upper boundary value.
[0043] Among them, the lamp UID may refer to the identity of the lamp, which can be used to uniquely identify the lamp. It is understandable that each lamp has its own exclusive UID, and the unique lamp can be determined by the lamp UID. It should be noted that the present embodiment does not impose any restrictions on the number of bits of the lamp UID, and can be flexibly set according to actual application requirements. For example, the lamp UID can be set to 48 bits. The lamp UID recognition trigger event can be understood as an operation instruction that can trigger the lamp UID recognition event. The subdivision rule may refer to the rule for dividing the address interval. Exemplarily, the subdivision rule can be set to divide the address interval into equal parts, such as dividing the address interval into two or three equal parts, or it can be set to divide the address interval according to the ratio of the length of the interval, such as dividing the address interval according to the interval length of 1:2.
[0044] Among them, the address interval can refer to the addressing range of the lamp UID. That is to say, each lamp UID can be regarded as an address, and the address interval can be understood as the search range of the lamp UID. Specifically, the address interval may include a low boundary value and a high boundary value. It can be understood that when a certain address interval is known, the low boundary value and the high boundary value of the address interval are easily determined, that is, the low boundary value is the minimum value in the address interval, and the high boundary value is the maximum value in the address interval. Optionally, the low boundary value and the high boundary value included in the address interval are represented in binary. Among them, binary only contains two numbers, 0 and 1, and needs to be read bit by bit. For example, assuming that the address interval is 100 to 111, the low boundary value of the address interval is 100, and the high boundary value is 111.
[0045] In this embodiment, when a lamp UID identification trigger event is detected, the current cycle address interval can be determined according to a predetermined subdivision rule. Exemplarily, assuming that the lamp UID is 3 bits, the total address interval is from 000 to 111. If the predetermined subdivision rule at this time is to divide the address interval into two equal parts, 000 to 111 can be divided into two sub-address intervals, namely 000 to 011 and 100 to 111, according to the subdivision rule. The lamp UID search can be performed in order from low to high, and 000 to 011 is determined as the current cycle address interval. At this time, the low boundary value of the current cycle address interval is 000, and the high boundary value is 011.
[0046] S120: If the detection of UID values of all lamps in the address interval of the current cycle is completed, the high boundary value of the current cycle is assigned as the low boundary value of the next cycle.
[0047] In this embodiment, after determining the current cycle address interval, all the UID values of the lamps in the current cycle address interval must first be detected. The UID value of the lamp may refer to the specific content of the lamp UID. Optionally, the detection process of all the UID values of the lamps in the current cycle address interval includes: sending a detection instruction to all the UID values of the lamps in the current cycle address interval; if a lamp reply instruction is received and the lamp reply instruction is parsed successfully, it is determined that the detection of all the UID values of the lamps in the current cycle address interval is completed.
[0048] Among them, the detection instruction may refer to an operation instruction for instructing to detect the UID values of all lamps in the current cycle address interval. The lamp reply instruction may refer to a lamp response operation instruction in response to the detection instruction. Specifically, the lamp reply instruction may include several lamps that meet the detection instruction. It should be noted that the detection instruction and the lamp reply instruction are corresponding. For example, if the detection instruction is to detect the lamps in the lit state, all the UID values of the lamps in the current cycle address interval will be detected. Specifically, if there are lamps in the lit state in the current cycle address interval, the lamp reply instruction will be received, and it can be known how many lamps meet the detection instruction according to the lamp reply instruction; if there are no lamps in the lit state in the current cycle address interval, the lamp reply instruction cannot be received, and the lamp UID values of other refined sub-address intervals will be detected.
[0049] In this embodiment, if a lamp reply instruction is received, the lamp reply instruction is further parsed. Specifically, if there is only one lamp that matches the detection instruction in the current cycle address interval, it can be said that the parsing is successful. Exemplarily, based on the above example, if there is only one lamp in the lighting state in the current cycle address interval, it means that the lamp reply instruction is parsed successfully, that is, it can be determined which lamp is in the lighting state, and at this time it can be determined that the detection of the UID values of all lamps in the current cycle address interval is completed.
[0050] Through such a setting, this solution can detect the UID values of all lamps in the current cycle address range. When the lamp reply instruction is parsed successfully, the lamp that meets the detection instruction can be accurately searched, thereby achieving accurate positioning of the lamp.
[0051] In this embodiment, if the detection of all the UID values of the lamps in the address range of the current cycle is completed, the high boundary value of the current cycle can be assigned to the low boundary value of the next cycle. For example, assuming that the address range of the current cycle is 000 to 011, that is, the high boundary value of the current cycle is 011. If the detection of all the UID values of the lamps in the address range of 000 to 011 of the current cycle is completed, the high boundary value 011 of the current cycle can be assigned to the low boundary value of the next cycle, that is, the low boundary value of the next cycle is 011.
[0052] S130, determining the next cycle high boundary value according to the characteristic bit of the next cycle low boundary value, so as to detect all lamp UID values in the next cycle address interval, and assign values to the next cycle one by one until the lamp UID identification termination condition is met.
[0053] Among them, the characteristic bit may refer to a digit in the low boundary value used to characterize the characteristics of the low boundary value. For example, the characteristic bit may be the highest bit or the lowest bit of the low boundary value, or the highest bit or the lowest bit where 0 or 1 is located in the low boundary value. The lamp UID identification termination condition may refer to a condition used to instruct to stop the lamp UID identification operation. Exemplarily, the lamp UID identification termination condition may be set to identify all lamp UIDs that meet the detection instructions.
[0054] In this embodiment, the high boundary value of the next cycle can be determined according to the characteristic bit of the low boundary value of the next cycle, so as to detect all the UID values of the lamps in the address range of the next cycle. Exemplarily, it is assumed that the low boundary value of the next cycle is 1010, and its characteristic bit is the lowest bit of the low boundary value of the next cycle, that is, the corresponding value is 0. At this time, the last bit of the high boundary value of the next cycle can be set to 0, and the other 3 bits can be set to 1, thereby determining that the high boundary value of the next cycle is 1110, and then determining that the address range of the next cycle is 1010 to 1110. After obtaining the address range of the next cycle, all the UID values of the lamps in the address range of the next cycle can be detected according to the above-mentioned detection method for all the UID values of the lamps in the address range of the current cycle, and the next cycle can be assigned values one by one according to the above-mentioned assignment process until the lamp UID identification termination condition is met, and the detection of the lamp UID value is stopped. It should be noted that the next cycle is relative to the current cycle, and is not fixed, but changes dynamically according to the detection cycle.
[0055] The technical solution of the embodiment of the present invention, if a lamp UID identification triggering event is detected, the current cycle address interval is determined based on a predetermined subdivision rule; wherein the address interval includes a low boundary value and a high boundary value; if all lamp UID values within the current cycle address interval are detected, the high boundary value of the current cycle is assigned as the low boundary value of the next cycle; the high boundary value of the next cycle is determined according to the characteristic bit of the low boundary value of the next cycle, so as to detect all lamp UID values within the address interval of the next cycle, and successively assign values to the next cycle until the lamp UID identification termination condition is met. This technical solution can effectively reduce the complexity of the search algorithm, thereby reducing the search time of the lamp UID, improving the search efficiency, and at the same time saving resource space and reducing power consumption.
[0056] In this embodiment, optionally, after issuing a detection instruction to all lamp UID values in the current cycle address interval, the method also includes: if a lamp reply instruction is received and the lamp reply instruction parsing fails, the current cycle address interval is subdivided into at least two sub-address intervals, and the lamp UID values are detected in the at least two sub-address intervals.
[0057] In this embodiment, if there are multiple lamps that match the detection instruction in the current cycle address interval, it can indicate that the parsing has failed. Exemplarily, based on the above example, if there are multiple lamps in the lighting state in the current cycle address interval, then because of the mutual interference between the lamps in the lighting state, the lamp reply instruction parsing will fail, that is, it is impossible to determine which lamps are in the lighting state. If the lamp reply instruction parsing fails, the current cycle address interval can be subdivided into at least two sub-address intervals according to a predetermined subdivision rule, and the lamp UID values can be detected in at least two sub-address intervals respectively. For the specific detection method, please refer to the above-mentioned detection process of all lamp UID values in the current cycle address interval.
[0058] Through such a setting, this solution can continue to subdivide the current cycle address interval when the lamp reply command parsing fails, and detect the lamp UID value in the refined sub-address interval to achieve accurate positioning of the lamp.
[0059] Embodiment 2
[0060] Figure 2 A flowchart of a lamp UID identification method based on an address interval is provided for the second embodiment of the present invention. This embodiment is optimized based on the above embodiment. The specific optimization is: determining the high boundary value of the next cycle according to the characteristic bit of the low boundary value of the next cycle, including: identifying the characteristic bit of the low boundary value of the next cycle; determining the range of the address interval of the next cycle according to the characteristic bit; summing the low boundary value of the next cycle and the range to obtain the high boundary value of the next cycle.
[0061] like Figure 2 As shown, the method of this embodiment specifically includes the following steps:
[0062] S210: If a lamp UID identification triggering event is detected, the current cycle address interval is determined based on a predetermined subdivision rule; wherein the address interval includes a low boundary value and an upper boundary value.
[0063] S220: If the detection of all the UID values of lamps in the address interval of the current cycle is completed, the high boundary value of the current cycle is assigned as the low boundary value of the next cycle.
[0064] The specific implementation process of S210 - S220 may refer to the description of S110 - S120 .
[0065] S230, identifying the characteristic bit of the lower boundary value of the next cycle.
[0066] In this embodiment, optionally, the feature bit is the lowest bit with a value of 1 in the lower boundary value of the next cycle. Exemplarily, assuming that the lower boundary value of the next cycle is 0110, the feature bit can be the lowest bit with a value of 1 in the lower boundary value 0110 of the next cycle, that is, the feature bit is the second bit from right to left in 0110.
[0067] S240: Determine a range of an address interval for the next cycle according to the characteristic bit.
[0068] The range of the address interval of the next cycle can be understood as the address range between the high boundary value and the low boundary value of the next cycle, that is, the difference between the high boundary value and the low boundary value of the next cycle is the range of the address interval of the next cycle.
[0069] In this embodiment, the range of the address interval of the next cycle can be determined according to the characteristic bit. Optionally, determining the range of the address interval of the next cycle according to the characteristic bit includes: according to the lowest bit with a value of 1 in the low boundary value of the next cycle, determining a binary value in which the value of the lowest bit is 1 and the values of other bits are 0 as the range of the address interval of the next cycle. Specifically, when the characteristic bit is the lowest bit with a value of 1 in the low boundary value of the next cycle, the characteristic bit can be kept unchanged at 1, and all other bits can be set to zero, and the binary value obtained in this way can be used as the range of the address interval of the next cycle.
[0070] Exemplarily, based on the above example, when the characteristic bit is the second bit from right to left in the low boundary value 0110 of the next cycle, the 1 on the characteristic bit can be retained and the other 3 bits can be set to zero, so that the address range of the next cycle is 0010, that is, the difference between the high boundary value and the low boundary value 0110 of the next cycle is 0010.
[0071] Through such a setting, the present solution can quickly determine the range of the address interval of the next cycle according to the characteristic bit, thereby simplifying the search algorithm and further reducing the complexity of the algorithm.
[0072] S250, summing the lower boundary value of the next cycle and the range to obtain the upper boundary value of the next cycle, so as to detect all the UID values of lamps in the address interval of the next cycle, and successively assign values to the next cycle until the lamp UID identification termination condition is met.
[0073] It can be understood that since the difference between the high boundary value and the low boundary value of the next cycle is the range of the address interval of the next cycle, if the low boundary value of the next cycle and the range of the address interval of the next cycle are known, the high boundary value of the next cycle can be obtained by adding the two.
[0074] In this embodiment, the high boundary value of the next cycle can be obtained by summing the low boundary value of the next cycle and the range of the address interval of the next cycle, and then the address interval of the next cycle can be determined, so as to detect all the UID values of lamps in the address interval of the next cycle and assign values to the next cycle one by one until the lamp UID identification termination condition is met.
[0075] Exemplarily, the process of determining the address intervals of different cycles includes the lower boundary value, the upper boundary value and the range of the address interval of each address interval, as shown in Table 1:
[0076] Table 1 Address ranges of different cycles
[0077] cycle Low Boundary Value scope High Boundary Value 1 010010100110 000000000010 010010101000 2 010010101000 000000001000 010010110000 3 010010110000 000000010000 010011000000 4 010011000000 000001000000 010100000000
[0078] It should be noted that the four cycles in the lamp UID search process are listed in Table 1 only to illustrate the determination process of the address range of different cycles, and it does not mean that the search process has only four cycles. Specifically, if cycle 1 is the current cycle, cycle 2 is the next cycle. The high boundary value of cycle 1 is 010010101000, and it is assigned to the low boundary value of cycle 2, so the low boundary value of cycle 2 is 010010101000. At this time, the lowest bit with a value of 1 in the low boundary value of cycle 2 is the 4th bit from right to left. This bit can be determined as a feature bit, and the 1 on this feature bit is retained, and the remaining bits are all set to zero, so that the range of the address range of cycle 2 is 000000001000. By adding the low boundary value of cycle 2 010010101000 and the range of the address range 000000001000, the high boundary value of cycle 2 can be obtained as 010010110000. Similarly, according to the above operations, the address ranges of cycle 3 and cycle 4 can be obtained in turn.
[0079] The technical solution of the embodiment of the present invention first identifies the characteristic bit of the lower boundary value of the next cycle, then determines the range of the address interval of the next cycle according to the characteristic bit, and then sums the lower boundary value of the next cycle with the range to obtain the upper boundary value of the next cycle. This technical solution can effectively reduce the complexity of the search algorithm, further reduce the search time of the lamp UID, improve the search efficiency, and save resource space and reduce power consumption.
[0080] Embodiment 3
[0081] Figure 3 This is a schematic diagram of the structure of a lamp UID identification device based on address intervals provided in the third embodiment of the present invention. The device can execute the lamp UID identification method based on address intervals provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method. Figure 3 As shown, the device comprises:
[0082] The current cycle address interval determination module 310 is used to determine the current cycle address interval based on a predetermined subdivision rule if a lamp UID identification triggering event is detected; wherein the address interval includes a low boundary value and an upper boundary value;
[0083] The boundary assignment module 320 is used to assign the high boundary value of the current cycle as the low boundary value of the next cycle if the detection of all the UID values of the lamps in the address interval of the current cycle is completed;
[0084] The lamp detection module 330 is used to determine the next cycle high boundary value according to the characteristic bit of the next cycle low boundary value, so as to detect all lamp UID values in the next cycle address interval and assign values to the next cycle one by one until the lamp UID identification termination condition is met.
[0085] Optionally, the lower boundary value and the upper boundary value included in the address range are represented in binary.
[0086] Optionally, the lamp detection module 330 includes:
[0087] A feature bit identification unit, used to identify the feature bit of the lower boundary value of the next cycle;
[0088] A range determination unit, used to determine the range of the address interval of the next cycle according to the characteristic bit;
[0089] The next cycle high boundary value determination unit is used to sum the low boundary value of the next cycle and the range to obtain the next cycle high boundary value.
[0090] Optionally, the characteristic bit is the lowest bit with a value of 1 in the lower boundary value of the next cycle.
[0091] Optionally, the range determination unit is specifically used to:
[0092] According to the lowest bit with a value of 1 in the lower boundary value of the next cycle, a binary value in which the value of the lowest bit is 1 and the values of other bits are 0 is determined as the range of the address interval of the next cycle.
[0093] Optionally, the boundary assignment module 320 is used to:
[0094] Send a detection command to all lamp UID values within the current cycle address range;
[0095] If a lamp reply instruction is received and the lamp reply instruction is parsed successfully, it is determined that the detection of all lamp UID values within the current cycle address interval is completed.
[0096] Optionally, the boundary assignment module 320 is further used to:
[0097] After sending a detection instruction to all lamp UID values in the current cycle address interval, if a lamp reply instruction is received and the lamp reply instruction parsing fails, the current cycle address interval is subdivided into at least two sub-address intervals, and the lamp UID values are detected in the at least two sub-address intervals.
[0098] A lamp UID identification device based on address intervals provided in an embodiment of the present invention can execute a lamp UID identification method based on address intervals provided in any embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution method.
[0099] Embodiment 4
[0100] Figure 4 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0101] like Figure 4 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0102] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0103] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the lamp UID identification method based on the address interval.
[0104] In some embodiments, the address interval-based lamp UID identification method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the address interval-based lamp UID identification method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the address interval-based lamp UID identification method in any other appropriate manner (e.g., by means of firmware).
[0105] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0106] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0107] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0108] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0109] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0110] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0111] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0112] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A lamp UID identification method based on address interval, characterized in that: include: If a lamp UID identification trigger event is detected, the current cycle address interval is determined based on a predetermined subdivision rule; wherein the address interval includes a low boundary value and an upper boundary value; If the detection of all the UID values of the lamps in the address interval of the current cycle is completed, the high boundary value of the current cycle is assigned as the low boundary value of the next cycle; Determine the high boundary value of the next cycle according to the characteristic bit of the low boundary value of the next cycle, so as to detect all the UID values of the lamps in the address range of the next cycle, and assign values to the next cycle one by one until the termination condition of the lamp UID identification is met; The step of determining the next cycle high boundary value according to the feature bit of the next cycle low boundary value comprises: Identify the characteristic bit of the lower boundary value of the next cycle; Determine the range of the address interval of the next cycle according to the characteristic bit; Summing the lower boundary value of the next cycle and the range to obtain the upper boundary value of the next cycle; The subdivision rule includes dividing the address interval into equal parts, or dividing the address interval according to the length ratio of the intervals; The process of detecting the UID values of all lamps in the current cycle address interval includes: Sending a detection instruction to all lamp UID values within the current cycle address interval; If a lamp reply instruction is received and the lamp reply instruction is parsed successfully, it is determined that the detection of all lamp UID values within the current cycle address interval is completed; After sending a detection instruction to all lamp UID values within the current cycle address interval, the method further includes: If the lamp reply instruction is received and the lamp reply instruction parsing fails, the current cycle address interval is subdivided into at least two sub-address intervals, and the lamp UID value is detected in the at least two sub-address intervals.
2. The method according to claim 1, characterized in that The lower boundary value and the upper boundary value included in the address range are expressed in binary.
3. The method according to claim 1, characterized in that The characteristic bit is the lowest bit with a value of 1 in the lower boundary value of the next cycle.
4. The method according to claim 3, characterized in that Determining the range of the address interval of the next cycle according to the characteristic bit includes: According to the lowest bit with a value of 1 in the lower boundary value of the next cycle, a binary value in which the value of the lowest bit is 1 and the values of other bits are 0 is determined as the range of the address interval of the next cycle.
5. A lamp UID identification device based on address interval, characterized in that: include: A current cycle address interval determination module, used to determine the current cycle address interval based on a predetermined subdivision rule if a lamp UID identification triggering event is detected; wherein the address interval includes a low boundary value and an upper boundary value; A boundary assignment module, used to assign the high boundary value of the current cycle to the low boundary value of the next cycle if the detection of all the UID values of the lamps in the address interval of the current cycle is completed; The lamp detection module is used to determine the high boundary value of the next cycle according to the characteristic bit of the low boundary value of the next cycle, so as to detect all the lamp UID values in the address interval of the next cycle, and assign values to the next cycle one by one by calling the boundary assignment module until the lamp UID identification termination condition is met; The lamp detection module comprises: A feature bit identification unit, used to identify the feature bit of the lower boundary value of the next cycle; A range determination unit, used to determine the range of the address interval of the next cycle according to the characteristic bit; A next cycle high boundary value determination unit, used for summing the next cycle low boundary value and the range to obtain the next cycle high boundary value; The subdivision rule includes dividing the address interval into equal parts, or dividing the address interval according to the length ratio of the intervals; The lamp detection module is specifically used to send a detection instruction to all lamp UID values in the current cycle address interval; if a lamp reply instruction is received and the lamp reply instruction is parsed successfully, it is determined that the detection of all lamp UID values in the current cycle address interval is completed; The lamp detection module is also used to, after sending a detection instruction to all lamp UID values in the current cycle address interval, if a lamp reply instruction is received and the lamp reply instruction parsing fails, subdivide the current cycle address interval into at least two sub-address intervals, and detect the lamp UID values in the at least two sub-address intervals.
6. An electronic device for identifying lamp UID based on address interval, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the lamp UID identification method based on address intervals as described in any one of claims 1-4.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the lamp UID identification method based on address intervals as described in any one of claims 1 to 4 when executed.
