This application is a Non-Provisional Application of Chinese Application No. 202010940059.4 filed on Sep. 9, 2020, entitled “DATA TRANSMISSION METHOD AND EQUIPMENT BASED ON SINGLE LINE”, which is incorporated herein by reference in its entirety

TECHNICAL FIELD

The application relates to the technical field of computers, and in particular to a data transmission method and equipment based on a single line.

BACKGROUND

When equipment works, a plurality of instruments are mostly combined to work together, during which data needs to be summarized to a central control system, so that the central control system can upload the data to a ground control system. Due to space limitation, a communication bus mounted with the plurality of instruments can only be a single line. In the prior art, a method for single-line data transmission of equipment is relatively complex and cannot adapt to many scenes.

SUMMARY

In view of this, the embodiment of the application provides a data transmission method and equipment based on a single line in order to solve the problems that a method for single-line data transmission of equipment in the prior art is relatively complex and cannot adapt to many scenes.

The embodiment of the application adopts the following technical solutions:

The embodiment of the application provides a data transmission method based on a single line, and the method is applied to drilling equipment and includes:

performing, by a master node of the drilling equipment, data acquisition on a specified slave node of the drilling equipment, and sending instruction information of data transmission to the slave node through a bus in a preset first cycle;

judging, by the slave node of the drilling equipment, whether data needs to be sent or not according to the instruction information of data transmission;

sending the data to the master node of the drilling equipment through the bus if the slave node of the drilling equipment judges that the data needs to be sent;

uploading, by the slave node of the drilling equipment, the data autonomously to cope with an emergency situation of the slave node of the drilling equipment in a preset second cycle, wherein the emergency situation may be a failure alarm; and sending, by other slave nodes, the data to the master node sequentially through the bus according to a preset slave node priority, an electric potential condition of the bus and a data state of the other slave nodes; and wherein the data state of the other nodes includes data upload and no data upload;

the step of sending, by the other slave nodes of the drilling equipment, the data to the master node sequentially through the bus according to the preset slave node priority of the drilling equipment, the electric potential condition of the bus and the data state of the other slave nodes specifically includes the following steps:

judging whether there are other slave nodes sending data to the master node according to the data state of the other slave nodes;

judging, by the other slave nodes, whether the bus is at a preset electric potential or not according to the preset slave node priority if it is determined that there are other slave nodes sending data to the master node, and sending the data to the master node through the bus when it is determined that the bus is at the preset electric potential; and

leaving the data upload for the next cycle if the other slave nodes fail to complete data upload after the time of the second cycle has passed;

the step of sending, by the other slave nodes, the data to the master node sequentially through the bus according to the preset slave node priority, the electric potential condition of the bus and the data state of the other slave nodes includes:

judging whether the bus is at the preset electric potential or not according to the preset slave node priority when the data state of the other slave nodes is the data upload, and sending the data to the master node through the bus when it is determined that the bus is at the preset electric potential; and

detecting the electric potential condition of the bus through a data transmission detection circuit, whereat the preset electric potential is a first electric potential or a second electric potential, wherein the first electric potential is an electric potential at which a first transmission detection circuit detects that the bus is idle, the second electric potential is an electric potential at which a second transmission detection circuit detects that the bus is idle, and the first electric potential is greater than the second electric potential.

Further, the data state of the other slave nodes includes data upload and no data upload.

Further, the first transmission detection circuit includes a first sending port, a first receiving port, a bus and a first detection module, wherein,

the master node and the slave nodes are all connected to a first serial port through the first sending port and the first receiving port;

the first serial port is connected to the bus; and

the first detection module is connected to the first receiving port, the first sending port and the bus.

Further, the first detection module includes three units, wherein the first detection module includes a first unit, a second unit and a third unit;

a first end of the first unit is connected to the first sending port, a second end of the first unit is connected to a high electric potential, and a third end of the first unit is grounded and connected to a first end of the third unit;

a first end of the second unit is connected to the first sending port, a second end of the second unit is grounded, and a third end of the second unit is connected to the high electric potential and the bus; and

the first end of the third unit is grounded and connected to the third end of the first unit, a second end of the third unit is connected to the bus, and a third end of the third unit is connected to the first receiving port and the high electric potential.

Further, the second transmission detection circuit includes a second sending port, a second receiving port, a bus and a second detection module, wherein,

the master node and the slave nodes are all connected to a second serial port through the second sending port and the second receiving port;

the second serial port is connected to the bus; and

the second detection module is connected to the second receiving port, the second sending port and the bus.

Further, the second detection module includes four units, wherein the second detection module includes a fourth unit, a fifth unit, a sixth unit and a seventh unit;

a first end of the fourth unit is connected to the second sending port, a second end of the fourth unit is connected to a high electric potential, and a third end of the fourth unit is grounded and connected to a first end of the fifth unit;

the first end of the fifth unit is grounded and connected to the third end of the fourth unit, a second end of the fifth unit is connected to the bus, and a third end of the fifth unit is grounded and connected to a first end of the sixth unit;

the first end of the sixth unit is grounded and connected to the third end of the fifth unit, a second end of the sixth unit is connected to the high electric potential, and a third end of the sixth unit is grounded and connected to the second receiving end; and

a first end of the seventh unit is connected to the second sending port, a second end of the seventh unit is connected to the high electric potential, and a third end of the seventh unit is grounded and connected to the bus.

The embodiment of the application further provides data transmission equipment based on a single line, and the equipment includes:

at least one processor; and

a memory connected to the at least one processor; wherein,

the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor, thereby causing the at least one processor to:

perform, by a master node, data acquisition on a specified slave node in a preset first cycle, and send instruction information of data transmission to the slave node through a bus;

judge, by the slave node, whether data needs to be sent or not according to the instruction information of data transmission;

send the data to the master node through the bus if the slave node judges that the data needs to be sent;

upload, by the slave node, data autonomously in a preset second cycle to cope with an emergency situation of the slave node, wherein the emergency situation may be a failure alarm; and send, by the other slave nodes, the data to the master node sequentially through the bus according to a preset slave node priority, an electric potential condition of the bus and a data state of the other slave nodes, wherein the data state of the other slave nodes includes data upload and no data upload;

the step of sending, by the other slave nodes, the data to the master node sequentially through the bus according to the preset slave node priority, the electric potential condition of the bus and the data state of the other slave nodes specifically includes the following steps:

judging whether there are other slave nodes sending data to the master node according to the data state of the other slave nodes;

judging, by the other slave nodes, whether the bus is at a preset electric potential or not according to the preset slave node priority if it is determined that there are other slave nodes sending data to the master node, and sending the data to the master node through the bus when it is determined that the bus is at the preset electric potential; and

leaving the data upload for the next cycle if the other slave nodes fail to complete the data upload after the time of the second cycle has passed;

the step of sending, by the other slave nodes, the data to the master node sequentially through the bus according to the preset slave node priority, the electric potential condition of the bus and the data state of the other slave nodes includes:

judging whether the bus is at the preset electric potential or not according to the preset slave node priority when the data state of the other slave nodes is the data upload, and sending the data to the master node through the bus when it is determined that the bus is at the preset electric potential; and

detecting the electric potential condition of the bus through a data transmission detection circuit, wherein the preset electric potential is a first electric potential or a second electric potential, wherein the first electric potential is an electric potential at which a first transmission detection circuit detects that the bus is idle, the second electric potential is an electric potential at which a second transmission detection circuit detects that the bus is idle, and the first electric potential is greater than the second electric potential.

According to the at least one technical solution adopted by the embodiment of the application, the following beneficial effects can be achieved: in a preset first cycle, data is actively requested from a slave node, and in a preset second cycle, other slave nodes can actively send the data to a master node according to a preset slave node priority, an electric potential condition of a bus and a data state of the other slave nodes, thereby completing single-line data transmission.

