{'fraction_non_alphanumeric': 0.021657135904611265, 'fraction_numerical': 0.006326803747414528, 'mean_word_length': 4.867237687366167, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Design and application of intelligent traffic guidance system for fog area based on LoRa

An intelligent traffic guidance system based on LoRa technology was designed for driving safety in foggy environment. The purpose of the system is to monitor the visibility value in the atmosphere in real time, automatically judge and perform corresponding guidance operation. LoRa networks and user management were integral parts of the system. Its structure adopted star and chain network topology. Based on LoRa technology, the system had completed the software and hardware design of a series of terminal nodes, relay nodes and base station nodes. Communication protocol was customized according to system requirements to realize fog-guiding system. The system was applied in engineering, experiments shown that good communication and synchronous can be obtained. The system not only provides security for road users, but also provides a convenient access for managers.


2.Overall system design
The overall design of the system is presented in Figure 1. System could be categorized into user management and LoRa network. GPRS was used for communication between user management and LoRa network. Functionally, LoRa could be classified as base station, relay and terminal three types. Although LoRa technology can implement ultra-long distance transmission, the base station nodes load too many terminal nodes will cause the bit error rate to increase and the network to be paralyzed [5] . Hence, the relay node can be appropriately added. At the user management, administrators can real-time supervise the road conditions through a mobile device or computer. The remote control system can also be modified by the target parameters set in the server.  Overall system design. It can be seen that the structure of the system is clear, the network is simple, meanwhile real-time feedback and modification can be carried out. It can complete automatic control, data upload, data distribution, remote control, remote monitoring and other intelligent functions. The system not only improves the road safety in the foggy environment, but also provides managers a convenient channel, a better service.

3.System network topology design
The network topology of system was a hybrid topology, which was composed of star network topology and chain network topology. The chain topology was formed between the base station and the relay nodes, as seen from Figure 2. The chain structure, which the base station node composed its center, was simpler than tree structure [6] . Each node in a chain was interconnected with the other two nodes. A star topology was composed between the relay and the terminal nodes, as shown in Figure 3. Relative to the mesh structure, the synchronization overhead and hop count to be eliminated [7] .

Terminal node hardware design
The terminal node consisted of STM32F103RCT6 MCU, SX1278 LoRa module, guidance execution module and power module was designed, which mainly implements receiving and guiding.

Relay node hardware design
A node that aggregated the functions of booting, receiving, processing, and sending data was called a relay node. The hardware component of the relay node was composed of terminal nodes and additional GPS modules. GPS was being used to deal with the problem of the light synchronized flicker.

Base station node hardware design
The base station node diffused the data downward to implement remote control of the entire system when upper computer issued instruction to it. In addition, the base station node could also upload live image, visibility value and other information to the host computer to realize remote monitoring of the project site by the administrator. On the basis of the terminal node, the GPRS module, the visibility meter interface module and the image interface module were the significantly increased modules of the base station node.

5.Software design
The system software was built on the Keil RTX operating system. RTX is a royalty-free and deterministic RTOS with source code which suitable for ARM and Cortex-M devices [8] . First, BSP_Init () function was called to initialize hardware. After that, the Os_Sys_Init () function was called to start the initialization of the operating system and start the process, which initialized the semaphore, the mailbox, creates the task. Finally, the Os_Task_Delet_Self () function was called to switches the process so that the RTX kernel began to perform multitasking [9] .

LoRa network communication protocol design
According to the actual needs of the system, the LoRa communication protocol was designed to process and parse the data packets. The data packet was a data frame packing, of which a hexadecimal byte stream of the transmission sequence was used [10] . Moreover, CRC-16 check algorithm was used to ensure accurate data transmission.
The data length of system was 12 bytes [11] , which was made up of the 2byte header + 2byte target device + 6byte data volume + 2byte end flag. The format of data frame as shown as Table 1. The package was consisted of control commands, network group numbers, time data, package numbers and checksums bit. Different control instruction represented different operations of the guided module, which is presented at Table 2. Network group number was used to form different network groups, by which the communication between each network group does not interfere with each other, guaranteeing the signal completion. In addition, in order to prevented network group receiving the same information repeatedly, packet number was used. The terminal nodes were basic units in the control system which responsible for receiving wireless data, performing judgment and processing. The terminal nodes need the air signal to be detected real-time, it will estimate the data packet number or the network number is consistent when receiving the signal. Subsequently, the corresponding operations of terminal node will be made base on control instructions. The procedure control flow chart of terminal node is shown in Figure 4.

Relay node software design
The relay nodes played a role as bridge that received the data from base station node and sent reconstructing data to terminal node. Besides, the relay nodes need the time information from the GPS module to be received periodically and sent it to the terminal node to realize the synchronous flashing function of the system [12] . The software flow is shown in Figure 5.

Base station node software design
Base station node was regarded as the center of the entire system, and its performance was crucial to the whole control system. The visibility value and the image information, which collected by the base station node, were uploaded to the server through GPRS [13] , so that administrator could monitor the project site and the target value could be modified to remotely control the system. In addition, the base station node automatically selected the guidance mode base on the value of visibility then data command will be sent to the relay node through LoRa. The LoRa module of the base station node was only used for transmission. The software design process is shown in Figure 6.

6.System application
The design was used for a project that had a length of 3Km, with many mountains and windings, and including a small section of building. After all this was a great challenge for wireless communication, but the result was proved good and the system could be synchronized induction by adding appropriate relay nodes. The test results are shown in Table 3  3.00 8.0% Figure 7. The photo of project site. After all, experimental results shown that the relay node could be reduced in the application of LoRa RF module. The method of network grouping was used to decrease the interference between signals and ensure the stable communication of the system.

7.Conclusion
In this paper, the intelligent traffic guidance system was designed based on LoRa technology. The findings in the current study are important for developing new way of traffic that combination wireless technology and traffic safety. Thus, this paper provides some reference significance in the application field of intelligent transportation.