Address allocation system, address allocation method and storage medium

By introducing remote controls and automatic address allocation units into the address allocation system between the master and slave devices, the problems of cumbersome address allocation and bus conflict in the prior art are solved, and an efficient and flexible communication process is achieved.

CN118041893BActive Publication Date: 2024-11-15YANTAI HAIBO ELECTRICAL EQUIP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410353450.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-27
Publication Date
2024-11-15
Estimated Expiration
2044-03-27

AI Technical Summary

Technical Problem

In the prior art, the address allocation process between the master station equipment and multiple slave station equipment is cumbersome, inefficient, and susceptible to bus conflicts, resulting in high operational difficulties and high maintenance costs.

Method used

Adopt an address allocation system, including a master station device, a plurality of slave station devices and a remote control, and is connected through the first signal line and the second signal line, the remote control communicates with the slave station equipment, the master station address allocation unit and the slave station The data processing unit works together to realize automatic address allocation, avoid bus conflicts, and simplify the encoding process.

Benefits of technology

Effectively avoid bus conflicts, simplify the encoding process, reduce operation difficulty, ensure that slave equipment works normally without communication, and improve communication flexibility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118041893B_ABST
    Figure CN118041893B_ABST
Patent Text Reader

Abstract

The present application discloses an address allocation system, an address allocation method and a storage medium, which belongs to the field of electronic communication technology. The address allocation system includes a master station device, multiple slave station devices and a remote control. The master station device is connected to multiple slave station devices through a first signal line and a second signal line, and the remote control is connected to the slave station device signal, and can send a start reception and transmission enable to the slave station device; in the master station device, the master station address allocation unit is connected to the master station data transceiver unit, so as to allocate address data; in the slave station device, the slave station enable unit is connected to the remote control signal and the slave station data transceiver unit, and the slave station data processing unit and the master station data transceiver unit are connected to the slave station data transceiver unit. The address allocation system can effectively avoid the influence of bus conflicts, simplify the encoding process, reduce the difficulty of operation, ensure that the slave station device can perform other normal work in the absence of communication, and facilitate automatic encoding, and improve communication flexibility.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of electronic communication technology, and in particular to an address allocation system, an address allocation method and a storage medium. Background Art

[0002] In some system devices, the master station device and the slave station device are connected to form a complete communication system, so that they can work reasonably and efficiently. The communication problem between the master station device and multiple slave station devices is an important part of the development of the single-chip microcomputer program. Before the master station device communicates with multiple slave station devices, it is necessary to assign addresses to the slave station devices. The current four-wire system has two power supply lines and two communication lines. The power supply lines and communication lines need to be controlled separately. The slave station device can be powered on by controlling the power supply line connection, and then the master station device and the slave station device can communicate; when multiple slave station devices are connected to the bus, the communication may be affected by bus conflicts.

[0003] In the related technology, the master station device is often required to encode each slave station device in sequence to achieve address allocation. The encoding is cumbersome and inefficient, the operation is difficult, and the subsequent maintenance cost is high. Summary of the invention

[0004] In view of this, the present application provides an address allocation system, an address allocation method and a storage medium, which can effectively avoid the impact of bus conflicts, simplify the encoding process, reduce the difficulty of operation, ensure that the slave station device can perform other normal work in the absence of communication, and facilitate automatic encoding to improve communication flexibility.

[0005] Specifically, the following technical solutions are included:

[0006] In a first aspect, an embodiment of the present application provides an address allocation system, the address allocation system comprising a master station device, a plurality of slave station devices and a remote control, the master station device being connected to the plurality of slave station devices via a first signal line and a second signal line, the remote control being signal-connected to the plurality of slave station devices;

[0007] The master station device comprises a master station address allocation unit and a master station data transceiver unit, the master station address allocation unit is connected to the master station data transceiver unit, the master station address allocation unit is used to allocate address data, and the master station data transceiver unit is used to receive and send data;

[0008] The slave station devices all include a slave station enabling unit, a slave station data transceiver unit and a slave station data processing unit. The slave station enabling unit is connected to the remote control signal and the slave station data transceiver unit. The slave station data processing unit and the master station data transceiver unit are both connected to the slave station data transceiver unit. The slave station enabling unit is used to receive the enable signal of the remote control. The slave station data transceiver unit is used to communicate data with the master station data transceiver unit. The slave station data processing unit is used to process address data.

[0009] In some embodiments, the communication method between the remote control and the slave device is infrared remote control communication.

[0010] In some embodiments, the slave station device further includes a slave station storage unit, which is connected to the slave station data transceiver unit and is used to store addresses.

[0011] In a second aspect, an embodiment of the present application provides an address allocation method, which is applied to the address allocation system provided in the first aspect above, wherein the address of the slave device itself is initially a threshold address, and the address allocation method includes:

[0012] The master device obtains the total number n of multiple slave devices and sends address data;

[0013] An address allocation process is performed, the address allocation process comprising:

[0014] After a slave station device receives the enable signal sent by the remote control component, it turns on the receiving and sending enable, and the slave station device with the receiving and sending enabled receives the address data sent by the master station device, and updates its own address to the address data sent by the master station device;

[0015] After completing the update of its own address, the slave station device with reception and transmission enabled performs subtraction processing on the value contained in its own address to obtain updated address data, and sends the updated address data to the master station device;

[0016] After the master station device receives the updated address data, it sends the address data, and the address data sent is the updated address data;

[0017] In response to the value contained in the address data received by the slave station device with the reception and transmission enabled being smaller than the value contained in the address of the slave station device with the reception and transmission enabled, the slave station device with the reception and transmission enabled turning off the transmission enable;

[0018] The address allocation process is repeatedly performed until the value contained in the updated address data received by the master device is the stop threshold, and the address allocation of all slave devices is completed.

[0019] In some embodiments, the slave device with receiving and sending enabled performs subtraction processing on the value contained in its own address to obtain updated address data, including:

[0020] The slave device with reception and transmission enabled subtracts the difference threshold from the value contained in its own address to obtain the address update data.

[0021] In some embodiments, after the slave device with receiving and sending enabled receives the address data sent by the master device and updates its own address to the address data sent by the master device, the address allocation process further includes:

[0022] The slave station device with reception and transmission enabled stores the address data received and sent by the master station device.

[0023] In some embodiments, the address allocation method further includes:

[0024] After completing the address allocation of all slave devices, the master device sends a flag to start the transmission enable bit;

[0025] After the slave station device receives the start-transmission enable flag, the slave station device starts transmission enable.

[0026] In some embodiments, in response to the value contained in the address data received by the slave device with reception and transmission enabled being less than the value contained in the address of the slave device with reception and transmission enabled, the slave device with reception and transmission enabled turning off transmission enable includes:

[0027] The slave device that starts receiving and sending enables detects whether the value included in the received address data is smaller than the value included in the address of the slave device that starts receiving and sending enables;

[0028] When it is detected that the value contained in the received address data is smaller than the value contained in its own address, the slave device that has enabled receiving and sending turns off the sending enable;

[0029] The value obtained by adding n times the difference threshold to the stop threshold is equal to the value included in the address data initially sent by the master station device, and the value included in the threshold address is smaller than the stop threshold.

[0030] In some embodiments, the address allocation method further includes:

[0031] After the slave device receives the start-send enable flag, the slave device stops executing a detection process, wherein the detection process includes detecting whether a value included in the received address data is smaller than a value included in its own address.

[0032] In a third aspect, the present application provides a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the address allocation method provided in the second aspect is implemented.

[0033] The beneficial effects of the technical solution provided by the embodiments of the present application include at least:

[0034] The embodiment of the present application provides an address allocation system, an address allocation method and a storage medium, wherein the address allocation system includes a master station device, multiple slave station devices and a remote control component, wherein the master station device is connected to the multiple slave station devices via a first signal line and a second signal line, and the remote control component is connected to the multiple slave station device signals, and the multiple slave station devices can receive an enable signal sent by the remote control component, thereby turning on reception and transmission enable; the master station device includes a master station address allocation unit and a master station data transceiver unit, and the master station address allocation unit is connected to the master station data transceiver unit to allocate address data; the slave station devices all include a slave station enabling unit, a slave station data transceiver unit and a slave station data processing unit, and the slave station enabling unit is all connected to the remote control component signal and the slave station data transceiver unit, and the slave station data processing unit and the master station data transceiver unit are all connected to the slave station data transceiver unit, the slave station enabling unit is used to receive the enable signal of the remote control component, the slave station data transceiver unit is used to communicate data with the master station data transceiver unit, and the slave station data processing unit is used to process address data, thereby receiving the allocated address. The address allocation system can effectively avoid the impact of bus conflicts, simplify the encoding process, reduce the difficulty of operation, ensure that the slave device can perform other normal work without communication, facilitate automatic encoding, and improve communication flexibility. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0036] Figure 1 A schematic diagram of the structure of an address allocation system provided in an embodiment of the present application;

[0037] Figure 2 A method flow chart of an address allocation method provided in an embodiment of the present application.

[0038] The reference numerals in the figures represent respectively:

[0039] 1-master station device, 11-master station address allocation unit, 12-master station data transceiver unit, 2-slave station device, 21-slave station enabling unit, 22-slave station data transceiver unit, 23-slave station data processing unit, 24-slave station storage unit, 3-remote control component, 4-first signal line, 5-second signal line. DETAILED DESCRIPTION

[0040] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0041] In the first aspect, an embodiment of the present application provides an address allocation system, which includes a master station device 1, multiple slave station devices 2 and a remote control component 3. The master station device 1 is connected to the multiple slave station devices 2 through a first signal line 4 and a second signal line 5, and the remote control component 3 is signal-connected to the multiple slave station devices 2. The master station device 1 sends and receives data with the multiple slave station devices 2 through the first signal line 4 and the second signal line 5 respectively.

[0042] The master station device 1 mainly plays a master control role, determines the data communication of the bus, and has functions such as calculation and communication processing. The slave station device 2 is a peripheral device that can communicate with the master station device 1 and receive control from the master station device 1.

[0043] In order to avoid laying power lines, improve anti-interference capabilities, and increase communication distance, the address allocation system provided in the embodiment of the present application adopts a two-bus system. Compared with the traditional four-bus system with two power lines and two communication lines, it only includes two buses, the first signal line 4 and the second signal line 5, and combines the power line and the signal line into one. The first signal line 4 and the second signal line 5 can both supply power and communicate, so that the signal and power supply share one bus. When the master station device 1 and the slave station device 2 have communication needs or not, the first signal line 4 and the second signal line 5 need to be used for power supply, so as to ensure the normal operation of the equipment.

[0044] By setting the remote control component 3, the receiving and sending enable of the slave device 2 can be turned on through the remote control component 3, which can effectively avoid the influence of bus conflicts, and can ensure that the slave device can perform other normal work in the absence of communication, thereby improving communication flexibility.

[0045] It should be noted that, since the master station device 1 sends data to the slave station device 2 through the first signal line 4, when the master station device 1 sends data to the first signal line 4, the slave station devices 2 connected to the first signal line 4 and with the receiving and sending enabled can all receive the data sent by the master station device 1. Therefore, in order to avoid bus communication conflicts and prevent multiple slave station devices 2 from being assigned the same address data, the remote control 3 is set to turn on the receiving and sending enable of the slave station device when the address allocation needs to be received.

[0046] The master station device 1 comprises a master station address allocation unit 11 and a master station data transceiver unit 12, the master station address allocation unit 11 and the master station data transceiver unit 12 are connected, the master station address allocation unit 11 is used to allocate address data, and the master station data transceiver unit 12 is used to receive and send data.

[0047] The slave station devices 2 all include a slave station enabling unit 21, a slave station data transceiver unit 22 and a slave station data processing unit 23. The slave station enabling unit 21 is connected to the remote control unit 3 signal and the slave station data transceiver unit 22. The slave station data processing unit 23 and the master station data transceiver unit 12 are both connected to the slave station data transceiver unit 22. The slave station enabling unit 21 is used to receive the enabling signal of the remote control unit 3. The slave station data transceiver unit 22 is used to communicate data with the master station data transceiver unit 12. The slave station data processing unit 23 is used to process address data. The address data processed by the slave station data processing unit 23 can provide an allocation basis for the master station address allocation unit 11 in the master station device 1, which can simplify the encoding process and reduce the difficulty of operation.

[0048] In some embodiments, the communication method between the remote control and the slave device is infrared remote control communication.

[0049] In some embodiments, the slave device further includes a slave storage unit, which is connected to the slave data transceiver unit and is used to store addresses to avoid repeated address allocation after power failure.

[0050] In some embodiments, the slave storage unit may be a Flash unit of the slave device.

[0051] In summary, the address allocation system provided in the embodiment of the present application can effectively avoid the impact of bus conflicts, simplify the encoding process, reduce the difficulty of operation, ensure that the slave station device can perform other normal operations without communication, facilitate automatic encoding, and improve communication flexibility.

[0052] Second, as Figure 2 As shown, an embodiment of the present application provides an address allocation method, which is applied to the address allocation system provided in the first aspect above, and the address of the slave device 2 is initially a threshold address. The address allocation method includes the following steps:

[0053] Step 201 , the master station device 1 obtains the total number n of multiple slave station devices 2 and sends address data.

[0054] The total number n of the slave devices 2 is obtained so as to be used by the master device 1 to determine the address data to be sent initially.

[0055] In some embodiments, the master station device 1 obtains the total number n of the plurality of slave station devices 2 through the master station data transceiver unit 12 and sends address data.

[0056] In some embodiments, the master data transceiver unit 12 of the master device 1 sends the acquired total number n of the plurality of slave devices 2 to the master address allocation unit 11 so that the master address allocation unit 11 allocates addresses.

[0057] Step 202: performing an address allocation process, the address allocation process includes:

[0058] (1) After a slave device 2 receives an enable signal sent by the remote control unit 3, it turns on the receiving and sending enable. The slave device 2 with the receiving and sending enabled receives the address data sent by the master device 1 and updates its own address to the address data sent by the master device 1.

[0059] The condition for the slave device 2 to start receiving and sending is to receive the enable signal sent by the remote control 3, which effectively avoids the influence of bus conflicts, ensures that the slave device can perform other normal work without communication, and facilitates automatic encoding, improving communication flexibility. After receiving the address data sent by the master device 1, update its own address to the address data sent by the master device 1, thereby completing the allocation of the master device 1 to the slave device 2.

[0060] In some embodiments, the master station device 1 sends address data to the first signal line 4 through the master station data transceiver unit 12 to be received by the slave station device 2 connected to the first signal line 4 .

[0061] In some embodiments, the master address allocating unit 11 of the master device 1 determines the address data initially sent to the slave device 2 according to the difference threshold, the total number n of the plurality of slave devices 2 and the stop threshold.

[0062] In some embodiments, the master address allocation unit 11 sends the determined address data to the master data transceiver unit 12 , which then sends it to the first signal line 4 to be received by the slave data transceiver unit 22 of the slave device 2 .

[0063] In some embodiments, the slave device 2 receives the enable signal sent by the remote control 3 through the slave enabling unit 21 , and receives the address data sent by the master device 1 to the first signal line 4 through the slave data transceiver unit 22 .

[0064] (2) After completing the update of its own address, the slave device 2 that has enabled receiving and sending performs a subtraction process on the value contained in its own address to obtain updated address data, and sends the updated address data to the master device 1.

[0065] The slave device 2 with reception and transmission enabled performs subtraction processing on the value contained in its own address to obtain updated address data, which can provide allocation basis for the master device 1, simplify the encoding process and reduce the difficulty of operation.

[0066] In some embodiments, the master station device 1 receives the updated address data through the master station data transceiver unit 12, and sends the address data to the master station address allocation unit 11 to allocate the address to the next slave station device 2 to be allocated.

[0067] In some embodiments, the slave device 2 performs subtraction processing on the value contained in its own address through the slave data processing unit 23, and sends the updated address data to the second signal line 5 through the slave data transceiver unit 22, waiting for the master device 1 to receive the updated address data.

[0068] In some embodiments, the slave device 2 with receiving and sending enabled performs subtraction processing on the value contained in its own address to obtain updated address data, including:

[0069] The slave device 2 with the receiving and sending enabled subtracts the difference threshold from the value contained in its own address to obtain address update data.

[0070] By subtracting the difference threshold from the value contained in its own address, the master device 1 can be provided with an allocation basis to obtain the address data to be allocated to the next slave device 2, thereby simplifying the encoding process and reducing the difficulty of operation.

[0071] (3) After receiving the updated address data, the master station device 1 sends the address data, and the address data sent is the updated address data.

[0072] The master device 1 sends the updated address data, and the slave device 2 with reception and transmission enabled will receive the updated address data. The next slave device 2 with reception and transmission enabled will also receive the updated address data, thereby enabling the address allocation of the next slave device 2.

[0073] In some embodiments, the master address allocation unit 11 of the master device 1 sends the updated address data to the master data transceiver unit 12 , and the master data transceiver unit 12 sends the updated address data to the first signal line 4 .

[0074] (4) In response to the value contained in the address data received by the slave station device 2 with the receiving and sending enabled being smaller than the value contained in the address of the slave station device 2 with the receiving and sending enabled, the slave station device 2 with the receiving and sending enabled turns off the sending enable.

[0075] In some embodiments, since the master station device 1 sends data to the slave station device 2 through the first signal line 4, when the master station device 1 sends data to the first signal line 4, the slave station devices 2 that are connected to the first signal line 4 and have the receiving and sending enabled can all receive the data sent by the master station device 1. Therefore, in order to avoid bus communication conflicts and prevent multiple slave station devices 2 from being assigned the same address data, it is necessary to turn off the sending enable of the slave station device 2 that has completed the address allocation, and turn on the receiving and sending enable of the next slave station device 2 to be assigned an address through the remote control 3.

[0076] If the value contained in the address data received by the slave device 2 with the receiving and sending enabled is smaller than the value contained in the address of the slave device 2 with the receiving and sending enabled, it means that the address of the slave device 2 has been successfully allocated and the address data to be received by the next slave device 2 with the address to be allocated has also been successfully generated and sent. The slave device 2 can turn off the sending enable and start the address allocation of the next slave device 2.

[0077] Step 203 , the address allocation process is repeatedly performed until the value contained in the updated address data received by the master device 1 is the stop threshold, and the address allocation of all slave devices 2 is completed.

[0078] Repeat the address allocation process, that is, repeat from step (1), after the next slave station device 2 receives the enable signal sent by the remote control component 3, it turns on the receiving and sending enable, receives the address data sent by the master station device 1, and continues the address allocation.

[0079] It should be noted that two conditions are required to enable the address allocation of the next slave device 2. One condition is that the slave device 2 starts receiving and sending after receiving the enable signal sent by the remote control 3. The other condition is that the master device 1 sends address data.

[0080] When the value contained in the updated address data received by the master device 1 is the stop threshold, it indicates that the address allocation of all slave devices 2 has been completed.

[0081] In some embodiments, after the slave station device 2 with reception and transmission enabled receives the address data sent by the master station device 1 and updates its own address to the address data sent by the master station device 1, the address allocation process also includes: the slave station device 2 with reception and transmission enabled stores the address data sent by the master station device 1.

[0082] In some embodiments, the address allocation method further includes: (1) after completing the address allocation of all slave devices 2, the master device 1 sends a start-send enable flag, which can notify all slave devices 2 that the address allocation is completed and can enable the send enable of all slave devices 2 to communicate between the master device 1 and multiple slave devices 2. (2) after the slave device 2 receives the start-send enable flag, the slave device 2 turns on the send enable to prepare for communication.

[0083] In some embodiments, in response to the fact that the value contained in the address data received by the slave device 2 with reception and transmission enabled is less than the value contained in the address of the slave device 2 with reception and transmission enabled, the slave device 2 with reception and transmission enabled turns off the transmission enable, including: (1) the slave device 2 with reception and transmission enabled starts to detect whether the value contained in the received address data is less than the value contained in the address of the slave device 2 with reception and transmission enabled. (2) when it is detected that the value contained in the received address data is less than the value contained in the address of the slave device 2 with reception and transmission enabled, the slave device 2 with reception and transmission enabled turns off the transmission enable. The value obtained by adding n times the difference threshold to the stop threshold is equal to the value contained in the address data initially sent by the master device 1, and the value contained in the threshold address is less than the stop threshold.

[0084] It should be noted that the value obtained by adding n times the difference threshold to the stop threshold is equal to the value contained in the address data initially sent by the master device 1, so the received address data must be greater than its own address data (threshold address), so the stop threshold is smaller than the value contained in the received address data.

[0085] The slave devices 2 that have enabled receiving and sending may include the slave devices 2 that have been assigned addresses and the slave devices 2 that are to be assigned addresses. Both of these slave devices 2 will detect whether the value contained in the received address data is less than the value contained in the address of the slave device 2 that has enabled receiving and sending. In this case, it is necessary to turn off the sending enable of the slave device 2 that has been assigned addresses but not the sending enable of the slave device 2 that is to be assigned addresses. In addition, the address of the slave device 2 that is to be assigned addresses is initially the threshold address. Therefore, the value after adding the difference threshold n times to the stop threshold is set to be equal to the value contained in the address data initially sent by the master device 1, and the value contained in the threshold address is less than the stop threshold, so that the value contained in the address data received by the slave device 2 that is to be assigned addresses is greater than the value contained in its own address, and does not meet the detection condition of turning off the sending enable, thereby ensuring that the slave device 2 that is to be assigned addresses can be assigned addresses smoothly.

[0086] In some embodiments, the address allocation method further includes:

[0087] After the slave device 2 receives the start-send enable flag, the slave device 2 stops executing the detection process, which includes detecting whether the value contained in the received address data is smaller than the value contained in its own address, and stops executing the detection process to perform other work.

[0088] For example, the initial address of the slave device 2 is 0 (the value contained in the threshold address), the total number is 4, the difference threshold is set to 1, and the stop threshold is set to 0. (1) The master device 1 obtains the total number 4 of the multiple slave devices 2 and sends the address data 4; (2) After the first slave device 2 receives the enable signal sent by the remote control 3, it turns on the receiving and sending enable. The first slave device 2 that turns on the receiving and sending enable can receive the address data 4 sent by the master device 1 and update its own address to 4; (3) After completing the update of its own address, the slave device 2 performs a subtraction process on 4, subtracts 1 from 4, obtains the updated address data 3, and sends the updated address data 3 to the master device 1. 3; (4) after the master device 1 receives the updated address data 3, it sends the address data 3; (5) in response to the fact that the address data 3 received by the first slave device 2 that has enabled reception and transmission is less than its own address 4, the first slave device 2 that has enabled reception and transmission turns off the transmission enable; (6) after the second slave device 2 receives the enable signal sent by the remote control 3, it turns on the reception and transmission enable. The second slave device 2 that has enabled reception and transmission can receive the address data 3 sent by the master device 1 and update its own address to 3; (7) after completing the update of its own address, the slave device 2 performs a subtraction process on 3, subtracts 1 from 3, and obtains the updated address. (8) After receiving the updated address data 2, the master device 1 sends the address data 2; (9) In response to the second slave device 2 that has the receiving and sending enabled enabled receiving address data 2 received being less than its own address 3, the second slave device 2 that has the receiving and sending enabled enabled turning off the sending enable; (10) After the third slave device 2 receives the enable signal sent by the remote control 3, it turns on the receiving and sending enable. The third slave device 2 that has the receiving and sending enabled enabled can receive the address data 2 sent by the master device 1 and update its own address to 2; (11) After completing the update of its own address, the slave device 2 Subtract 2, subtract 1 from 2, obtain updated address data 1, and send the updated address data 1 to the master device 1; (12) after receiving the updated address data 1, the master device 1 sends the address data 1; (13) in response to the third slave device 2 that has enabled reception and transmission, receiving address data 1 less than its own address 2, the third slave device 2 that has enabled reception and transmission turns off the transmission; (14) after receiving the enable signal sent by the remote control 3, the fourth slave device 2 that has enabled reception and transmission can receive the address data 1 sent by the master device 1 and update its own address to 1;(15) After completing the update of its own address, the slave device 2 performs a subtraction process on 1, subtracts 1 from 1, obtains the updated address data 0, and sends the updated address data 0 to the master device 1; (16) In response to the master device 1 receiving the updated address data 0 as the stop threshold, the address allocation of the four slave devices 2 is completed; (17) After completing the address allocation of all slave devices 2, the master device 1 sends a start-send enable flag; after the slave device 2 receives the start-send enable flag, the slave device 2 turns on the send enable; (18) After the slave device 2 receives the start-send enable flag, the slave device 2 stops executing the detection process, and the detection process includes detecting whether the value contained in the received address data is less than the value contained in its own address. ;

[0089] In summary, this address allocation method can effectively avoid the impact of bus conflicts, simplify the encoding process, reduce the difficulty of operation, ensure that the slave device can perform other normal work without communication, facilitate automatic encoding, and improve communication flexibility.

[0090] In a third aspect, the present application provides a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the address allocation method provided in the second aspect is implemented.

[0091] The non-volatile computer readable medium includes, but is not limited to, any type of disk (including floppy disk, hard disk, optical disk, CD-ROM, and magneto-optical disk), ROM, RAM, EPROM (Erasable Programmable Read-Only Memory), EEPROM, flash memory, magnetic card or optical card. In other words, the readable medium includes any medium that can store or transmit information in a readable form by a device (e.g., a computer).

[0092] The non-volatile computer-readable storage medium provided in the embodiment of the present application has the same inventive concept as the embodiments described above. The contents not shown in detail in the non-volatile computer-readable storage medium can be referred to the embodiments described above and will not be repeated here.

[0093] In the present application, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance. The term "plurality" refers to two or more than two, unless otherwise clearly defined.

[0094] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the present application disclosed herein. The present application is intended to cover any variations, uses or adaptations of the present application, which follow the general principles of the present application and include common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only.

[0095] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. Address allocation system, It is characterized in that The address distribution system comprises a master station device (1), a plurality of slave station devices (2) and a remote control unit (3), wherein the master station device (1) is connected to the plurality of slave station devices (2) via a first signal line (4) and a second signal line (5), and the remote control unit (3) is signal-connected to the plurality of slave station devices (2); The master station device (1) comprises a master station address allocation unit (11) and a master station data transceiver unit (12), wherein the master station address allocation unit (11) and the master station data transceiver unit (12) are connected, the master station address allocation unit (11) is used to allocate address data, and the master station data transceiver unit (12) is used to receive and send data; The slave station devices (2) each comprise a slave station enabling unit (21), a slave station data transceiving unit (22) and a slave station data processing unit (23); the slave station enabling unit (21) is connected to the remote control device (3) signal and the slave station data transceiving unit (22); the slave station data processing unit (23) and the master station data transceiving unit (12) are connected to the slave station data transceiving unit (22); the slave station enabling unit (21) is used to receive an enabling signal from the remote control device (3); the slave station data transceiving unit (22) is used to perform data communication with the master station data transceiving unit (12); and the slave station data processing unit (23) is used to process address data; The communication mode between the remote control component (3) and the slave station device (2) is infrared remote control communication, and the remote control component (3) is used to send an enable signal to the slave station device 2 to be assigned an address.

2. The address allocation system according to claim 1, It is characterized in that The slave station device (2) further comprises a slave station storage unit (24), wherein the slave station storage unit (24) is connected to the slave station data transceiver unit (22) and is used for storing addresses.

3. Address allocation method, It is characterized in that The address allocation method is applied to the address allocation system according to claim 1, the address of the slave device (2) itself is initially a threshold address, and the address allocation method comprises: The master device (1) obtains the total number n of the plurality of slave devices (2) and sends address data; An address allocation process is performed, the address allocation process comprising: After a slave device (2) receives an enable signal sent by the remote control unit (3), it starts receiving and sending, and the slave device (2) that starts receiving and sending receives the address data sent by the master device (1), and updates its own address to the address data sent by the master device (1); After completing the update of its own address, the slave device (2) with reception and transmission enabled performs a subtraction process on the value contained in its own address to obtain updated address data, and sends the updated address data to the master device (1); After the master station device (1) receives the updated address data, it sends the address data, where the sent address data is the updated address data; In response to the value contained in the address data received by the slave device (2) with the reception and transmission enabled being smaller than the value contained in the address of the slave device (2) with the reception and transmission enabled, the slave device (2) with the reception and transmission enabled turns off the transmission enable; The address allocation process is repeatedly performed until the value contained in the updated address data received by the master device (1) is the stop threshold, and the address allocation of all slave devices (2) is completed.

4. The address allocation method according to claim 3, It is characterized in that The slave device (2) with the receiving and sending enabled performs a subtraction process on the value contained in its own address to obtain updated address data, including: The slave device (2) with reception and transmission enabled subtracts the difference threshold from the value contained in its own address to obtain the address update data.

5. The address allocation method according to claim 3, It is characterized in that After the slave device (2) with receiving and sending enabled receives the address data sent by the master device (1) and updates its own address to the address data sent by the master device (1), the address allocation process further includes: The slave device (2) with reception and transmission enabled stores the address data received and sent by the master device (1).

6. The address allocation method according to claim 3, It is characterized in that The address allocation method further comprises: After completing the address allocation of all slave devices (2), the master device (1) sends a flag to start the transmission enable bit; After the slave station device (2) receives the start-transmission enable flag, the slave station device (2) starts transmission enable.

7. The address allocation method according to claim 4, It is characterized in that In response to the value contained in the address data received by the slave station device (2) with the reception and transmission enabled being smaller than the value contained in the address of the slave station device (2) with the reception and transmission enabled being turned off, the slave station device (2) with the reception and transmission enabled being turned off, comprising: The slave device (2) that starts receiving and sending enables detects whether a value included in the received address data is smaller than a value included in the address of the slave device (2) that starts receiving and sending enables; When it is detected that the value contained in the received address data is smaller than the value contained in its own address, the slave device (2) that has enabled receiving and sending turns off the sending enable; The value obtained by adding n times the difference threshold to the stop threshold is equal to the value contained in the address data initially sent by the master station device (1), and the value contained in the threshold address is smaller than the stop threshold.

8. The address allocation method according to claim 7, It is characterized in that The address allocation method further comprises: After the slave device (2) receives the start-send enable flag, the slave device (2) stops executing a detection process, wherein the detection process includes detecting whether a value included in the received address data is smaller than a value included in its own address.

9. A non-volatile computer-readable storage medium, It is characterized in that The non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the address allocation method according to any one of claims 3 to 8 is implemented.