# A Police and Insurance Joint Management System Based on High Precision BDS/GPS Positioning
## 4 Key Technologies
### Kernel Positioning Driver  
The terminal developed in this article not only involves the traffic police department and different insurance companies when it provides police and insurance joint management service. It also serves as an IoV product. Therefore, it is necessary to provide high precision positioning data for different kinds of Apps installed in the terminal, but it is very difficult for developers to master both the high precision BDS/GPS positioning and inertial navigation in developing their third-party Apps. Therefore, a driver model, namely, CarWise, is proposed in order to reduce the skill barrier for developers. The results of this scheme are as follows: (1) Third-party Android application developers can get high precision positioning results by calling the original standard GNSS ordinary positioning Application Programming Interface; (2) Existing third-party Android applications can obtain high precision positioning results without modification. This design scheme is to realize high precision satellite navigation and vehicle integrated navigation in the Android kernel layer of the terminal. Starting from Android operating system Hardware Abstraction Layer (HAL), upward layer by layer, it can realize the related functions of satellite high precision positioning. Based on the public architecture of the Android operating system, a high precision satellite navigation algorithm is achieved in the Android bottom layer by modifying the standard Android system GPS HAL kernel and Sensor kernel and adding a Sensor Data Agent (SDA) module to the multi-hardware HAL. Additionally, an integrated navigation positioning mode is added in the standard Android system to expand and modify a number of interface functions of related functions starting from Java Native Interface (JNI)) layer. The frame of the scheme is shown in Figure 8.  
Specifically speaking, a SDA module is set for inertial navigation in the layer under the hardware HAL layer of the standard Android operating system, which guides the relevant sensor data (including 3-axis gyroscope, 3-axis accelerometer, barometer, magnetometer, optical sensors, etc.) to the Android system GPS HAL kernel and Sensor HAL kernel. To realize the relevant interfaces and data access function of the standard Android Sensor HAL kernel again can interact with the inertial sensor hardware through SDA. The standard Android GPS HAL kernel can also interact with the inertial sensor hardware via SDA. GNSS hardware data and Sensor hardware data can be directed to any HAL kernel through SDA, thus integrated navigation is realized in the kernel. Figure 7: The trajectories of vehicle on roads with noise barrier (the green trajectory uses only satellite positioning, and the red trajectory uses both satellite positioning and inertial navigation, while the blue one is obtained from the POS 620 unit). The Standard Android GPS HAL kernel is modified to support high precision positioning and an integrated navigation model. That is to say, an integrated navigation positioning implementation layer is added in the Android GPS HAL. Now the GPS HAL kernel is composed of a GNSS data access sublayer, IMU data access sublayer, high precision integrated navigation positioning sublayer and GNSS Abstract sublayer. The GNSS data access sublayer gets data from the high precision positioning module, and then coverts it into a standard GNSS data structure and puts it into a shared data area. Similarly, the IMU data access sublayer obtains the IMU sensor data through SDA, and then converts it into the standard IMU data structure and puts it into the shared data area. High precision navigation and positioning are achieved when the sublayer can copy standard GNSS data, standard IMU data and other auxiliary information data (such as magnetic compass sensor data, attitude control information, vehicle CAN bus information, etc.) from the shared data area. Then, it can do soft computation for navigation and report the calculation results to the GNSS hardware abstraction layer.