{'fraction_non_alphanumeric': 0.024911325579477027, 'fraction_numerical': 0.008001319805328713, 'mean_word_length': 4.8485287023637245, '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': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Design and implementation of fire rescue scene frame polling dispatcher based on FPGA

In this paper, the design requirements of fire rescue scene frame polling dispatcher based on FPGA are analyzed. After expatiating the research status of video image scheduler and the principle of polling scheduling system, the hardware structure design and function simulation platform of the system are discussed. And then, we introduced the related code system implementation process. Finally, the function of the system design is verified and the result is simulated by the FPGA experimental platform. The whole system function and simulation results meet our design requirements. It has a good application prospect.


Introduction
In recent years, with the development of economy and society, traffic accidents, fires and other geological disasters happen frequently. The occurrence of all kinds of disaster accidents seriously affects the safety of life and property of our people. In the event of disasters, fire fighting forces, as the national team and main force of emergency rescue in China, have played an important role in emergency rescue. Especially, with the input of fire emergency command image and voice integrated platform, firefighting and emergency response have been greatly improved [1].
With the wide application of fixed-point video surveillance, satellite communications, microwave communications, 4G mobile communications and fire-fighting drones, the methods of scene acquisition and transmission for fire and emergency rescue are more diversified [2]. The scene images of fire rescue which can be collected and transmitted show the characteristics of multi-angle, multi-direction and multi-screen real-time transmission. However, there is only one large screen in our fire command center at all levels, and the scheduling of video images is mostly presented through MCU, scheduling software, TV wall, video conference system, etc. A video conference group and screen drag are needed to present the rescue scene manually [3]. The operation speed and screen screening ability of man-made is contradictory to the changing environment of the rescue site, and it is always impossible to transfer the key picture and the key development situation back to the command center. For example, fire control satellite station, portable station can process 4 video images. However, the national satellite link can be distributed by fire station. The choice of 4 video images cannot be operated on site. The image filtering is done by the back-end command center manually. If the rescue scene has more than 4-channel video image input, then the redundant video images will not be able to return to the command center in real time [4].
In order to solve the contradictions above, the project team set up a frame polling and dispatching mechanism to show the fire rescue scene images to the rear command center in all directions. It can display the rescue scene multipath images one by one, and the mechanism can be realized by FPGA [5], 2 and the rotary demonstration of the video image can be done from the hardware level. This paper not only solves the above contradiction, but also has the advantage of fairness and time over manual software scheduling. At the same time, it can meet the real-time requirement of emergency rescue scene communication, which has important research value.

Research status of dispatcher
Commonly used dispatchers include SP, WFQ, RR, etc.
SP (strategic priority) scheduling refers to the absolute high priority scheduling, which does not have the concept of weight, according to priority scheduling. The advantage of absolute high priority scheduling is that high priority delay can be guaranteed, and the disadvantage is that low priority will starve to death when high priority is not empty.
WFQ (weighted fair queue) is a congestion management algorithm. WFQ scheduling refers to scheduling with weight, scheduling uniformity is very good, is the optimal scheduling algorithm in all dispatchers. However, there are shortcomings, that is, the algorithm takes up more resources (registers, combinatorial logic), when the number of ports involved in all the comparison, It is prone to timing problems.
RR (round-robin). The RR scheduling refers to polling scheduling, which takes no weight concept, and conducts scheduling with uniform polling. Circular queues avoid local queue starvation through circular services. The dispatcher always moves sequentially to the next queue with grouping to send (the empty queue is skipped). If each queue has grouping waiting to be sent, the scheduling order matches the queue order; if some queues are empty, others are frequently served. RR scheduler is mainly used in the fields of QoS of data communication and task processing of software. It is a very common and important scheduler. This paper uses polling scheduling as the basic algorithm and using FPGA to realize the scene video image polling scheduler of fire rescue.

Implementation principle of polling dispatcher
In this paper, taking the video dispatching of fire satellite rescue station as an example, the polling scheduling of four rescue scene images is realized. In the figure above, a total of four video images are transmitted to the satellite surveillance station, namely, the field command HD camera, the satellite monogragh 1, the satellite monogragh 2 and the field HD distribution ball. Set the time interval of screen polling to 10s, and four signals are played in turn. The scene generally includes a picture scheduling algorithm, through the scheduling algorithm can be selected to schedule the screen, and then can be sent out.
The scheduler always moves sequentially to the next screen input (the empty input is skipped) with the screen to play. If each input has a video picture, the scheduling sequence matches the input sequence. 3 If some screen inputs are empty, others are frequently served. In extreme cases, if the other inputs are empty, a single input can use the full link bandwidth, that is, to play the current screen all the time. When a screen input enters an empty scheduler, the queue is served in the next loop, thus avoiding the scheduler's "hunger".
At the same time, set the 4 screen play switch to control the screen input, and the 4 keys respectively correspond to the 4 signal, default setting that is the signal is chosen, when pressing the button, It will stopping the screen input at the corresponding input.

System structure design and implementation process
We used Verilog HDL to describe the polling scheduler at the RTL level, and then, Taking Alterra's EPC4CE6E22C8N as the target chip, the layout, wiring and integrated simulation were carried out on the quartz II 8.0 platform. Finally, it is verified on ep4ce6 development board [6].

System structure design
The scheduler designs 4 input ports and uses real-time scheduling, because the time-sharing method wastes the time gap and reduces the scheduling bandwidth. In order to verify the functions of the scheduler on the EP4CE6 development board, select four keystrokes as effective port indication and 2 led light emitting diodes indicate the port number of the scheduling at this time. When the keys was not pressed, led glows from 00 01 10 11 in turn, representing 4 ports valid polling; When you press a key, the leds lights up from 00 01 10 in turn, representing three ports for valid polling. When you press two keys, the red lights up from 00 01 in turn, representing two ports for valid polling. The led always displays the 00 state when pressing three keys, representing one valid polling port. When all the keys are pressed, the red lights go out and the dispatcher stops working. The hardware principles of keystrokes and led lamps, as shown in figure 3-1:

Figure. 3-1. keys and led lamp realization principle
The default key is a high level strobe. When the switch is pressed, the current channel is blocked. Eight LEDs consist of two control modules, one control module controls four led light switches and two control modules control eight LEDs. Use four keystrokes to indicate the port hours effectively, and two LEDs to indicate the port number of the schedule at this time. The function of the polling scheduler is simulated by two led light emitting secondary lights and switches.

System implementation process
Start scheduling from the maximum port number, select from 0, skip the empty queue, and place the "next" flag at 1 if the queue port number is greater than the previous one, Remember the port number you are currently selecting, or place the "prior" flag on 1, and remember the port number you are currently selecting. The final result is that the port number currently selected is closest to the previous scheduling port because it is selected from the maximum port number to 0. The core program workflow is shown in figure 3-2 below: The program starts with parameter initialization, and starts when the slice signal is enabled, otherwise the "prior" and "next" flags of previous port and the next port are cleared. The program starts polling each port, and if the selected port number is greater than 0, the selected port number minus 1, if the selected port is legal, If the screen can be transmitted and the current selection port number is greater than the selected port number, the "new _ valid _ next", "new _ port _ next" flag is placed 1. Otherwise, the "new _ valid _ primary"," new _ port _ primary" flag is placed in 1; If the current port is not legal, the "new _ valid _ next", "new _ valid _ primary" flag is placed at 1, "new _ port_next" and "new _ port _ primary" are assigned to the current valid port number, To ensure that the remaining channels can continue polling operations after the switch is off.

Results verification of polling dispatcher based on FPGA
After program compilation and pin allocation, the project team downloaded the target code to the EP4CE6 platform via the QuartusII platform loader for verification, and when the key is not pressed, All channels can be polling, the platform led from 00 01 10 11 in order to light, press the corresponding switch, then the relevant channel led lights do not show, The expected design requirements have been met. The FPGA implementation of polling scheduler is verified using SignalTap, and the results are shown in figure 4-1: As you can see from the figure, the polling of the four signals is shown by the led level change, and in the figure, the LED light is changed by 00 01 10 11, and after the key [0] is pressed, the 00 jumps directly, Polling starts from 01, and the result is verified to be consistent with the expected function design. The fire rescue scene video image polling dispatcher based on FPGA can accomplish the related dispatching task, which greatly saves the operation time. It can ensure the real-time and robustness of screen scheduling, and improve the fighting effectiveness of firefighting and emergency rescue.

Summary
This paper analyzes the practical difficulties in the process of scene switching of fire rescue scene, and introduces a method to realize scene changing polling dispatcher scheduling with FPGA. The scheduler is analyzed firstly, the indoor-type RR polling scheduling is chosen as the research content of this paper after the comprehensive comparison. Secondly, this paper describes the principle of the polling scheduler, the mechanism design and implementation process of the system, and finally demonstrates the results by using the FPGA platform of EP4CE6. It is proved that the system design and function can meet the current application prospect and have good application value. In the future work, the more complex SP and WFQ scheduling algorithm will be implemented by FPGA platform [7] [8]. To really realize the flexible and reasonable dispatch switch of fire rescue scene screen by AI technology, Through technological changing, it will giving better provide by technical support for firefighting and rescue operations, striving for more time to protect the lives and property of our citizens in all directions.