An indoor unit address allocation method for a multi-connected air conditioner

By using the hash conversion of the internal unit to generate candidate IP addresses in multiple online air conditioning systems, combined with CAN bus conflict detection and priority adjustment, the problem of inefficient address allocation is solved and efficient internal unit address allocation is achieved.

CN120074980BActive Publication Date: 2025-07-08GUANGDONG SANHUA VANADIUM SOUND TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510541073.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-28
Publication Date
2025-07-08
Estimated Expiration
2045-04-28

AI Technical Summary

Technical Problem

In the prior art, multiple online air conditioning systems are prone to CAN bus traffic collisions and high repetition rate of RS485 bus random number address generation when allocating internal addresses, resulting in insufficiency or unsuccessful address allocation.

Method used

Each internal unit reads a unique MAC address for hash conversion to generate candidate IP addresses, and detects conflicts through the CAN bus, dynamically adjusts priority and sets the sending slot node to avoid conflicts and improves address allocation efficiency.

Benefits of technology

By reducing the IP address duplication rate and dynamic adjustment of priority, the conflict problem of internal computer address allocation is solved, and the efficiency and success rate of address allocation are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120074980B_ABST
    Figure CN120074980B_ABST
Patent Text Reader

Abstract

The present invention provides an indoor unit address allocation method for a multi-connected air conditioner, which relates to the field of indoor unit address allocation for air conditioners; this method includes inputting a unique MAC address into a hash function to obtain a conversion value, and converting the conversion value into a candidate IP address; the indoor unit accesses the CAN bus and sends a data packet to the outdoor unit; the CAN bus detects whether there is a bit conflict, and the outdoor unit confirms whether the IP address is occupied by a conflict; when a conflict occurs, a backoff operation, a CAN bus arbitration operation, and a sending time slot setting operation are executed; the present invention obtains an IP address through hash conversion of the unique MAC address of the indoor unit, reduces the IP repetition rate by means of dispersing IP addresses, calculates the retry waiting time after the conflict of the indoor unit through the number of conflicts and dynamically adjusts the priority to solve the problem of simultaneous conflicts of indoor units, and completely avoids conflicts by setting a sending time slot node, thereby improving the efficiency and success rate of indoor unit address allocation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of address allocation for air conditioner indoor units, and particularly relates to a method for allocating addresses for indoor units of a multi-connected air conditioner. Background Art

[0002] A multi-connected air conditioner is a central air conditioning system in which one outdoor unit is connected to multiple indoor units. Therefore, it is necessary to construct a system with a centralized control host (air conditioner outdoor unit) and multiple slave units (air conditioner indoor units). In the system, the outdoor unit needs to allocate a unique and valid address to the connected indoor units.

[0003] In the prior art, communication between the indoor unit and the outdoor unit is carried out through the RS485 bus or the CAN bus. For a system using the CAN bus for communication, the CAN bus indoor unit address allocation technology mainly involves the indoor unit generating a candidate IP address using a unique MAC address. The indoor unit applies to the outdoor unit through the contention mechanism of the CAN bus with the candidate IP address. The outdoor unit confirms whether the candidate IP address is available. If available, it notifies the indoor unit that the IP allocation is successful. The RS485 bus is a half-duplex communication method, and the indoor unit uses random number allocation. That is, after the outdoor unit is powered on, it sends a command to generate a random number to the indoor unit. The indoor unit obtains the command from the outdoor unit and executes the generation of the random number address. After the outdoor unit delays and waits for the indoor unit to complete the generation of the random number address, it allocates the indoor unit IP address by calling the random number address.

[0004] The above two address allocation methods both have defects:

[0005] 1. When multiple indoor units apply for addresses to the outdoor unit at the same time point, a CAN bus line occupation conflict will occur. After the conflict occurs, the indoor units that have not been allocated addresses will apply to the outdoor unit again at the same time, resulting in repeated conflicts, an endless loop of repeated applications and repeated conflicts, and thus leading to low efficiency of indoor unit address allocation or unsuccessful indoor unit address allocation;

[0006] 2. The RS485 bus uses random number address generation, and the random numbers will cause too high a repetition rate of the generated addresses, and it is necessary to continuously verify and regenerate the random number addresses.

[0007] Therefore, for a multi-connected air conditioner system, how to efficiently allocate addresses to indoor units and avoid conflicts when indoor units apply for addresses is a problem that needs to be solved currently. Summary of the Invention

[0008] In view of the problems raised in the background art, the present invention proposes a method for allocating addresses for indoor units of a multi-connected air conditioner.

[0009] To achieve this purpose, the present invention adopts the following technical solutions:

[0010] An indoor unit address allocation method for a multi-connected air conditioner. Step A: When multiple air conditioner indoor units are powered on, each indoor unit reads the burned unique MAC address, inputs the unique MAC address into a hash function to obtain a conversion value, and converts the conversion value into a candidate IP address;

[0011] Step B: The indoor unit accesses the CAN bus and sends a data packet to the outdoor unit. The data packet includes the candidate IP address and the unique MAC address;

[0012] Step C: When the indoor unit executes Step B, the CAN bus detects whether there is a bit conflict. If so, the indoor unit enters Step E; if not, it executes Step D;

[0013] Step D: The outdoor unit confirms whether the candidate IP address is occupied through the data packet. If it is not occupied, the outdoor unit sends a confirmation signal to the indoor unit and stores the unique MAC address and the candidate IP address of the indoor unit. After receiving the confirmation signal, the indoor unit locks the candidate IP address and writes it into the non-volatile memory;

[0014] If the candidate IP address is occupied, the outdoor unit sends a signal to the indoor unit to regenerate the candidate IP, and the indoor unit enters Step E;

[0015] Step E: Perform a backoff operation: The conflicting indoor units can only re-access the CAN bus after the waiting time ends;

[0016] Perform a CAN bus arbitration operation: When multiple indoor units access the CAN bus simultaneously, it is judged whether there are indoor units that have not had a conflict. If so, the CAN bus allows all indoor units that have not had a conflict to access the CAN bus and execute Step B; if not, the CAN bus compares the priorities of all indoor units accessing this time, allows the indoor unit with the highest priority to access the CAN bus, cancels the access of other indoor units this time and determines the access of other indoor units as a conflict, and other indoor units re-enter Step E;

[0017] Perform a set transmission time slot operation: When a conflicting indoor unit is allowed to access the CAN bus, the conflicting indoor unit needs to set a transmission time slot node and send a data packet to the outdoor unit at the transmission time slot node.

[0018] Preferably, in Step A, it includes:

[0019] Step A1: Divide the unique MAC address into four conversion intervals from left to right, with every three hexadecimal digits in each interval. In the first and second conversion intervals, respectively, fix the first two hexadecimal digits and input them into the hash function to obtain a first conversion value and a second conversion value. In the third and fourth conversion intervals, respectively, arbitrarily take two hexadecimal digits and input them into the hash function to obtain a third conversion value and a fourth conversion value. All the obtained conversion values are four-digit hexadecimal numbers;

[0020] Step A2: Take the last two hexadecimal digits of all conversion values, convert them to decimal digits to obtain four IP fields, and combine the four IP fields to form a candidate IP address.

[0021] Preferably, before performing the said Step B, the following steps are further included:

[0022] Set a conflict counter and initial parameters for the internal unit cache. The initial parameters include the candidate IP address, the number of times of the conflict counter, and the initial priority value. Initially, the number of times of the conflict counter is zero;

[0023] The conflict counter is used to record the number of times the internal unit retries due to conflicts;

[0024] The initial priority value is used for the CAN bus arbitration operation. The CAN bus determines the priority of the internal unit according to the initial priority value. The initial priority value is the last hexadecimal digit of the unique MAC address;

[0025] When performing the said Step B, the internal unit accesses the CAN bus and sends a data packet to the external unit. The data packet also includes the initial priority value.

[0026] Preferably, in the said Step E, performing the backoff operation includes:

[0027] When a conflict occurs in the internal unit, update the number of times of the conflict counter of the internal unit, calculate the waiting time of the internal unit according to Formula 1, and the internal unit can re-access the CAN bus only after the waiting time ends;

[0028] --Formula 1;

[0029] represents the waiting duration of the internal unit;

[0030] represents the basic waiting unit duration, which is a preset value;

[0031] n represents the updated number of times of the conflict counter;

[0032] When the waiting duration of the internal unit exceeds the preset allowed waiting value, reset the number of times of the conflict counter of the internal unit to zero.

[0033] Preferably, in the said Step E, performing the CAN bus arbitration operation includes:

[0034] When multiple indoor units are connected to the CAN bus simultaneously, if there is no indoor unit that has not experienced a conflict, the initial priority values of all the indoor units connected this time are updated according to the following Formula 2. The CAN bus compares the priorities of the indoor units based on the updated priority values, allows the indoor unit with the highest priority to access the CAN bus, cancels the access of other indoor units this time and determines that a conflict has occurred, updates the number of times of the conflict counter, and re-enters Step E;

[0035] Among them, the larger the priority value of an indoor unit, the lower its priority;

[0036] --Formula 2;

[0037] represents the updated priority value;

[0038] represents the unupdated priority value;

[0039] represents the binary number of the value of the conflict counter after update;

[0040] m represents the number of bits shifted to the left, which is a preset constant.

[0041] Preferably, in the said Step E, performing the set transmission time slot operation includes:

[0042] After an indoor unit that has experienced a conflict is allowed to access the CAN bus, the indoor unit that has experienced a conflict sets the transmission time slot node according to Formula 3 and sends a data packet to the outdoor unit at the transmission time slot node;

[0043] --Formula 3;

[0044] represents the set transmission time slot node, and the indoor unit that has experienced a conflict sends a data packet to the outdoor unit at this transmission time slot node;

[0045] represents the IP field value obtained from the fourth conversion value;

[0046] represents a preset byte constant, which is 64 or 8;

[0047] % represents taking the remainder;

[0048] represents the unit basic time slot divided within a time slot;

[0049] n represents the number of times of the conflict counter after update;

[0050] represents the length of the time slot unit that needs to be increased after a conflict occurs.

[0051] Preferably, in the step D, the external unit sending a confirmation signal back to the internal unit includes:

[0052] The validity period of the corresponding IP address.

[0053] Preferably, in the step D, after the internal unit locks the candidate IP address and writes it into the non-volatile memory, it further includes:

[0054] The internal unit sends a heartbeat packet to the external unit once every preset time interval. When the external unit does not receive the heartbeat packet within the preset number of times, it is determined that the IP address of the internal unit is invalid, and the internal unit needs to re-execute steps A to E.

[0055] Advantages of the present invention over the prior art:

[0056] The present invention obtains the IP address through hash conversion of the unique MAC address of the internal unit, reduces the IP duplication rate by means of dispersing the IP address, calculates the retry waiting time after the internal unit conflicts and dynamically adjusts the priority through the number of conflicts to solve the problem of simultaneous conflicts of the internal units, and completely avoids conflicts by setting the sending time slot nodes, thereby improving the efficiency and success rate of the internal unit address allocation. Brief Description of the Drawings

[0057] Figure 1 is a flowchart of the internal unit address allocation method of the multi-connected air conditioner of the present invention;

[0058] Figure 2 is a schematic diagram of whether there is an IP address occupancy conflict in an embodiment of the present invention;

[0059] Figure 3 is a schematic diagram of performing a backoff operation in an embodiment of the present invention;

[0060] Figure 4 is a schematic diagram of performing a backoff operation in another embodiment of the present invention;

[0061] Figure 5 is a schematic diagram of performing a CAN bus arbitration operation in an embodiment of the present invention;

[0062] Figure 6 is a schematic diagram of performing a CAN bus arbitration operation in another embodiment of the present invention. Detailed Embodiments

[0063] The technical solution of the present invention will be further described below in conjunction with the drawings and through specific embodiments.

[0064] To enable those skilled in the art to better understand the solution of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative work belong to the scope of protection of the present invention.

[0065] The terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, device, product or terminal that includes a series of steps or units is not limited to the listed steps or units, but optionally further includes steps or units not listed, or optionally further includes other steps or units inherent to these processes, methods, products or terminals.

[0066] Referring to "embodiments" herein means that specific features, structures, or characteristics described in connection with the embodiments can be included in at least one embodiment of the present invention. The phrase appears in various places in the specification and does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. Those skilled in the art will explicitly and implicitly understand that the embodiments described herein can be combined with other embodiments.

[0067] This application proposes a method for allocating internal unit addresses for a multi-connected air conditioner, as Figure 1 shown, step A: When multiple air conditioner internal units are powered on, each internal unit reads the burned-in unique MAC address, inputs the unique MAC address into a hash function to obtain a conversion value, and converts the conversion value into a candidate IP address;

[0068] Preferably, in the said step A, it includes:

[0069] Step A1: Divide the unique MAC address into four conversion intervals with every three hexadecimal digits from left to right. In the first and second conversion intervals, respectively, fix the first two hexadecimal digits and input them into the hash function to obtain the first conversion value and the second conversion value. In the third and fourth conversion intervals, respectively, arbitrarily take two hexadecimal digits and input them into the hash function to obtain the third conversion value and the fourth conversion value. All the obtained conversion values are four-digit hexadecimal numbers;

[0070] Step A2: Take the last two hexadecimal digits of all the conversion values, convert them into decimal digits to obtain four IP fields, and combine the four IP fields to form a candidate IP address.

[0071] In this embodiment, the method generates candidate IP addresses based on the unique MAC address of each indoor unit, which can significantly reduce the problem of excessive repetition rate of the generated IP addresses. In actual production, the unique MAC address of each indoor unit consists of 12 hexadecimal digits. The first six digits represent the unique identification code of the air conditioner manufacturer. Through the first six digits, the manufacturer of the air conditioner can be known, and the last six digits represent the unique identification code of this indoor unit. Specifically, after obtaining the unique MAC address, the method will get 12 hexadecimal digits. These 12 hexadecimal digits are divided into one conversion interval every three hexadecimal digits in the order from left to right, resulting in a total of four conversion intervals. We will obtain the four fields of the IP address from these four conversion intervals. For the digits in the first conversion interval and the second conversion interval, the first two hexadecimal digits of each conversion interval are fixedly taken and input into the hash function to obtain the first conversion value and the second conversion value. Therefore, the first six digits represent the unique identification code of the air conditioner manufacturer. Therefore, no matter which indoor unit it is, the first six digits are the same. So we fixedly take the first, second, fourth, and fifth digits as the first two fields of the IP address. For the third conversion interval and the fourth conversion interval, we randomly select any two digits in each interval and input them into the hash function to obtain the third conversion value and the fourth conversion value. The hash function used to convert the MAC address into a conversion value is a prior art. Which hash function is actually adopted depends on actual production. An embodiment will be used as an explanation below;

[0072] For example, a MAC address: "00-7B-89-66-2C-2B-00-1A-3B-12-34-56", "00-7B-89" corresponds to the first conversion interval, "66-2C-2B" corresponds to the second conversion interval, "00-1A-3B" corresponds to the third conversion interval, and "12-34-56" corresponds to the fourth conversion interval. The first conversion interval fixedly takes "00-7B", the second conversion interval fixedly takes "66-2C", any two are taken from the third conversion interval, such as "1A-3B", and any two are taken from the fourth conversion interval, such as "34-56"; The digits obtained from each conversion interval are input into the hash function for shift or exclusive OR operations to obtain the first conversion value as 0X00C0, the second conversion value as 0X80A8, the third conversion value as 0x1A55, and the fourth conversion value as 0XA5B3. Take the last two hexadecimal digits of each conversion value and convert them into decimal digits. The first conversion value takes C0 and is converted to 192, the second conversion value takes A8 and is converted to 168, the third conversion value takes 55 and is converted to 85, and the fourth conversion value takes B3 and is converted to 179. After combination, the candidate IP address is 192.168.85.179;

[0073] The actual code of the hash function in one embodiment is expressed as: "mac_part = 0x3456 / / 0x represents hexadecimal, taking any two values from the fourth conversion range, 34 - 56;

[0074] hash_val = (mac_part << 8) ^ (mac_part >> 4) / / Obtain 0xA5B3 through exclusive OR operation after shifting left by 8 bits and shifting right by 4 bits;

[0075] ip_candidate = hash_val & 0xFF / / Take the last two hexadecimal digits and convert them to a decimal number as the IP field, that is, B3 is converted to 179".

[0076] In another embodiment, since the first six digits of the MAC address are fixed, only the last three digits can be converted. That is, the first three fields of the IP addresses obtained by converting all indoor units from the first conversion range to the third conversion range are fixed, and only the numbers in the fourth conversion range are subjected to hash conversion to obtain the last field of the IP address. This method is the most labor-saving. However, if the goal is to minimize the repetition rate of IP addresses, it is still necessary to convert the last six digits.

[0077] Step B: The indoor unit accesses the CAN bus and sends a data packet to the outdoor unit. The data packet includes the candidate IP address and the unique MAC address;

[0078] Preferably, before performing the said Step B, the following steps are further included:

[0079] Set a conflict counter, and the indoor unit caches the initial parameters. The initial parameters include the candidate IP address, the number of times of the conflict counter, and the initial priority value. Initially, the number of times of the conflict counter is zero;

[0080] The conflict counter is used to record the number of times the indoor unit retries due to conflicts;

[0081] The initial priority value is used for the CAN bus arbitration operation. The CAN bus determines the priority of the indoor unit according to the initial priority value. The initial priority value is the last hexadecimal digit of the unique MAC address;

[0082] When performing the said Step B, the indoor unit accesses the CAN bus and sends a data packet to the outdoor unit. The data packet also includes the initial priority value.

[0083] In this embodiment, after all indoor units obtain the candidate IP addresses, they need to cache the initial parameters, which include the candidate IP address, the number of times of the conflict counter, and the initial priority value. Among them, the conflict counter is used to record the number of times of subsequent conflicts of indoor units. Initially, the number of times of the conflict counter is 0. After a conflict occurs, the number of times of the conflict counter is updated to 1. The initial priority value takes the last hexadecimal digit of the unique MAC address. For example, in the above embodiment, for the unique MAC address "00-7B-89-66-2C-2B-00-1A-3B-12-34-56", the last hexadecimal digit is 56, so the initial priority value is represented in hexadecimal notation as 0x5600.

[0084] After all indoor units are connected to the CAN bus, they need to send data packets to the outdoor unit to let the outdoor unit verify whether the IP is available. The content format of the data packet can be expressed as:

[0085]

[0086] Step C: When the indoor unit executes Step B, the CAN bus detects whether there is a bit conflict. If so, the indoor unit enters Step E; if not, it executes Step D.

[0087] In this embodiment, when the CAN bus detects a bit conflict, it means that multiple indoor units send data packets simultaneously, resulting in abnormal levels. This situation means that a conflict occurs during the process of multiple indoor units competing for resources. For the indoor units that have conflicts, they need to cancel the sending, exit the CAN bus, and execute the operations in Step E. If no bit conflict is detected, it means that all indoor units have smoothly sent the data packets to the outdoor unit. At this time, only need to wait for the outdoor unit to verify whether the candidate IP address in the data packet is occupied.

[0088] Step D: The outdoor unit confirms whether the candidate IP address is occupied through the data packet. If it is not occupied, the outdoor unit sends a confirmation signal to the indoor unit and stores the unique MAC address and the candidate IP address of the indoor unit. After receiving the confirmation signal, the indoor unit locks the candidate IP address and writes it into the non-volatile memory.

[0089] If the candidate IP address is occupied, the outdoor unit sends a signal to the indoor unit to regenerate a candidate IP, and the indoor unit enters Step E.

[0090] In this embodiment, as Figure 2 shown, when the outdoor unit verifies that the candidate IP address in the data packet is not occupied by other indoor units, the outdoor unit sends an ACK confirmation signal to the indoor unit. The outdoor unit associates and stores the unique MAC address and the candidate IP address of the indoor unit. After receiving the ACK confirmation signal, the indoor unit locks the candidate IP address and writes it into the non-volatile memory, such as EEPROM. In this way, when the indoor unit is powered off and restarted, it will also first try to read and use the previously allocated IP from the non-volatile memory.

[0091] If the candidate IP address is occupied, the outdoor unit sends a signal to the indoor unit to regenerate the candidate IP. The indoor unit needs to regenerate a new candidate IP address and recognize this application as a conflict, and then needs to enter step E.

[0092] Preferably, in the said step D, the outdoor unit's reply of the confirmation signal to the indoor unit includes:

[0093] The validity period of the corresponding IP address.

[0094] In this embodiment, the content of the confirmation frame of the ACK confirmation signal can be:

[0095] [Allocated IP = 192.168.85.179 | Validity period = 24 hours | CRC check code];

[0096] By setting a validity period for the IP address, the occupation of valid addresses by "zombie devices" can be avoided.

[0097] Preferably, in the said step D, after the indoor unit locks the candidate IP address and writes it into the non-volatile memory, it further includes:

[0098] The indoor unit sends a heartbeat packet to the outdoor unit at preset intervals. When the outdoor unit does not receive a heartbeat packet within the preset number of times, it is determined that the IP address of the indoor unit is invalid, and the indoor unit needs to re-execute steps A to E.

[0099] In this embodiment, after the indoor unit locks the IP address, it will send a heartbeat packet to the outdoor unit at regular intervals. For example, it sends a heartbeat packet every 5 minutes (content: IP = 192.168.85.179 | Status normal). If the outdoor unit does not receive a heartbeat for 3 consecutive times (i.e., 15 minutes), it is determined that the IP address is invalid and the IP = 192.168.85.179 is recycled; in addition to preventing the occupation of valid addresses, the heartbeat packet can also be used for network status monitoring.

[0100] Step E: Perform a backoff operation: The indoor unit with a conflict needs to wait until the waiting time ends before it can reconnect to the CAN bus;

[0101] Specifically, when a conflict occurs in the indoor unit, update the number of times of the conflict counter of the indoor unit, calculate the waiting time of the indoor unit according to formula one, and the indoor unit can reconnect to the CAN bus only after the waiting time ends;

[0102] --Formula one;

[0103] Indicates the waiting duration of the indoor unit;

[0104] Indicates the basic waiting unit duration, which is a preset value;

[0105] n represents the number of times of the updated conflict counter;

[0106] When the waiting duration of the indoor unit exceeds the preset allowed waiting value, the number of times of the conflict counter of the indoor unit is reset to zero.

[0107] In this embodiment, when a conflict occurs or is recognized as a conflict after the indoor unit accesses the CAN bus, it will not immediately retry the access, but needs to wait for a period of time before retrying to access the CAN bus. Because if it accesses the bus immediately after a conflict occurs, it may cause additional conflicts to other indoor units that are accessing the bus. At the same time, the present application randomizes the retry time using the number of conflicts, which can effectively avoid the indoor units that have conflicts from retrying simultaneously.

[0108] For example Figure 3 As shown, after the indoor unit A and the indoor unit C collide and form a conflict when accessing the bus for the first time, the indoor unit A and the indoor unit C need to cancel the current transmission and wait for a period of time before retrying. According to Formula 1 The calculation is as follows. The basic waiting unit duration is preset to 5 ms according to the actual situation. When the indoor unit A has its first conflict and the updated number of conflict times n = 1, the waiting duration of the indoor unit A is , that is, the indoor unit A needs to wait for 10 ms before retrying to access the bus;

[0109] As Figure 4 shown, if Figure 3 the indoor unit A immediately accesses the bus after the first conflict, and then the indoor unit B accesses the bus for the first time, then the indoor unit A may collide with the indoor unit B and form an additional conflict, resulting in a situation where the indoor unit A has continuous conflicts and retries, causing itself to be unable to send data packets and affecting other indoor units such as the indoor unit B to send data packets.

[0110] Furthermore, when Figure 3 the indoor unit A has its first conflict and waits for 10 ms before accessing the bus for the second time, and at this time the indoor unit B accesses the bus for the first time, it is still possible that as Figure 4 shown, after the indoor unit A accesses the bus for the second time, it collides with the indoor unit B and forms a new conflict. This conflict is not an additional conflict. Then at this time, the indoor unit A needs to wait again, and the waiting duration is , that is, after the second conflict of the indoor unit A, it needs to wait for 20 ms before retrying to access the bus for the third time, and the indoor unit B is in its first conflict and needs to wait , before retrying to access the bus for the second time.

[0111] Further, when the waiting duration of the indoor unit A exceeds the preset allowable waiting value, it means that the number of conflicts of the indoor unit A is too large. For example, after the indoor unit A has 6 conflicts, the waiting duration is , and 160 ms exceeds the preset allowable waiting value, such as 100 ms. Since this waiting duration is too long, it will seriously affect the address allocation efficiency of the indoor unit A. Therefore, at this time, the number of conflicts of the indoor unit A needs to be reset to zero, and the indoor unit A only needs to wait . Subsequently, if the indoor unit A has a conflict again, the number of conflicts will increase to 1 again.

[0112] Execute the CAN bus arbitration operation: When multiple indoor units access the CAN bus at the same time, determine whether there is an indoor unit that has not had a conflict. If so, the CAN bus allows all indoor units that have not had a conflict to access the CAN bus and execute step B; if not, the CAN bus compares the priorities of all indoor units accessing this time, allows the indoor unit with the highest priority to access the CAN bus, cancels the access of other indoor units this time and determines the access of other indoor units as a conflict, and other indoor units re-enter step E;

[0113] Specifically, it includes: When multiple indoor units access the CAN bus at the same time, if there is no indoor unit that has not had a conflict, update the initial priority values of all indoor units accessing this time according to the following formula two. The CAN bus compares the priorities of indoor units according to the updated priority values, allows the indoor unit with the highest priority to access the CAN bus, cancels the access of other indoor units this time and determines it as a conflict, updates the number of times of the conflict counter, and re-enters step E;

[0114] Among them, the larger the priority value of the indoor unit, the lower the priority;

[0115] --Formula two;

[0116] represents the updated priority value;

[0117] represents the unupdated priority value;

[0118] represents the binary number of the updated number of times of the conflict counter;

[0119] m represents The number of bits shifted to the left, which is a preset constant.

[0120] In the prior art, the CAN bus has a built-in ID arbitration function. The CAN bus stipulates that the ID with a smaller value has a higher priority. Based on this, on the basis of the initial priority value, we calculate the priority value using the number of conflicts. The larger the priority value of the indoor unit, the lower the priority level. Therefore, in this embodiment, when multiple indoor units access the bus at the same time, there may be several situations, such asFigure 5 As shown in the figure, in Case 1, the indoor units accessing the bus this time include those that have had conflicts and those that have not had conflicts (first access). For this situation, the CAN bus only allows the indoor units that have not had conflicts to access. Because according to the calculation formula of the priority value, the indoor units that have not had conflicts only have the initial priority value, and the initial priority value is the last hexadecimal digit of the MAC address. If forced to calculate according to the priority value formula, this number has great randomness for the indoor units accessing the bus for the first time, resulting in only allowing the indoor unit with the smallest initial priority value to access among multiple indoor units accessing the bus for the first time, which is unfair to other indoor units accessing the bus for the first time. Therefore, the initial priority value has no reference significance for the priority value calculation among the indoor units accessing the bus for the first time. Therefore, for the indoor units accessing the bus for the first time that have had conflicts and those that have not had conflicts, the bus only allows all the indoor units that have not had conflicts to access, and other indoor units that have had conflicts are all considered as conflict behaviors in this access, and need to cancel the sending and calculate the waiting duration, and can retry after the waiting duration ends;

[0121] In Case 2, all the indoor units accessing the bus this time have not had conflicts, such as Figure 2 all the indoor units shown are accessing the bus for the first time; for this situation, as described above, it is meaningless to calculate the priority value for the indoor units accessing the bus for the first time, so all the indoor units accessing the bus for the first time are also allowed to access the bus;

[0122] Such as Figure 6 shown, in Case 3, all the indoor units accessing the bus this time have had conflicts. For example, the initial priority values of indoor unit A and indoor unit B are the same, both being 0x3800, and the left shift number m is 13, and m is set according to the actual situation. Because what actually affects the priority value more is , only when is the same, will the initial priority value be looked at; indoor unit B has sent two conflicts and is accessing the bus for the third time, and indoor unit A has had one conflict and is accessing the bus for the second time. Then the conflict count of indoor unit A is 1, that is , and the priority value is , the conflict count of indoor unit B is 2, that is , and the priority value is

[0123] , , then the priority value of indoor unit A is less than that of indoor unit B, so the priority of indoor unit A is higher than that of indoor unit B. The CAN bus arbitration allows indoor unit A to access, indoor unit B cancels the sending, and is considered as this conflict, and the conflict count of indoor unit B is updated to 3.

[0124] Execute the operation of setting the transmission time slot: After the indoor unit that has experienced a collision is allowed to access the CAN bus, the indoor unit that has experienced a collision needs to set the transmission time slot node and send a data packet to the outdoor unit at the transmission time slot node.

[0125] Specifically, it includes: After the indoor unit that has experienced a collision is allowed to access the CAN bus, the indoor unit that has experienced a collision sets the transmission time slot node according to Formula 3 and sends a data packet to the outdoor unit at the transmission time slot node;

[0126] -- Formula 3;

[0127] represents the set transmission time slot node, and the indoor unit that has experienced a collision sends a data packet to the outdoor unit at this transmission time slot node;

[0128] represents the IP field value obtained from the fourth conversion value;

[0129] represents the preset byte constant, which is 64 or 8;

[0130] % represents taking the remainder;

[0131] represents the unit basic time slot divided within a time slot;

[0132] n represents the number of times of the updated collision counter;

[0133] represents the length of the time slot unit that needs to be increased after a collision occurs.

[0134] In this embodiment, when the indoor unit that has experienced a collision is allowed to access the bus after the priority determination, there may still be other indoor units sending data on the bus at this time, or other indoor units that have experienced a collision are also allowed to access the bus, resulting in a collision between the indoor unit that accesses the bus later and the indoor unit that accesses the bus earlier. Therefore, it is necessary to set the transmission time slot node and send data only at a specific transmission time node in sequence to avoid collisions;

[0135] If the IP field value obtained from the fourth conversion value of the IP address of the indoor unit is 179, the preset byte constant takes 64, the unit basic time slot , the length of the time slot unit that needs to be increased after a collision occurs , the transmission time slot node of the indoor unit after the first collision

[0136] ; the transmission time slot node after the second collision is

[0137] .

[0138] It should be noted that when executing the setting transmission time slot operation, the outdoor unit broadcasts the time synchronization signal to the indoor unit every 10ms, and all indoor units align their clocks according to the time synchronization signal.

[0139] The technical principle of the present invention is described above in conjunction with specific embodiments. These descriptions are only for explaining the principle of the present invention and cannot be interpreted as limiting the scope of protection of the present invention in any way. Based on the explanations herein, those skilled in the art can associate other specific implementations of the present invention without paying creative labor, and these methods will fall within the scope of protection of the present invention.

Claims

1. An indoor unit address allocation method for a multi-connected air conditioner, characterized in that: Step A: When multiple indoor units of the air conditioner are powered on, each indoor unit reads the burned unique MAC address, inputs the unique MAC address into a hash function to obtain a conversion value, and converts the conversion value into a candidate IP address; Step B: The indoor unit accesses the CAN bus and sends a data packet to the outdoor unit. The data packet includes the candidate IP address and the unique MAC address; Step C: When the indoor unit executes Step B, the CAN bus detects whether there is a bit conflict. If so, the indoor unit enters Step E; if not, it executes Step D; Step D: The outdoor unit confirms whether the candidate IP address is occupied through the data packet. If it is not occupied, the outdoor unit sends a confirmation signal to the indoor unit and stores the unique MAC address and the candidate IP address of the indoor unit. After receiving the confirmation signal, the indoor unit locks the candidate IP address and writes it into the non-volatile memory; If the candidate IP address is occupied, the outdoor unit sends a signal to the indoor unit to regenerate the candidate IP, and the indoor unit enters Step E; Step E: Perform a backoff operation: The conflicting indoor units need to wait until the waiting time ends before they can re-access the CAN bus; Perform CAN bus arbitration operation: When multiple indoor units access the CAN bus simultaneously, determine whether there are indoor units that have not had a conflict. If so, the CAN bus allows all indoor units that have not had a conflict to access the CAN bus and execute Step B; if not, the CAN bus compares the priorities of all indoor units accessing this time, allows the indoor unit with the highest priority to access the CAN bus, cancels the access of other indoor units this time and determines the access of other indoor units as a conflict, and other indoor units re-enter Step E; Perform the set transmission time slot operation: When a conflicting indoor unit is allowed to access the CAN bus, the conflicting indoor unit needs to set the transmission time slot node and send a data packet to the outdoor unit at the transmission time slot node.

2. The indoor unit address allocation method for a multi-connected air conditioner according to claim 1, characterized in that: In the said Step A, it includes: Step A1: Divide the unique MAC address into four conversion intervals with every three hexadecimal digits from left to right. In the first and second conversion intervals, respectively, fix the first two hexadecimal digits and input them into the hash function to obtain the first conversion value and the second conversion value. In the third and fourth conversion intervals, respectively, arbitrarily take two hexadecimal digits and input them into the hash function to obtain the third conversion value and the fourth conversion value. All the obtained conversion values are four-digit hexadecimal numbers; Step A2: Take the last two hexadecimal digits of all the conversion values, convert them into decimal numbers to obtain four IP fields, and combine the four IP fields to form a candidate IP address.

3. The indoor unit address allocation method for a multi-connected air conditioner according to claim 2, characterized in that: Before executing the said Step B, the following steps are also included: Set a conflict counter, and the indoor unit caches the initial parameters. The initial parameters include the candidate IP address, the number of times of the conflict counter, and the initial priority value. Initially, the number of times of the conflict counter is zero; The conflict counter is used to record the number of times the indoor unit retries due to conflicts; When the initial priority value is used to perform the CAN bus arbitration operation, the CAN bus determines the priority of the indoor unit according to the initial priority value, and the initial priority value is the last hexadecimal digit of the unique MAC address; When performing step B, the indoor unit accesses the CAN bus and sends a data packet to the outdoor unit, and the data packet further includes the initial priority value.

4. The method for allocating an address of an indoor unit of a multi-connected air conditioner according to claim 3, wherein: In step E, performing the back-off operation includes: After a conflict occurs in the indoor unit, update the number of times of the conflict counter of the indoor unit, calculate the waiting time of the indoor unit according to Formula 1, and the indoor unit can re-access the CAN bus only after the waiting time ends; --Formula 1; Indicates the waiting duration of the indoor unit; Indicates the basic waiting unit duration, which is a preset value; n represents the updated number of times of the conflict counter; When the waiting duration of the indoor unit exceeds the preset allowed waiting value, the count of the conflict counter of the indoor unit is reset to zero.

5. The method for allocating an address of an indoor unit of a multi-connected air conditioner according to claim 3, wherein: In step E, performing the CAN bus arbitration operation includes: When multiple indoor units access the CAN bus at the same time, if there is no indoor unit that has not had a conflict, then update the initial priority values of all the indoor units accessing this time according to the following Formula 2, the CAN bus compares the priorities of the indoor units according to the updated priority values, allows the indoor unit with the highest priority to access the CAN bus, cancels the access of other indoor units this time and determines that a conflict has occurred, updates the number of times of the conflict counter, and re-enters step E; Among them, the larger the priority value of the indoor unit, the lower the priority; --Formula II; Indicates the updated priority value; Indicates the priority value that has not been updated; A binary number representing the number value of the updated conflict counter; m represents the number of bits shifted to the left, which is a preset constant.

6. The method for allocating an address of an indoor unit of a multi-connected air conditioner according to claim 3, wherein: In step E, performing the operation of setting the transmission time slot includes: When an indoor unit that has had a conflict is allowed to access the CAN bus, the indoor unit that has had a conflict sets the transmission time slot node according to Formula 3 and sends a data packet to the outdoor unit at the transmission time slot node; --Formula III; Indicates the set transmission time slot node. The indoor unit that has experienced a collision sends a data packet to the outdoor unit at this transmission time slot node; Indicates the IP field value obtained from the fourth conversion value; Represents a preset byte constant, which is 64 or 8; % represents taking the remainder; Indicates the divided unit basic time slot within a time slot; n represents the updated number of times of the conflict counter; Indicates the unit length of the time slot that needs to be increased after a conflict occurs.

7. The method for allocating an address of an indoor unit of a multi-connected air conditioner according to claim 1, wherein: In step D, the outdoor unit sends a confirmation signal to the indoor unit, including: The validity period of the corresponding IP address.

8. The method for allocating an address of an indoor unit of a multi-connected air conditioner according to claim 1, wherein: In step D, after the indoor unit locks the candidate IP address and writes it into the non-volatile memory, it further includes: The indoor unit sends a heartbeat packet to the outdoor unit at a preset interval. When the outdoor unit does not receive the heartbeat packet within the preset number of times, it is determined that the IP address of the indoor unit is invalid, and the indoor unit needs to re-perform steps A to E.

Citation Information

Patent Citations

  • Bus resource allocation method and device and air conditioning system

    CN111835609A

  • CAN bus communication network design method capable of avoiding conflicts

    CN112532496A