CN107995080B - Multi-host communication method based on two-wire bus - Google Patents

Multi-host communication method based on two-wire bus Download PDF

Info

Publication number
CN107995080B
CN107995080B CN201711340864.8A CN201711340864A CN107995080B CN 107995080 B CN107995080 B CN 107995080B CN 201711340864 A CN201711340864 A CN 201711340864A CN 107995080 B CN107995080 B CN 107995080B
Authority
CN
China
Prior art keywords
data
slave station
station
repeater
bus
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
CN201711340864.8A
Other languages
Chinese (zh)
Other versions
CN107995080A (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.)
Changsha Xuanmi Electronic Technology Co ltd
Original Assignee
Changsha Xuanmi Electronic Technology 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 Changsha Xuanmi Electronic Technology Co ltd filed Critical Changsha Xuanmi Electronic Technology Co ltd
Priority to CN201711340864.8A priority Critical patent/CN107995080B/en
Publication of CN107995080A publication Critical patent/CN107995080A/en
Application granted granted Critical
Publication of CN107995080B publication Critical patent/CN107995080B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L12/40006Architecture of a communication node
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L12/40143Bus networks involving priority mechanisms
    • H04L12/40163Bus networks involving priority mechanisms by assigning priority to messages according to a message field

Abstract

The invention discloses a multi-host communication method based on a two-wire system bus, which comprises a step of transmitting data by a master station, wherein the step of transmitting data by the master station is used for transmitting the data to a slave station; the step that the slave station uploads data without broadcasting is used for uploading data from the slave station to the master station; a step of uploading data by broadcasting of the whole bus of the slave station, wherein the step is used for sending the data to all the slave stations and the master station by the slave station; and a step of the slave station limiting range broadcasting uploading data, wherein the step is used for the slave station sending data to the master station and the slave station connected with the slave station in the same repeater. Through the existing two-bus mode and the innovative communication method, the invention not only realizes the communication mode of multiple hosts, but also realizes the full-bus broadcast and limited range data transmission of the slave station; in addition, the communication method is simple, reliable and convenient to implement.

Description

Multi-host communication method based on two-wire bus
Technical Field
The invention particularly relates to a multi-host communication method based on a two-wire system bus.
Background
With the development of national economic technology and the improvement of living standard of people, the industry has used a large amount of buses for communication. The bus communication has the advantages of simple and reliable communication hardware, strong anti-interference capability and the like, and is widely applied to various industrial occasions.
In current bus applications, two-wire buses occupy a large proportion. The two-bus communication mode has been widely applied in the aspects of power grid power monitoring, fire-fighting electronic equipment, energy management and the like. The two-wire bus has the advantages of strong anti-interference capability of other bus communication, simple and reliable hardware and the like, and also has the advantages that the master-slave equipment communication can be completed only by two wires without an additional power line.
However, the conventional two-wire bus only supports a master-slave mode of one-to-many communication, but not many-to-many communication, thereby greatly limiting many industrial application occasions of the two-wire bus.
Disclosure of Invention
The invention aims to provide a multi-host communication method based on a two-wire system bus, which is suitable for multi-host communication.
The invention provides a multi-host communication method based on a two-wire bus, which comprises the following steps:
a step of sending data by the master station, which is used for sending the data to all slave stations on the bus by the master station;
the step that the slave station does not have broadcast uploading data is used for uploading the data to the master station;
a step of broadcasting and uploading data by the slave station full bus, wherein the slave station is used for sending the data to all slave stations and master stations on the bus;
and a step of the slave station limiting range broadcasting uploading data, wherein the slave station transmits the data to all slave stations connected with the slave station limiting range on the same repeater.
The step of the master station issuing data is specifically that the following steps are adopted to complete the issuing of the master station data:
A. the master station packs the data to be issued, adds a data flag bit and then issues the data to the bus; the data flag bit is a first value;
B. all slave stations and relays which are directly connected with the master station on the bus receive data packets sent by the master station;
C. after receiving the data packet sent by the master station, the repeater keeps the data flag bit unchanged and forwards the received data packet to all the devices directly hung on the repeater; all the devices comprise a repeater and a slave station;
D. and D, repeating the step C until all slave stations on the bus receive the data packet transmitted by the master station, thereby completing the step of transmitting the data of the master station.
The step of uploading data without broadcasting by the slave station specifically comprises the following steps of:
a. the slave station i packs the data to be uploaded, adds a data flag bit and then uploads the data to the bus; at the moment, the data flag bit is a second value, and i is a natural number;
b. if the master station is directly connected with the slave station i through the bus, the master station receives the data packet uploaded by the slave station i, and the non-broadcast data uploading of the slave station i is finished; if the master station is not directly connected with the slave station i through the bus, the repeater receives a data packet uploaded by the slave station i;
c. the repeater sets the data flag position in the received data packet to be a third value and continuously uploads the data flag position to a bus in the direction of the master station;
d. and c, repeating the step c until the master station receives the data packet uploaded by the slave station i, thereby completing the step of uploading the non-broadcast data of the slave station.
And c, the repeater does not forward data downwards.
The step of uploading data by broadcasting the slave station full bus specifically comprises the following steps of:
(1) the slave station j packs the data to be uploaded, adds a data flag bit and then uploads the data to the bus; at this time, the data flag bit is a fourth value, and j is a natural number;
(2) the master station or the repeater directly connected with the slave station j directly receives the data packet sent by the slave station j, and the master station or the repeater sets the data flag position as a fifth value and sends the fifth value to all the devices directly hung on the master station or the repeater; all the devices comprise a repeater and a slave station;
(3) repeating the step (2) until all the devices from the slave station j to the tail end of the bus on the bus receive the data packet sent by the slave station j;
(4) if the master station is not directly connected with the slave station j through the bus, after receiving the data packet sent by the slave station j, the repeater sets the data flag bit to be a sixth value and continuously uploads the data flag bit to the bus in the direction of the master station, and meanwhile, the repeater sets the data flag bit of the data packet sent by the slave station j to be a seventh value and continuously sends the data flag bit to all equipment directly hung on the repeater; all the devices comprise a repeater and a slave station;
(5) and (5) repeating the step (4) until all slave stations and master stations from the slave station j to the front end of the bus on the bus receive the data packet sent by the slave station j, and completing the full-bus uploading of the data of the slave station j.
And (4) setting the data flag bit of the data packet sent from the station j to be the seventh value by the repeater, continuing to issue the data packet to all the devices directly hung on the repeater, discarding the data with the data flag bit being the seventh value by the repeater directly hung on the repeater, and stopping issuing the data.
The fifth value is equal to the fourth value.
The sixth value and the seventh value are equal.
The step of the slave station for broadcasting the upload data within the limited range specifically comprises the following steps of:
1) the slave station k packs data to be sent, adds a data flag bit and uploads the data to the bus; the data flag bit at this time is an eighth value, and k is a natural number;
2) the master station or the repeater directly connected with the slave station k directly receives the data packet sent by the slave station k;
3) the repeater sets the data flag position as a ninth value after receiving the data packet sent by the slave station k, and sends the ninth value to all the devices directly hung on the repeater, so that the limited range broadcast uploading of the data of the slave station k is completed; all devices described include relays and slaves.
And 3) the repeater receives the data packet sent by the station k, sets the data flag bit to be a ninth value and transmits the ninth value to all the devices directly connected with the repeater, and the repeater directly connected with the repeater discards the data packet with the data flag bit being the ninth value and terminates transmission.
When the slave station broadcasts the uploading data by the full bus of the slave station and broadcasts the uploading data by the limited range of the slave station, the slave station shields the data packet returned by the master station or the repeater by adopting the following silent algorithm:
the state transition value p of the slave station is calculated by the following formula:
P=N-b+n
wherein p is the state transition value of the slave station, N is the number of data uploaded by the slave station, b is the number of returned data of the relay received by the slave station, and N is the number of newly added uploaded data of the slave station;
and II, judging whether the slave station shields the data returned by the repeater or not by adopting the following rules according to the state transfer value obtained in the step I:
if the state transition value p is not equal to 0, the slave station enters a silent mode and shields data returned by the repeater;
if the state transition value p is equal to 0, the slave station enters a normal mode and receives data returned by the repeater;
and III, the following rule is adopted to prevent the slave station from being out of the shielding state due to the fact that the data packet returned by the repeater is lost:
if T > Itmax and p >0, then p-1;
the value rule of Itmax in the formula is: if (Itmax/2 ≧ n1), Itmax ═ Itmax/2; the initial value of Itmax is the time interval between single data upload and return, n1 is a first predetermined threshold, and n1 is a natural number;
and IV, if detecting that the data packet is lost, setting: t > m1 × T, Itmax ═ m 2; if the data packet loss is continuously detected, setting: t > m3 × T, Itmax ═ m 4; m1, m2, m3 and m4 are all natural numbers, m3 is less than m1, and m4 is less than m 2.
When the master station or the relay transmits the data back in the broadcasting and uploading process of the slave station full bus and the broadcasting and uploading process of the slave station limited range, the data are transmitted by adopting the following delay forwarding algorithm, so that the integrity of data forwarding is ensured:
i, setting an upper layer data forwarding priority Pu and a lower layer backhaul data forwarding priority Pd of the master station by adopting the following rules:
if u is 0 and d is 0, setting Pu > Pd, indicating that the upper layer data forwarding priority Pu is higher than the lower layer backhaul data forwarding priority Pd;
if u is 0, d is greater than 0 and T is greater than tx, setting Pd > Pu, indicating that the lower layer returned data forwarding priority Pd is higher than the upper layer data forwarding priority Pu;
if u is greater than 0, d is 0 and T is greater than tx, setting Pu to be greater than Pd, and indicating that the forwarding priority Pu of the upper layer data is higher than the forwarding priority Pd of the lower layer return data;
if u is not equal to 0, d is not equal to 0 and u + d is larger than 0, setting the switching time of upper layer data forwarding and lower layer return data forwarding as tx;
the tx is z is m5 is t, m5 is a natural number, t is the time of single data transmission, z is a reserved idle time adjustment parameter, and the larger the value of z is, the more the reserved idle time is;
and ii, the master station issues the data according to the priority set in the step i.
The multi-host communication method based on the two-wire bus realizes the communication between the slave station and the slave station by the existing two-bus mode and the innovative communication method and by utilizing the master station and the relay return function, so that the slave station can be converted into the host mode at any time, thereby realizing the multi-host communication mode and realizing the full-bus broadcast and the limited range data transmission of the slave station; in addition, the communication method is simple, reliable and convenient to implement.
Drawings
FIG. 1 is a schematic diagram of a bus structure of the method of the present invention.
FIG. 2 is a flow chart of the steps of the master station issuing data according to the method of the present invention.
Fig. 3 is a flow chart illustrating the steps of the method of the present invention for uploading data from a secondary station without broadcast.
Fig. 4 is a flowchart illustrating the steps of the method of the present invention for broadcasting the upload data from the station full bus.
Fig. 5 is a flowchart illustrating steps of a method of the present invention for broadcasting upload data from a station with a limited range.
Detailed Description
FIG. 1 is a schematic diagram of a bus structure of the method of the present invention. The communication method of the present invention may be implemented using communication hardware as described in the applied patent 201620933082. X. The bus structure is shown in fig. 1 (schematic): i slave stations (slave station 1-slave station i) and a repeater 1 are directly connected below the master station, slave stations i + 1-slave station j are directly connected below the repeater 1, and a repeater 2 is also connected; and repeating the steps until the last repeater n and the slave stations k to n hung under the repeater n.
Fig. 2 is a flowchart showing the steps of the master station issuing data according to the method of the present invention: the step of the master station issuing data specifically comprises the following steps of:
A. the master station packs the data to be issued, adds a data flag bit and then issues the data to the bus; the data flag bit is a first value;
B. all slave stations and relays which are directly connected with the master station on the bus receive data packets sent by the master station;
C. after receiving the data packet sent by the master station, the repeater keeps the data flag bit unchanged and forwards the received data packet to all the devices directly hung on the repeater; all the devices comprise a repeater and a slave station;
D. and D, repeating the step C until all slave stations on the bus receive the data packet transmitted by the master station, thereby completing the step of transmitting the data of the master station.
Fig. 3 is a flowchart illustrating steps of the method of the present invention for uploading data from a secondary station without broadcasting: the step of uploading data without broadcasting by the slave station is specifically that the following steps are adopted to finish the data uploading without broadcasting by the slave station:
a. the slave station i packs the data to be uploaded, adds a data flag bit and then uploads the data to the bus; at the moment, the data flag bit is a second value, and i is a natural number;
b. if the master station is directly connected with the slave station i through the bus, the master station receives the data packet uploaded by the slave station i, and the non-broadcast data uploading of the slave station i is finished; if the master station is not directly connected with the slave station i through the bus, the repeater receives a data packet uploaded by the slave station i;
c. the repeater sets the data flag position in the received data packet to be a third value and continuously uploads the data flag position to a bus in the direction of the master station; meanwhile, the repeater may not perform a data down-forwarding operation.
d. And c, repeating the step c until the master station receives the data packet uploaded by the slave station i, thereby completing the step of uploading the non-broadcast data of the slave station.
Fig. 4 is a flowchart illustrating steps of the method of the present invention for broadcasting the upload data from the station full bus: the method comprises the following steps of (1) broadcasting and uploading data from a slave station full bus, specifically, completing the data uploading from the slave station full bus by adopting the following steps:
(1) the slave station j packs the data to be uploaded, adds a data flag bit and then uploads the data to the bus; at this time, the data flag bit is a fourth value, and j is a natural number;
(2) the master station or the repeater directly connected with the slave station j directly receives the data packet sent by the slave station j, and the master station or the repeater sets the data flag position as a fifth value and sends the fifth value to all the devices directly hung on the master station or the repeater; all the devices comprise a repeater and a slave station;
(3) repeating the step (2) until all the devices from the slave station j to the tail end of the bus on the bus receive the data packet sent by the slave station j;
(4) if the master station is not directly connected with the slave station j through the bus, after receiving the data packet sent by the slave station j, the repeater sets the data flag bit to be a sixth value and continuously uploads the data flag bit to the bus in the direction of the master station, meanwhile, the repeater sets the data flag bit of the data packet sent by the slave station j to be a seventh value and continuously issues the data flag bit to all equipment directly hung on the repeater, the repeater directly hung on the repeater discards the data of which the data flag bit is the seventh value, and the issuing is stopped; all the devices comprise a repeater and a slave station;
(5) and (5) repeating the step (4) until all slave stations and master stations from the slave station j to the front end of the bus on the bus receive the data packet sent by the slave station j, and completing the full-bus uploading of the data of the slave station j.
In the data transmission process, the fifth value and the fourth value may be equal; the sixth value and the seventh value may be equal.
Fig. 5 is a flowchart illustrating steps of the method of the present invention for broadcasting upload data from a station with a limited range: and a step of the slave station for broadcasting the uploading data within the limited range, which is to adopt the following steps to complete the step of the slave station for broadcasting the uploading data within the limited range:
1) the slave station k packs data to be sent, adds a data flag bit and uploads the data to the bus; the data flag bit at this time is an eighth value, and k is a natural number;
2) the master station or the repeater directly connected with the slave station k directly receives the data packet sent by the slave station k;
3) the repeater sets the data flag bit to be a ninth value after receiving the data packet sent by the slave station k, and issues the ninth value to all the devices directly hung on the repeater, and the repeater directly hung on the repeater discards the data with the data packet flag bit being the ninth value and stops issuing, so that the limited range broadcast uploading of the data of the slave station k is completed; all devices described include relays and slaves.
In addition, in the communication process, the slave station shields the data packet returned by the master station or the relay by adopting the following silence algorithm when the slave station broadcasts the upload data in the full bus and the slave station broadcasts the upload data in the limited range:
the number of data uploaded by a slave station is set to be N, the current to-be-shielded return data of the slave station is set to be p, the initial value of p is set to be N, the newly-added upload data of the slave station is set to be N, the single data transmission time is set to be t, communication between the slave station and the slave station is realized through a relay or a master station, after the slave station uploads the data, the time interval for waiting for return data is set to be a certain time interval, the single data upload and return time interval is set to be an interval [ N1 x t, N2 x t ], N1 can be set to be 2, N2 is indefinite, but in practical application, 99.99% probability N2 is less than or equal to 8; b is the number of the slave stations receiving the returned data, and T is the bus idle time;
the state transition value p of the slave station is calculated by the following formula:
P=N-b+n
in the formula, p is a state transfer value of the slave station, N is the number of data uploaded by the slave station, b is the number of returned data of the relay received by the slave station, and N is newly added uploaded data of the slave station;
and II, judging whether the slave station shields the data returned by the repeater or not by adopting the following rules according to the state transfer value obtained in the step I:
if the state transition value p is not equal to 0, the slave station enters a silent mode and shields data returned by the repeater;
if the state transition value p is equal to 0, the slave station enters a normal mode and receives data returned by the repeater;
and III, the following rule is adopted to prevent the slave station from being out of the shielding state due to the fact that the data packet returned by the repeater is lost:
if T > Itmax and p >0, then p-1;
the value rule of Itmax in the formula is: if (Itmax/2 ≧ n1), Itmax ═ Itmax/2; the initial value of Itmax is the time interval between single data uploading and returning, and in practical application, the maximum value of Itmax can be confirmed to be 8 × t within a 99.99% probability range; n1 is a first threshold value set in advance, and n1 is a natural number;
if detecting the data packet loss (for example, twice), setting: t > m1 × T, Itmax ═ m 2; if the data packet loss is continuously detected, setting: t > m3 × T, Itmax ═ m 4; m1, m2, m3 and m4 are all natural numbers, m3 is greater than m1, m4 is greater than m2, and in specific implementation, when m1 takes the value of 8, m2 takes the value of 4, m3 takes the value of 4 and m4 takes the value of 2, two times of continuous loss detection occur, so that the situation can be converged to be consistent with the actual backhaul, and the situation that the slave station cannot receive new data transmitted by the master station or the relay due to packet loss is avoided.
In the communication process, when the master station or the relay transmits the data back by broadcasting the upload data from the full bus of the slave station and transmits the data back by broadcasting the upload data from the limited range of the slave station, the data is transmitted by adopting a delayed forwarding algorithm as follows, so that the integrity of data forwarding is ensured:
assuming that a bus system comprises a master station number 1 and a relay number N, wherein the number k of slave stations of directly-affiliated adapter equipment under each bus master station forwarding module assumes the probability equivalence condition of data transmission of each node;
i, setting an upper layer data forwarding priority Pu and a lower layer backhaul data forwarding priority Pd of the master station by adopting the following rules:
if u is 0 and d is 0, setting Pu > Pd, indicating that the upper layer data forwarding priority Pu is higher than the lower layer backhaul data forwarding priority Pd;
if u is 0, d is greater than 0 and T is greater than tx, setting Pd > Pu, indicating that the lower layer returned data forwarding priority Pd is higher than the upper layer data forwarding priority Pu;
if u is greater than 0, d is 0 and T is greater than tx, setting Pu to be greater than Pd, and indicating that the forwarding priority Pu of the upper layer data is higher than the forwarding priority Pd of the lower layer return data;
if u is not equal to 0, d is not equal to 0 and u + d is larger than 0, setting the switching time of upper layer data forwarding and lower layer return data forwarding as tx;
the tx is z is m5 is t, m5 is a natural number, t is the time of single data transmission, z is a reserved idle time adjustment parameter, and the larger the value of z is, the more the reserved idle time is; in specific implementation, z may be 2, and m5 may be n 1;
and ii, the master station issues the data according to the priority set in the step i.

Claims (9)

1. A multi-host communication method based on a two-wire bus comprises the following steps:
a step of sending data by the master station, which is used for sending the data to all slave stations on the bus by the master station;
the step that the slave station does not have broadcast uploading data is used for uploading the data to the master station;
a step of broadcasting and uploading data by the slave station full bus, wherein the slave station is used for sending the data to all slave stations and master stations on the bus;
a step of the slave station limiting range broadcasting uploading data, wherein the slave station is used for sending the data to all slave stations connected to the same repeater;
when the slave station broadcasts the uploading data in the full bus of the slave station and broadcasts the uploading data in the limited range of the slave station, the slave station shields the data packet returned by the master station or the repeater by adopting the following silence algorithm:
the state transition value p of the slave station is calculated by the following formula:
p=N-b+n
wherein p is the state transition value of the slave station, N is the number of data uploaded by the slave station, b is the number of returned data of the relay received by the slave station, and N is the number of newly added uploaded data of the slave station;
and II, judging whether the slave station shields the data returned by the repeater or not by adopting the following rules according to the state transfer value obtained in the step I:
if the state transition value p is not equal to 0, the slave station enters a silent mode and shields data returned by the repeater;
if the state transition value p is equal to 0, the slave station enters a normal mode and receives data returned by the repeater;
and III, the following rule is adopted to prevent the slave station from being out of the shielding state due to the fact that the data packet returned by the repeater is lost:
if T > Itmax and p >0, p = p-1; the value rule of Itmax in the formula is: if Itmax/2 is greater than or equal to n1, then Itmax = Itmax/2; the initial value of Itmax is the time interval between single data upload and return, n1 is a first predetermined threshold, and n1 is a natural number;
and IV, if detecting that the data packet is lost, setting: t > m1 × T, Itmax = m 2; if the data packet loss is continuously detected, setting: t > m3 × T, Itmax = m 4; m1, m2, m3 and m4 are all natural numbers, m3 is less than m1, and m4 is less than m 2.
2. The two-wire bus-based multi-host communication method according to claim 1, wherein the step of issuing data by the master station is specifically to complete the issuing of the data by the master station by adopting the following steps:
A. the master station packs the data to be issued, adds a data flag bit and then issues the data to the bus; the data flag bit is a first value;
B. all slave stations and relays which are directly connected with the master station on the bus receive data packets sent by the master station;
C. after receiving the data packet sent by the master station, the repeater keeps the data flag bit unchanged and forwards the received data packet to all the devices directly hung on the repeater; all the devices comprise a repeater and a slave station;
D. and D, repeating the step C until all slave stations on the bus receive the data packet transmitted by the master station, thereby completing the step of transmitting the data of the master station.
3. The two-wire bus-based multi-host communication method according to claim 1, wherein the step of the slave station uploading data without broadcasting is implemented by:
a. the slave station i packs the data to be uploaded, adds a data flag bit and then uploads the data to the bus; at the moment, the data flag bit is a second value, and i is a natural number;
b. if the master station is directly connected with the slave station i through the bus, the master station receives the data packet uploaded by the slave station i, and the non-broadcast data uploading of the slave station i is finished; if the master station is not directly connected with the slave station i through the bus, the repeater receives a data packet uploaded by the slave station i;
c. the repeater sets the data flag position in the received data packet to be a third value and continuously uploads the data flag position to a bus in the direction of the master station;
d. and c, repeating the step c until the master station receives the data packet uploaded by the slave station i, thereby completing the step of uploading the non-broadcast data of the slave station.
4. The two-wire bus-based multi-host communication method according to claim 3, wherein the repeater of step c does not perform a data down-forwarding operation.
5. The two-wire bus-based multi-host communication method according to claim 1, wherein the step of broadcasting the upload data from the station full bus is to complete the upload data from the station full bus by using the following steps:
(1) the slave station j packs the data to be uploaded, adds a data flag bit and then uploads the data to the bus; at this time, the data flag bit is a fourth value, and j is a natural number;
(2) the master station or the repeater directly connected with the slave station j directly receives the data packet sent by the slave station j, and the master station or the repeater sets the data flag position as a fifth value and sends the fifth value to all the devices directly hung on the master station or the repeater; all the devices comprise a repeater and a slave station;
(3) repeating the step (2) until all the devices from the slave station j to the tail end of the bus on the bus receive the data packet sent by the slave station j;
(4) if the master station is not directly connected with the slave station j through the bus, after receiving the data packet sent by the slave station j, the repeater sets the data flag bit to be a sixth value and continuously uploads the data flag bit to the bus in the direction of the master station, and meanwhile, the repeater sets the data flag bit of the data packet sent by the slave station j to be a seventh value and continuously sends the data flag bit to all equipment directly hung on the repeater; all the devices comprise a repeater and a slave station;
(5) and (5) repeating the step (4) until all slave stations and master stations from the slave station j to the front end of the bus on the bus receive the data packet sent by the slave station j, and completing the full-bus uploading of the data of the slave station j.
6. The two-wire bus-based multi-host communication method according to claim 5, wherein the repeater in step (4) sets the data flag bit of the packet sent from the station j to a seventh value and continues to issue to all devices directly hooked to itself, and the repeater directly hooked to itself discards the data whose data flag bit is the seventh value and terminates the issue.
7. The two-wire bus-based multi-master communication method according to claim 5 or 6, wherein the step of broadcasting the upload data from the slave station in a limited range is implemented by:
1) the slave station k packs data to be sent, adds a data flag bit and uploads the data to the bus; the data flag bit at this time is an eighth value, and k is a natural number;
2) the master station or the repeater directly connected with the slave station k directly receives the data packet sent by the slave station k;
3) the repeater sets the data flag position as a ninth value after receiving the data packet sent by the slave station k, and sends the ninth value to all the devices directly hung on the repeater, so that the limited range broadcast uploading of the data of the slave station k is completed; all devices described include relays and slaves.
8. The two-wire bus-based multi-host communication method according to claim 7, wherein the repeater in step 3) sets the flag bit of the data to the ninth value after receiving the data packet sent from the station k and issues the data to all the devices directly attached to the repeater, and the repeater directly attached to the repeater discards the data with the flag bit of the data packet to the ninth value and terminates the issuing.
9. The method according to claim 7, wherein the master station or the repeater issues the data by using a delayed forwarding algorithm as follows when the slave station broadcasts the upload data back transmission in full bus and broadcasts the upload data back transmission in limited range, so as to ensure the integrity of data forwarding:
i, setting an upper layer data forwarding priority Pu and a lower layer backhaul data forwarding priority Pd of the master station by adopting the following rules:
if u =0 and d =0, setting Pu > Pd, indicating that the upper layer data forwarding priority Pu is higher than the lower layer backhaul data forwarding priority Pd;
if u =0, d >0 and T > tx, setting Pd > Pu, indicating that the lower layer return data forwarding priority Pd is higher than the upper layer data forwarding priority Pu;
if u is greater than 0, d =0 and T is greater than tx, setting Pu to be greater than Pd, indicating that the upper layer data forwarding priority Pu is higher than the lower layer return data forwarding priority Pd;
if u is not equal to 0, d is not equal to 0 and u + d is larger than 0, setting the switching time of upper layer data forwarding and lower layer return data forwarding as tx;
the tx = z × m5 × t, m5 is a natural number, t is time of single data transmission, z is a reserved idle time adjustment parameter, and the larger the value of z is, the more the reserved idle time is;
and ii, the master station issues the data according to the priority set in the step i.
CN201711340864.8A 2017-12-14 2017-12-14 Multi-host communication method based on two-wire bus Active CN107995080B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711340864.8A CN107995080B (en) 2017-12-14 2017-12-14 Multi-host communication method based on two-wire bus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711340864.8A CN107995080B (en) 2017-12-14 2017-12-14 Multi-host communication method based on two-wire bus

Publications (2)

Publication Number Publication Date
CN107995080A CN107995080A (en) 2018-05-04
CN107995080B true CN107995080B (en) 2020-09-29

Family

ID=62038349

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711340864.8A Active CN107995080B (en) 2017-12-14 2017-12-14 Multi-host communication method based on two-wire bus

Country Status (1)

Country Link
CN (1) CN107995080B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110661245A (en) * 2018-06-29 2020-01-07 彭博 Two-wire remote power supply and multi-station communication
CN112130535B (en) * 2020-09-18 2021-12-03 重庆欢腾科技有限公司 Multi-host communication system with multi-layer extension architecture and communication method

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1925445A (en) * 2005-08-31 2007-03-07 欧姆龙株式会社 Communication system and slave and repeater units
CN101060457A (en) * 2007-04-05 2007-10-24 华南理工大学 Optical fiber-based high speed serial industrial real-time communication bus system and its control method
CN102137463A (en) * 2011-03-09 2011-07-27 无锡泛联物联网科技股份有限公司 Energy-based multi-path routing method for wireless network
CN102710484A (en) * 2012-05-26 2012-10-03 济南凌康数控技术有限公司 Ring redundant real-time Ethernet communication method
CN103048978A (en) * 2013-01-08 2013-04-17 中国石油天然气集团公司 Underground high-speed interconnection bus
CN103414547A (en) * 2013-07-22 2013-11-27 大唐移动通信设备有限公司 Method according to which main station controls multiple auxiliary stations, base station and system
CN104750649A (en) * 2013-12-31 2015-07-01 中核控制系统工程有限公司 Synchronous sequential control method for opening topology structure bus
CN104750050A (en) * 2013-12-31 2015-07-01 中核控制系统工程有限公司 Mixed-protocol based two-stage topologic structure and field formation method thereof
CN105207971A (en) * 2014-06-13 2015-12-30 艾默生网络能源有限公司 Data transmission method and device
CN206147614U (en) * 2016-08-25 2017-05-03 长沙玄米电子科技有限公司 Novel two bus communication circuit
CN107465474A (en) * 2016-06-03 2017-12-12 上海铼钠克数控科技股份有限公司 The clock synchronization system and method for digital control system bus apparatus

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2341742B1 (en) * 2008-10-28 2019-01-09 Icom Incorporated Relay system, relay device and synchronization method
US9946679B2 (en) * 2011-10-05 2018-04-17 Analog Devices, Inc. Distributed audio coordination over a two-wire communication bus

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1925445A (en) * 2005-08-31 2007-03-07 欧姆龙株式会社 Communication system and slave and repeater units
CN101060457A (en) * 2007-04-05 2007-10-24 华南理工大学 Optical fiber-based high speed serial industrial real-time communication bus system and its control method
CN102137463A (en) * 2011-03-09 2011-07-27 无锡泛联物联网科技股份有限公司 Energy-based multi-path routing method for wireless network
CN102710484A (en) * 2012-05-26 2012-10-03 济南凌康数控技术有限公司 Ring redundant real-time Ethernet communication method
CN103048978A (en) * 2013-01-08 2013-04-17 中国石油天然气集团公司 Underground high-speed interconnection bus
CN103414547A (en) * 2013-07-22 2013-11-27 大唐移动通信设备有限公司 Method according to which main station controls multiple auxiliary stations, base station and system
CN104750649A (en) * 2013-12-31 2015-07-01 中核控制系统工程有限公司 Synchronous sequential control method for opening topology structure bus
CN104750050A (en) * 2013-12-31 2015-07-01 中核控制系统工程有限公司 Mixed-protocol based two-stage topologic structure and field formation method thereof
CN105207971A (en) * 2014-06-13 2015-12-30 艾默生网络能源有限公司 Data transmission method and device
CN107465474A (en) * 2016-06-03 2017-12-12 上海铼钠克数控科技股份有限公司 The clock synchronization system and method for digital control system bus apparatus
CN206147614U (en) * 2016-08-25 2017-05-03 长沙玄米电子科技有限公司 Novel two bus communication circuit

Also Published As

Publication number Publication date
CN107995080A (en) 2018-05-04

Similar Documents

Publication Publication Date Title
CN110601943B (en) Communication system based on RS485 bus and communication method thereof
CN107995080B (en) Multi-host communication method based on two-wire bus
CN101813935A (en) Non-polar field bus system and realization method
CN105183687B (en) A kind of timesharing serial port communication method and system
CN104333499A (en) Device backboard high-speed bus link layer communication protocol based on M-LVDS
CN101005427A (en) 485 bus system and method for transmitting data
CN104247284A (en) Overlapping priority contention windows for g3 power line communications networks
CN107659456A (en) A kind of data collision transmission method based on RS485 communications
CN105553795A (en) Method for transmitting standard Ethernet data in industrial Ethernet
CN110752909B (en) Software processing method for 485 bus half-duplex communication
CN102957586B (en) Based on the Full duplex RS 485 bus communication method of collision-free protocol
CN207588889U (en) A kind of intelligent terminal interactive system based on Ethernet
CN205005065U (en) RS485 communication circuit
CN103268301A (en) Automatic-flowing half-duplex UART interface circuit
CN111065168A (en) Wireless access method based on same-frequency simultaneous full duplex
CN102566532A (en) KNX (Konnex) bus equipment-based control system
CN202206412U (en) Full duplex RS485 bus communication device on basis of collision-free protocol
CN106950890B (en) Intelligent switch circuit based on double 485 communication
CN202025203U (en) Feeding type communication circuit
CN204145526U (en) With the CAN repeater of dual master control module
CN202904869U (en) RS485 bus interface with relay function
CN105391666A (en) Multi-service bus transmission system and transmission method based on FSK modem
CN101950485B (en) Traffic signal lamp digital networking equipment
CN201435076Y (en) Single-stranded bus system
CN103957145A (en) CAN bus repeater with dual master control modules and data transfer method thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant