Abstract
For the current shipborne anti-collision sounding system, when multiple detection signals are transmitted, it is difficult to avoid collision with each other. In addition, there are shortcomings of insufficient energy consumption, low sounding precision, and slow response. To address this problem, a shipborne anti-collision sounding system based on ACT algorithm and Internet of things is designed in this paper. With ZigBee wireless communication technology and embedded technology, the function of anti-collision and sounding is realized by modular design. For the problem of the signal collision of each node of the wireless network, the ACT algorithm is introduced for system optimization to prevent signals from conflict when receiving, and ensure the synchronization and accuracy of the whole system. STM32F103 VET6 embedded chip is used as the control core of the system. CC2530 is responsible for the implementation of ZigBee wireless network communication. Experimental results show that the designed system has the advantages of low energy consumption, fast response, and high precision.
Introduction
In the modern transportation industry, water transportation occupies a very important position in China. The development of international trade has also prompted the activity of water transportation industry [1, 2]. The rapid development of network and informationization directly leads to the development of water transportation industry. The introduction of a variety of high-tech businesses simplifies miscellaneous procedure of the interview and consultations. In this way, the volume of goods trade is increasing rapidly, and the business volume of the water transportation industry is greatly improved. The water transportation activities are gradually compact and busy [3]. Meanwhile, the frequency of collision and reef accidents is increasing because of the high number of cargo ships and high frequency of navigation. Therefore, it is necessary to research the design and development of a new, safe and reliable shipborne anti-collision system [4, 5].
For the problems of the accident of ship collision, reef accident, and the trouble of water transportation equipment, bad weather, and other sudden hidden dangers, a lot of research work has been carried out [6]. At present, it is mainly to use electronic control and network system. Under given observation condition, the allowable area and the expansion of dangerous area of ship navigation are divided out. According to the method of estimating the number of ships in the dangerous area, the anti-collision control rule of the guidance path is given to prevent the collision [7]. However, the system cannot accurately obtain the real-time running information of the ship according to the precision equipment. There are shortcomings of insufficient energy consumption, low sounding precision, and slow response.
For the above problems, a shipborne anti-collision sounding system based on the technology of Internet of things is designed in this paper. Combined with ZigBee wireless communication technology and embedded technology, the function of anti-collision and sounding is realized by modular design. The main research contents are as follows.
Information acquisition module. The information acquisition module mainly uses the ultrasonic transmission drive circuit. The D882 transistor with low power and low cost is used in circuit design [8]. The draw-off current and sinking current of the transistor have reached 25 mA, ensuring the reliability and stability of the whole circuit. For the problem of the relative prolongation of the residual wave time after the ultrasonic generation, the part of the residual wave suppression circuit is added [9]. The transistor will be switched on after pulse transmission, and the primary inductance of the transformer will be short circuited, which will quickly consume the energy of the resonance circuit and eliminate the residual wave effectively.
Wireless network communication module. A wireless network is constructed with ZigBee to achieve close range wireless communication. Radio wave is used for data transmission between sensors. Cluster network topology is used in ZigBee device. All devices communicate with the PAN coordinator [10, 11]. The functions of the coordinator, the router and the terminal equipment are clear, the construction process is more concise, and the resources needed to be used are saved. The accuracy and coordination of the shipborne anti-collision system requires high communication efficiency and less used devices. CC2530 chip [12] is selected for the hardware core of the coordinator. It has features of high performance and high integration and less peripheral equipment.
System control module. STM32 series single-chip has the advantages of high performance and abundant instruction [13]. The control module uses the embedded processing chip of STM32F103 VET6 as the main control end. It is powerful and has low consumption and sufficient external interface.
Anti-collision algorithm design. For the requirement of real-time, shipborne anti-collision sounding system is optimized by adaptive collision tree algorithm. The idea of adaptive multilevel bifurcation is introduced. In the query process, the number of digital signal tags in the current group is estimated. The group at the next level is bifurcated. Based on the Manchester code, it is easy to judge whether each bit is collided or not and the location of the collision bit according to the received signal, which effectively avoids the problem of blocking and conflicting of multi-thread.
Material and methods
Information acquisition module
Ultrasonic transmission drive circuit
The circuit of shipborne anti-collision sounding system is mainly composed of ultrasonic transmitter, transformer TR, transistor, resistance, and capacitance, as shown in Fig. 1. Two port access system control modules of send and cut are controlled by the main chip. D882 is selected for the transistor Q2. When the I/O port of the system resource is set as a push-pull output mode, the draw-off current and sinking current of the transistor can reach 20 mA, enabling D882 [14, 15] to achieve enough driving power and fast on-off characteristics. The ultrasonic transmitter is capacitive, which forms a resonant circuit with the secondary inductor of the transformer TR, in order to improve the transmission efficiency of the ultrasonic wave. At the same time, the effect is caused by the relative prolongation of the residual wave time after the ultrasonic transmission. To solve this problem, the residual wave suppression circuit is added in the whole circuit. Capacitance C1 and C2 are used to adjust the capacitance of the load to induce the formation of the resonant circuit. The resistance R4 is to consume the power of the ultrasonic wave, increase the power loss of the resonant circuit, and shorten the end time of the residual wave. After the pulse transmission, the transistor Q1 will be switched on, and the primary inductance of the transformer will be short circuited, which quickly consumes the energy of the resonant circuit. The smaller the resistance R3 is, the better the suppression effect is. However, it is easy to get out of control, and a short circuit will burn out the components. For this problem, a jumper S is added in this circuit. When the debugging of the software is not completed, it is always in a disconnected state, avoiding unnecessary power loss, preventing the program from making a mistake and causing short circuit.

Ultrasonic transmission drive circuit.
Ultrasonic receiving circuit is the core part of the whole information collection module. Due to the easy realization of ultrasonic waveform and timing function, it is the key of circuit design to ensure accurate detection of echo signal. The receiving circuit composes of TL852 module, ultrasonic receiver, resistor, capacitor, and inductor, as shown in Fig. 2. CCA-CCD accesses to the I/O port of the main control chip of the system [16, 17] to control the working gain of TL852. It has a pull-up resistance inside, which is set to OC output mode. The REC pin of TL852 connects to the Sout end and accesses interrupt resources through the system control module. When the ultrasonic wave is transmitted, the output resistance of the TL852 is suppressed, and the OC output is set at this time. R2 and R3 are designed to be through-hole device. Changing the ratio of the two values can change the sensitivity of the circuit.

Ultrasonic receiving circuit.
The wireless network is built with ZigBee. ZigBee technology is a new wireless network technology that can perceive and collect node signals in a valid range in real-time. It can realize the dynamic self-organizing of the network, and its topology has the characteristics of random adjustment.
ZigBee protocol standard
The ZigBee protocol standard is a layered structure mode. The architecture consists of the physical layer (PHY), the media access control layer (MAC), the network layer (NWK), and the application layer (APL). The physical layer and media access control layer are defined according to IEEE 802.15.4 standard. Application layer framework provides application support layer (APS), ZigBee device object (ZDO) and user defined application object.Special communication and access can be realized through interfaces between layers and layers.
ZigBee network topology
There are three kinds of IEEE802.15.4 network devices: PAN coordinator, coordinator and general device. PAN coordinator is the central node of the whole network, and a network allows only one PAN coordinator. ZigBee network topology can be divided into star network, mesh network, and cluster network. All devices in a star network can communicate with the PAN coordinator, which has no router. Any two devices in an effective radio range in a mesh network can communicate directly [18]. The information maintenance of the node is complex when the network is built. The functions of the coordinator, router and terminal equipment in the cluster network are clear, the construction process is more concise, and the resources needed to be used are saved. In this paper, cluster network topology is applied in the ZigBee device [19].
Hardware design of ZigBee network coordinator
As the hardware core of the coordinator and the nodes, the processor is the main factor for the performance of the network. CC2530 is a chip for 2.4CHz band based on an on-chip system solution. An optimized 8051 microprocessor and a high-performance RF transceiver are integrated inside the chip and 8KB RAM, 32/64/128/256 KB FLASH, 2 USART, and other functional modules are deployed.The peripheral circuit of CC2530 is shown in Fig. 3. The main function of the coordinator is to build up the whole network architecture, receive and process the ultrasonic signals collected at the nodes, and achieve serial communication with the host of the monitoring center. The hardware design of the coordinator is built with the serial port technology and CC2530, as shown in Fig. 4. The serial port uses SP3232 to realize the level conversion of RS-232 serial data. After connecting with the host of the monitoring center, the data meaning represented by the ultrasonic signal is displayed [20].

CC2530 peripheral circuit.

SP3232 serial conversion circuit.
Embedded processing chip STM32F103 VET6 is used in the control module. The external interface is sufficient to store and process large amounts of data. STM32F103 VET6 is an ARM-based 32 bit Cortex-M3 kernel processor. The chip is integrated with 512KB FLASH, and 64KB SRAM. It has CAN and USB bus, 2 I2C and 3 SPI bus interfaces and 5 US-ART serial interfaces, which meets the needs of a variety of communication functions.
The function of the intelligent shipboard system is realized mainly through the transmission and reception of the ultrasonic signal. When multi-channel ultrasonic signals are contacted with multiple signal receiving nodes at the same time, there will be two cases of collision. One case is that ultrasonic signal causes multiple signal receiving node tags to respond, and the other is the same signal receiving node tag receives many different ultrasonic signals at the same time. This can make a sudden change in the signal. Collision is unavoidable when identifying multiple tags. Therefore, according to the collision state of the tag, the bifurcation is used to reduce collision slot [21–24].
In order to reduce the collision slot of the node tag receiving signal, the idea of adaptive multilevel bifurcation is introduced to the ACT algorithm. During the query process, the number of system signal tags in the current group (a branch of a tree) is estimated, and bifurcates at the next level group (the next node of the tree). When the number of tags is large and the collision is more, quanternary downward bifurcation is carried out for the collision node. 2 bit highest collision bits are set to 00, 01, 10, and 11, respectively, to form 4 new query prefixes and pressed into the stack. When the number of tags is less and the collision is less, binary downward bifurcation is used at the collision node. The highest collision bits are set to 0 and 1, respectively, to form 2 new query prefixes and pressed the stack.
Assume there are N system signal tags to be identified in the reading range of the network system. The possibility that every bit has no collisions isgiven by
The larger the value of N, the smaller the probability of a single bit collision. The collision factor is defined as the ratio of the collision bits to the length of the tag UID in the tag response information.
Assume k is search depth of search tree. The next node bifurcation number of the current node is L, p (k) is recognition probability. Then
Average search depth of search tree is given by
From Equations (3–5), it can be obtained that
The average number of queries required in the CT algorithm is given by
The average number of queries required in the ICT algorithm is given by
If the original ICT algorithm uses the quanternary bifurcation method, that is, L = 4, the average number of queries for identification of N tags is given by
From comparison of Equations (10) and (10), it can be obtained that, if N < 3, T
ICT
< T4ICT, otherwise, if N ≥ 3, T
ICT
> T4ICT. In the ACT algorithm, N = 3 is the key value that decides to use binary or quanternary bifurcation. When N = 3, the collision factor is given by
The number of tags is evaluated by comparing the impact factor z and 0.75 to determine whether it is better to use binary bifurcation or quanternary bifurcation. If z ≥ 0.75, the quanternary bifurcation method is used to reduce the collision slots and the search depth. If z < 0.75, the binary bifurcation is used. This adaptive downward bifurcation way makes the algorithm more flexible.
After optimizing the system through the ACT algorithm, it prevents the signal from conflicting when receiving, and sends the measurement results to the monitoring software through wireless. Then the user can know the location of the ship.
For the requirement of anti-collision function of the ship in the submarine operation, the ARM9-based embedded WindowsCE6.0 operating system is selected as the operating environment. The built system is tested in the lake with 50 m2 area. The receiver is arranged in a pavilion nearby. ZigBee child node equipment is deployed around the surrounding lake. The mobile point connects with cortex-M4 through the RS232 interface to send the measured data. The hardware part of the system is shown in Fig. 5.

Hardware of system.
The simulation experiments of ACT algorithm, CT algorithm, and ICT algorithm are carried out by Matlab.
For anti-collision algorithms, the number of query times, system throughput, and the amount of data transmission are the most important performance indexes, which represent the time complexity and communication complexity of the anti-collision sounding system. The ACT algorithm is analyzed in detail from these 3 aspects.
Assume there is N′ tags to be identified in the reading range of the reader, that is, there are N′ leaf nodes in the query tree. In CT algorithm, the number of required query times is given by
According to the idea of automatic recognition, it can be obtained that, if there is M times of 1 bit collision, the number of reduced query times is 2M.
When the search depth is k, The average number of tags of each child node is 3. When the search depth is less than equal to k, quaternary tree grouping is used on the basis of ICT, and when the search depth is greater than k, binary tree grouping is used.
The total number of query above the (k + 1) layer of search tree is given by
The best case is that the search tree is full tree. The M at this time can be taken to the maximum value N/2. The worst case is that there is no OOBC state and M is taken to the minimum value 0.
The query times of ACT is given by
System throughput can be obtained with the query times of the ACT algorithm. Assume E (N) is the throughput of the ACT algorithm and defined as the ratio of the number of system signal tags to be identified N and the total number of query times T (N) required for identifying these system signal tags.
The total number of transmitted bits represents the communication complexity. One of the most efficient methods for saving energy is to reduce the amount of data between tags and readers. The total amount of transmitted data for the ACT algorithm is the product of the number of query times and the amount of data required to be transmitted for each query. The amount of data for each transmission consists of two parts, that is, the amount of data sent to the reader and the amount of data sent to the tag by the reader. The total amount of data required in the ACT algorithm C (N) is given by
The comparison and analysis of ACT algorithm, CT algorithm, and ICT algorithm are carried out from 3 aspects of query times (times), system throughput (%) and transmission data (bit). In the experiment, the number of tags within the reader read range is set from 20 to 4000. The signal tag length is 100 bits, and the required data cost in the communication process is 32 bits.
Figure 6 shows the comparison of the average number of queries required by ACT algorithm, CT algorithm, and ICT algorithms for the case of the same number of tags. From Fig. 6, it can be seen that for 12000 tags, CT algorithm needs nearly 7500 query times, ICT algorithm needs nearly 4500 query times, and ACT algorithm only needs nearly 1200 query times. It can be concluded that the time complexity of ACT algorithm is less than CT algorithm and ICT algorithm.

Comparison of query times of ACT algorithm, CT algorithm, and ICT algorithm.
Figure 7 shows the comparison of the system throughput of ACT algorithm, CT algorithm, and ICT algorithm. From Fig. 7, as the number of tags increases, the system throughput of ACT algorithm tends to a stable value of 1.5. The system throughput of CT algorithm is 0.5 and ICT algorithm is 1.0. The system throughput of ACT algorithm is higher than the CT algorithm and ICT algorithm.

Comparison of system throughput of ACT algorithm, CT algorithm, and ICT algorithm.
Figure 8 shows the comparison of the average data amount required to be transmitted for N labels to be identified of ACT algorithm, CT algorithm, and ICT algorithm. From Fig. 8, it can be seen that, for the same number of labels, data amount required to be transmitted for identification with ACT algorithm is 13% of CT algorithm. ACT greatly reduces the transmitted data amount and with the increase of N, the effect of reduction is more obvious. It can be concluded that the communication complexity of ACT algorithm is less than CT algorithm and ICT algorithm.

Comparison of transmitted data amount of ACT algorithm, CT algorithm, and ICT algorithm.
ICT algorithm is improved based on CT algorithm. However, in ICT algorithm, only the binary bifurcation is used, which is a factor that restricts the performance improvement of the system. For this problem, ACT algorithm is proposed based on ICT algorithm, in which the idea of adaptive multilevel bifurcation is introduced to improve the system efficiency.
Performance test of shipborne anti-collision sounding system optimized by ACT algorithm is carried out. First, the case of actual distance within 80 m is analyzed. 8 experiments are carried out and 10 independent simulations are carried out in each group. The average value is taken as the measured distance. The results of the experimental simulation are counted and the error and the error ratio are analyzed, as shown in Table 1.
Analysis of statistical results and error
According to the above method, experimental simulation analysis of the measurement accuracy of the actual distance with 10–50 m is carried out. The simulation results are shown in Table 2.
Analysis of statistical results and error for the case of 10–50 m
From Tables 1 and 2, it can be seen that, the measurement results of the distance is close to the actual distance. For the measured distance range of 5–80 m, the maximum error value is no more than 1%. For the measured distance range of 10–50 m, the maximum error value is no more than 2.5%. The maximum error in the experiment occurs when the actual distance is 1 m. From the simulation data of the 8 groups of Table 1, it can be seen that the error ratio is increased with the larger actual distance, that is, with the distance increases, the precision is lower. This is because with the increase of the measured depth, the time of duration of the residual wave becomes longer and the uncertainty caused by the interference from the channel becomes greater. In the short distance, such as the 10–50 m distance in Table 2, the influence of the channel uncertainty is smaller. Therefore, this system has advantage in short distancemeasuring.
To further verify the performance of the proposed system, comparison of the energy consumption between the proposed system and the anti-collision sounding system based on directed graph. The comparison results are shown in Fig. 9. From Fig. 9, it can be seen that, for given measured depth, the total energy consumption of the anti-collision sounding system based on the Internet of things technology is reduced by 45%, compared with the anti-collision sounding system based on the directed graph, and the transmission delay is reduced by 2 s.

Comparison of anti-collusion performance.
Table 3 shows a set of early warning processes for the case of 5 typical operation of ship. Through the preliminary experiment and trial operation results in nearly 3 months, it can be seen that, according to different ship motion, the anti-collision sounding system can automatically control the warning distance, and alarm for ship collision and grounding collision accurately and timely, which has high reliability.
Early warning process record of shipborne anti-collision system/m
Alarm function of information acquisition module. In order to reduce the loss caused by the collision of the ship, a circuit for detecting, transmitting and receiving ultrasonic obstacles is designed. When the hull is threatened by an obstacle collision, the buzzer is stimulated for alarm [25, 26].
Wireless communication function. The wireless network transmission module with ZigBee technology is mainly used to transmit the information detected by ship to the user, and achieve real-time data recording of the whole system. The whole data transmission system structure can realize the dynamic network organization. The topological structure has the characteristics of random adjustment, which can reduce the difficulty of constructing a system platform and the damage caused by damage of part of module. In this way, the performance of the whole system is optimized.
System control module. The STM32F103 VET6 embedded processing chip is used as the main controller. It has powerful functions, low power consumption, abundant resources, and sufficient external interfaces. In addition, it can store and process large amounts of data, so as to achieve various functions of intelligent shipborne system.
Introduction of anti-collision algorithm. The anti-collision algorithm is introduced to process the signal, avoiding that the same node tag receives different ultrasonic signals at the same time, which has an impact on the measurement results, and improves the stability and reliability of the system.
Conclusions
For the situation and problems of the current water traffic, the design of the intelligent shipborne system is researched in this paper. The Internet of things technology and network communication technology are used to improve the various safety alarm systems on the carrier ship of water traffic. The system is upgraded and optimized by the introduction of anti-collision algorithm, which greatly enhances the performance of the system. In addition, the shipborne system has a high portability. It can be applied to other vehicles, and can also support the activities of aerial monitoring and seabed detection. It can strengthen the scientific monitoring and management of sailing and ensure unimpeded water route and traffic safety. Experimental results show that the system has a high practical significance.
