CN105338129B - Automatic address division method, display terminal and module terminal - Google Patents
Automatic address division method, display terminal and module terminal Download PDFInfo
- Publication number
- CN105338129B CN105338129B CN201510771758.XA CN201510771758A CN105338129B CN 105338129 B CN105338129 B CN 105338129B CN 201510771758 A CN201510771758 A CN 201510771758A CN 105338129 B CN105338129 B CN 105338129B
- Authority
- CN
- China
- Prior art keywords
- address
- terminal
- modular
- random number
- display terminal
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 54
- 238000012790 confirmation Methods 0.000 claims abstract description 101
- 238000004891 communication Methods 0.000 claims abstract description 29
- 238000012544 monitoring process Methods 0.000 claims abstract description 23
- 230000004044 response Effects 0.000 claims description 66
- 230000005540 biological transmission Effects 0.000 claims description 40
- 241001269238 Data Species 0.000 claims description 11
- 238000010200 validation analysis Methods 0.000 claims description 10
- 238000012795 verification Methods 0.000 abstract description 3
- 230000003111 delayed effect Effects 0.000 description 8
- 230000000694 effects Effects 0.000 description 8
- 230000008569 process Effects 0.000 description 6
- 235000013399 edible fruits Nutrition 0.000 description 5
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 239000013078 crystal Substances 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 230000008878 coupling Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 238000009434 installation Methods 0.000 description 2
- 230000007257 malfunction Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000001186 cumulative effect Effects 0.000 description 1
- 230000001788 irregular Effects 0.000 description 1
- 238000005192 partition Methods 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 238000000926 separation method Methods 0.000 description 1
- XLYOFNOQVPJJNP-UHFFFAOYSA-N water Substances O XLYOFNOQVPJJNP-UHFFFAOYSA-N 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/50—Address allocation
- H04L61/5046—Resolving address allocation conflicts; Testing of addresses
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Small-Scale Networks (AREA)
Abstract
The invention discloses an automatic address division method, a display terminal and a module terminal. Wherein, the method comprises the following steps: after monitoring a round of address allocation data sent by a display terminal, a module terminal allocates an address for the display terminal according to the address allocation data to obtain a target address; the module terminal sends a target address to the bus for the display terminal to carry out address verification; the module terminal monitors a confirmation request sent by the display terminal; if the confirmation request is monitored, the target address is used as the address of the target address; if the confirmation request is not monitored, returning to the step of distributing the address for the display terminal according to the address distribution data after monitoring the round of address distribution data sent by the display terminal. The invention solves the technical problem that the communication fault of the unit is caused by dial missing or wrong dial during manual debugging.
Description
Technical field
The present invention relates to air-conditioner fields, divide location method, display terminal and module whole automatically in particular to a kind of
End.
Background technique
For modular air conditioner water cooler, address area is carried out using toggle switch between each module in control system
Point, the address that toggle switch is dialled when factory all, the dial-up of address is manually carried out in installation and debugging.
What usual toggle switch indicated is binary code, needs installation and debugging personnel that can adjust dial-up using binary code
Switch, but commissioning staff's is irregular, sometimes because dial-up leakage is dialled or dialing the wrong number causes unit communication failure occur.
For above-mentioned problem, currently no effective solution has been proposed.
Summary of the invention
The embodiment of the invention provides one kind divide location method, display terminal and modular terminal automatically, at least solve due to
Dial-up leakage is dialled when manual debugging or dialing the wrong number causes unit the technical issues of communication failure occur.
According to an aspect of an embodiment of the present invention, a kind of automatic point location method is provided, comprising: at least two modules are whole
End is communicated with display terminal by the CAN bus of no principal and subordinate, which comprises modular terminal is monitoring the display terminal
After the wheel address assignment data sent, address is distributed for it according to the address assignment data, obtains destination address;The mould
Block terminal sends the destination address to the bus, so that the display terminal carries out address validation;The modular terminal prison
The confirmation request for listening the display terminal to send;If listening to the confirmation request, certainly using the destination address as it
The address of body;If not listening to the confirmation request, return in the wheel address for having monitored the display terminal transmission
The step of distributing address according to the address assignment data after distribution data for it.
According to another aspect of an embodiment of the present invention, a kind of automatic point location method is additionally provided, comprising: at least two modules
Terminal is communicated with display terminal by the CAN bus of no principal and subordinate, which comprises the display terminal is sent to the bus
After one wheel address assignment data, the response data that modular terminal is sent is obtained by the bus, wherein the response data is taken
It is the destination address of its own distribution with object module terminal, the object module terminal is appointing at least two module
It anticipates a terminal;The display terminal verifies whether the object module terminal succeeds distributively according to the response data got
Location;In the case where the address of the object module terminal is allocated successfully, the display terminal is sent according to the destination address
The instruction information being allocated successfully;In the case where failure is distributed in the address of the object module terminal, the display terminal is returned
The step of sending a wheel address assignment data to the bus.
According to another aspect of an embodiment of the present invention, a kind of modular terminal, including at least two modular terminals are additionally provided
It is communicated with display terminal by the CAN bus of no principal and subordinate, the modular terminal includes: allocation unit, for described in has monitored
After the wheel address assignment data that display terminal is sent, address is distributed for it according to the address assignment data, with obtaining target
Location;First address transmission unit is tested for sending the destination address to the bus so that the display terminal carries out address
Card;First monitoring unit, the confirmation request sent for monitoring the display terminal;Determination unit, for listen to it is described
When confirmation request, using the destination address as its own address;First call unit, for do not listen to it is described really
When recognizing request, the allocation unit is called.
According to another aspect of an embodiment of the present invention, a kind of display terminal is additionally provided, at least two modular terminals and aobvious
Show that terminal is communicated by the CAN bus of no principal and subordinate, the display terminal includes: acquiring unit, for sending one to the bus
After taking turns address assignment data, the response data that modular terminal is sent is obtained by the bus, wherein the response data carries
Object module terminal is the destination address of its own distribution, and the object module terminal is any at least two module
One terminal;Authentication unit, it is whether successful distributively for verifying the object module terminal according to the response data got
Location;Indicate transmission unit, in the case where the address of the object module terminal is allocated successfully, the display terminal according to
The destination address sends the instruction information being allocated successfully;Data call unit, in the address of the object module terminal
In the case where distribution failure, the acquiring unit is called.
In embodiments of the present invention, using modular terminal in the wheel address assignment data for having monitored display terminal transmission
Afterwards, address is distributed for it according to address assignment data, obtains destination address;Modular terminal sends destination address to bus, for
Display terminal carries out address validation;Modular terminal monitors the confirmation request that display terminal is sent;If listening to confirmation request,
Using destination address as its own address;If not listening to confirmation request, returns and monitoring display terminal transmission
One wheel address assignment data after according to address assignment data for its distribute address the step of mode, solve due to manually adjusting
Dial-up leakage is dialled when examination or dialing the wrong number causes unit the technical issues of communication failure occur.
Detailed description of the invention
The drawings described herein are used to provide a further understanding of the present invention, constitutes part of this application, this hair
Bright illustrative embodiments and their description are used to explain the present invention, and are not constituted improper limitations of the present invention.In the accompanying drawings:
Fig. 1 is the schematic diagram of control system according to an embodiment of the present invention;
Fig. 2 is the flow chart of according to embodiments of the present invention 1 automatic point location method;
Fig. 3 is the flow chart of according to embodiments of the present invention 1 preferred point location method automatically;
Fig. 4 is the flow chart of according to embodiments of the present invention 2 automatic point location method;
Fig. 5 is the flow chart of according to embodiments of the present invention 2 preferred point location methods automatically;
Fig. 6 is the schematic diagram of according to embodiments of the present invention 3 modular terminal;
Fig. 7 is the schematic diagram of according to embodiments of the present invention 4 display terminal.
Specific embodiment
In order to enable those skilled in the art to better understand the solution of the present invention, below in conjunction in the embodiment of the present invention
Attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is only
The embodiment of a part of the invention, instead of all the embodiments.Based on the embodiments of the present invention, ordinary skill people
The model that the present invention protects all should belong in member's every other embodiment obtained without making creative work
It encloses.
It should be noted that description and claims of this specification and term " first " in above-mentioned attached drawing, "
Two " etc. be to be used to distinguish similar objects, without being used to describe a particular order or precedence order.It should be understood that using in this way
Data be interchangeable under appropriate circumstances, so as to the embodiment of the present invention described herein can in addition to illustrating herein or
Sequence other than those of description is implemented.In addition, term " includes " and " having " and their any deformation, it is intended that cover
Cover it is non-exclusive include, for example, the process, method, system, product or equipment for containing a series of steps or units are not necessarily limited to
Step or unit those of is clearly listed, but may include be not clearly listed or for these process, methods, product
Or other step or units that equipment is intrinsic.
Embodiment 1
According to embodiments of the present invention, a kind of embodiment of the method for automatic point location method is provided, this divides location method can automatically
To apply in control system as shown in Figure 1.As shown in Figure 1, at least two modular terminals and display terminal pass through no principal and subordinate
CAN bus communicated, the data that module issues can be received by other modules in the CAN bus simultaneously.Therefore, when
When display terminal sends data to bus, modular terminal can all listen to the data and be replied.A meanwhile modular terminal
The data of sending can also be listened to by other modular terminals.The embodiment is exactly the above-mentioned principle according to CAN bus, multiple modules
Terminal all replys the address assignment data of display terminal transmission, and the delay time that each modular terminal is replied can pass through random number
It determines, display terminal is staggered the reply data of modules terminal according to the time difference of delay time, to realize ground
Location distribution.
Random number generate explanation: due to the crystal oscillator individual used in disparate modules terminal be it is discrepant, each crystal oscillator it
Between have certain reference frequency deviation, using crystal oscillator clock generate cumulative number will have any different as time increases,
The puppet for using clock accumulated variables to obtain same program on different modular terminals as the seed for generating pseudo random number
The collision probability of random number is smaller, and constantly elapsing forward with the time, and the collision probability of the pseudo random number of acquisition is also got over
It is next smaller, that is, use the probability of identical delay time smaller between multiple modular terminals, it can be quickly whole for multiple modules
End distribution address.
It should be noted that step shown in the flowchart of the accompanying drawings can be in such as a group of computer-executable instructions
It is executed in computer system, although also, logical order is shown in flow charts, and it in some cases, can be with not
The sequence being same as herein executes shown or described step.Step in embodiment 1 can be executed by modular terminal.
Fig. 2 is the flow chart of according to embodiments of the present invention 1 automatic point location method, as shown in Fig. 2, this method includes as follows
Step:
Step S202, modular terminal is after having monitored a wheel address assignment data of display terminal transmission, according to address point
Address is distributed for it with data, obtains destination address.
Step S204, modular terminal send destination address to bus, so that display terminal carries out address validation.
Step S206, modular terminal monitor the confirmation request that display terminal is sent.
Step S208, if listening to confirmation request, using destination address as its own address.If do not monitored
To confirmation request, then return is it according to address assignment data after the wheel address assignment data for having monitored display terminal transmission
The step of distributing address.
Modular terminal can listen to the address distribution number that display terminal is sent to all modular terminals by CAN bus
According to modular terminal is after listening to display terminal and completing the transmission that one takes turns address assignment data, in never occupied address
The smallest address is searched as destination address.Since modular terminal can listen to all process CAN bus by CAN bus
The data of transmission also include the address that other modules are sent to display terminal, and therefore, which address modular terminal can differentiate
Through occupying, which address do not have it is occupied, and selected in never occupied address one the smallest one as oneself
Address obtains destination address.Address used by modular terminal can be binary digital encoding, can be according in CAN bus
The quantity of the modular terminal of connection distributes the digit of binary digital encoding.I.e. optionally, modular terminal is monitoring display
After the wheel address assignment data that terminal is sent, address is distributed for it according to address assignment data, obtaining destination address includes: mould
The data for having occupied address transmitted in block terminal monitoring bus;Modular terminal is distributed according to the data for having occupied address from address
The lowest address being not used by is searched in data;Modular terminal is using the address found as destination address.
After modular terminal is oneself to distribute address, CAN bus, such CAN bus are sent by the address of distribution
In all modular terminals and display terminal can be received by the address.Display terminal verifies the address, to avoid with
The address of other modular terminals, which generates, to be repeated or conflicts, other modular terminals can also be made to avoid module end in selection address
Hold the address having been selected.When the address that display terminal verifies destination address and other modules does not repeat, issue confirmation request with
Just modular terminal knows whether successfully to distribute address.If instructing the address of modular terminal to be allocated successfully according to confirmation request,
Then the next round address assignment data that display terminal issues, weight are otherwise monitored again using destination address as the address of its own
It is new to obtain distribution data and verified, until it successfully distributes address.Display terminal sends multiple address to CAN bus and distributes
Data, the number of transmission and the number of modular terminal are identical, after all sending address assignment data to all modular terminals, one
Wheel address assignment data is sent completely.
In this embodiment, according to the data of no principal and subordinate's CAN bus can by multiple terminals simultaneously received principle so that
Each modular terminal is oneself distribution address, and other modular terminals is made to know which address is occupied, is realized certainly
Dynamic distribution address, meanwhile, the address for using display terminal and modular terminal to distribute modular terminal is verified to guarantee module
The accuracy of terminal distribution address, so that dial-up leakage dials or dials the wrong number and lead to unit when solving in the prior art due to manual debugging
There is the technical issues of communication failure, and then has reached the technical effect that accurate point location avoids communication failure.
It is illustrated by taking Fig. 1 as an example.
Display terminal A to modular terminal B1, modular terminal B2 ... modular terminal Bn sends address assignment data respectively,
After modular terminal B1, which listens to all address assignment datas, to be all sent, modular terminal B1 is oneself distribution address.
If transmission has the address of modular terminal B2 in CAN bus, modular terminal B1 is in the occupancy for listening to modular terminal B2
The information of location can avoid the address from modular terminal B2 when distributing address, so as to avoid the address phase with modular terminal B2
It causes to conflict together.
Display terminal A receives the address that each modular terminal is sent from CAN bus, and has verified whether duplicately
Location determines that the wheel address is allocated successfully in the case where no duplicate address, and otherwise wheel address distribution failure, re-starts
The address of next round is distributed.The mode of next round distribution is identical as the first round, and specific steps refer to above content.If module is whole
After the address of end B1 has determined into the distribution of work, when next round distributes address, it is total that its address is sent to CAN by modular terminal B1
Line, in order to which other modular terminals generate address.
Optionally, in modular terminal after having monitored a wheel address assignment data of display terminal transmission, and at module end
It holds before sending destination address to bus, modular terminal generates random number;It includes: mould that modular terminal, which sends destination address to bus,
Block terminal sends address and random number when reaching delay time, to bus, wherein modular terminal is delayed according to generating random number
Time.When multiple modular terminals are oneself to be assigned with identical address, display terminal is according to the random number of each modular terminal
Determine that the address of which modular terminal is allocated successfully with the time for replying data, failure is distributed in the address of which modular terminal.
Modular terminal generates random number after the address assignment data for listening to display terminal transmission, and when determining to be delayed according to random number
Between.Since delay time is determined by random number, in the case where random number identical probability very little, the identical probability of delay time
Also very little, this facilitates display terminal and carries out address validation.The range of delay time is at 0 to 22 millisecond.
It is the address that oneself is distributed is 01 for example, the delay of modular terminal B1 is 2ms, when the delay of modular terminal B2
Between be 4ms, be oneself distribution address be 11, then display terminal send distribute address command to CAN line after, modular terminal exists
After having monitored a wheel distribution address command, the address 01 oneself distributed is replied to display terminal, mould by modular terminal B1 delay 2ms
The address 11 oneself distributed is replied to display terminal by block terminal B2 delay 4ms.
It optionally, include: that judgement confirmation is asked using destination address as the address of its own if listening to confirmation request
Ask the random number of carrying whether consistent with the random number that modular terminal generates;If it is judged that confirmation request carry random number with
The random number that modular terminal is sent is consistent, and the address of determining module terminal is allocated successfully;If it is judged that confirmation request carried
Random number and the random number that modular terminal is sent are inconsistent, and failure is distributed in the address of determining module terminal.
For example, the delay of modular terminal B1 is 2ms, it is 01 that random number 2, which is the address of oneself distribution, modular terminal
The delay time of B2 be 4ms, random number 4, be oneself distribution address be 10, then modular terminal B1 delay 2ms by oneself
The address 01 of distribution replies to display terminal, and the address 10 oneself distributed is replied to display terminal by modular terminal B2 delay 4ms.
Display terminal receives the address of modular terminal B1 and modular terminal B2, then display terminal is sent to modular terminal B1
Address 01 sends the confirmation request for carrying random number 2, and the address 10 sent to modular terminal B2 sends and carries random number 4
Confirmation request.After modular terminal B1 receives the confirmation request for carrying random number, the random number for judging that confirmation request carries is
No is 2, if it is confirmed that the random number that request carries is 2, then current address is allocated successfully;If it is confirmed that the random number that request carries
It is not 2, it is determined that current address distribution failure.The verification method of modular terminal B2 is identical as modular terminal B1, repeats no more.
It should be noted that confirmation request is in the case where tentatively judging the modular terminal distribution successful situation in address, into one
Whether the address distribution of step card succeeds, that is to say, that display terminal may determine that whether the address that multiple modular terminals generate has weight
Multiple, modular terminal can further judge whether the confirmation request of display terminal is accurate, to ensure being not in that address distribution is wrong
Accidentally the case where.The confirmation request for carrying random number is not received, and has directly received next round address assignment data, it is determined that
Failure is distributed in current address.
Optionally, after the address of determining module terminal is allocated successfully, method include: monitor display terminal send with
Machine number generates request;Judge the random number that modular terminal generation whether is carried in generating random number request;In generating random number
When carrying the random number of modular terminal generation in request, modular terminal sends destination address to bus;It is asked in generating random number
When not carrying the random number of modular terminal generation in asking, return after having monitored a wheel address assignment data of display terminal transmission
The step of distributing address according to address assignment data for it.
After display terminal has sent a wheel address assignment data, if the modular terminal in CAN bus is without all
Address is all distributed, then when sending address assignment data again, the address assignment data that display terminal is sent to modular terminal is carried
There is the random number of the modular terminal, when modular terminal receives the address assignment data for carrying random number, is sent to CAN bus
Its address information.If not carrying the random number of its generation in the address assignment data that modular terminal receives, again for certainly
Oneself distributes address.Failure is distributed in i.e. last round of address, needs deallocation.
In this embodiment, whether the address that modular terminal verifies its distribution twice succeeds, and is to receive display for the first time
The confirmation request that terminal is sent then primarily determines ground if it is confirmed that the random number that request carries is identical as the random number that it is generated
Location is allocated successfully;It is when receiving address assignment data again for the second time, it may also be said to be to receive random number generation again to ask
When asking, if carrying random number, it is determined that address is allocated successfully, and only address need to be sent to CAN bus, if do not taken
Band random number, then modular terminal is oneself distribution address and generates random number again, the method for distributing address according to first time
Deallocation is simultaneously verified.Each modular terminal can come automatic distributively location according to the method described above, until the CAN
The address of all modular terminals in bus is all assigned.Due to whether verifying address twice at the distribution of work, avoid module whole
The address assignment error at end or the communication failure caused without distribution, have reached accurate distribution address and have avoided communication failure
Technical effect.Simultaneously as the data of CAN bus transmission are that all modular terminals connected on the bus are shared, improve
The dispensing rate of address.
Divide location method automatically in conjunction with Fig. 3 specification module terminal.
Step S302 receives the address assignment data frame that display terminal is sent.
Step S304 has monitored a wheel address assignment data frame, the lowest address being not used by is distributed to this modular terminal.
Step S306, be delayed random time, sends address assignment response data frame.Modular terminal generates random number, according to
Generating random number random time is delayed after random time to display terminal returning response data frame.
Step S308 receives the request confirmation frame that display terminal is sent.
Step S310 judges the data in the responsive data frame whether sent comprising upper deuterzooid module in the frame.If so,
S312 is thened follow the steps, if not, return step S302.
Step S312 replys display terminal Address Confirmation frame, this modular terminal address is allocated successfully.
Embodiment 2
According to embodiments of the present invention, a kind of embodiment of the method for automatic point location method is provided, this divides location method can automatically
It is executed with display terminal as shown in Figure 1.Display terminal is it may be said that host computer in air-conditioner control system.
Fig. 4 is the flow chart of according to embodiments of the present invention 2 automatic point location method.As shown in figure 4, this method includes as follows
Step:
Step S402 after display terminal sends a wheel address assignment data to bus, obtains modular terminal hair by bus
The response data sent, wherein response data carries the destination address that object module terminal is its own distribution, object module terminal
For any one terminal at least two modules.
Whether step S404, display terminal are successful distributively according to the response data verifying object module terminal got
Location.
Step S406, in the case where the address of object module terminal is allocated successfully, display terminal is sent out according to destination address
Send the instruction information being allocated successfully.In the case where failure is distributed in the address of object module terminal, display terminal is returned to bus
The step of sending a wheel address assignment data.
Display terminal sends address assignment data to CAN bus, i.e., sends generating random number to each modular terminal and ask
It asks, and receiving each modular terminal is the destination address that oneself is generated.Display terminal verifies the target that modules terminal is sent
It is simultaneously verified address.After being verified, the prompt information being allocated successfully is sent to the destination address, otherwise retransmits ground
Data are distributed in location, to allow each modular terminal to be again oneself distribution address.After a wheel address assignment data is sent completely,
May have the address of part of module terminal can successfully determine, it is also possible to which the address of whole modular terminals can successfully determine.Such as
Fruit has the address of part of module terminal that can successfully determine, then a wheel address assignment data is sent again, until remaining all
The address of modular terminal can successfully determine.
By the embodiment, after display terminal sends address assignment data, each modular terminal is oneself distribution address,
Automatic point location is realized, the address that display terminal distribute modular terminal is verified, and ensure that distributing address does not repeat to make
Between modules terminal can normal communication, dial or dial to solve in the prior art dial-up leakage when due to manual debugging
Mistake causes unit the technical issues of communication failure occur, and then has reached the technical effect that accurate point location avoids communication failure.
Optionally, which is characterized in that response data carry object module terminal generation random number, display terminal according to
Successfully whether distribution address includes: that display terminal judges two be first connected to the response data verifying object module terminal got
Whether address entrained by response data has repetition;If it is judged that there is weight in address entrained by two response datas being first connected to
It is multiple, it is determined that the failure of object module terminal distribution address;If it is judged that address entrained by two response datas being first connected to
It does not repeat, it is determined that the success of object module terminal distribution address.
Under normal conditions, modular terminal transmits the address that it is oneself distribution by CAN bus, other modular terminals are selecting
Selected address can be avoided when selecting address, therefore, the modular terminal for the same time that is delayed may select identically
Location, especially in the identical situation in address that the first two modular terminal is sent, the address that subsequent modular terminal is sent may also
It can malfunction, therefore, in the duplicate situation in address that the first two modular terminal is sent, determine the distribution failure of epicycle address.
It is illustrated by taking Fig. 1 as an example.
Display terminal A sends address assignment data to modular terminal B1, modular terminal B2 ... modular terminal Bn respectively, when
Modular terminal B1 is listened to after all address assignment datas are all sent, and modular terminal B1 is oneself distribution address.Such as
Transmission has the address of modular terminal B2 in fruit CAN bus, then modular terminal B1 is in the occupancy address for listening to modular terminal B2
Information, the address from modular terminal B2 can be avoided, when distributing address so as to avoid identical as the address of modular terminal B2
And it causes to conflict.
Display terminal A receives the address that each modular terminal is sent from CAN bus, and has verified whether duplicately
Location determines that the wheel address is allocated successfully in the case where no duplicate address, and otherwise wheel address distribution failure, re-starts
The address of next round is distributed.The mode of next round distribution is identical as the first round, and specific steps refer to above content.If module is whole
After the address of end B1 has determined into the distribution of work, when next round distributes address, it is total that its address is sent to CAN by modular terminal B1
Line, in order to which other modular terminals generate address.
When multiple modular terminals are oneself to be assigned with identical address, display terminal is according to the delay of each modular terminal
Time determines that the address of which modular terminal is allocated successfully, and failure is distributed in the address of which modular terminal.Modular terminal is being supervised
Random number is generated after hearing the address assignment data that display terminal is sent, and delay time is determined according to random number.Due to delay
Time is determined by random number, and in the case where random number identical probability very little, the identical probability of delay time also very little, this is just
Address validation is carried out convenient for display terminal.The range of delay time is at 0 to 22 millisecond.
It is the address that oneself is distributed is 01 for example, the delay of modular terminal B1 is 2ms, when the delay of modular terminal B2
Between be 4ms, be oneself distribute address be 11, then modular terminal B1 sends address 01 after the 2ms that is delayed, and modular terminal B2 exists
Address 11 is sent after delay 4ms.The address of display terminal determining module terminal B1 and modular terminal B2 do not conflict, and determining module is whole
End B1 and modular terminal B2 successfully distribute address.
If modular terminal B1 and modular terminal B2 is 01 for the address of oneself distribution, but the delay of modular terminal B1
For 2ms, the delay time of modular terminal B2 is 4ms, it is determined that the address of modular terminal B1 is 01, the address point of modular terminal B2
With failure.If modular terminal B1 and modular terminal B2 is that the address of oneself distribution is 01, and delay is display in 2ms
Terminal can not determine that the address of which modular terminal is 01, therefore, by judging delay time come the address of determining module terminal
Whether distribution succeeds.
Display terminal verifies whether to show identical address to different modular terminals, to avoid address assignment error,
Delay time is further verified in the case where there is identical address, it is whole that the shorter module of delay time is distributed in same address
End, to ensure that the correctness of the address distribution of modular terminal.
Optionally it is determined that object module terminal distribution address successfully includes: random number of the display terminal according to modular terminal
Confirmation request is generated, and will confirm that request is sent to destination address, confirmation request carries the random number of modular terminal generation;It is aobvious
Show terminal monitoring confirmation response, wherein confirmation response be the corresponding modular terminal of destination address verify that confirmation request carries with
What machine number generated when consistent with the random number that the modular terminal generates;When display terminal listens to confirmation response, target is determined
Modular terminal distributes address success;When display terminal is not received by confirmation response, display terminal is returned to bus and sends one
The step of taking turns address assignment data.
For example, the delay of modular terminal B1 is 2ms, it is 01 that random number 2, which is the address of oneself distribution, modular terminal
The delay time of B2 be 4ms, random number 4, be oneself distribution address be 01, then display terminal determine display terminal B1 with
The address of display terminal B2 is identical, then further judges delay time, since the delay time of modular terminal B1 is shorter, then will
Distribute to modular terminal B1 in address 01.Display terminal issues confirmation request to modular terminal B1, carry in the confirmation request with
Machine number 2, verifying random number 2 is identical as the random number that it is generated after modular terminal B1 receives confirmation request, then confirms address point
With success.Due to modular terminal B2 address distribution it is unsuccessful, then display terminal when sending next round address assignment data, to
Modular terminal B2 sends address assignment data.
Display terminal sends the address for carrying random number to modular terminal B1 when sending next round address assignment data
Distribute data;The address assignment data of not random number is sent to modular terminal B2.Modular terminal B1 has sent it to bus
The address of distribution, and modular terminal B2 deallocation according to the above steps of this embodiment.
Optionally, when display terminal listens to confirmation response, after determining the success of object module terminal distribution address, side
Method further include: display terminal judges whether at least two modular terminals are fully completed address distribution;Display terminal if it is judged that
At least two modular terminals are not fully completed address distribution, then send address at least two modular terminals again and distribute number
According to, wherein the address assignment data sent to object module terminal carries the random number that object module terminal generates.
After the address for having modular terminal determines, which can send its address to CAN bus, therefore, other
The modular terminal for not distributing address can select address as the address distributed to oneself in never occupied address, go forward side by side
The process of row verifying.When storing the modular terminal without distributing address in CAN bus, display terminal is with can all sending a wheel
Data are distributed in location, and every wheel address is assigned, and whether all display terminal can judge all modular terminals in CAN bus again
Address distribution has been completed, has terminated point location automatically if completing, has continued the address point of next round if not completing
Match, until all modular terminals are all completed to divide location automatically.
It by the embodiment, realizes each modular terminal and distributes address automatically, and between modules terminal
Address will not conflict, and solve in the prior art dial-up leakage group when due to manual debugging or dialing the wrong number causes unit communication failure occur
The technical issues of, and then reached the technical effect that accurate point location avoids communication failure.
Illustrate the automatic point location method of display terminal in conjunction with Fig. 5.
Step S502 sends address assignment data frame.
Step S504 receives all data frames of response, receives the number of responses of display terminal response address distribution data frame
According to frame, responsive data frame includes the random number and address that modular terminal generates.
Step S506 judges whether there are duplicate data in response frame, that is, judges whether there is duplicate address, if so,
Then return step S502, if it is not, executing step S508.
Step S508 sends address validation data frame, i.e. transmission confirmation request.
Step S510 judges whether to only receive frame response frame data, if so, S512 is thened follow the steps, if it is not, then
Return step S508.
Step S512, some modular terminal address are allocated successfully.
Step S514, judges whether all modular terminal addresses distribute, if it is, end address is distributed, if not,
Then return step S502.
Above-mentioned the step of dividing location method automatically, is as follows:
1, display terminal sends address assignment data, i.e. display terminal generates claim frame to CAN bus random number.
2, modular terminal generates random number, and is oneself distribution address, and address and random number are sent to CAN bus.
3, display terminal sends request confirmation frame to destination address, and carries random number.Destination address is modular terminal point
The address matched.
4, whether random number entrained by the request confirmation frame that modular terminal verifying receives generates with the modular terminal
Random number is identical, if identical, returns to acknowledgement frame response;If do not carried, do not reply.
5, when display terminal is judged to receive only a response for the same destination address, confirm that the address is distributed into
Function.If when being not received by response or when receiving multiple responses, address distribution is unsuccessful.
Embodiment 3
According to embodiments of the present invention, a kind of embodiment of modular terminal is provided, which can execute above-mentioned reality
Apply the automatic point location method in example.In this embodiment, at least two modular terminals and display terminal are total by the CAN of no principal and subordinate
Line communication, as shown in fig. 6, the modular terminal include allocation unit 60, the first address transmission unit 62, the first monitoring unit 64,
Determination unit 66 and the first call unit 68.
Allocation unit 60 is used for after having monitored a wheel address assignment data of display terminal transmission, distributes number according to address
Address is distributed according to for it, obtains destination address.
First address transmission unit 62 is used to send destination address to bus, so that display terminal carries out address validation.
First monitoring unit 64 is used to monitor the confirmation request of display terminal transmission.
Determination unit 66 is used for when listening to confirmation request, using destination address as its own address.
First call unit 68 is used for when not listening to confirmation request, calls allocation unit.
Modular terminal can listen to the address distribution number that display terminal is sent to all modular terminals by CAN bus
According to modular terminal is after listening to display terminal and completing the transmission that one takes turns address assignment data, in never occupied address
The smallest address is searched as destination address.Since modular terminal can listen to all process CAN bus by CAN bus
The data of transmission also include the address that other modules are sent to display terminal, and therefore, which address modular terminal can differentiate
Through occupying, which address do not have it is occupied, and selected in never occupied address one the smallest one as oneself
Address obtains destination address.Address used by modular terminal can be binary digital encoding, can be according in CAN bus
The quantity of the modular terminal of connection distributes the digit of binary digital encoding.I.e. optionally, modular terminal is monitoring display
After the wheel address assignment data that terminal is sent, address is distributed for it according to address assignment data, obtaining destination address includes: mould
The data for having occupied address transmitted in block terminal monitoring bus;Modular terminal is distributed according to the data for having occupied address from address
The lowest address being not used by is searched in data;Modular terminal is using the address found as destination address.That is allocation unit packet
It includes: module is monitored, for monitoring the data for having occupied address transmitted in bus;Searching module has occupied address for basis
Data the lowest address being not used by is searched from address assignment data;Third determining module, the address for will find
As destination address.
After modular terminal is oneself to distribute address, CAN bus, such CAN bus are sent by the address of distribution
In all modular terminals and display terminal can be received by the address.Display terminal verifies the address, to avoid with
The address of other modular terminals, which generates, to be repeated or conflicts, other modular terminals can also be made to avoid module end in selection address
Hold the address having been selected.When the address that display terminal verifies destination address and other modules does not repeat, issue confirmation request with
Just modular terminal knows whether successfully to distribute address.If instructing the address of modular terminal to be allocated successfully according to confirmation request,
Then the next round address assignment data that display terminal issues, weight are otherwise monitored again using destination address as the address of its own
It is new to obtain distribution data and verified, until it successfully distributes address.Display terminal sends multiple address to CAN bus and distributes
Data, the number of transmission and the number of modular terminal are identical, after all sending address assignment data to all modular terminals, one
Wheel address assignment data is sent completely.
In this embodiment, according to the data of no principal and subordinate's CAN bus can by multiple terminals simultaneously received principle so that
Each modular terminal is oneself distribution address, and other modular terminals is made to know which address is occupied, is realized certainly
Dynamic distribution address, meanwhile, the address for using display terminal and modular terminal to distribute modular terminal is verified to guarantee module
The accuracy of terminal distribution address, so that dial-up leakage dials or dials the wrong number and lead to unit when solving in the prior art due to manual debugging
There is the technical issues of communication failure, and then has reached the technical effect that accurate point location avoids communication failure.
It is illustrated by taking Fig. 1 as an example.
Display terminal A sends address assignment data to modular terminal B1, modular terminal B2 ... modular terminal Bn respectively, when
Modular terminal B1 is listened to after all address assignment datas are all sent, and modular terminal B1 is oneself distribution address.Such as
Transmission has the address of modular terminal B2 in fruit CAN bus, then modular terminal B1 is in the occupancy address for listening to modular terminal B2
Information, the address from modular terminal B2 can be avoided, when distributing address so as to avoid identical as the address of modular terminal B2
And it causes to conflict.
Display terminal A receives the address that each modular terminal is sent from CAN bus, and has verified whether duplicately
Location determines that the wheel address is allocated successfully in the case where no duplicate address, and otherwise wheel address distribution failure, re-starts
The address of next round is distributed.The mode of next round distribution is identical as the first round, and specific steps refer to above content.If module is whole
After the address of end B1 has determined into the distribution of work, when next round distributes address, it is total that its address is sent to CAN by modular terminal B1
Line, in order to which other modular terminals generate address.
Optionally, generation unit, after taking turns address assignment data monitored display terminal transmission one, and in module
Before terminal sends destination address to bus, random number is generated;First address transmission unit is also used to when reaching delay time,
Address and random number are sent to bus, wherein modular terminal is according to generating random number delay time.It is certainly in multiple modular terminals
When oneself is assigned with identical address, which display terminal determines according to the time of the random number of each modular terminal and reply data
The address of a modular terminal is allocated successfully, and failure is distributed in the address of which modular terminal.Modular terminal is listening to display terminal
Random number is generated after the address assignment data of transmission, and delay time is determined according to random number.Since delay time is by random number
It determines, in the case where random number identical probability very little, the identical probability of delay time also very little, this facilitates display terminal
Carry out address validation.The range of delay time is at 0 to 22 millisecond.
It is the address that oneself is distributed is 01 for example, the delay of modular terminal B1 is 2ms, when the delay of modular terminal B2
Between be 4ms, be oneself distribution address be 11, then display terminal send distribute address command to CAN line after, modular terminal exists
After having monitored a wheel distribution address command, the address 01 oneself distributed is replied to display terminal, mould by modular terminal B1 delay 2ms
The address 11 oneself distributed is replied to display terminal by block terminal B2 delay 4ms.
Optionally it is determined that unit includes: judgment module, for judging whether the random number that confirmation request carries is whole with module
Hold the random number generated consistent;First determining module, in the random number and modular terminal hair for judging that confirmation request carries
When the random number sent is consistent, the address of determining module terminal is allocated successfully;Second determining module, for judging confirmation request
When the random number that the random number and modular terminal of carrying are sent is inconsistent, failure is distributed in the address of determining module terminal.
For example, the delay of modular terminal B1 is 2ms, it is 01 that random number 2, which is the address of oneself distribution, modular terminal
The delay time of B2 be 4ms, random number 4, be oneself distribution address be 10, then modular terminal B1 delay 2ms by oneself
The address 01 of distribution replies to display terminal, and the address 10 oneself distributed is replied to display terminal by modular terminal B2 delay 4ms.
Display terminal receives the address of modular terminal B1 and modular terminal B2, then display terminal is sent to modular terminal B1
Address 01 sends the confirmation request for carrying random number 2, and the address 10 sent to modular terminal B2 sends and carries random number 4
Confirmation request.After modular terminal B1 receives the confirmation request for carrying random number, the random number for judging that confirmation request carries is
No is 2, if it is confirmed that the random number that request carries is 2, then current address is allocated successfully;If it is confirmed that the random number that request carries
It is not 2, it is determined that current address distribution failure.The verification method of modular terminal B2 is identical as modular terminal B1, repeats no more.
It should be noted that confirmation request is in the case where tentatively judging the modular terminal distribution successful situation in address, into one
Whether the address distribution of step card succeeds, that is to say, that display terminal may determine that whether the address that multiple modular terminals generate has weight
Multiple, modular terminal can further judge whether the confirmation request of display terminal is accurate, to ensure being not in that address distribution is wrong
Accidentally the case where.The confirmation request for carrying random number is not received, and has directly received next round address assignment data, it is determined that
Failure is distributed in current address.
Optionally, modular terminal further include: the second monitoring unit, for being allocated successfully in the address of determining module terminal
Later, the generating random number request that display terminal is sent is monitored;Judging unit, for judging whether take in generating random number request
The random number generated with modular terminal;Second address transmission unit, for carrying module end in generating random number is requested
When holding the random number generated, modular terminal sends destination address to bus;Second call unit, for being requested in generating random number
In do not carry modular terminal generation random number when, call allocation unit.
After display terminal has sent a wheel address assignment data, if the modular terminal in CAN bus is without all
Address is all distributed, then when sending address assignment data again, the address assignment data that display terminal is sent to modular terminal is carried
There is the random number of the modular terminal, when modular terminal receives the address assignment data for carrying random number, is sent to CAN bus
Its address information.If not carrying the random number of its generation in the address assignment data that modular terminal receives, again for certainly
Oneself distributes address.Failure is distributed in i.e. last round of address, needs deallocation.
In this embodiment, whether the address that modular terminal verifies its distribution twice succeeds, and is to receive display for the first time
The confirmation request that terminal is sent then primarily determines ground if it is confirmed that the random number that request carries is identical as the random number that it is generated
Location is allocated successfully;It is when receiving address assignment data again for the second time, it may also be said to be to receive random number generation again to ask
When asking, if carrying random number, it is determined that address is allocated successfully, and only address need to be sent to CAN bus, if do not taken
Band random number, then modular terminal is oneself distribution address and generates random number again, the method for distributing address according to first time
Deallocation is simultaneously verified.Each modular terminal can come automatic distributively location according to the method described above, until the CAN
The address of all modular terminals in bus is all assigned.Due to whether verifying address twice at the distribution of work, avoid module whole
The address assignment error at end or the communication failure caused without distribution, have reached accurate distribution address and have avoided communication failure
Technical effect.Simultaneously as the data of CAN bus transmission are that all modular terminals connected on the bus are shared, improve
The dispensing rate of address.
Embodiment 4
According to embodiments of the present invention, a kind of embodiment of display terminal is provided, which can execute embodiment 2
Automatically divide location method, can be display terminal shown in FIG. 1, at least two modular terminals and display terminal pass through no principal and subordinate's
CAN bus communication.Display terminal is it may be said that host computer etc. in air-conditioner control system.
As shown in fig. 7, the display terminal includes: acquiring unit 70, authentication unit 72, instruction transmission unit 74 and data tune
With unit 76.
After acquiring unit 70 is used to send a wheel address assignment data to bus, obtain what modular terminal was sent by bus
Response data, wherein response data carries the destination address that object module terminal is its own distribution, and object module terminal is extremely
Any one terminal in few two modules.
Authentication unit 72 is used for whether successfully distributing address according to the response data verifying object module terminal got.
Indicate that transmission unit 74 is used in the case where the address of object module terminal is allocated successfully, display terminal is according to mesh
Mark address sends the instruction information being allocated successfully.
Data call unit 76 is used to call acquiring unit in the case where failure is distributed in the address of object module terminal.
Display terminal sends address assignment data to CAN bus, i.e., sends generating random number to each modular terminal and ask
It asks, and receiving each modular terminal is the destination address that oneself is generated.Display terminal verifies the target that modules terminal is sent
It is simultaneously verified address.After being verified, the prompt information being allocated successfully is sent to the destination address, otherwise retransmits ground
Data are distributed in location, to allow each modular terminal to be again oneself distribution address.After a wheel address assignment data is sent completely,
May have the address of part of module terminal can successfully determine, it is also possible to which the address of whole modular terminals can successfully determine.Such as
Fruit has the address of part of module terminal that can successfully determine, then a wheel address assignment data is sent again, until remaining all
The address of modular terminal can successfully determine.
By the embodiment, after display terminal sends address assignment data, each modular terminal is oneself distribution address,
Automatic point location is realized, the address that display terminal distribute modular terminal is verified, and ensure that distributing address does not repeat to make
Between modules terminal can normal communication, dial or dial to solve in the prior art dial-up leakage when due to manual debugging
Mistake causes unit the technical issues of communication failure occur, and then has reached the technical effect that accurate point location avoids communication failure.
Optionally, response data carries the random number of object module terminal generation, and authentication unit includes: that address judges mould
Whether block, address entrained by two response datas for judging first to be connected to have repetition;First address determination module is used for
When judging that there is repetition in address entrained by be first connected to two response datas, determine that object module terminal distribution address fails;
Second address determination module when not repeating for the address entrained by two response datas for judging first to be connected to, determines
The success of object module terminal distribution address.
Under normal conditions, modular terminal transmits the address that it is oneself distribution by CAN bus, other modular terminals are selecting
Selected address can be avoided when selecting address, therefore, the modular terminal for the same time that is delayed may select identically
Location, especially in the identical situation in address that the first two modular terminal is sent, the address that subsequent modular terminal is sent may also
It can malfunction, therefore, in the duplicate situation in address that the first two modular terminal is sent, determine the distribution failure of epicycle address.
It is illustrated by taking Fig. 1 as an example.
Display terminal A sends address assignment data to modular terminal B1, modular terminal B2 ... modular terminal Bn respectively, when
Modular terminal B1 is listened to after all address assignment datas are all sent, and modular terminal B1 is oneself distribution address.Such as
Transmission has the address of modular terminal B2 in fruit CAN bus, then modular terminal B1 is in the occupancy address for listening to modular terminal B2
Information, the address from modular terminal B2 can be avoided, when distributing address so as to avoid identical as the address of modular terminal B2
And it causes to conflict.
Display terminal A receives the address that each modular terminal is sent from CAN bus, and has verified whether duplicately
Location determines that the wheel address is allocated successfully in the case where no duplicate address, and otherwise wheel address distribution failure, re-starts
The address of next round is distributed.The mode of next round distribution is identical as the first round, and specific steps refer to above content.If module is whole
After the address of end B1 has determined into the distribution of work, when next round distributes address, it is total that its address is sent to CAN by modular terminal B1
Line, in order to which other modular terminals generate address.
When multiple modular terminals are oneself to be assigned with identical address, display terminal is according to the delay of each modular terminal
Time determines that the address of which modular terminal is allocated successfully, and failure is distributed in the address of which modular terminal.Modular terminal is being supervised
Random number is generated after hearing the address assignment data that display terminal is sent, and delay time is determined according to random number.Due to delay
Time is determined by random number, and in the case where random number identical probability very little, the identical probability of delay time also very little, this is just
Address validation is carried out convenient for display terminal.The range of delay time is at 0 to 22 millisecond.
It is the address that oneself is distributed is 01 for example, the delay of modular terminal B1 is 2ms, when the delay of modular terminal B2
Between be 4ms, be oneself distribute address be 11, then modular terminal B1 sends address 01 after the 2ms that is delayed, and modular terminal B2 exists
Address 11 is sent after delay 4ms.The address of display terminal determining module terminal B1 and modular terminal B2 do not conflict, and determining module is whole
End B1 and modular terminal B2 successfully distribute address.
If modular terminal B1 and modular terminal B2 is 01 for the address of oneself distribution, but the delay of modular terminal B1
For 2ms, the delay time of modular terminal B2 is 4ms, it is determined that the address of modular terminal B1 is 01, the address point of modular terminal B2
With failure.If modular terminal B1 and modular terminal B2 is that the address of oneself distribution is 01, and delay is display in 2ms
Terminal can not determine that the address of which modular terminal is 01, therefore, by judging delay time come the address of determining module terminal
Whether distribution succeeds.
Display terminal verifies whether to show identical address to different modular terminals, to avoid address assignment error,
Delay time is further verified in the case where there is identical address, it is whole that the shorter module of delay time is distributed in same address
End, to ensure that the correctness of the address distribution of modular terminal.
Optionally, the second address determination module includes: that request generates submodule, for raw according to the random number of modular terminal
At confirmation request, and it will confirm that request is sent to destination address, confirmation request carries the random number of modular terminal generation;It monitors
Submodule is responded for monitoring confirmation, wherein confirmation response is that the corresponding modular terminal of destination address verifies confirmation request carrying
Random number it is with the random number that the modular terminal generates consistent when generate;Submodule is determined, for listening in display terminal
When confirmation response, the success of object module terminal distribution address is determined;Submodule is called, for being not received by really in display terminal
When recognizing response, acquiring unit is called.
For example, the delay of modular terminal B1 is 2ms, it is 01 that random number 2, which is the address of oneself distribution, modular terminal
The delay time of B2 be 4ms, random number 4, be oneself distribution address be 01, then display terminal determine display terminal B1 with
The address of display terminal B2 is identical, then further judges delay time, since the delay time of modular terminal B1 is shorter, then will
Distribute to modular terminal B1 in address 01.Display terminal issues confirmation request to modular terminal B1, carry in the confirmation request with
Machine number 2, verifying random number 2 is identical as the random number that it is generated after modular terminal B1 receives confirmation request, then confirms address point
With success.Due to modular terminal B2 address distribution it is unsuccessful, then display terminal when sending next round address assignment data, to
Modular terminal B2 sends address assignment data.
Display terminal sends the address for carrying random number to modular terminal B1 when sending next round address assignment data
Distribute data;The address assignment data of not random number is sent to modular terminal B2.
Optionally, display terminal further include: judging unit, for determining mesh when display terminal listens to confirmation response
After marking modular terminal distribution address success, display terminal judges whether at least two modular terminals are fully completed address distribution;
Data call unit is also used to when judging that at least two modular terminals are not fully completed address distribution, again at least two
A modular terminal sends address assignment data, wherein the address assignment data sent to object module terminal carries target mould
The random number that block terminal generates.Modular terminal B1 sends its allocated address to bus, and modular terminal B2 is according to this reality
Apply the above-mentioned steps deallocation of example.
After the address for having modular terminal determines, which can send its address to CAN bus, therefore, other
The modular terminal for not distributing address can select address as the address distributed to oneself in never occupied address, go forward side by side
The process of row verifying.When storing the modular terminal without distributing address in CAN bus, display terminal is with can all sending a wheel
Data are distributed in location, and every wheel address is assigned, and whether all display terminal can judge all modular terminals in CAN bus again
Address distribution has been completed, has terminated point location automatically if completing, has continued the address point of next round if not completing
Match, until all modular terminals are all completed to divide location automatically.
It by the embodiment, realizes each modular terminal and distributes address automatically, and between modules terminal
Address will not conflict, and solve in the prior art dial-up leakage group when due to manual debugging or dialing the wrong number causes unit communication failure occur
The technical issues of, and then reached the technical effect that accurate point location avoids communication failure.
The serial number of the above embodiments of the invention is only for description, does not represent the advantages or disadvantages of the embodiments.
In the above embodiment of the invention, it all emphasizes particularly on different fields to the description of each embodiment, does not have in some embodiment
The part of detailed description, reference can be made to the related descriptions of other embodiments.
In several embodiments provided herein, it should be understood that disclosed technology contents can pass through others
Mode is realized.Wherein, the apparatus embodiments described above are merely exemplary, such as the division of unit, can be one kind
Logical function partition, there may be another division manner in actual implementation, such as multiple units or components can combine or can
To be integrated into another system, or some features can be ignored or not executed.Another point, shown or discussed is mutual
Coupling, direct-coupling or communication connection can be through some interfaces, the indirect coupling or communication connection of unit or module,
It can be electrical or other forms.
Unit may or may not be physically separated as illustrated by the separation member, shown as a unit
Component may or may not be physical unit, it can and it is in one place, or may be distributed over multiple units
On.It can some or all of the units may be selected to achieve the purpose of the solution of this embodiment according to the actual needs.
It, can also be in addition, the functional units in various embodiments of the present invention may be integrated into one processing unit
It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list
Member both can take the form of hardware realization, can also realize in the form of software functional units.
It, can if integrated unit is realized in the form of SFU software functional unit and when sold or used as an independent product
To be stored in a computer readable storage medium.Based on this understanding, technical solution of the present invention substantially or
Say that all or part of the part that contributes to existing technology or the technical solution can embody in the form of software products
Out, which is stored in a storage medium, including some instructions are used so that a computer equipment
(can be personal computer, server or network equipment etc.) executes all or part of step of each embodiment method of the present invention
Suddenly.And storage medium above-mentioned includes: USB flash disk, read-only memory (ROM, Read-Only Memory), random access memory
The various media that can store program code such as (RAM, Random Access Memory), mobile hard disk, magnetic or disk.
The above is only the preferred embodiment of the present invention, it is noted that those skilled in the art are come
It says, various improvements and modifications may be made without departing from the principle of the present invention, these improvements and modifications also should be regarded as
Protection scope of the present invention.
Claims (16)
1. a kind of divide location method automatically, which is characterized in that at least two modular terminals and display terminal are total by the CAN of no principal and subordinate
Line communication, which comprises
Modular terminal is after having monitored the wheel address assignment data that the display terminal is sent, according to the address assignment data
Address is distributed for it, obtains destination address;
The modular terminal sends the destination address to the bus, so that the display terminal carries out address validation;
The modular terminal monitors the confirmation request that the display terminal is sent;
If listening to the confirmation request, using the destination address as its own address;
If not listening to the confirmation request, return in the wheel address distribution number for having monitored the display terminal transmission
According to rear the step of distributing address according to the address assignment data for it;
Wherein, modular terminal is after having monitored the wheel address assignment data that the display terminal is sent, according to the address point
Address is distributed for it with data, obtaining destination address includes:
The modular terminal monitors the data for having occupied address transmitted in the bus;
The modular terminal is searched from the address assignment data according to the data for having occupied address and is not used by most
Small address;
The modular terminal is using the address found as the destination address.
2. the method according to claim 1, wherein
In the modular terminal after having monitored the wheel address assignment data that the display terminal is sent, and it is whole in the module
It holds before sending the destination address to the bus, the modular terminal generates random number;
It includes: the modular terminal when reaching delay time that the modular terminal, which sends the destination address to the bus,
The address and the random number are sent to the bus, wherein the modular terminal prolongs according to the generating random number
When the time.
3. according to the method described in claim 2, it is characterized in that, if listening to the confirmation request, by the target
Address includes: as the address of its own
Judge whether the random number that the confirmation request carries is consistent with the random number that the modular terminal generates;
If it is judged that the random number that the confirmation request carries is consistent with the random number that the modular terminal is sent, described in determination
The address of modular terminal is allocated successfully;
If it is judged that the random number of the confirmation request carrying and the random number that the modular terminal is sent are inconsistent, institute is determined
State the address distribution failure of modular terminal.
4. according to the method described in claim 3, it is characterized in that, determining that the address of the modular terminal is allocated successfully it
Afterwards, which comprises
Monitor the generating random number request that the display terminal is sent;
Judge whether carry the random number that the modular terminal generates in the generating random number request;
When carrying the random number that the modular terminal generates in generating random number request, the modular terminal is to described
Bus sends the destination address;
When not carrying the random number that the modular terminal generates in generating random number request, returns and monitoring described show
Show terminal send one wheel address assignment data after according to the address assignment data for its distribute address the step of.
5. a kind of divide location method automatically, which is characterized in that at least two modular terminals and display terminal are total by the CAN of no principal and subordinate
Line communication, which comprises
After the display terminal sends a wheel address assignment data to the bus, modular terminal is obtained by the bus and is sent
Response data, wherein the response data carries the destination address that object module terminal is its own distribution, the target mould
Block terminal is any one terminal at least two module;
The display terminal verifies whether the object module terminal successfully distributes address according to the response data got;
In the case where the address of the object module terminal is allocated successfully, the display terminal is sent according to the destination address
The instruction information being allocated successfully;
In the case where failure is distributed in the address of the object module terminal, the display terminal is returned to the bus and sends one
The step of taking turns address assignment data;
Wherein, object module terminal is that the destination address of its own distribution includes:
The modular terminal monitors the data for having occupied address transmitted in the bus;
The modular terminal is searched from the address assignment data according to the data for having occupied address and is not used by most
Small address;
The modular terminal is using the address found as the destination address.
6. according to the method described in claim 5, it is characterized in that, the response data carries the object module terminal life
At random number, whether the display terminal according to the response data that gets verifies the object module terminal successful distributively
Location includes:
Whether address entrained by two response datas that the display terminal judgement is first connected to has repetition;
If it is judged that there is repetition in address entrained by two be first connected to the response data, it is determined that the object module is whole
End distribution address failure;
If it is judged that address entrained by two be first connected to the response data does not repeat, it is determined that the object module
The success of terminal distribution address.
7. according to the method described in claim 6, it is characterized in that, determining that object module terminal distribution address is successfully wrapped
It includes:
The confirmation request is sent to institute according to the generating random number confirmation request of the modular terminal by the display terminal
Destination address is stated, the confirmation request carries the random number that the modular terminal generates;
The display terminal monitors confirmation response, wherein the confirmation response is that the corresponding modular terminal of the destination address is tested
Demonstrate,prove random number that the confirmation request carries it is consistent with the random number that the modular terminal generates when generate;
When the display terminal listens to confirmation response, the success of object module terminal distribution address is determined;
When the display terminal is not received by confirmation response, the display terminal is returned to the bus and sends a wheel
The step of address assignment data.
8. the method according to the description of claim 7 is characterized in that the display terminal listen to the confirmation response when,
After determining the success of object module terminal distribution address, the method also includes:
The display terminal judges whether at least two modular terminal is fully completed address distribution;
The display terminal is if it is judged that at least two modular terminal is not fully completed address distribution, then again to institute
It states at least two modular terminals and sends address assignment data, wherein the address assignment data that Xiang Suoshu object module terminal is sent
Carry the random number that the object module terminal generates.
9. a kind of modular terminal, which is characterized in that at least two modular terminals and display terminal are logical by the CAN bus of no principal and subordinate
Letter, the modular terminal include:
Allocation unit, for being divided after having monitored the wheel address assignment data that the display terminal is sent according to the address
Address is distributed for it with data, obtains destination address;
First address transmission unit, for sending the destination address to the bus, so that the display terminal carries out address
Verifying;
First monitoring unit, the confirmation request sent for monitoring the display terminal;
Determination unit, for when listening to the confirmation request, using the destination address as its own address;
First call unit, for when not listening to the confirmation request, calling the allocation unit;
Wherein, the allocation unit includes:
Module is monitored, for monitoring the data for having occupied address transmitted in the bus;
Searching module is not used by most for being searched from the address assignment data according to the data for having occupied address
Small address;
Third determining module, for using the address found as the destination address.
10. modular terminal according to claim 9, which is characterized in that
Generation unit, after taking turns address assignment data monitored the display terminal transmission one, and it is whole in the module
It holds before sending the destination address to the bus, generates random number;
First address transmission unit is also used to when reaching delay time, Xiang Suoshu bus send the address and it is described with
Machine number, wherein modular terminal delay time according to the generating random number.
11. modular terminal according to claim 10, which is characterized in that the determination unit includes:
Judgment module, the random number one whether generated with the modular terminal for judging the random number that the confirmation request carries
It causes;
First determining module, for judge random number that the confirmation request carries with the modular terminal and send it is random
When number is consistent, determine that the address of the modular terminal is allocated successfully;
Second determining module, for judge random number that the confirmation request carries with the modular terminal and send it is random
When number is inconsistent, the address distribution failure of the modular terminal is determined.
12. modular terminal according to claim 11, which is characterized in that the modular terminal further include:
Second monitoring unit, for after determining that the address of the modular terminal is allocated successfully, monitoring the display terminal hair
The generating random number request sent;
Judging unit, the random number for judging whether to carry the modular terminal generation in the generating random number request;
Second address transmission unit, the random number generated for carrying the modular terminal in generating random number request
When, the modular terminal sends the destination address to the bus;
Second call unit, when for not carrying the random number that the modular terminal generates in generating random number request,
Call the allocation unit.
13. a kind of display terminal, which is characterized in that the CAN bus that at least two modular terminals and display terminal pass through no principal and subordinate
Communication, the display terminal include:
Acquiring unit obtains modular terminal hair by the bus after sending a wheel address assignment data to the bus
The response data sent, wherein the response data carries the destination address that object module terminal is its own distribution, the target
Modular terminal is any one terminal at least two module;
Authentication unit, for verifying whether the object module terminal successfully distributes address according to the response data got;
Indicate transmission unit, in the case where the address of the object module terminal is allocated successfully, the display terminal root
The instruction information being allocated successfully is sent according to the destination address;
Data call unit, for calling the acquisition single in the case where the address of the object module terminal is distributed and fails
Member;
Wherein, object module terminal is that the destination address of its own distribution includes:
The modular terminal monitors the data for having occupied address transmitted in the bus;
The modular terminal is searched from the address assignment data according to the data for having occupied address and is not used by most
Small address;
The modular terminal is using the address found as the destination address.
14. display terminal according to claim 13, which is characterized in that the response data carries the object module
The random number that terminal generates, the authentication unit include:
Whether address judgment module, address entrained by two response datas for judging first to be connected to have repetition;
First address determination module, for judging that there is repetition in address entrained by two be first connected to the response data
When, determine that object module terminal distribution address fails;
Second address determination module, for judging that address entrained by two be first connected to the response data do not repeat
When, determine the success of object module terminal distribution address.
15. display terminal according to claim 14, which is characterized in that second address determination module includes:
Request generates submodule, for the generating random number confirmation request according to the modular terminal, and by the confirmation request
It is sent to the destination address, the confirmation request carries the random number that the modular terminal generates;
Submodule is monitored, for monitoring confirmation response, wherein the confirmation response is the corresponding modular terminal of the destination address
Verify random number that the confirmation request carries it is consistent with the random number that the modular terminal generates when generate;
Submodule is determined, for determining the object module terminal point when the display terminal listens to confirmation response
With address success;
Submodule is called, for calling the acquiring unit when the display terminal is not received by confirmation response.
16. display terminal according to claim 15, which is characterized in that the display terminal further include:
Judging unit, for determining the object module terminal distribution when the display terminal listens to confirmation response
After the success of address, the display terminal judges whether at least two modular terminal is fully completed address distribution;
The data call unit is also used to when judging that at least two modular terminal is not fully completed address distribution,
Address assignment data is sent at least two modular terminal again, wherein the address that Xiang Suoshu object module terminal is sent
Distribution data carry the random number that the object module terminal generates.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510771758.XA CN105338129B (en) | 2015-11-11 | 2015-11-11 | Automatic address division method, display terminal and module terminal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510771758.XA CN105338129B (en) | 2015-11-11 | 2015-11-11 | Automatic address division method, display terminal and module terminal |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105338129A CN105338129A (en) | 2016-02-17 |
CN105338129B true CN105338129B (en) | 2019-03-22 |
Family
ID=55288399
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510771758.XA Active CN105338129B (en) | 2015-11-11 | 2015-11-11 | Automatic address division method, display terminal and module terminal |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105338129B (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111131536B (en) * | 2019-12-09 | 2021-07-13 | 珠海格力电器股份有限公司 | Efficient configuration method, device and system for communication address and electric meter |
CN111586206B (en) * | 2020-05-29 | 2022-05-31 | 四川艾贝斯科技发展有限公司 | Automatic reporting method for address number of single lamp controller of street lamp system |
CN111711471A (en) * | 2020-06-12 | 2020-09-25 | 江苏集能易新能源技术有限公司 | Method for realizing power line carrier communication ad hoc network |
CN112665035B (en) * | 2021-01-19 | 2022-06-24 | 青岛海信日立空调***有限公司 | Multi-connected air conditioning system and control method thereof |
CN113612868B (en) * | 2021-08-06 | 2023-08-29 | 深圳市欧瑞博科技股份有限公司 | Equipment address allocation method, device and system |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6700877B1 (en) * | 1997-08-05 | 2004-03-02 | Siemens Aktiengesellschaft | Method and bus system for automatic address allocation |
CN1655081A (en) * | 2004-02-10 | 2005-08-17 | 上海新时达电气有限公司 | Allocator for automatically allocating address to serial bus device and method for controlling the same |
CN102292682A (en) * | 2008-11-25 | 2011-12-21 | 皮尔茨公司 | Method for transferring data in an automated control system |
CN202528858U (en) * | 2012-02-28 | 2012-11-14 | 华霆(合肥)动力技术有限公司 | Electromobile battery management system |
CN103676833A (en) * | 2013-09-25 | 2014-03-26 | 江苏峰谷源储能技术研究院有限公司 | An automatic configuration and correction method for battery electronic component communication addresses |
-
2015
- 2015-11-11 CN CN201510771758.XA patent/CN105338129B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6700877B1 (en) * | 1997-08-05 | 2004-03-02 | Siemens Aktiengesellschaft | Method and bus system for automatic address allocation |
CN1655081A (en) * | 2004-02-10 | 2005-08-17 | 上海新时达电气有限公司 | Allocator for automatically allocating address to serial bus device and method for controlling the same |
CN102292682A (en) * | 2008-11-25 | 2011-12-21 | 皮尔茨公司 | Method for transferring data in an automated control system |
CN202528858U (en) * | 2012-02-28 | 2012-11-14 | 华霆(合肥)动力技术有限公司 | Electromobile battery management system |
CN103676833A (en) * | 2013-09-25 | 2014-03-26 | 江苏峰谷源储能技术研究院有限公司 | An automatic configuration and correction method for battery electronic component communication addresses |
Also Published As
Publication number | Publication date |
---|---|
CN105338129A (en) | 2016-02-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105338129B (en) | Automatic address division method, display terminal and module terminal | |
CN106550318B (en) | A kind of processing method and terminal in direct mode operation lower channel conflict | |
US9222986B2 (en) | Distributed battery management system and method of identification distribution using the same | |
CN105783194B (en) | Multi-online air-conditioning system and its communication means | |
CN112272243B (en) | Address allocation method | |
CN107249048B (en) | Air conditioning system and address allocation method and device thereof | |
CN102934414A (en) | Address distributing method and device thereof | |
CN103716420A (en) | Automatic station address obtaining method of Modbus ASCII slave station and slave station | |
CN112671584A (en) | Network topology identification method, device, system and storage medium | |
CN103825789B (en) | Bus system and its operation method and the fluidic system with bus system | |
CN111597123A (en) | Automatic address allocation method, device, computer equipment and storage medium | |
CN102638590B (en) | Collocation method, air-conditioning system and the indoor apparatus of air conditioner of indoor set address | |
CN116319683A (en) | Method, system and device for distributing networking address and electronic equipment | |
CN107707385B (en) | A kind of data reporting method and system | |
CN112437454A (en) | Data transmission method and device, storage medium and electronic device | |
EP2517122A2 (en) | Routing and topology management | |
CN106792844B (en) | Data transmission method and device | |
CN101170470B (en) | Method for operation of bus system | |
CN106488563A (en) | A kind of resource selection method and device | |
CN114173396B (en) | Method and device for determining terminal networking time, electronic equipment and storage medium | |
CN104320455B (en) | A kind of data distributing method, server and system | |
US20220022009A1 (en) | Wireless communication system | |
CN113612868A (en) | Equipment address allocation method, device and system | |
CN107968718A (en) | A kind of method, apparatus and equipment for confirming standby usage state | |
CN105120013A (en) | Method and system for distributing network addresses of probe and central station |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |