CN111159086A - System and method for communication between multiple hosts and multiple slaves - Google Patents

System and method for communication between multiple hosts and multiple slaves Download PDF

Info

Publication number
CN111159086A
CN111159086A CN201911411999.8A CN201911411999A CN111159086A CN 111159086 A CN111159086 A CN 111159086A CN 201911411999 A CN201911411999 A CN 201911411999A CN 111159086 A CN111159086 A CN 111159086A
Authority
CN
China
Prior art keywords
host
slave
event
event request
master
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.)
Pending
Application number
CN201911411999.8A
Other languages
Chinese (zh)
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.)
Shandong Youren Information Technology Co ltd
Original Assignee
Shandong Youren Information 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 Shandong Youren Information Technology Co ltd filed Critical Shandong Youren Information Technology Co ltd
Priority to CN201911411999.8A priority Critical patent/CN111159086A/en
Publication of CN111159086A publication Critical patent/CN111159086A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/40Bus structure
    • G06F13/4063Device-to-bus coupling

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Small-Scale Networks (AREA)

Abstract

The invention discloses a system and a method for communication between multiple hosts and multiple slaves, comprising the following steps: at least two hosts, a gateway device and at least one slave; the gateway equipment is provided with host interfaces used for being connected with the hosts, and each host corresponds to one host interface; the gateway equipment allocates a data cache channel for each host; the gateway equipment is provided with slave interfaces which are sequentially connected with all the slaves in series. The invention has the beneficial effects that: the problem that the conflict is generated when multiple hosts send commands simultaneously in a host-slave-machine bus can be solved; the function of simultaneously controlling or acquiring data of the same controlled device or different controlled devices by a plurality of hosts in the same bus is realized.

Description

System and method for communication between multiple hosts and multiple slaves
Technical Field
The invention relates to the technical field of information communication, in particular to a system and a method for communication between multiple hosts and multiple slaves.
Background
The statements in this section merely provide background information related to the present disclosure and may not necessarily constitute prior art.
In the existing serial bus structure, for example: the RS485 bus, modbus protocol, other PLC protocols, and the like, mostly adopt a form of one master and multiple slaves, and the protocol specifies that only one device in the bus is allowed to be the master, and the other devices are all slaves, as shown in fig. 1.
When a plurality of host machines exist, if a plurality of host machines send out instructions simultaneously, the problem of conflict is caused, so that data interaction and instruction control cannot be carried out between the plurality of host machines and a plurality of slave machines, and the requirement that the plurality of host machines can access the slave machines in the bus simultaneously without errors cannot be met.
Disclosure of Invention
In order to solve the above problems, the present invention discloses a system and a method for communication between multiple masters and multiple slaves, which can implement the function of simultaneously controlling or acquiring data of the same controlled device or different controlled devices by multiple masters in the same bus, and solve the problem of command collision simultaneously issued by multiple masters.
In some embodiments, the following technical scheme is adopted:
a system for multiple master to multiple slave communications, comprising: at least two hosts, a gateway device and at least one slave;
the gateway equipment is provided with host interfaces used for being connected with the hosts, and each host corresponds to one host interface; the gateway equipment allocates a channel of data cache for each host; the gateway equipment is provided with slave interfaces which are sequentially connected with all the slaves in series.
The gateway equipment receives event requests of all the hosts and caches request data of different hosts into different channels respectively.
The gateway equipment sequentially executes the event request of each host in a time-sharing multiplexing mode, sends the event request of the current host to all the slaves through slave interfaces, responds to the slave in the event request according to the received event request, and sends the response of the slave to the current host through the gateway equipment according to the original path; and finishing the data interaction process and processing the event request of the next host.
And the gateway equipment sends the event request of the current host to the slave, and after waiting for the set time and not receiving a response instruction of the slave, the data interaction process is finished, and the event request of the next host is processed.
When the gateway equipment receives a plurality of event requests of the same host at the same time, only the last event request is reserved, and other requests are abandoned.
In other embodiments, the following technical solutions are adopted:
a method of multiple master to multiple slave communication, comprising:
receiving an event request of each host and respectively caching the event requests to different channels;
sequentially executing the event request of each host in a time-sharing multiplexing mode, sending the event request of the current host to all the slave machines, responding by the corresponding slave machine in the event request according to the received event request, sending the response of the slave machine to the current host, and finishing the data interaction process;
the event request of the next host is processed.
Compared with the prior art, the invention has the beneficial effects that:
the method can solve the problem that the conflict is generated when the multiple hosts simultaneously send the commands in the one-host multi-slave bus; the function of simultaneously controlling or acquiring data of the same controlled device or different controlled devices by a plurality of hosts in the same bus is realized.
Drawings
FIG. 1 is a diagram illustrating a master-to-slave communication in the prior art;
fig. 2 is a schematic diagram of a system structure for multi-master multi-slave communication according to an embodiment of the present invention.
Detailed Description
It should be noted that the following detailed description is exemplary and is intended to provide further explanation of the disclosure. Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs.
It is noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of example embodiments according to the present application. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, and it should be understood that when the terms "comprises" and/or "comprising" are used in this specification, they specify the presence of stated features, steps, operations, devices, components, and/or combinations thereof, unless the context clearly indicates otherwise.
The embodiments and features of the embodiments of the present invention may be combined with each other without conflict.
Example one
In one or more embodiments, a system for multiple master to multiple slave communications is disclosed, with reference to fig. 2, comprising: a plurality of masters, a gateway device, and a plurality of slaves;
the gateway equipment is provided with host interfaces used for being connected with the hosts, and each host corresponds to one host interface; referring to fig. 2, the host 1 corresponds to the host interface 1, and the host n corresponds to the host interface n. The device caches the request data of different hosts into different channels respectively, and the gateway equipment allocates a data cache channel for each host; host 1 corresponds to channel 1 and host n corresponds to channel n. The gateway equipment is provided with slave interfaces which are sequentially connected with all the slaves in series.
First, the apparatus related to this embodiment will be described as follows:
1. a host computer: host 1-host n as shown in fig. 2. An active device in the bus; multiple masters can and have a need for data interaction with slaves in a bus. The corresponding slave in the command bus sent by the master can receive and recognize the command and then reply the command execution result to the master.
2. A slave machine: a passive device in the bus, (waiting-receiving-executing-replying) a command issued by the host in the bus. Each slave has a different device identification for distinguishing the slave devices.
3. A gateway device: there are multiple host interfaces, each of which can interface to a host device. There is a slave interface for connecting slave devices in the serial bus.
4. A host group: after being connected with the gateway equipment, a plurality of hosts are regarded as a host cluster. The host computer group can play the role of any host computer and perform data interaction with other slave computers in the bus.
5. Caching operation of the gateway device: the gateway device may receive data from all hosts connected to the host interface. And buffers the data.
6. Data interaction between a primary host and a secondary host: when the host sends an instruction to the slave, the slave executes and replies, and the host receives the reply. This process is referred to as primary master to slave data interaction.
The abnormal data interaction comprises:
a) the host sends an instruction, the slave considers that the instruction incorrectly replies an error message, and the host receives the error message.
b) The host sends an instruction, the slave does not receive or respond, and the host is over time.
7. Event request of the host: the master queries, sets and controls what is called a master event request for the slave in one complete cycle. The event request of the primary master comprises one or more data interactions between the primary master and the secondary machine.
8. Host atomic operation: atomic operations refer to operations that are not divisible, not interruptible. An event request by a host is an atomic operation. The event request of one host is not allowed to be executed without being completed. When a host cluster acts as a host and sends a command to a designated slave, the atomic operation of the host starts. The slave machine receives the command to process and sends out a processing result, and after the command reply is received by the host machine group and forwarded to the corresponding host machine or the reply of the slave machine is not received and overtime, the atomic operation of the host machine is finished (when the one-time complete event request of the host machine and the slave machine is finished, the atomic operation of the host machine is finished). When one host performs an atomic operation, the other hosts are not allowed to start the atomic operation.
In this embodiment, the gateway device receives event requests of all hosts, and caches request data of different hosts into different channels respectively;
the gateway equipment sequentially executes the event request of each host in a time-sharing multiplexing mode, sends the event request of the current host to all the slaves through slave interfaces, responds to the slave corresponding to the event request according to the received event request, and sends the response of the slave to the current host through the gateway equipment according to the original path; and finishing the data interaction process and processing the event request of the next host.
And the gateway equipment sends the event request of the current host to the slave, and after waiting for the set time and not receiving a response instruction of the slave, the data interaction process is finished, and the event request of the next host is processed. If the next channel has no data, the data request of the next channel is executed, and so on.
When the gateway equipment receives a plurality of event requests of the same host at the same time, only the last event request is reserved, and other requests are abandoned.
Example two
In one or more embodiments, a method of multiple master to multiple slave communication is disclosed, comprising:
receiving an event request of each host and respectively caching the event requests to different channels;
sequentially executing the event request of each host in a time-sharing multiplexing mode, sending the event request of the current host to all the slave machines, responding by the corresponding slave machine in the event request according to the received event request, sending the response of the slave machine to the current host, and finishing the data interaction process;
the event request of the next host is processed.
And sending the event request of the current host to the slave, and after waiting for a set time, if the response instruction of the slave is not received, ending the data interaction process and processing the event request of the next host.
When receiving multiple event requests of the same host at the same time, only retaining the last event request and abandoning other requests.
Specifically, the specific implementation process of the above process is as follows:
a) the gateway equipment respectively receives control or query instructions of multiple main controls, and respectively stores and records channel numbers of commands issued by different hosts;
b) acquiring a command of a channel X, and if the channel X has no query instruction issued by the host, continuously acquiring a command of a next channel X + 1;
c) sending the obtained command to a slave bus;
d) if the slave does not receive the data replied by the slave after the timeout, continuing to execute the command of continuously acquiring the next channel X +1 from the step a).
e) If the command is sent and receives the reply data of the slave to the command, the data returned from the bus is received and stored in the corresponding channel X, and then the data received by the channel X is sent to the host equipment corresponding to the channel X.
f) The instruction execution succeeds to obtain the instruction in the next channel X +1 and continues to execute the step b).
Although the embodiments of the present invention have been described with reference to the accompanying drawings, it is not intended to limit the scope of the present invention, and it should be understood by those skilled in the art that various modifications and variations can be made without inventive efforts by those skilled in the art based on the technical solution of the present invention.

Claims (8)

1. A system for multiple master and multiple slave communications, comprising: at least two hosts, a gateway device and at least one slave;
the gateway equipment is provided with host interfaces used for being connected with the hosts, and each host corresponds to one host interface; the gateway equipment allocates a channel of data cache for each host; the gateway equipment is provided with slave interfaces which are sequentially connected with all the slaves in series.
2. The system of claim 1, wherein the gateway device receives event requests from all masters and buffers the request data from different masters into different channels.
3. The system of claim 1, wherein the gateway device sequentially executes event requests of each master in a time-division multiplexing manner, sends the event requests of the current master to all slaves through slave interfaces, responds to the event requests received by the corresponding slaves in the event requests, and sends the responses of the slaves to the current master through the gateway device according to an original path; and finishing the data interaction process and processing the event request of the next host.
4. The system of claim 3, wherein the gateway device sends the event request of the current master to the slaves, and after waiting for a set time and without receiving a response command from the slaves, the data interaction process is terminated and the event request of the next master is processed.
5. The system of claim 1, wherein when the gateway device receives multiple event requests from the same master at the same time, only the last event request is retained and other requests are discarded.
6. A method of communicating with multiple slaves on a multiple master computer, comprising:
receiving an event request of each host and respectively caching the event requests to different channels;
sequentially executing the event request of each host in a time-sharing multiplexing mode, sending the event request of the current host to all the slave machines, responding by the corresponding slave machine in the event request according to the received event request, sending the response of the slave machine to the current host, and finishing the data interaction process;
the event request of the next host is processed.
7. The method as claimed in claim 6, wherein the event request of the current master is sent to the slave, and after waiting for a set time, if no response command of the slave is received, the data interaction process is ended, and the event request of the next master is processed.
8. The method as claimed in claim 6, wherein when multiple event requests from the same master are received at the same time, only the last event request is retained, and other requests are discarded.
CN201911411999.8A 2019-12-31 2019-12-31 System and method for communication between multiple hosts and multiple slaves Pending CN111159086A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911411999.8A CN111159086A (en) 2019-12-31 2019-12-31 System and method for communication between multiple hosts and multiple slaves

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911411999.8A CN111159086A (en) 2019-12-31 2019-12-31 System and method for communication between multiple hosts and multiple slaves

Publications (1)

Publication Number Publication Date
CN111159086A true CN111159086A (en) 2020-05-15

Family

ID=70560237

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911411999.8A Pending CN111159086A (en) 2019-12-31 2019-12-31 System and method for communication between multiple hosts and multiple slaves

Country Status (1)

Country Link
CN (1) CN111159086A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114090493A (en) * 2021-11-29 2022-02-25 深圳市科中云技术有限公司 Data transmission control method based on RS485 bus and related device
CN115396256A (en) * 2022-09-14 2022-11-25 江苏安科瑞电器制造有限公司 RS 485-based networking mode for rapidly acquiring data
CN115982072A (en) * 2023-03-16 2023-04-18 中京科信技术有限公司 Information communication method, device, computer equipment and storage medium
CN117873940A (en) * 2023-12-05 2024-04-12 江苏云涌电子科技股份有限公司 Mirror image data transmission system and method thereof

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110040912A1 (en) * 2004-09-10 2011-02-17 Freescale Semiconductor Apparatus and method for multiple endian mode bus matching
CN102929826A (en) * 2012-11-16 2013-02-13 深圳市建恒测控股份有限公司 System and method for transmitting multiple ultrasonic signals with single ultrasonic signal bus
CN107590099A (en) * 2017-08-31 2018-01-16 深圳市共济科技股份有限公司 A kind of more main frames access method, expanding unit and the storage medium of slave
CN207124638U (en) * 2017-08-23 2018-03-20 江苏舾普泰克自动化科技有限公司 A kind of more host communication systems based on Modbus agreements
CN110531686A (en) * 2019-09-28 2019-12-03 徐州可云智能科技有限公司 A kind of devices and methods therefor based on single master mostly from the more hosts of protocol realization

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110040912A1 (en) * 2004-09-10 2011-02-17 Freescale Semiconductor Apparatus and method for multiple endian mode bus matching
CN102929826A (en) * 2012-11-16 2013-02-13 深圳市建恒测控股份有限公司 System and method for transmitting multiple ultrasonic signals with single ultrasonic signal bus
CN207124638U (en) * 2017-08-23 2018-03-20 江苏舾普泰克自动化科技有限公司 A kind of more host communication systems based on Modbus agreements
CN107590099A (en) * 2017-08-31 2018-01-16 深圳市共济科技股份有限公司 A kind of more main frames access method, expanding unit and the storage medium of slave
CN110531686A (en) * 2019-09-28 2019-12-03 徐州可云智能科技有限公司 A kind of devices and methods therefor based on single master mostly from the more hosts of protocol realization

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114090493A (en) * 2021-11-29 2022-02-25 深圳市科中云技术有限公司 Data transmission control method based on RS485 bus and related device
CN114090493B (en) * 2021-11-29 2024-09-17 深圳市科中云技术有限公司 Data transmission control method based on RS485 bus and related device
CN115396256A (en) * 2022-09-14 2022-11-25 江苏安科瑞电器制造有限公司 RS 485-based networking mode for rapidly acquiring data
CN115982072A (en) * 2023-03-16 2023-04-18 中京科信技术有限公司 Information communication method, device, computer equipment and storage medium
CN117873940A (en) * 2023-12-05 2024-04-12 江苏云涌电子科技股份有限公司 Mirror image data transmission system and method thereof

Similar Documents

Publication Publication Date Title
CN111159086A (en) System and method for communication between multiple hosts and multiple slaves
CN105847456A (en) RS485 automatic address distribution method, device and system
CN110955626A (en) Method and system for realizing Modbus communication on serial link
JPH0552973B2 (en)
DE102015214915A1 (en) Flexible planning method and device in LIN communication
CN112147927B (en) Multi-axis motion control system for two-channel bus communication
CN110896372A (en) I2C link switching method, terminal and storage medium
CN114265352A (en) Automatic configuration system and method for CAN bus ID
CN112947857A (en) Data moving method, device, equipment and computer readable storage medium
CN114500151A (en) Motion control communication system and communication method based on CAN bus
CN111818127B (en) Data synchronization method and device
CN107368327A (en) The method and system write with a brush dipped in Chinese ink to chip
CN109120731B (en) Universal communication method, system and device
CN116184885A (en) Transaction processing method, system, electronic equipment and readable storage medium
CN114631289A (en) Efficient communication bus arbitration system and method
CN111736578B (en) Dual-CPU controller-based UDS diagnosis method and device
CN114637597A (en) Task execution system and method for vehicle operating system
CN111464346B (en) Main and standby control board synchronization method and system based on ATCA (advanced telecom computing architecture)
CN113946369A (en) Automatic adding method, device, system, equipment and storage medium of equipment
CN107968718A (en) A kind of method, apparatus and equipment for confirming standby usage state
CN116319680B (en) Method for dynamically distributing addresses, coupler and backboard
CN115525415B (en) Data processing method, device, equipment and medium
CN117614940B (en) Method and system for automatic configuration of serial communication equipment address
CN115080482B (en) Independent arbitration method and related device
CN111338680B (en) Firmware upgrading method, firmware upgrading device and terminal of slave station

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
CB02 Change of applicant information

Address after: 250101 rooms 1103 and 1105, 11 / F, building 1, Aosheng building, 1166 Xinluo street, high tech Zone, Jinan City, Shandong Province

Applicant after: Shandong Youren networking Co.,Ltd.

Address before: 250101 rooms 1103 and 1105, 11 / F, building 1, Aosheng building, 1166 Xinluo street, high tech Zone, Jinan City, Shandong Province

Applicant before: SHANDONG YOUREN INFORMATION TECHNOLOGY Co.,Ltd.

CB02 Change of applicant information
RJ01 Rejection of invention patent application after publication

Application publication date: 20200515

RJ01 Rejection of invention patent application after publication