[go: up one dir, main page]

CN105591857B - A kind of method and apparatus of 485 multi-host communication - Google Patents

A kind of method and apparatus of 485 multi-host communication Download PDF

Info

Publication number
CN105591857B
CN105591857B CN201510093094.6A CN201510093094A CN105591857B CN 105591857 B CN105591857 B CN 105591857B CN 201510093094 A CN201510093094 A CN 201510093094A CN 105591857 B CN105591857 B CN 105591857B
Authority
CN
China
Prior art keywords
node
data
time
waiting time
idle
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
Application number
CN201510093094.6A
Other languages
Chinese (zh)
Other versions
CN105591857A (en
Inventor
秦明海
刘康
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hisense Air Conditioning Co Ltd
Original Assignee
Hisense Shandong Air Conditioning Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Hisense Shandong Air Conditioning Co Ltd filed Critical Hisense Shandong Air Conditioning Co Ltd
Priority to CN201510093094.6A priority Critical patent/CN105591857B/en
Publication of CN105591857A publication Critical patent/CN105591857A/en
Application granted granted Critical
Publication of CN105591857B publication Critical patent/CN105591857B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Small-Scale Networks (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

An embodiment of the present invention provides a kind of method and apparatus of 485 multi-host communication, are related to field of communication technology, to long, the low problem of communication efficiency that solves in existing 485 communication system single host communication poll time.The method of 485 multi-host communication includes that first node determines the idle waiting time, and the idle waiting time, the no data from bus was transferred to the time that transmission data waits for by the first node;Whether detection has data transmission within the idle waiting time in the bus;If no, first node transmission data when the idle waiting time expires.

Description

485 multi-master communication method and device
Technical Field
The invention relates to the technical field of communication, in particular to a 485 multi-master communication method and device.
Background
The 485 communication network is a digital multipoint system adopting differential balanced transmission, and generally adopts a master-slave communication mode, namely, a master machine is provided with a plurality of slave machines, and meanwhile, a half-duplex communication mode is adopted between the master machine and the plurality of slave machines, so that the 485 communication network is widely applied by the advantages of low cost and simple design.
At present, the mode that the master inquires the slave responses only is adopted in the 485 communication network by adopting the half-duplex communication technology, namely, the master polls the slaves of the bus one by one, and the slaves respond to the master according to a polling mechanism, so that the collision of signals on the bus caused by the fact that a plurality of main bodies in the 485 communication network are in a sending state at the same time is avoided.
However, when a plurality of slaves are hooked on a single master, the polling mechanism results in long polling time and low communication speed, which cannot satisfy the requirement of fast data exchange, and further causes low communication efficiency.
Disclosure of Invention
The embodiment of the invention provides a 485 multi-master communication method and device, which are used for solving the problems of overlong single-host communication polling time and low communication efficiency in the existing 485 communication system.
In order to achieve the above purpose, the embodiment of the invention adopts the following technical scheme:
the embodiment of the invention provides a 485 multi-master communication method, which comprises the following steps:
a first node determines idle waiting time, wherein the idle waiting time is the waiting time from no data transmission to data sending of the first node;
detecting whether there is data transmission on the bus within the idle latency;
if not, the first node sends data when the idle waiting time expires.
The embodiment of the invention also provides a 485 multi-master communication device, which comprises:
a first determining unit, configured to determine an idle waiting time, where the idle waiting time is a time for the first node to wait from no data transmission on a bus to data transmission;
the detection unit is used for detecting whether data are transmitted on the bus in the idle waiting time;
a sending unit, configured to send data when the idle waiting time expires when the detecting unit detects that no data is transmitted on the bus within the idle waiting time.
The embodiment of the invention provides a 485 multi-master communication method and a device, which are characterized in that whether data are transmitted on a bus within the idle waiting time of a first node is detected by determining the idle waiting time of the first node; if not, the first node transmits the data upon expiration of the first node's idle wait time. Therefore, each node on the 485 bus is used as a first node, the master-slave relation is avoided, the idle waiting time of the first node is calculated, the first node sends data when the idle waiting time expires, data communication is not needed to be carried out in a host polling mode in the prior art, and the problems that the single host communication polling time is too long and the communication efficiency is low are solved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a schematic diagram of a 485 multi-master communication method according to an embodiment of the present invention;
fig. 2 is a schematic diagram of another 485 multi-master communication method according to an embodiment of the present invention;
FIG. 3 is a diagram illustrating another collision detection method according to an embodiment of the present invention;
fig. 4 is a schematic diagram of a 485 multi-master communication apparatus according to an embodiment of the present invention;
fig. 5 is a schematic diagram of another 485 multi-master communication device according to an embodiment of the present invention;
fig. 6 is a schematic diagram of another 485 multi-master communication apparatus according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The embodiment of the invention provides a 485 multi-master communication method, which is applied to each node in a standard 485 communication network, each node in the standard 485 communication network can be used as a first node, and other external interfaces are not required to be connected, so that data transmission is realized. Specifically, as shown in fig. 1, the method includes:
step 101, the first node determines an idle waiting time, which is a waiting time from no data transmission to data transmission of the first node on the bus.
Specifically, when there is no data transmission on the bus, the nodes that need to occupy the bus, that is, the nodes that need to send data, determine their respective idle waiting time.
The determining, by the first node, the idle waiting time of the first node specifically includes:
a1, obtaining the random attribute information of the first node, wherein the random attribute information of the first node comprises the address information of the first node, and/or the hardware parameter of the first node in the current environment, and/or any random number in 0-255.
and a2, carrying out summation operation on the random attribute information of the first node to obtain a first reference value.
a3, determining the idle waiting time of the first node according to a first formula: t is1=M1mod N1+t1(ii) a Wherein, T1Is the idle latency of the first node, M1Is a first reference value, t1For conflict-free minimum latency, N1Is the first modulus value.
For example, it is assumed that 100 machines are connected to the bus, each machine is a node, and addresses of the 100 machines are numbered in sequence as 01, 02, … …, and 100. When there is no data to transmit on the bus, all nodes need to send data to occupy the bus, and each node calculates its own idle latency. Taking the first node as a machine with an address of 62 as an example, the idle waiting time of the node is calculated, specifically, the obtained random attribute information of the first node includes that the address information of the first node is 62, the current ambient temperature of the first node is 20 degrees, and the random number obtained from (0-255) is 89, thenFirst reference value M1Equal to 171, i.e. M162+20+ 89; if the first modulus is 32, there is no conflict with the minimum waiting time t125ms, the idle waiting time of the first node is 36ms according to the first formula.
Step 102, detecting whether data is transmitted on the bus in the idle waiting time.
Because the idle waiting time of the first node calculated according to the method of step 101 is different, it needs to be determined whether there is data to be transmitted on the bus within the idle waiting time of the first node, and if there is no data to be transmitted on the bus, step 103 is executed; if there is data transmission on the bus, it is necessary to wait until the node sending the data finishes data transmission, and then calculate the idle waiting time according to step 101, and the cycle is repeated.
Illustratively, on the basis of the example of step 101, the first node detects whether there is data to be sent on the bus within 36 ms. If there is no data transmission on the bus, go to step 103; if the idle waiting time of the machine with the address of 60 is 30ms, when the idle time on the bus reaches 30ms, the machine with the address of 60 starts to send data, at this time, the machine with the address of 62 may detect that there is data transmission on the bus at 36ms, and the machine with the address of 62 needs to wait until all the data of the machine with the address of 60 is sent, and then calculate the idle waiting time again according to the step 101, and repeat the cycle.
And 103, if not, the first node sends data when the idle waiting time is expired.
The format of the data sent by the first node may use a standard serial port data format or a non-standard serial port data format.
The embodiment of the invention provides a 485 multi-master communication method, which comprises the steps of determining the idle waiting time of a first node, and detecting whether data transmission exists on a bus within the idle waiting time of the first node; if not, the first node transmits the data upon expiration of the first node's idle wait time. Therefore, each node on the 485 bus is used as a first node, the master-slave relation is avoided, the idle waiting time of the first node is calculated, the first node sends data when the idle waiting time expires, data communication is not required to be carried out in a host polling mode in the prior art, and the problems that the single host communication polling time is too long and the communication efficiency is low are solved.
Further, as shown in fig. 2, while performing step 103, the method further includes:
and step 104, determining whether the transmitted data have collision according to a collision detection method.
In the embodiment of the present invention, because there is no master-slave relationship between nodes on the 485 communication bus, when a first node occupies the bus to transmit data, the first node also receives data transmitted by itself, and then, according to the data transmitted and received by itself, the first node determines whether the transmitted data is transmitted in a collision, where the collision is that when other nodes are the same as idle time of the first node, the data is transmitted at the same time, and at this time, the data on the bus will occupy the bus to cause a collision.
As shown in fig. 3, the determining, by the first node, whether the data to be transmitted conflicts according to the conflict detection method specifically includes:
b1, the first node determines whether the parity bit of the transmitted data is correct.
If the first node determines that the parity bit of the transmitted data is correct, performing step b 2; if the first node determines that the parity bit of the transmitted data is erroneous, step b6 is performed.
b2, if the first node determines that the parity bit of the transmitted data is correct, the first node determines whether the transmitted data length is correct.
If the first node determines that the sent data length is correct, executing step b 3; if the first node determines that the sent data length is incorrect, step b6 is executed.
b3, if the first node determines that the length of the data is correct, the first node determines whether the stop bit of the sent data is correct.
If the first node determines that the stop bit of the transmitted data is correct, executing step b 4; if the first node determines that the stop bit of the transmitted data is erroneous, step b6 is performed.
b4, if the first node determines that the stop bit of the transmitted data is correct, the first node determines whether the data frame of the transmitted data is correct.
If the first node determines that the stop bit of the transmitted data is correct, executing step b 5; if the first node determines that the stop bit of the transmitted data is erroneous, step b6 is performed.
b5, if the first node determines that the data frame of the transmitted data is correct, the first node determines that the transmitted data has no conflict.
b6, the first node determines that the transmitted data is in conflict.
The order of the above steps b1, b2, b3, b4 may be adjusted, and the present invention is illustrated by only one of them. Meanwhile, the parity bit in step b1, the data length in step b2, the stop bit in step b3, and the data frame in step b4 may be set according to a method in the prior art, which is not described again.
According to the step 104, when the first node determines that the transmitted data is not collided, executing the step 105; when the first node determines that the transmitted data is in conflict, step 106 is executed.
And 105, if the transmitted data are determined not to have collision, continuing to transmit the data.
Of course, in the subsequent data sending process, whether the sent data conflict can be judged in real time until the data sending is finished.
And step 106, if the sending conflict of the sent data is determined, detecting whether the conflict times reach the preset conflict times.
For example, assuming that the preset number of collisions is 4, when data sent by the machine with the address of 62 collides, the number of collisions of the machine with the address of 62 is added by 1, and when the number of collisions reaches 4 after adding 1, step 107 is executed; if the number of collisions has not reached 4 times after adding 1, step 108 is performed.
And 107, if so, calculating the back-off time of the first node according to a back-off delay algorithm.
Wherein calculating the back-off time of the first node according to the back-off delay algorithm comprises:
c1, acquiring address information of a second node, wherein the second node is a node which normally sends data before no data is transmitted on the bus;
c2, calculating the back-off time of the first node according to a second formula:
T2=|S1-S2|×t2+t3
wherein, T2Is the back-off time of the first node, S1Is address information of the first node, S2Is address information of the second node, t2Is a unit back-off delay time, t3Is the minimum back-off delay time.
After the delay time of the first node is calculated according to the back-off delay algorithm, the first node detects again whether there is data transmission on the bus after the delay time expires, and proceeds to step 101 to perform subsequent operations.
For example, assuming that the sending of data by the machine with address 03 is finished before the sending of data by the machine with address 62, the machine with address 03 is the second node, and the address information of the second node is 03; if unit back-off delay time t210ms, minimum backoff delayTime of flight t3Is 100ms, then the back-off time T of the first node is calculated according to the second formula2Equal to 690ms, i.e. T2The calculated backoff time of the first node is much longer than the idle waiting time of the first node, so that the frequently colliding machines temporarily exit from the bus contention, and after the backoff time expires, the bus contention is detected to determine whether there is data transmission on the bus, so as to re-enter the bus contention.
And step 108, if the delay time does not reach the preset delay time, calculating the delay time of the first node according to a conflict delay algorithm.
Wherein calculating the delay time of the first node according to the collision delay algorithm comprises:
d1, acquiring second random attribute information of the first node.
It should be noted that the contents of the acquired second random attribute information and the first random attribute information may be the same, and are only acquired for distinguishing different times. Reference may be made to the above description of the first random attribute information for the second random attribute information.
d2, carrying out summation operation on the second random attribute information to obtain a second reference value.
d3, calculating the delay time of the first node according to a third formula:
T3=(M2mod N2)+t4-k×t5
wherein, T3Is a delay time of the first node, M2Is the second reference value, N2Is the second modulus, t4K is the number of collisions of the first node, t5Is the collision latency.
After the delay time of the first node is calculated according to the collision delay algorithm, the first node detects whether data transmission exists on the bus again after the delay time expires, and the process continues to step 101 to perform subsequent operations.
For example, assuming that the number of collisions at the machine with the address 62 is 1, the obtaining of the second random attribute information of the machine with the address 60 includes: address information 62, temperature of current environment 19 deg. and random number 9 selected from (0-255), and obtained second reference value M2Equal to 90, i.e. M262+19+ 9; minimum waiting time t if there is no conflict416ms, collision latency t52ms and the second modulus is 8, the delay time T of the first node is calculated according to a third formula3And the calculated delay time of the first node is far less than the idle waiting time of the first node, so that the time is recalculated according to a collision delay algorithm under the condition of limited collision times in order to reduce the occurrence of subsequent collisions. In order to reduce the probability of subsequent collision, the success rate of retransmission of the machine with collision is provided, the priority of transmission of the machine with collision is provided in turn according to the subtraction of a certain time from the number of collision in calculation, and whether data transmission exists on the bus is detected after the waiting delay time expires, so as to re-enter the bus competition.
The 485 multi-master communication method provided by the embodiment of the invention determines the idle waiting time of the first node and detects whether data transmission exists on a bus within the idle waiting time of the first node; if not, the first node transmits the data upon expiration of the first node's idle wait time. However, when there are many nodes on which the bus is attached, the idle waiting time of several devices may be the same as the idle waiting time of the first node, and when the idle waiting time expires, the first node and the several devices may transmit data at the same time, so that the first node collides with the several devices, and the back-off time or the delay time of the several devices is recalculated according to different algorithms according to the number of times of collision, and since the delay time is smaller than the idle waiting time, the time for which the machine that collided waits is shorter than the machine that did not collide, and the collision detection of the next time completes the transmission of data. According to the method provided by the embodiment of the invention, each node on the 485 bus is taken as a first node, no master-slave relation exists, and the idle waiting time of the first node is calculated, so that the first node sends data when the idle waiting time of the first node expires, data communication is not required to be carried out in a host polling mode in the prior art, and the problems of long communication polling time and low communication efficiency of a single host are solved. Meanwhile, reliable and efficient operation of multi-master communication can be achieved through collision detection.
The embodiment of the invention provides a 485 multi-master communication device, as shown in fig. 4, comprising:
a first determining unit 401, configured to determine an idle waiting time, where the idle waiting time is a time that a first node waits from no data transmission on a bus to data transmission;
a detecting unit 402, configured to detect whether there is data transmission on the bus within the idle waiting time;
a sending unit 403, configured to send data when the idle waiting time expires when the detecting unit 402 detects that there is no data transmission on the bus within the idle waiting time.
Further, as shown in fig. 5, the apparatus further includes: a second determination unit 404, a calculation unit 405.
Wherein, the second determining unit 404 is configured to determine whether the transmitted data is in collision according to a collision detection method;
the detecting unit 402 is further configured to detect whether the number of collisions reaches a preset number of collisions if the second determining unit 404 determines that the transmitted data have collisions;
the calculating unit 405 is configured to calculate a backoff time of the first node according to a backoff delay algorithm if the detecting unit 402 detects that the collision frequency reaches a preset collision frequency;
the calculating unit 405 is further configured to calculate the delay time of the first node according to a collision delay algorithm if the detecting unit 402 detects that the number of collisions does not reach the preset number of collisions;
the backoff time of the first node is greater than the idle waiting time of the first node, and the idle waiting time of the first node is greater than the delay time of the first node.
Optionally, as shown in fig. 6, the first determining unit 401 includes: a first obtaining sub-unit 4011, a first calculating sub-unit 4012 and a determining sub-unit 4013;
the first obtaining sub-unit 4011 is configured to obtain random attribute information of the first node, where the random attribute information of the first node includes address information of the first node, and/or a hardware parameter of the first node in a current environment, and/or any random number from 0 to 255;
the first calculating sub-unit 4012 is configured to perform summation operation on the random attribute information of the first node to obtain a first reference value;
a determining subunit 4013, configured to determine an idle latency of the first node according to a first formula, where the first formula is: t is1=M1mod N1+t1(ii) a Wherein, T1Is the idle latency of the first node, M1Is a first reference value, t1For conflict-free minimum latency, N1Is the first modulus value.
Optionally, the second determining unit 404 is specifically configured to determine whether the parity of the transmitted data is correct; if the data length of the sent data is correct, determining whether the data length of the sent data is correct; if so, determining whether the stop bit of the sent data is correct; if the data frame is correct, determining whether the data frame of the transmitted data is correct; and if the data is correct, determining that no conflict occurs.
Optionally, as shown in fig. 6, the calculating unit 405 includes: a second acquisition sub-unit 4051, a second calculation sub-unit 4052.
The second obtaining subunit 4051 is configured to obtain address information of a second node, where the second node is a node that normally sends data before no data is transmitted on the bus;
the second calculating subunit 4052 is configured to calculate the back-off time of the first node according to a second formula, where the second formula is: t is2=|S1-S2|×t2+t3(ii) a Wherein, T is2Is the back-off time of the first node, S1Is address information of the first node, S2Is address information of the second node, t2Is a unit back-off delay time, t3Is the minimum back-off delay time.
Optionally, the second obtaining sub-unit 4051 is further configured to obtain second random attribute information of the first node; the second calculating subunit 4052 is further configured to perform summation operation on the second random attribute information to obtain a second reference value; calculating the delay time of the first node according to a third formula, wherein the third formula is as follows: t is3=(M2mod N2)+t4-k×t5(ii) a Wherein, T is3Is a delay time of the first node, the M2Is the second reference value, the N2Is a second modulus value, said t4For conflict-free minimum latency, k is the number of conflicts of the first node, t5Is the collision latency.
The embodiment of the invention provides a 485 multi-master communication device, which is characterized in that whether data is transmitted on a bus within the idle waiting time of a first node is detected by determining the idle waiting time of the first node; if not, the first node transmits the data upon expiration of the first node's idle wait time. Therefore, each node on the 485 bus is used as a first node, the master-slave relation is avoided, the idle waiting time of the first node is calculated, the first node sends data when the idle waiting time expires, data communication is not needed to be carried out in a host polling mode in the prior art, and the problems that the single host communication polling time is too long and the communication efficiency is low are solved.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be physically included alone, or two or more units may be integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
The integrated unit implemented in the form of a software functional unit may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute some steps of the methods according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (6)

1. A method of 485 multi-master communication, comprising:
a first node determines idle waiting time, wherein the idle waiting time is the waiting time from no data transmission to data sending of the first node;
detecting whether there is data transmission on the bus within the idle latency;
if not, the first node sends data when the idle waiting time expires;
while the first node is transmitting data upon expiration of the idle wait time, the method further comprises:
determining whether the transmitted data are conflicted according to a confliction detection method;
if the sent data are determined to have conflict, detecting whether the number of conflicts reaches the preset number of conflicts;
if so, calculating the back-off time of the first node according to a back-off delay algorithm;
if not, calculating the delay time of the first node according to a conflict delay algorithm;
the backoff time of the first node is greater than the idle waiting time of the first node, and the idle waiting time of the first node is greater than the delay time of the first node.
2. The method of claim 1, wherein the determining an idle latency time comprises:
acquiring random attribute information of a first node, wherein the random attribute information of the first node comprises address information of the first node, and/or hardware parameters of the first node in the current environment, and/or any random number in 0-255;
performing summation operation on the random attribute information of the first node to obtain a first reference value;
determining an idle latency of the first node according to a first formula, the first formula being: t is1=M1mod N1+t1(ii) a Wherein, T is1Is the idle waiting time of the first node, the M1Is the first reference value, the t1For conflict-free minimum latency, N1Is the first modulus value.
3. The method of claim 1, wherein determining whether the transmitted data is collided according to the collision detection method comprises:
determining whether a parity bit of the transmitted data is correct;
if the data length of the sent data is correct, determining whether the data length of the sent data is correct;
if so, determining whether the stop bit of the sent data is correct;
if the data frame is correct, determining whether the data frame of the transmitted data is correct;
and if the data is correct, determining that no conflict occurs.
4. The method of claim 1, wherein the calculating the back-off time of the first node according to a back-off delay algorithm comprises:
acquiring address information of a second node, wherein the second node is a node which normally sends data before no data is transmitted on the bus;
calculating the back-off time of the first node according to a second formula, wherein the second formula is as follows:
T2=|S1-S2|×t2+t3
wherein, T is2Is the back-off time of the first node, S1Is address information of the first node, S2Is address information of the second node, t2Is a unit back-off delay time, t3Is the minimum back-off delay time.
5. The method of claim 1, wherein said calculating a delay time of the first node according to a collision delay algorithm comprises:
acquiring second random attribute information of the first node;
performing summation operation on the second random attribute information to obtain a second reference value;
calculating the delay time of the first node according to a third formula, wherein the third formula is as follows:
T3=(M2mod N2)+t4-k×t5
wherein, T is3Is a delay time of the first node, the M2Is the second reference value, cN is2Is a second modulus value, said t4For conflict-free minimum latency, k is the number of conflicts of the first node, t5Is the collision latency.
6. An apparatus for 485 multi-master communication, comprising:
the first determining unit is used for determining the idle waiting time, wherein the idle waiting time is the waiting time from no data transmission to data sending of the first node on the bus;
the detection unit is used for detecting whether data are transmitted on the bus in the idle waiting time;
a sending unit, configured to send data when the idle waiting time expires when the detecting unit detects that no data is transmitted on the bus within the idle waiting time;
the device further comprises: a second determination unit, a calculation unit; wherein,
the second determining unit is used for determining whether the transmitted data are collided according to a collision detection method;
the detecting unit is further configured to detect whether the number of collisions reaches a preset number of collisions if the second determining unit determines that the transmitted data collide;
the calculating unit is used for calculating the backoff time of the first node according to a backoff delay algorithm if the detecting unit detects that the collision times reach the preset collision times;
the calculating unit is further configured to calculate the delay time of the first node according to a conflict delay algorithm if the detecting unit detects that the number of conflicts does not reach a preset number of conflicts;
the backoff time of the first node is greater than the idle waiting time of the first node, and the idle waiting time of the first node is greater than the delay time of the first node.
CN201510093094.6A 2015-03-02 2015-03-02 A kind of method and apparatus of 485 multi-host communication Active CN105591857B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510093094.6A CN105591857B (en) 2015-03-02 2015-03-02 A kind of method and apparatus of 485 multi-host communication

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510093094.6A CN105591857B (en) 2015-03-02 2015-03-02 A kind of method and apparatus of 485 multi-host communication

Publications (2)

Publication Number Publication Date
CN105591857A CN105591857A (en) 2016-05-18
CN105591857B true CN105591857B (en) 2018-09-25

Family

ID=55931108

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510093094.6A Active CN105591857B (en) 2015-03-02 2015-03-02 A kind of method and apparatus of 485 multi-host communication

Country Status (1)

Country Link
CN (1) CN105591857B (en)

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106302066A (en) * 2016-08-26 2017-01-04 珠海格力电器股份有限公司 Master-slave-free communication method and device
CN106502936B (en) * 2016-10-26 2020-02-04 海信(山东)空调有限公司 Conflict avoidance method of multiple main buses and node equipment
CN107171921B (en) * 2017-04-07 2020-08-07 惠州市天泽盈丰物联网科技股份有限公司 Real-time communication method based on RS485 network
CN107171917B (en) * 2017-04-07 2020-11-03 惠州市天泽盈丰物联网科技股份有限公司 RS485 bus capacity expansion-based network
CN107104865B (en) * 2017-04-07 2020-08-18 惠州市天泽盈丰物联网科技股份有限公司 RS485 bus-based background extension method and system
CN106982156B (en) * 2017-06-08 2019-11-15 日立楼宇技术(广州)有限公司 Priority setting method, device, communication system, equipment and readable storage medium
CN107465487B (en) * 2017-08-14 2020-07-28 来邦科技股份公司 Bus data sending method, system and sub-equipment
CN109495215B (en) * 2018-12-20 2022-02-11 山东比特智能科技股份有限公司 Communication method, system and device of half-duplex bus and readable storage medium
CN112217701A (en) * 2019-07-09 2021-01-12 杭州萤石软件有限公司 Bus collision avoidance method and device
CN110635982B (en) * 2019-08-09 2021-12-14 工业互联网创新中心(上海)有限公司 Double-host communication method and system on communication bus, industrial control gateway and storage medium
CN113965308A (en) * 2021-10-26 2022-01-21 上海三思电子工程有限公司 Connection communication method, slave device and device control system
CN116582384A (en) * 2023-04-19 2023-08-11 青岛海信日立空调系统有限公司 485 bus-based communication method and intelligent home system
CN119594545A (en) * 2024-12-11 2025-03-11 Tcl空调器(中山)有限公司 Cascade air conditioner address allocation method and device, storage medium and cascade air conditioner

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101626334A (en) * 2009-08-10 2010-01-13 中兴通讯股份有限公司 Method and device for controlling communication bus
CN202041950U (en) * 2010-12-30 2011-11-16 Tcl集团股份有限公司 A RS485 bus anti-collision controller
CN102546141A (en) * 2012-02-20 2012-07-04 杭州海康威视系统技术有限公司 485 bus system and asynchronous half-duplex communication method thereof

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7668998B2 (en) * 2008-01-08 2010-02-23 Parata Systems, Llc Methods, systems, and devices for providing an interrupt scheme in automated pharmaceutical dispensing machines without centralized arbitration

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101626334A (en) * 2009-08-10 2010-01-13 中兴通讯股份有限公司 Method and device for controlling communication bus
CN202041950U (en) * 2010-12-30 2011-11-16 Tcl集团股份有限公司 A RS485 bus anti-collision controller
CN102546141A (en) * 2012-02-20 2012-07-04 杭州海康威视系统技术有限公司 485 bus system and asynchronous half-duplex communication method thereof

Also Published As

Publication number Publication date
CN105591857A (en) 2016-05-18

Similar Documents

Publication Publication Date Title
CN105591857B (en) A kind of method and apparatus of 485 multi-host communication
US9015267B2 (en) Method for setting addresses of slave devices in communication network
EP1921801B1 (en) Method and network for forwarding messages with priority-based arbitration
CN112579509B (en) Single-wire communication method, single-wire communication device, electronic equipment and readable storage medium
CN104410547B (en) A kind of address conflict detecting method in dcs
CN109150680B (en) Self-adaptive address-determining networking circuit and method suitable for RS485 bus
US11720505B2 (en) Device for a single wire digital bus, master device, sensor, and method to assign addresses to multiple devices on a single wire digital bus
CN109495215B (en) Communication method, system and device of half-duplex bus and readable storage medium
TWI516942B (en) Assigning addresses to devices on an interconnect
JP2003162498A (en) Bus system and retry method
JP6055019B2 (en) PLC system including a plurality of CPU modules and control method
KR20160047484A (en) Method to minimize the number of irq lines from peripherals to one wire
US8671230B2 (en) Data transfer device and data transfer method
CN104486187B (en) A kind of CAN communication device and method of dynamic synchronization
TWI745495B (en) Wireless communication device and recording medium for recording program
CN108173950B (en) Data transmission method, device and system, image acquisition equipment and storage medium
JP5815085B1 (en) Communication system, communication apparatus, connection state determination method, and control program
CN103778091B (en) Apparatus and method for operating and switching single conductor interface
CN119835252A (en) Method, system, apparatus and medium for address conflict identification
CN107453844A (en) A kind of method and device of smart machine automatic network-building
CN108628796A (en) A kind of serial communication method and system
US20150334047A1 (en) Initiator terminal, target terminal, method of interrupting access of initiator terminal, and method of interrupting access of target terminal
KR20150061348A (en) Method and Apparatus for setting up device address for I2C communication
CN108183845A (en) A kind of bus contention method based on bit arbitration
CN113032307A (en) Integrated device access request processing method and related assembly

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 266736 Hisense Road 1, South Village Town, Pingdu City, Qingdao, Shandong

Applicant after: HISENSE (SHANDONG) AIR-CONDITIONING Co.,Ltd.

Address before: 266100 Zhuzhou Road, Laoshan District, Qingdao, Shandong Province, No. 151

Applicant before: HISENSE (SHANDONG) AIR-CONDITIONING Co.,Ltd.

GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: No.1 Haixin Road, Nancun Town, Pingdu City, Qingdao City, Shandong Province

Patentee after: Hisense Air Conditioning Co.,Ltd.

Country or region after: China

Address before: No. 151, Zhuzhou Road, Laoshan District, Qingdao, Shandong

Patentee before: HISENSE (SHANDONG) AIR-CONDITIONING Co.,Ltd.

Country or region before: China