Serial data transmission device, method and data processing equipment
Technical Field
The application relates to the technical field of communication of the Internet of things, in particular to a serial data transmission device, a serial data transmission method and data processing equipment.
Background
In some data transmission systems of the internet of things, each node module has 1 core MCU, i.e., a microprocessor. Under the condition of serial data communication requirement, the MCU can receive the data sent by the MCU of the previous stage, and then, after carrying out localization operation, the MCU of the next stage is continuously transmitted with new data through the interface. A serial, split-node data transmission system may be formed.
However, due to the MCU chip used, there is a possibility of failure under certain application environments, such as saline-alkali, static electricity, etc. This results in a situation: if the MCU of a certain node in the middle is damaged or actively exits from the working state, the whole data transmission system cannot continue to transmit data.
Disclosure of Invention
The application aims to overcome the defects, provide a serial data transmission device, and perform normal sequential data processing and transmission when MCUs on all nodes work normally, and when the MCU of one intermediate node fails, the data of the previous node can skip the intermediate node to directly transmit the data to the next node for processing, and also provide a data transmission method based on the device, and further provide a data processing device for forming the device.
The technical scheme adopted by the application is as follows:
the application provides a serial data transmission device, which comprises a plurality of MCU processors connected in series in turn, wherein a data transmission line between the MCU comprises a main line and an auxiliary line, wherein:
the main lines of adjacent MCUs are directly connected in series;
a control component is arranged on an auxiliary line of each MCU, and after the auxiliary lines of adjacent MCUs are connected in series, the MCU is connected to the auxiliary line in parallel;
when the MCU is in a normal working state and data transmission exists on a main line and an auxiliary line connected with the MCU, the MCU selects the data of the main line for processing, ignores the data of the auxiliary line, and cuts off the data of the auxiliary line at the MCU; the MCU transmits the processed data through the main line and the auxiliary line simultaneously;
when the MCU processes the abnormal state, the main line is cut off, data on the auxiliary line is transmitted to the next MCU crossing the MCU, the data is received on the auxiliary line connected with the next MCU, and the data is simultaneously transmitted through the main line and the auxiliary line after being processed.
As a further optimization of the device, the MCU is provided with a first main line pin for receiving and transmitting the last MCU data, a second main line pin for receiving and transmitting the next MCU data, a first auxiliary line pin connected to the auxiliary line and used for receiving and transmitting the last MCU data and a second auxiliary line pin connected to the auxiliary line and used for receiving and transmitting the next MCU data.
As a further optimization of the device of the present application, the first main line pin, the second main line pin, the first auxiliary line pin and the second auxiliary line pin each comprise a receiving pin and a transmitting pin, and the corresponding main line and auxiliary line each comprise a receiving branching line and a transmitting branching line.
As a further optimization of the device, the receiving pins of the first auxiliary wire pins are connected in parallel to the transmitting branches of the auxiliary wire lines, the transmitting pins of the first auxiliary wire pins are connected in parallel to the receiving branches of the auxiliary wire lines, the transmitting pins of the second auxiliary wire pins are connected in parallel to the transmitting branches of the auxiliary wire lines, and the receiving pins of the second auxiliary wire pins are connected in parallel to the receiving branches of the auxiliary wire lines;
the auxiliary line is connected with a first resistor and a diode along the data transmission direction in series at each MCU in sequence, the auxiliary line is connected with a second resistor at the rear side of the diode along the data transmission direction and is grounded, and the first resistor and the second resistor are both positioned between the MCU and the contacts of the auxiliary line;
the transmitting pins in the first auxiliary wire pins and the transmitting pins in the second auxiliary wire pins are grounded through the MOS tube in the MCU.
As a further optimization of the device, the connection mode between the adjacent MCUs is wireless connection and/or wired connection, and the main line and the auxiliary line are independent in receiving and transmitting.
As a further optimization of the device of the present application, the resistance value of the first resistor is 22 ohms, and the resistance value of the second resistor is 1000 ohms.
The application also provides a serial data transmission method, which comprises the following steps:
the method comprises the steps that a plurality of data processing devices are connected in series through a protocol, and an MCU in each device is connected with a main line and an auxiliary line;
when the MCU is in a normal working state and data transmission exists on a main line and an auxiliary line connected with the MCU, the MCU selects the data of the main line for processing, ignores the data of the auxiliary line, and cuts off the data of the auxiliary line at the MCU; the MCU transmits the processed data through the main line and the auxiliary line simultaneously;
when the MCU processes the abnormal state, the main line is cut off, data on the auxiliary line is transmitted to the next MCU crossing the MCU, the data is received on the auxiliary line connected with the next MCU, and the data is simultaneously transmitted through the main line and the auxiliary line after being processed.
As a further optimization of the method of the present application, the serial connection manner between the plurality of data processing devices of the present application is a wireless connection and/or a wired connection, and the main line and the auxiliary line are independent from each other in transmission and reception.
The application also provides data processing equipment, which comprises an MCU, wherein the MCU is connected with a main line and an auxiliary line;
the MCU is provided with a first main line pin for receiving and transmitting the last MCU data, a second main line pin for receiving and transmitting the next MCU data, a first auxiliary line pin connected to an auxiliary line and used for receiving and transmitting the last MCU data and a second auxiliary line pin connected to an auxiliary line and used for receiving and transmitting the next MCU data, wherein the first main line pin, the second main line pin, the first auxiliary line pin and the second auxiliary line pin all comprise receiving pins and transmitting pins, and the corresponding main line and auxiliary line comprise receiving branching lines and transmitting branching lines;
the receiving pins of the first auxiliary wire pins are connected in parallel to the transmitting branch lines of the auxiliary wire lines, the transmitting pins of the first auxiliary wire pins are connected in parallel to the receiving branch lines of the auxiliary wire lines, the transmitting pins of the second auxiliary wire pins are connected in parallel to the transmitting branch lines of the auxiliary wire lines, and the receiving pins of the second auxiliary wire pins are connected in parallel to the receiving branch lines of the auxiliary wire lines;
the auxiliary line is connected with a first resistor and a diode along the data transmission direction in series at each MCU in sequence, the auxiliary line is connected with a second resistor at the rear side of the diode along the data transmission direction and is grounded, and the first resistor and the second resistor are both positioned between the MCU and the contacts of the auxiliary line;
the transmitting pins in the first auxiliary wire pins and the transmitting pins in the second auxiliary wire pins are grounded through the MOS tube in the MCU.
As a further optimization of the single device, the connection mode of the main line and the auxiliary line of the MCU and other data processing devices comprises wired connection and/or wireless connection.
The application has the following advantages:
1. the application provides a circuit structure for transmitting main and auxiliary lines, wherein the transmission of the main line is the connection of the traditional serial mode, each MCU is connected in parallel with the auxiliary line, when the MCU at the position is in a normal working state, the MCU performs one-choice processing on the same data information transmitted by the main line and the auxiliary line, the data information of the auxiliary line is cut off at the MCU, the transmission to the next MCU is avoided, and after the data information is processed by the MCU, the MCU simultaneously transmits the data information through the main line and the auxiliary line, and the next MCU repeats the processing process;
when a fault occurs in a MCU, all pins on the MCU float, no influence exists on the auxiliary line, the data information of the last MCU is transmitted to the next MCU through the MCU, the next MCU only receives the data information transmitted on the auxiliary line, and the middle MCU is judged to be faulty, so that the data information on the auxiliary line is processed.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
The application is further described below with reference to the accompanying drawings:
FIG. 1 is a block diagram of a processing apparatus;
FIG. 2 is a block diagram of a serial data transmission device;
fig. 3 is a schematic diagram of pin grounding of the MCU.
Detailed Description
The application will be further described with reference to the accompanying drawings and specific examples, so that those skilled in the art can better understand the application and implement it, but the examples are not meant to limit the application, and the technical features of the embodiments of the application and the examples can be combined with each other without conflict.
It should be appreciated that in the description of embodiments of the application, the words "first," "second," and the like are used merely for distinguishing between the descriptions and not for indicating or implying any relative importance or order. "plurality" in the embodiments of the present application means two or more.
In the embodiment of the present application, the "and/or" is merely an association relationship describing the association object, and the representation may have three relationships, for example, a and/or B may represent: a alone, B alone, and both A and B. In addition, the character "/" herein generally indicates that the front-rear associated object is an "or" relationship.
The present embodiment provides a data processing apparatus, as shown in fig. 1, including an MCU connected with a main line including a transmission branch line and a reception branch line,
the MCU comprises 8 pins, wherein the pin 1 and the pin 2 are used for connecting a previous data processing device, the pin 1 is used for connecting a first receiving branch L3 of a main line and used for receiving data sent by the previous data processing device, the pin 2 is used for connecting a second receiving branch L4 of the main line and used for returning data to the previous data processing device, the pin 7 and the pin 8 are used for connecting a next data processing device, the pin 7 is used for connecting a sending branch L5 of the main line and used for sending data to the next data processing device, the pin 8 is used for connecting a receiving branch L6 of the main line and used for receiving return data of the next data processing device, two ends of the sending branch L1 of a subsidiary line are respectively connected with the sending branch of the subsidiary line of the previous data processing device and the sending branch of the subsidiary line of the next data processing device in series, and two ends of the receiving branch L2 of the subsidiary line are respectively connected with the receiving branch of the subsidiary line of the previous data processing device and the receiving branch of the next data processing device in series;
the transmission branch line L1 of the auxiliary line is sequentially provided with a first resistor R1 and a diode D1 along the data transmission direction, the direction of the diode D1 is along the data transmission direction of the transmission branch line L1, the first resistor R1 and the diode D1 are positioned between the contact point of the pin 3 and the transmission branch line L1 and the contact point of the pin 5 and the transmission branch line L1, and the negative electrode end of the diode D1 positioned on the transmission branch line L1 is connected with a second resistor R11 in parallel and is further grounded;
the receiving branch line L2 of the corresponding auxiliary line is provided with a second resistor R2 and a diode D2 along the data transmission direction, the direction of the diode D2 is along the data transmission direction of the receiving branch line L2, the second resistor R2 and the diode D2 are positioned between the contact point of the pin 4 and the sending branch line L2 and the contact point of the pin 6 and the sending branch line L2, the negative end of the sending branch line L2 positioned at the diode D2 is connected with a second resistor R22 in parallel, and the second resistor R22 is further grounded, wherein the first resistor R1 and the first resistor R2 are both set to be 22 ohms, and the second resistor R11 and the second resistor R22 are both set to be 1000 ohms;
in this embodiment, both the pin 4 and the pin 5 of the MCU are grounded through the MOS tube in the MCU, as shown in fig. 3, and the switch of the MOS tube is controlled to control the access of the signal input end or the input of the ground end.
In this embodiment, the connection manner between the main line and the auxiliary line of the MCU and other data processing devices includes wired connection and/or wireless connection, and the main application scenario is data transmission of the wireless internet of things, so that the main receiving manner is a wireless connection manner, and the transmission and the reception on the main line and the auxiliary line are mutually independent.
The embodiment also provides a serial data transmission device, which is composed of the plurality of data processing devices, as shown in fig. 2, wherein a data transmission line of the MCU between the data processing devices includes a main line and an auxiliary line, wherein:
the main lines of adjacent MCUs are directly connected in series, and the auxiliary lines of adjacent MCUs are directly connected in series, wherein the connection mode is a wired or wireless mode, and the embodiment is mainly used for data transmission of the wireless internet of things, as another application of the inventor, namely, an NB-IoT device communication system and method, provides an application scene, adjacent NB-IoT devices cannot establish connection with a base station to perform data transmission due to insufficient coverage of base station signals, adjacent NB-IoT devices sequentially establish connection to perform data processing and transmission, and further data of all NB-IoT devices are transmitted to the NB-IoT devices capable of establishing connection with the base station, and all data are sent to the base station through the device. In the above-described process, the serial data transmission device of the present embodiment is utilized.
In fig. 2, when the MCUB is in a normal working state, the MCUB of the intermediate data processing device is exemplified, data information from the MCUA exists on both the main line and the auxiliary line, that is, the pin 2 and the pin 3 can both receive the data information from the previous MCUA, the MCUB selects the data information on the main line for processing, ignores the data information from the pin 3, and sends response information through the pin 1, the L1 line of the auxiliary line is used as a load, the pin 3 is equivalent to short-circuiting the R1, so that the data information transmitted by the previous MCU is cut off at the first resistor R1, and in the process of receiving the data, the pin 4 and the pin 5 for transmitting the data of the MCUB are grounded through MOS tubes, so that the data information transmitted on the auxiliary line is 0, that is, for the previous MCUC, the auxiliary line has no signal transmission.
After the MCUB finishes processing data, the data is sent simultaneously through the main line and the auxiliary line, that is, the pin 5 and the pin 7 send data simultaneously, of course, when the pin 5 sends data, the data needs to be connected to the signal input end through the MOS tube first, and the data sent by the pin 7 is normally sent to the MCUC, on the auxiliary line, because of the unidirectional conductive characteristic of the diode D1, when the pin 5 sends a high level, the output end of the MCUA is not affected, and because the first resistor R1 acts as a load, when the pin 5 sends a low level, the high level and the low level of the output end of the a number are not affected, that is, the data transmitted on the auxiliary line is normally sent to the MCUC, and the MCUC repeats the processing procedure of the MCU.
When the MCUB fails, the main lines on the two sides of the MCUB are disconnected, and all the pins 3, 4, 5 and 6 connected to the auxiliary line float, so that no influence is exerted on the auxiliary line. The main line of the MCUC can not receive the data information of the MCU B, the auxiliary line of the MCUC can not receive the data information of the MCUA, the MCU of the upper stage is judged to be damaged, and then the data information of the MCUA is processed.
In the above, when the signal sent by the MCUA is at a high level, the signal at the high level is still at a high level when being transmitted to the node between the pin 5 and the auxiliary line due to the unidirectional conduction characteristic of the diode between the pin 3 and the pin 5 on the MCUB, and then is further transmitted to the pin 3 of the MCUC; when the signal from MCUA is low, the low level signal cannot pass through the diode, but due to the influence of the ground resistor R11, the level at the junction between the pin 5 of MCUB and the auxiliary line is also low, and the level signal can be transferred to the pin 3 of MCUC. The principle is the same when pin 4 of MCUC performs data return.
Based on the above device, the present embodiment further provides a serial data transmission method, including:
the method comprises the steps that a plurality of data processing devices are connected in series through a protocol, and an MCU in each device is connected with a main line and an auxiliary line;
when the MCU is in a normal working state and data transmission exists on a main line and an auxiliary line connected with the MCU, the MCU selects the data of the main line for processing, ignores the data of the auxiliary line, and cuts off the data of the auxiliary line at the MCU; the MCU transmits the processed data through the main line and the auxiliary line simultaneously;
when the MCU processes the abnormal state, the main line is cut off, data on the auxiliary line is transmitted to the next MCU crossing the MCU, the data is received on the auxiliary line connected with the next MCU, and the data is simultaneously transmitted through the main line and the auxiliary line after being processed.
In the above, the serial connection manner between the plurality of data processing apparatuses is a wireless connection and/or a wired connection, and the transmission and reception of the main line and the auxiliary line are independent.
The above-described embodiments are merely preferred embodiments for fully explaining the present application, and the scope of the present application is not limited thereto. Equivalent substitutions and modifications will occur to those skilled in the art based on the present application, and are intended to be within the scope of the present application. The protection scope of the application is subject to the claims.