CN110177035B - Data receiving and sending method, device and data receiving and sending system - Google Patents
Data receiving and sending method, device and data receiving and sending system Download PDFInfo
- Publication number
- CN110177035B CN110177035B CN201910403233.9A CN201910403233A CN110177035B CN 110177035 B CN110177035 B CN 110177035B CN 201910403233 A CN201910403233 A CN 201910403233A CN 110177035 B CN110177035 B CN 110177035B
- Authority
- CN
- China
- Prior art keywords
- port
- slave device
- interrupt
- slave
- data
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01S—RADIO DIRECTION-FINDING; RADIO NAVIGATION; DETERMINING DISTANCE OR VELOCITY BY USE OF RADIO WAVES; LOCATING OR PRESENCE-DETECTING BY USE OF THE REFLECTION OR RERADIATION OF RADIO WAVES; ANALOGOUS ARRANGEMENTS USING OTHER WAVES
- G01S5/00—Position-fixing by co-ordinating two or more direction or position line determinations; Position-fixing by co-ordinating two or more distance determinations
- G01S5/16—Position-fixing by co-ordinating two or more direction or position line determinations; Position-fixing by co-ordinating two or more distance determinations using electromagnetic waves other than radio waves
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01S—RADIO DIRECTION-FINDING; RADIO NAVIGATION; DETERMINING DISTANCE OR VELOCITY BY USE OF RADIO WAVES; LOCATING OR PRESENCE-DETECTING BY USE OF THE REFLECTION OR RERADIATION OF RADIO WAVES; ANALOGOUS ARRANGEMENTS USING OTHER WAVES
- G01S5/00—Position-fixing by co-ordinating two or more direction or position line determinations; Position-fixing by co-ordinating two or more distance determinations
- G01S5/18—Position-fixing by co-ordinating two or more direction or position line determinations; Position-fixing by co-ordinating two or more distance determinations using ultrasonic, sonic, or infrasonic waves
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
- H04L12/40169—Flexible bus arrangements
- H04L12/40176—Flexible bus arrangements involving redundancy
- H04L12/40202—Flexible bus arrangements involving redundancy by using a plurality of master stations
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/38—Information transfer, e.g. on bus
- G06F13/42—Bus transfer protocol, e.g. handshake; Synchronisation
- G06F13/4204—Bus transfer protocol, e.g. handshake; Synchronisation on a parallel bus
- G06F13/4221—Bus transfer protocol, e.g. handshake; Synchronisation on a parallel bus being an input/output bus, e.g. ISA bus, EISA bus, PCI bus, SCSI bus
- G06F13/4226—Bus transfer protocol, e.g. handshake; Synchronisation on a parallel bus being an input/output bus, e.g. ISA bus, EISA bus, PCI bus, SCSI bus with asynchronous protocol
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/38—Information transfer, e.g. on bus
- G06F13/42—Bus transfer protocol, e.g. handshake; Synchronisation
- G06F13/4282—Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
- G06F13/4291—Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus using a clocked protocol
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
- H04L2012/40208—Bus networks characterized by the use of a particular bus standard
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Radar, Positioning & Navigation (AREA)
- Remote Sensing (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Electromagnetism (AREA)
- Manipulator (AREA)
- Selective Calling Equipment (AREA)
Abstract
The application discloses a data receiving and sending method, a device and a data receiving and sending system, which belong to the technical field of communication and are applied to an intelligent robot, wherein the intelligent robot comprises a main device and N auxiliary devices, and the main device is provided with a first TX port, a first RX port and at least N interruption request receiving ports; each slave device is configured with a second TX port, a second RX port and an interrupt request transmission port; the first TX port is connected to each second RX port, the first RX port is connected to each second TX port, each interrupt request receiving port is connected to a different interrupt request sending port, the method comprising: the master device receives a first interrupt request through an interrupt request receiving port connected with the first slave device, enters an interrupt state if the first interrupt request can be responded, sends a first interrupt response message carrying address information of the first slave device through a first TX port, and receives data sent by the first slave device through a first RX port.
Description
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method and an apparatus for receiving and transmitting data of an intelligent robot, and a data transceiving system.
Background
A master-slave communication system generally includes a master device and a plurality of slave devices, wherein the master device has a transmitting TX port and a receiving RX port, the TX port of the master device is connected to the RX port of each slave device, the RX port of the master device is connected to the TX port of each slave device, the master device sends a control command to each slave device through its own TX port, and each slave device sends response data to the master device through its own TX port.
Referring to fig. 1, the master-slave communication system shown in fig. 1 includes 1 master Device MCU Host and 4 slave devices 0-3, and the MCU Host and the devices communicate with each other through Universal Asynchronous Receiver/Transmitter (UART). Assuming that the MCU Host is a processor for calculating a walking line of the robot, the devices 0-3 are 4 ultrasonic modules installed on a chassis of the robot for detecting a distance of a surrounding obstacle, each Device, upon receiving an instruction from the MCU Host for instructing transmission of an ultrasonic signal, transmits an ultrasonic wave to the outside, determines distance data between itself and the obstacle according to a time of transmitting the ultrasonic wave, a time of receiving the echo, and a propagation speed of the ultrasonic wave if the echo is received, and then transmits the distance data to the MCU Host, in order that the devices 0-3 do not collide when transmitting data to the MCU Host, different data transmission times are allocated to each Device, as shown in fig. 2, assuming that a polling period is 280ms, a data transmission time allocated to the Device0 is 0-70 ms, a data transmission time allocated to the Device1 is 70-140 ms, the data transmission time allocated to the Device2 is 140-210 ms, and the data transmission time allocated to the Device3 is 210-280 ms.
However, in a polling cycle, the data transmission time allocated to each Device includes not only the time when the Device transmits data, but also the time when the Device collects data, that is, the real data transmission time of the Device is less than the data transmission time allocated to the Device by the MCU Host, and the data transmission time allocated to the Device cannot be used by other devices to transmit data, so that the MCU Host can only obtain data from the Device within the data transmission time allocated to each Device, which is not beneficial for the robot to quickly find surrounding obstacles in time to avoid obstacles.
Similarly, for other one-master multi-slave communication systems, the master device can only obtain data within the data transmission time allocated to each slave device, and the problem that the data is not obtained timely also exists.
Disclosure of Invention
The embodiment of the application provides a data receiving and sending method, a device and a data receiving and sending system, which are used for solving the problem that in the prior art, a master device can only obtain data within data sending time distributed for each slave device, and the data are not obtained timely.
In a first aspect, a data receiving method provided in an embodiment of the present application is applied to an intelligent robot, where the intelligent robot includes a master device and N slave devices; the primary device is configured with a first transmit TX port, a first receive RX port, and at least N interrupt request receive ports; each slave device is configured with a second TX port, a second RX port, and an interrupt request transmission port; the first TX port is connected to each of the second RX ports, the first RX port is connected to each of the second TX ports, each of the interrupt request receiving ports is connected to a different interrupt request transmitting port, N is an integer greater than 2, and the method includes:
the method comprises the steps that a first interrupt request is received by a master device through an interrupt request receiving port connected with a first slave device, wherein the first slave device is any one of N slave devices;
if it is determined that the first interrupt request can be responded, the master device enters an interrupt state, and sends a first interrupt response message through the first TX port, wherein the first interrupt response message carries address information of the first slave device;
and the master device receives the data transmitted by the first slave device through the first RX port.
By adopting the scheme, before receiving the data sent by each slave device, the master device receives the interrupt request sent by the slave device through the interrupt request receiving port connected with the slave device, if the master device determines that the interrupt request of the slave device can be responded, the master device sends the interrupt response message carrying the address information of the slave device, and then receives the data sent by the slave device through the RX port of the master device, so that the data sent by each slave device is acquired in an interrupt response mode, and fixed data sending time does not need to be allocated to each slave device, and therefore the real-time performance of the data acquired by the master device from each slave device can be improved.
In a possible implementation manner, if the master device receives a second interrupt request through an interrupt request receiving port connected to a second slave device before exiting the interrupt state, where the second slave device is a slave device different from the first slave device in the N slave devices, the second slave device is a slave device in the N slave devices
After determining that data transmission with the first slave device is completed, the master device sends a second interrupt response message through the first TX port, where the second interrupt response message carries address information of the second slave device;
and the master device receives the data transmitted by the second slave device through the first RX port.
In this way, the master device can be prevented from being interfered by the second slave device when receiving the data transmitted by the first slave device through the first RX port of the master device.
In a possible implementation manner, if the master device receives a second interrupt request through an interrupt request receiving port connected to a second slave device before entering the interrupt state, response priorities of the first slave device and the second slave device are determined according to a response priority rule, and interrupt requests sent by each of the first slave device and the second slave device are sequentially responded according to the response priorities.
Therefore, even if the master device receives the interrupt requests sent by two or more slave devices before entering the interrupt state, the master device can ensure that the slave devices do not conflict with each other and send data to the master device orderly, and the system stability is good.
In a possible embodiment, the slave device is an ultrasonic module or an infrared module for collecting distance data of obstacles located around the intelligent robot.
In a second aspect, a data sending method provided in an embodiment of the present application is applied to an intelligent robot, where the intelligent robot includes a master device and N slave devices; the primary device is configured with a first transmit TX port, a first receive RX port, and at least N interrupt request receive ports; each slave device is configured with a second TX port, a second RX port, and an interrupt request transmission port; the first TX port is connected to each of the second RX ports, the first RX port is connected to each of the second TX ports, each of the interrupt request receiving ports is connected to a different interrupt request transmitting port, N is an integer greater than 2, and the method includes:
after the slave device collects data, sending an interrupt request to the master device through an interrupt request sending port of the slave device;
and if the slave device receives an interrupt response message sent by the master device through a second RX port of the slave device and determines that address information carried in the interrupt response message is the same as address information of the slave device, sending the data to the master device through a second TX port of the slave device.
In a possible embodiment, the slave device is an ultrasound module or an infrared module for acquiring distance data of obstacles located around the intelligent robot.
In a possible implementation manner, the slave device collects distance data of obstacles around the intelligent robot in real time, or after receiving a data collection instruction sent by the master device, the slave device collects distance data of obstacles around the intelligent robot.
In a third aspect, the data receiving apparatus provided in the embodiments of the present application is applied to an intelligent robot, where the intelligent robot includes a master device and N slave devices; the primary device is configured with a first transmit TX port, a first receive RX port, and at least N interrupt request receive ports; each slave device is configured with a second TX port, a second RX port, and an interrupt request transmission port; the first TX port is connected to each of the second RX ports, the first RX port is connected to each of the second TX ports, each of the interrupt request receiving ports is connected to a different interrupt request transmitting port, N is an integer greater than 2, and the apparatus is disposed in the master device, and includes:
a first receiving module, configured to receive a first interrupt request through an interrupt request receiving port connected to a first slave device, where the first slave device is any one of N slave devices;
an interrupt processing module, configured to enter an interrupt state if it is determined that the first interrupt request can be responded to, and send a first interrupt response message through the first TX port, where the first interrupt response message carries address information of the first slave device;
a second receiving module, configured to receive, through the first RX port, data sent by the first slave device.
In a possible implementation manner, the first receiving module is further configured to receive, before exiting the interrupt state, a second interrupt request through an interrupt request receiving port connected to a second slave device, where the second slave device is a different slave device from the first slave device in the N slave devices;
the interrupt processing module is further configured to send a second interrupt response message through the first TX port after determining that data transmission with the first slave device is completed, where the second interrupt response message carries address information of the second slave device;
the second receiving module is further configured to receive data sent by the second slave device through the first RX port.
In a possible implementation manner, the first receiving module is further configured to receive, before entering the interrupt state, a second interrupt request through an interrupt request receiving port connected to a second slave device, where the second slave device is a different slave device from the first slave device in the N slave devices;
the interrupt processing module is further configured to determine response priorities of the first slave device and the second slave device according to a response priority rule, and sequentially respond to an interrupt request sent by each of the first slave device and the second slave device according to the response priorities.
In a possible embodiment, the slave device is an ultrasound module or an infrared module for acquiring distance data of obstacles located around the intelligent robot.
In a fourth aspect, the data transmission apparatus provided in the embodiments of the present application is applied to an intelligent robot, where the intelligent robot includes a master device and N slave devices; the primary device is configured with a first transmit TX port, a first receive RX port, and at least N interrupt request receive ports; each slave device is configured with a second TX port, a second RX port, and an interrupt request transmission port; the first TX port is connected to each of the second RX ports, the first RX port is connected to each of the second TX ports, each of the interrupt request receiving ports is connected to a different interrupt request sending port, N is an integer greater than 2, and the apparatus is disposed in the slave device, and includes:
the sending module is used for sending an interrupt request to the master equipment through an interrupt request sending port of the slave equipment after data is collected;
and a processing module, configured to send the data to the master device through a second TX port of the slave device if an interrupt response message sent by the master device is received through a second RX port of the slave device and it is determined that address information carried in the interrupt response message is the same as address information of the slave device.
In a possible embodiment, the slave device is an ultrasound module or an infrared module for acquiring distance data of obstacles located around the intelligent robot.
In a possible implementation manner, the slave device collects distance data of obstacles around the intelligent robot in real time, or after receiving a data collection instruction sent by the master device, the slave device collects distance data of obstacles around the intelligent robot.
In a fifth aspect, the data transceiving system provided in the embodiments of the present application is applied to an intelligent robot, where the intelligent robot includes a master device and N slave devices; the primary device is configured with a first transmit TX port, a first receive RX port, and at least N interrupt request receive ports; each slave device is configured with a second TX port, a second RX port, and an interrupt request transmission port; the first TX port is connected to each of the second RX ports, the first RX port is connected to each of the second TX ports, each of the interrupt request receiving ports is connected to a different interrupt request transmitting port, N is an integer greater than 2, where:
the slave device is used for sending an interrupt request to the master device through an interrupt request sending port of the slave device after data is collected; if the slave device receives an interrupt response message sent by the master device through a second RX port of the slave device and determines that address information carried in the interrupt response message is the same as address information of the slave device, sending the data to the master device through a second TX port of the slave device;
the master device is used for receiving a first interrupt request through an interrupt request receiving port connected with a first slave device, wherein the first slave device is any one of N slave devices; if it is determined that the first interrupt request can be responded, the master device enters an interrupt state, and sends a first interrupt response message through the first TX port, wherein the first interrupt response message carries address information of the first slave device; and the master device receives the data transmitted by the first slave device through the first RX port.
In a sixth aspect, an embodiment of the present application provides an electronic device, including: at least one processor, and a memory communicatively coupled to the at least one processor, wherein:
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the above-described data transmission method or data reception method.
In a seventh aspect, a computer-readable medium provided in an embodiment of the present application stores computer-executable instructions, where the computer-executable instructions are configured to execute any one of the data sending method and the data receiving method.
These and other aspects of the present application will be more readily apparent from the following description of the embodiments.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
FIG. 1 is a diagram of a prior art master-slave communication system;
FIG. 2 is a diagram illustrating data transmission time allocated to slave devices in a master-slave communication system according to the prior art;
FIG. 3 is a schematic diagram illustrating an installation location of a slave device in an ultrasonic positioning system provided by an embodiment of the present application;
fig. 4 is a schematic diagram of a data transceiving system according to an embodiment of the present application;
fig. 5 is a schematic diagram of another data transceiving system according to an embodiment of the present application;
fig. 6 is a flowchart of a data receiving method according to an embodiment of the present application;
fig. 7 is a block diagram of a data receiving apparatus according to an embodiment of the present application;
fig. 8 is a flowchart of a data transmission method according to an embodiment of the present application;
fig. 9 is a structural diagram of a data transmission apparatus according to an embodiment of the present application;
fig. 10 is a schematic diagram of a hardware structure of an electronic device for implementing a data transmission method or a data reception method according to an embodiment of the present application.
Detailed Description
In order to solve the problem that in the prior art, a master device can only acquire data within data transmission time allocated to each slave device, and the data acquisition is not timely, embodiments of the present application provide a data receiving and transmitting method, a data receiving and transmitting device, and a data transceiving system.
The preferred embodiments of the present application will be described below with reference to the accompanying drawings of the specification, it should be understood that the preferred embodiments described herein are merely for illustrating and explaining the present application, and are not intended to limit the present application, and that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
In the prior art, a master-slave communication system adopts a time division multiplexing strategy to control each slave device to send data to a master device, but the inventor finds that in each polling cycle, some data sending time allocated to any slave device is always wasted, and other slave devices cannot send data by using the time, so that the problem that the master device cannot timely obtain data from each slave device is caused.
The above problem will be described in detail below by taking a positioning system in an intelligent robot as an example.
In the positioning system of the intelligent robot, a master Device is a processor for calculating a walking line of the robot, and a slave Device is an ultrasonic module or an infrared module distributed on a chassis of the robot for detecting distance data of surrounding obstacles, referring to fig. 3, fig. 3 is a schematic diagram of an installation position of the ultrasonic module (or the infrared module) in the ultrasonic positioning system, and the ultrasonic positioning system includes 4 ultrasonic modules of Device0 to Device3, wherein an Address of Device # 0 is Address # 0, an Address of Device # 1 is Address # 1, an Address of Device # 2 is Address # 2, and an Address of Device # 3 is Address # 3.
Taking each Device capable of detecting an obstacle within a distance of 6m as an example, the time for detecting the obstacle can be calculated by the following formula:
the sound velocity V is: v is 331+ 0.6T;
wherein T is the set working environment temperature of the Device, generally, T ranges from-10 ℃ to 40 ℃, then V ranges from 325m/s to 355m/s, and the time T for the Device to detect the obstacle is: t 6 x 2/VT=37ms~34ms。
In order to ensure that the devices do not collide when transmitting the distance data to the processor, the data transmission time allocated to each Device is generally not less than 70ms, that is, the data acquisition time and the data transmission time occupy half of each data transmission period, so that half of the data transmission time allocated to each Device is not really used for transmitting data, and the time cannot be used by other devices for transmitting data, thereby seriously affecting the real-time performance of the data acquired from each Device by the processor.
In order to solve the problem, an embodiment of the present application provides a data transceiving system, and referring to fig. 4, fig. 4 is a schematic diagram of a data transceiving system provided in an embodiment of the present application, the system is applied to an intelligent robot, the intelligent robot includes a master device and N slave devices, the master device is configured with a first TX port, a first RX port, and at least N interrupt request receiving ports; each slave device is configured with a second TX port, a second RX port, and an interrupt request transmission port INT, and the first TX port of the master device is connected to each second RX port, the first RX port of the master device is connected to each second TX port, each interrupt request reception port of the master device is connected to a different interrupt request transmission port, N is an integer greater than 2, where:
the slave device is used for sending an interrupt request to the master device through an interrupt request sending port of the slave device after data is collected; and if the interrupt response message sent by the master device is received through the second RX port of the slave device and the address information carried in the interrupt response message is determined to be the same as the address information of the slave device, sending data to the master device through the second TX port of the slave device.
The slave device may be an ultrasonic module or an infrared module for acquiring distance data of obstacles located around the intelligent robot, or of course, the slave device may also be other data acquisition devices in the intelligent robot, as long as there is a data transmission requirement, and the specific implementation of the slave device is not limited in the embodiment of the present invention.
In practical application, the slave device can acquire distance data of obstacles around the intelligent robot in real time, and can also acquire the distance data of the obstacles around the intelligent robot after receiving a data acquisition instruction sent by the master device.
When the slave device transmits data, an identification bit, such as eof, for indicating that the data transmission is completed may be attached to the end of the data, so that the master device can read the identification bit in the received data to determine that the data transmission with the slave device is completed.
The master device is configured to receive a first interrupt request through an interrupt request receiving port connected to the first slave device, where the first slave device is any one of the N slave devices, enter an interrupt state if it is determined that the first interrupt request can be responded to, send a first interrupt response message through a first TX port of the master device, where the first interrupt response message carries address information of the first slave device, and further receive data sent by the first slave device through a first RX port of the master device.
Further, the master device exits the interrupt state after completing the data transmission with the first slave device.
Specifically, after receiving an interrupt request from any one of the N slave devices, the master device responds to the interrupt request from the slave device when determining that the interrupt request can be responded, that is: and entering an interrupt state, broadcasting and sending an interrupt response message through the first TX port, wherein the interrupt response message carries the address information of the slave equipment responded by the master equipment, and exiting the interrupt state after data reception is finished.
In specific implementation, if the master device receives the second interrupt request through the interrupt request receiving port connected to the second slave device before exiting the interrupt state, the master device may send, after determining that data transmission with the first slave device is completed, a second interrupt response message through its own first TX port, where the second interrupt response message carries address information of the second slave device, and further receive, through its own first RX port, data sent by the second slave device, where the second slave device is a slave device different from the first slave device among the N slave devices.
Further, the master device exits the interrupt state after completing the data transmission with the second slave device.
In a specific implementation, if interrupt requests of a plurality of second slave devices are received, the master device may sequentially respond to the interrupt requests of the plurality of second slave devices according to a sequence from high response priority to low response priority of the plurality of second slave devices after determining that data transmission with the first slave device is completed.
In specific implementation, if the master device receives a second interrupt request through an interrupt request receiving port connected to a second slave device before entering an interrupt state, determining response priorities of the first slave device and the second slave device according to a response priority rule, and sequentially responding to the interrupt request sent by each of the first slave device and the second slave device according to the response priorities, where the second slave device is a slave device different from the first slave device in the N slave devices, and the number of the second slave devices is at least one.
Specifically, if the master device receives interrupt requests sent by other slave devices before entering the interrupt state, the master device determines response priorities of all slave devices sending the interrupt requests according to a preset response priority rule, and responds to the interrupt requests sent by the slave devices in sequence according to a sequence from high response priority to low response priority.
For example, the master device receives interrupt requests from the slave device1 and the slave device2 through an interrupt request receiving port connected to the slave device, enters an interrupt state, determines that the priority of the slave device2 is higher than the priority of the slave device1 according to a response priority rule, first sends an interrupt response message carrying an address of the slave device2 through the first TX port, sends an interrupt response message carrying an address of the slave device1 through the first TX port after completing data transmission with the slave device2, and exits the interrupt state after completing data transmission with the slave device 1.
It should be noted that "first" and "second" are used in the embodiment of the present invention to distinguish different slave devices, interrupt requests sent by different slave devices, and interrupt response messages to interrupt requests sent by different slave devices. The number and priority of the slave devices, interrupt requests, interrupt response messages are not limited. The first slave device may be any one of the N slave devices, and the second slave device may be any one of the N slave devices different from the first slave device.
The data transceiver system in the embodiment of the present application is described below by taking an example in which the master device is a processor of the intelligent robot, and the slave device is an ultrasonic module for acquiring distance data of an obstacle located around the intelligent robot.
Specifically, referring to fig. 5, fig. 5 is a schematic diagram of another data transceiving system according to an embodiment of the present application, including 1 MCU Host and N ultrasound modules Device0 to Device N-1, where the MCU Host communicates with the devices by using UART RS232 standard, where the MCU Host is configured with one TX port, one RX port, and M interrupt request receiving ports, each Device is configured with one TX port, one RX port, and one interrupt request transmitting port, the TX port of the MCU Host is connected to the RX port of each Device, the RX port of the MCU Host is connected to the TX port of each Device, the interrupt request receiving port of the MCU Host is connected to a different interrupt request transmitting port, N and M are integers, and M is greater than or equal to N ≧ 2.
In practical application, each Device can acquire distance data of obstacles around the intelligent robot in real time, and can also acquire the distance data of the obstacles around the intelligent robot after receiving a data acquisition instruction sent by the MCU Host.
Taking Device i as an example, after acquiring distance data, Device i can send an interrupt request to an MCU Host through its own interrupt request sending port, the MCU Host receives the interrupt request through an interrupt request receiving port connected to Device i, if it is determined that the interrupt request can be responded, it enters an interrupt state and can send an interrupt response message through its own TX port, where the interrupt response message carries address information of Device i responded by the MCU Host, Device i receives the interrupt response message through its own RX port, if it is determined that the address information carried in the interrupt response message is the same as its own address information, it can send data to the MCU Host through its own TX port, then the MCU Host receives data sent by Device i from its own RX port, and when it is determined that the data sent by Device i has been read, it exits the interrupt, where the value of i is [0, n-1 ].
In the process, if the MCU Host receives an interrupt request through an interrupt receiving port connected to Device j before exiting the interrupt state, the MCU Host can send an interrupt response message through its own TX port after determining that data transmission with Device i is completed, where the interrupt response message carries address information of Device j, so that Device j can receive the interrupt response message through its own RX port, and after determining that the address information carried in the interrupt response message is the same as its own address information, send data to the MCU Host through its own TX port, the MCU Host receives data sent by Device j through its own RX port, and exits the interrupt state after determining that the data sent by Device j is received, where a value of j is [0, n-1], and j is not equal to i.
In addition, if the MCU Host receives an interrupt request from more than one Device before exiting the interrupt state, for example, the MCU Host receives the interrupt request through the interrupt receiving port connected to Device j and receives the interrupt request through the interrupt receiving port connected to Device k, after determining that the data transmission with Device i is completed, the MCU Host can sequentially respond to the interrupt requests of Device j and Device k according to the sequence from high to low of the response priorities of Device j and Device k, where k is [0, n-1] and k is not equal to i and k is not equal to j.
Assuming that the response priority of the Device j determined by the MCU Host is higher than that of the Device k, the MCU Host may send an interrupt response message carrying the address of the Device j through its own TX port after determining that the data transmission with the Device i is completed, and then send an interrupt response message carrying the address of the Device k through its own TX port after completing the data transmission with the Device j, and exit the interrupt state after completing the data transmission with the Device k.
In the process, if the MCU Host receives an interrupt request through an interrupt receiving port connected to the Device o before entering the interrupt state, the MCU Host can determine the response priorities of the Device i and the Device o according to the response priority rule, and if the determined response priority of the Device o is higher than that of the Device i, the MCU Host can send an interrupt response message through its own TX port after entering the interrupt state, and carry the address information of the Device o in the interrupt response message, so that the Device o can send data to the MCU Host through its own TX port after receiving the interrupt response message through its own RX port and determining that the address information carried in the interrupt response message is the same as its own address information, and after determining that the data sent by the Device is received, the MCU Host sends the interrupt response message through its own TX port, and carries the address information of the Device i in the interrupt response message, thus, when the Device i receives the interrupt response message through the RX port of the Device i and determines that the address information carried in the interrupt response message is the same as the address information of the Device i, the Device i sends data to the MCU Host through the TX port of the Device i, and the MCU Host exits the interrupt state after determining that the data sent by the Device i are received, wherein the value of o is [0, n-1], and o is not equal to i.
Thus, even if interrupt requests sent by a plurality of devices are received, the devices can be ensured not to conflict with each other, and data can be orderly sent to the MCU Host, so that the system stability is good.
In the embodiment of the application, each slave device sends an interrupt request to the master device after acquiring data, and if the master device determines that the interrupt request can be responded, sending an interrupt response message, wherein the interrupt response message carries the address information of the slave equipment responded, the slave equipment receives the interrupt response message and determines that the address information in the interrupt response message is the same as the address information of the slave equipment, and then sending data to the master equipment, since the time for transmitting data from the slave device is generally very short, about 25ms, compared to the time-division multiplexing strategy, a certain time can be saved for sending data to other slave devices, so that the real-time performance of the master device for acquiring the data sent by each slave device is better, in addition, the master device receives the data sent by each slave device in an interrupt mode, so that the interference of other slave devices can be effectively avoided, and the communication reliability is good.
Corresponding to the master device in the data transceiving system, an embodiment of the present application further provides a data receiving method, as shown in fig. 6, which is a flowchart of the data receiving method provided in the embodiment of the present application, and includes the following steps:
s601: the master device receives a first interrupt request through an interrupt request receiving port connected with a first slave device, wherein the first slave device is any one of the N slave devices.
S602: if the master device determines that the first interrupt request can be responded, the master device enters an interrupt state, and sends a first interrupt response message through a first TX port of the master device, wherein the first interrupt response message carries address information of the first slave device.
S603: and the master device receives the data transmitted by the first slave device through the first RX port.
S604: and the master equipment exits the interrupt state after determining that the data sent by the first slave equipment is received.
In a specific implementation, if the master device receives a second interrupt request through an interrupt request receiving port connected to a second slave device before exiting the interrupt state, and the second slave device is a slave device different from the first slave device among the N slave devices, after determining that data transmission with the first slave device is completed, the master device may send a second interrupt response message through its own first TX port, where the second interrupt response message carries address information of the second slave device, and thus, after receiving the second interrupt response message, the second slave device may send data to the master device through its own second TX port if the address information carried in the second interrupt response message is determined to be the same as its own address information.
And, if the interrupt requests transmitted by the plurality of second slaves are received, the master device may sequentially respond to the interrupt requests of the plurality of second slaves in order from high response priority to low response priority of the plurality of second slaves after determining that the data transmission with the first slave is completed.
In addition, if the master device receives the second interrupt request through the interrupt request receiving port connected to the second slave device before entering the interrupt state, the master device may determine the response priorities of the first slave device and the second slave device according to the response priority rule, and sequentially respond to the interrupt request sent by each of the first slave device and the second slave device according to the determined response priorities, so that the first slave device and the second slave device sequentially send data to the master device.
Based on the same concept, an embodiment of the present application further provides a data receiving apparatus, as shown in fig. 7, including:
a first receiving module 701, configured to receive a first interrupt request through an interrupt request receiving port connected to a first slave device, where the first slave device is any slave device in N slave devices;
an interrupt processing module 702, configured to enter an interrupt state if it is determined that the first interrupt request can be responded to, and send a first interrupt response message through the first TX port, where the first interrupt response message carries address information of the first slave device;
a second receiving module 703 is configured to receive data sent by the first slave device through the first RX port.
In a possible implementation manner, the first receiving module 701 is further configured to receive, before exiting the interrupt state, a second interrupt request through an interrupt request receiving port connected to a second slave device, where the second slave device is a different slave device from the first slave device in the N slave devices;
the interrupt processing module 702 is further configured to send a second interrupt response message through the first TX port after determining that data transmission with the first slave device is completed, where the second interrupt response message carries address information of the second slave device;
the second receiving module 703 is further configured to receive data sent by the second slave device through the first RX port.
In a possible implementation manner, the first receiving module 701 is further configured to receive, before entering the interrupt state, a second interrupt request through an interrupt request receiving port connected to a second slave device, where the second slave device is a different slave device from the first slave device in the N slave devices;
the interrupt processing module 702 is further configured to determine response priorities of the first slave device and the second slave device according to a response priority rule, and sequentially respond to an interrupt request sent by each of the first slave device and the second slave device according to the response priorities.
In one possible embodiment, the slave device is an ultrasonic module or an infrared module for acquiring distance data of obstacles located around the intelligent robot.
Corresponding to the slave device in the data transceiving system, an embodiment of the present application further provides a data transmission method, and as shown in fig. 8, a flowchart of the data transmission method provided in the embodiment of the present application includes the following steps:
s801: and after the slave device collects the data, sending an interrupt request to the master device through an interrupt request sending port of the slave device.
Wherein, the ultrasonic module or the infrared module of slave unit for being used for gathering the distance data that is located the barrier around the intelligent robot to, the slave unit can gather the distance data that is located the barrier around the intelligent robot in real time, also can gather the distance data that is located the barrier around the intelligent robot after receiving the data acquisition instruction that the master unit sent.
S802: and if the slave device receives an interrupt response message sent by the master device through a second RX port of the slave device and determines that the address information carried in the interrupt response message is the same as the address information of the slave device, sending data to the master device through a second TX port of the slave device.
In a specific implementation, when the slave device sends data, an identification bit for indicating that the data is sent is attached to the end of the data, so that the master device determines that the data transmission with the slave device is completed according to the corresponding identification bit.
Based on the same concept, an embodiment of the present application further provides a data transmission apparatus, as shown in fig. 9, including:
a sending module 901, configured to send an interrupt request to the master device through an interrupt request sending port of the slave device after data is collected;
a processing module 902, configured to send the data to the master device through the second TX port of the slave device if an interrupt response message sent by the master device is received through the second RX port of the slave device and it is determined that address information carried in the interrupt response message is the same as address information of the slave device.
In a possible embodiment, the slave device is an ultrasound module or an infrared module for acquiring distance data of obstacles located around the intelligent robot.
In a possible implementation manner, the slave device collects distance data of obstacles around the intelligent robot in real time, or after receiving a data collection instruction sent by the master device, the slave device collects distance data of obstacles around the intelligent robot.
Referring to fig. 10, a schematic diagram of a hardware structure of an electronic device for implementing a data transmitting method or a data receiving method according to an embodiment of the present disclosure is provided, where the electronic device includes a transceiver 1001 and a processor 1002, and the processor 1002 may be a Central Processing Unit (CPU), a microprocessor, an application specific integrated circuit, a programmable logic circuit, a large scale integrated circuit, or a digital processing unit. The transceiver 1001 is used for data transmission and reception between an electronic device and other devices.
The electronic device may further comprise a memory 1003 for storing software instructions executed by the processor 1002, and may of course also store some other data required by the electronic device, such as identification information of the electronic device, encryption information of the electronic device, user data, etc. The memory 1003 may be a volatile memory (volatile memory), such as a random-access memory (RAM); the memory 1003 may also be a non-volatile memory (non-volatile memory) such as, but not limited to, a read-only memory (ROM), a flash memory (flash memory), a Hard Disk Drive (HDD) or a solid-state drive (SSD), or the memory 1003 may be any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer. The memory 1003 may be a combination of the above memories.
The embodiment of the present application does not limit the specific connection medium among the processor 1002, the memory 1003, and the transceiver 1001. In the embodiment of the present application, only the memory 1003, the processor 1002, and the transceiver 1001 are connected by the bus 1004 in fig. 10, the bus is shown by a thick line in fig. 10, and the connection manner between the other components is only schematically illustrated and is not limited thereto. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 10, but this is not intended to represent only one bus or type of bus.
The processor 1002 may be dedicated hardware or a processor running software, and when the processor 1002 can run software, the processor 1002 reads software instructions stored in the memory 1003 and executes the methods involved in the foregoing embodiments under the drive of the software instructions.
The embodiment of the present application further provides a computer-readable storage medium, which stores computer-executable instructions required to be executed by the processor, and includes a program required to be executed by the processor.
In some possible embodiments, various aspects of the data transmission method or data reception method provided in the present application may also be implemented in the form of a program product including program code for causing an electronic device to perform the steps in the data transmission method or data reception method according to various exemplary embodiments of the present application described above in this specification when the program product is run on the electronic device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The program product for communication of embodiments of the present application may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a computing device. However, the program product of the present application is not limited thereto, and in this document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device over any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., over the internet using an internet service provider).
It should be noted that although several units or sub-units of the apparatus are mentioned in the above detailed description, such division is merely exemplary and not mandatory. Indeed, the features and functions of two or more units described above may be embodied in one unit, according to embodiments of the application. Conversely, the features and functions of one unit described above may be further divided into embodiments by a plurality of units.
Further, while the operations of the methods of the present application are depicted in the drawings in a particular order, this does not require or imply that these operations must be performed in this particular order, or that all of the illustrated operations must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While the preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all alterations and modifications as fall within the scope of the application.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.
Claims (15)
1. A data receiving method is characterized by being applied to an intelligent robot, wherein the intelligent robot comprises a main device and N slave devices, and the slave devices are data acquisition devices arranged on the intelligent robot; the primary device is configured with a first transmit TX port, a first receive RX port, and at least N interrupt request receive ports; each slave device is configured with a second TX port, a second RX port, and an interrupt request transmission port; the first TX port is connected to each of the second RX ports, the first RX port is connected to each of the second TX ports, each of the interrupt request receiving ports is connected to a different interrupt request transmitting port, N is an integer greater than 2, and the method includes:
the method comprises the steps that a first interrupt request is received by a master device through an interrupt request receiving port connected with a first slave device, wherein the first slave device is any one of N slave devices;
if it is determined that the first interrupt request can be responded, the master device enters an interrupt state, and broadcasts and sends a first interrupt response message through the first TX port, wherein the first interrupt response message carries address information of the first slave device;
the master device receives data sent by the first slave device through the first RX port, and exits from an interrupt state after data reception is completed;
wherein the method further comprises:
if the master device receives a second interrupt request through an interrupt request receiving port connected with a second slave device before exiting the interrupt state, wherein the second slave device is a slave device different from the first slave device in the N slave devices, the master device sends a second interrupt response message through the first TX port after determining that data transmission with the first slave device is completed, and the second interrupt response message carries address information of the second slave device; and the master equipment receives the data sent by the second slave equipment through the first RX port, and exits from the interrupt state after the data reception is finished.
2. The method of claim 1, further comprising:
if the master device receives a second interrupt request through an interrupt request receiving port connected with a second slave device before entering the interrupt state, wherein the second slave device is a slave device different from the first slave device in the N slave devices, the second slave device is a slave device which is not the same as the first slave device in the N slave devices
The master device determines response priorities of the first slave device and the second slave device according to a response priority rule, and responds to the interrupt requests sent by each of the first slave device and the second slave device in sequence according to the response priorities.
3. The method of claim 1 or 2, wherein the slave device is an ultrasonic module or an infrared module for collecting distance data of obstacles located around the smart robot.
4. A data transmission method is characterized by being applied to an intelligent robot, wherein the intelligent robot comprises a main device and N slave devices, and the slave devices are data acquisition devices arranged on the intelligent robot; the primary device is configured with a first transmit TX port, a first receive RX port, and at least N interrupt request receive ports; each slave device is configured with a second TX port, a second RX port, and an interrupt request transmission port; the first TX port is connected to each of the second RX ports, the first RX port is connected to each of the second TX ports, each of the interrupt request receiving ports is connected to a different interrupt request transmitting port, N is an integer greater than 2, and the method includes:
after acquiring data, a first slave device sends a first interrupt request to the master device through an interrupt request sending port of the first slave device, wherein the first slave device is any one of the N slave devices;
if the first slave device receives an interrupt response message broadcast and sent by the master device through a second RX port of the first slave device and determines that address information carried in the interrupt response message is the same as address information of the first slave device, sending the data to the master device through a second TX port of the first slave device, where the interrupt response message is sent after the master device enters an interrupt state, where if the master device receives a second interrupt request through an interrupt request receiving port connected to a second slave device before exiting the interrupt state, where the second slave device is a slave device different from the first slave device among N slave devices, the master device determines that data transmission with the first slave device is completed and then sends a second interrupt response message through the first TX port, where the second interrupt response message carries address information of the second slave device, and receiving the data transmitted by the second slave equipment through the first RX port, and exiting the interrupt state after the data reception is finished.
5. The method of claim 4, wherein the slave device is an ultrasound module or an infrared module for acquiring distance data of obstacles located around the smart robot.
6. The method of claim 5, wherein the slave device collects distance data of obstacles located around the intelligent robot in real time, or wherein the slave device collects distance data of obstacles located around the intelligent robot after receiving a data collection instruction sent by the master device.
7. The data receiving device is characterized by being applied to an intelligent robot, wherein the intelligent robot comprises a main device and N slave devices, and the slave devices are data acquisition devices arranged on the intelligent robot; the primary device is configured with a first transmit TX port, a first receive RX port, and at least N interrupt request receive ports; each slave device is configured with a second TX port, a second RX port, and an interrupt request transmission port; the first TX port is connected to each of the second RX ports, the first RX port is connected to each of the second TX ports, each of the interrupt request receiving ports is connected to a different interrupt request transmitting port, N is an integer greater than 2, and the apparatus is disposed in the master device, and includes:
a first receiving module, configured to receive a first interrupt request through an interrupt request receiving port connected to a first slave device, where the first slave device is any one of N slave devices;
the interrupt processing module is configured to enter an interrupt state if it is determined that the first interrupt request can be responded to, and send a first interrupt response message in a broadcast manner through the first TX port, where the first interrupt response message carries address information of the first slave device;
a second receiving module, configured to receive, through the first RX port, data sent by the first slave device, and exit an interrupt state after data reception is completed;
the first receiving module is further configured to receive, before exiting the interrupt state, a second interrupt request through an interrupt request receiving port connected to a second slave device, where the second slave device is a slave device different from the first slave device in the N slave devices;
the interrupt processing module is further configured to send a second interrupt response message through the first TX port after determining that data transmission with the first slave device is completed, where the second interrupt response message carries address information of the second slave device;
the second receiving module is further configured to receive data sent by the second slave device through the first RX port, and exit an interrupt state after data reception is completed.
8. The apparatus of claim 7,
the first receiving module is further configured to receive, before entering an interrupt state, a second interrupt request through an interrupt request receiving port connected to a second slave device, where the second slave device is a slave device different from the first slave device in the N slave devices;
the interrupt processing module is further configured to determine response priorities of the first slave device and the second slave device according to a response priority rule, and sequentially respond to an interrupt request sent by each of the first slave device and the second slave device according to the response priorities.
9. The apparatus of claim 7 or 8, wherein the slave device is an ultrasonic module or an infrared module for collecting distance data of obstacles located around the smart robot.
10. A data sending device is characterized by being applied to an intelligent robot, wherein the intelligent robot comprises a main device and N slave devices, and the slave devices are data acquisition devices arranged on the intelligent robot; the primary device is configured with a first transmit TX port, a first receive RX port, and at least N interrupt request receive ports; each slave device is configured with a second TX port, a second RX port, and an interrupt request transmission port; the first TX port is connected to each of the second RX ports, the first RX port is connected to each of the second TX ports, each of the interrupt request receiving ports is connected to a different interrupt request sending port, N is an integer greater than 2, the apparatus is disposed in a first slave device, and the first slave device is any one of N slave devices, including:
the sending module is used for sending a first interrupt request to the master equipment through an interrupt request sending port of the first slave equipment after data are collected;
a processing module, configured to send the data to the master device through a second TX port of the first slave device if an interrupt response message broadcast and sent by the master device is received through a second RX port of the first slave device and it is determined that address information carried in the interrupt response message is the same as address information of the first slave device, where the interrupt response message is sent by the master device after entering an interrupt state, where if the master device receives a second interrupt request through an interrupt request receiving port connected to a second slave device before exiting the interrupt state, the second slave device is a slave device different from the first slave device among the N slave devices, the master device determines that data transmission with the first slave device is completed, and sends a second interrupt response message through the first TX port, where the second interrupt response message carries address information of the second slave device, and receiving the data transmitted by the second slave equipment through the first RX port, and exiting the interrupt state after the data reception is finished.
11. The apparatus of claim 10, wherein the slave device is an ultrasound module or an infrared module for collecting distance data of obstacles located around the smart robot.
12. The apparatus according to claim 11, wherein the slave device collects distance data of obstacles located around the intelligent robot in real time, or collects distance data of obstacles located around the intelligent robot after receiving a data collection instruction sent by the master device.
13. A data receiving and transmitting system is characterized by being applied to an intelligent robot, wherein the intelligent robot comprises a main device and N slave devices, and the slave devices are data acquisition devices arranged on the intelligent robot; the primary device is configured with a first transmit TX port, a first receive RX port, and at least N interrupt request receive ports; each slave device is configured with a second TX port, a second RX port, and an interrupt request transmission port; the first TX port is connected to each of the second RX ports, the first RX port is connected to each of the second TX ports, each of the interrupt request receiving ports is connected to a different interrupt request transmitting port, N is an integer greater than 2, where:
the slave device is used for sending an interrupt request to the master device through an interrupt request sending port of the slave device after data is collected; if the slave device receives an interrupt response message sent by the master device through a second RX port of the slave device and determines that address information carried in the interrupt response message is the same as address information of the slave device, sending the data to the master device through a second TX port of the slave device;
the master device is used for receiving a first interrupt request through an interrupt request receiving port connected with a first slave device, wherein the first slave device is any one of N slave devices; if it is determined that the first interrupt request can be responded, the master device enters an interrupt state, and broadcasts and sends a first interrupt response message through the first TX port, wherein the first interrupt response message carries address information of the first slave device; the master device receives data sent by the first slave device through the first RX port, and exits from an interrupt state after data reception is completed;
the master device is further configured to, if a second interrupt request is received through an interrupt request receiving port connected to a second slave device before exiting an interrupt state, where the second slave device is a slave device different from the first slave device among the N slave devices, after determining that data transmission with the first slave device is completed, the master device sends a second interrupt response message through the first TX port, where the second interrupt response message carries address information of the second slave device; and the master equipment receives the data sent by the second slave equipment through the first RX port, and exits from the interrupt state after the data reception is finished.
14. An electronic device, comprising: at least one processor, and a memory communicatively coupled to the at least one processor, wherein:
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1 to 3 or 4 to 6.
15. A computer-readable medium having stored thereon computer-executable instructions for performing the method of any of claims 1 to 3 or 4 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910403233.9A CN110177035B (en) | 2019-05-15 | 2019-05-15 | Data receiving and sending method, device and data receiving and sending system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910403233.9A CN110177035B (en) | 2019-05-15 | 2019-05-15 | Data receiving and sending method, device and data receiving and sending system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110177035A CN110177035A (en) | 2019-08-27 |
CN110177035B true CN110177035B (en) | 2021-12-14 |
Family
ID=67690998
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910403233.9A Active CN110177035B (en) | 2019-05-15 | 2019-05-15 | Data receiving and sending method, device and data receiving and sending system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110177035B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113890781B (en) * | 2021-09-23 | 2023-05-23 | 河北汇金集团股份有限公司 | Communication method, system and storage medium based on timer extension |
CN115567080B (en) * | 2022-09-14 | 2024-10-01 | 上海龙旗科技股份有限公司 | Communication method, system and equipment based on USART |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102546843A (en) * | 2012-01-17 | 2012-07-04 | 厦门雅迅网络股份有限公司 | Method for achieving UART (universal asynchronous receiver/transmitter) communication interfaces through software simulation |
CN103106113A (en) * | 2013-02-25 | 2013-05-15 | 广东威创视讯科技股份有限公司 | Interrupt event processing method and processing equipment |
CN103955410A (en) * | 2014-05-23 | 2014-07-30 | 苏州国芯科技有限公司 | Interruption control method based on multiple interrupt source priority ordering |
CN104836710A (en) * | 2015-02-10 | 2015-08-12 | 数据通信科学技术研究所 | Method and apparatus based on one-master with multi-slaves communication of distributed system |
CN105094976A (en) * | 2015-10-09 | 2015-11-25 | 天津国芯科技有限公司 | Interrupt control method and interrupt controller |
CN108563518A (en) * | 2018-04-08 | 2018-09-21 | 广州视源电子科技股份有限公司 | Master-slave machine communication method, device, terminal equipment and storage medium |
CN108733188A (en) * | 2017-06-30 | 2018-11-02 | 北京猎户星空科技有限公司 | A kind of electronic equipment control method, device, electronic equipment and storage medium |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9313824B2 (en) * | 2009-07-31 | 2016-04-12 | Motorola Solutions, Inc. | System and method for interrupting communications within a communication system |
CN104156334A (en) * | 2014-08-19 | 2014-11-19 | 宁夏赛文节能股份有限公司 | Serial port self-adaption data transparent transmission protocol for multimachine communication |
US20170168968A1 (en) * | 2015-12-15 | 2017-06-15 | Qualcomm Incorporated | Audio bus interrupts |
-
2019
- 2019-05-15 CN CN201910403233.9A patent/CN110177035B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102546843A (en) * | 2012-01-17 | 2012-07-04 | 厦门雅迅网络股份有限公司 | Method for achieving UART (universal asynchronous receiver/transmitter) communication interfaces through software simulation |
CN103106113A (en) * | 2013-02-25 | 2013-05-15 | 广东威创视讯科技股份有限公司 | Interrupt event processing method and processing equipment |
CN103955410A (en) * | 2014-05-23 | 2014-07-30 | 苏州国芯科技有限公司 | Interruption control method based on multiple interrupt source priority ordering |
CN104836710A (en) * | 2015-02-10 | 2015-08-12 | 数据通信科学技术研究所 | Method and apparatus based on one-master with multi-slaves communication of distributed system |
CN105094976A (en) * | 2015-10-09 | 2015-11-25 | 天津国芯科技有限公司 | Interrupt control method and interrupt controller |
CN108733188A (en) * | 2017-06-30 | 2018-11-02 | 北京猎户星空科技有限公司 | A kind of electronic equipment control method, device, electronic equipment and storage medium |
CN108563518A (en) * | 2018-04-08 | 2018-09-21 | 广州视源电子科技股份有限公司 | Master-slave machine communication method, device, terminal equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN110177035A (en) | 2019-08-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109766302B (en) | Method and device for managing equipment | |
JP7562661B2 (en) | Software upgrade method, apparatus and system | |
EP2902914B1 (en) | Data transmission method and device | |
CN102546843A (en) | Method for achieving UART (universal asynchronous receiver/transmitter) communication interfaces through software simulation | |
Tokoro et al. | Acknowledging ethernet | |
CN110177035B (en) | Data receiving and sending method, device and data receiving and sending system | |
CN103324592A (en) | Data migration control method, data migration method and data migration device | |
RU2012101410A (en) | FORMING A NETWORK CARD | |
EP3860296B1 (en) | Method for transmitting downlink control channel, terminal and network side device | |
EP4152708A1 (en) | Communication method and communication device | |
TWI516942B (en) | Assigning addresses to devices on an interconnect | |
US20170115372A1 (en) | Bulk propagation timing measurement messaging | |
WO2020077568A1 (en) | Time-frequency resource contention method, apparatus, device and system for direct-connection communication | |
CN108491347B (en) | Communication method and electronic device | |
US8806082B2 (en) | Direct memory access device for multi-core system and operating method of the same | |
CN111885588B (en) | Method and device for executing electronic card management service | |
CN116389414A (en) | Address allocation method, multi-device system and storage medium | |
CN114666806B (en) | Method, device, equipment and storage medium for wireless network virtualization | |
CN116743524A (en) | Method and system for transmitting data and main module | |
CN112566082B (en) | Data transmission method, device, equipment and medium | |
CN105723670A (en) | Self-interference channel estimation method and device | |
CN111278058B (en) | Method, device and storage medium for coordinating conflict of random access signal | |
CN115706642B (en) | CSI-IM resource allocation method and CRI calculation method | |
WO2023236094A1 (en) | Sensing result information sending method and apparatus, sensing result information receiving method and apparatus, and device and storage medium | |
WO2017080350A1 (en) | Systems and methods for real time context based isolation and virtualization |
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 |