1 Background and related work

In recent years, the development of ICV systems has been an active research area. Many methods have been proposed to enhance vehicle intelligence and improve the safety and efficiency of ICV (Zhang et al., 2021). Waymo, Cruise LLC, Baidu and other global automatic driving companies have invested a lot of energy in the research and development of intelligent connected driving technology. However, the most advanced technology is far from the ability to ensure driving safety and deal with the potential dangers of complex and uncertain traffic scenes (Tao et al., 2021). In different traffic environments, ICV will still have accidents during driving. Unless the security and reliability of these systems can be guaranteed, people and society are unlikely to accept this potential emerging technology. The analysis of these traffic accidents shows that they occur when the vehicle cannot correctly judge the potential risks in the driving environment (Cui et al., 2021). In order to ensure safety, a reliable vehicle condition assessment system is one of the key enabling technologies. It must be able to assess the risk in the driving process in real time.

Therefore, what kind of state the ICV is in when driving on the road is concerned, such as whether the vehicle's driving speed is too high, whether there are frequent rapid acceleration or deceleration, departure from the lane line, less than or equal to the safe driving distance, whether the power battery temperature is too high or too low, in addition, the temperature and power of the driving motor, tire pressure, traffic condition on the driving road, weather and road surface condition, etc. Intelligent algorithm is implemented to realize the environmental perception of the driving vehicle through the on-board camera, lidar, millimeter wave radar, satellite positioning and other technologies. Some state information parameters of the current vehicle in the driving process can be obtained through the on-board bus system and various other functional sensors on the vehicle (Yang et al., 2013). The V2X technology of ICV enables real-time communication between vehicles and vehicles, vehicles and people, vehicles and roads, and vehicles and remote monitoring platform (Hussein et al. 2016; Oh et al. 2012; Sun et al., 2016; Wedel et al., 2009). Therefore, these technologies enable all information on intelligent vehicles to be easily transmitted to relevant monitoring platform. It is a very important research topic that how to fuse these large amounts of information, make a comprehensive state evaluation of the driving vehicles, and timely convey the driving state evaluation of the monitoring vehicles to the relevant vehicles, people, and roads.

Information fusion technology is a multi-level and multi-party process, that is, to merge, correlate, and combine multiple sensors and the data information of information sources. By using computer technology, the observation information of several sensors obtained according to time sequence is automatically analyzed and optimized under certain criteria to complete the required decision-making and estimation tasks (Pengfei et al., 2021; Yuming et al., 2020). Multi-source information fusion methods can be divided into signal processing and estimation methods, statistical inference methods, information theory methods, decision theory methods, artificial intelligence methods, and geometric methods (Han et al., 2006). Artificial intelligence information fusion technology applies artificial intelligence technology to multi-sensor information fusion, which has great advantages in solving the imprecise and uncertain information in information fusion, so it has become the development direction of information fusion (Chen et al. 2020; Tian et al., 2019; Xie et al., 2020). According to the classification of fusion structure, multi-source information fusion technology can be divided into three categories: centralized, distributed, and hybrid (Shi et al., 2017; Tang et al., 2018; Wang et al., 2017). In the centralized information fusion structure, the observation data obtained by each sensor are transmitted to the superior information fusion center without analysis. With the help of certain criteria and algorithms, the information fusion center performs joint, screening, correlation, and synthesis processing on all initial data and provides the information fusion conclusion output at one time (Olofsson et al., 2016; Wei et al., 2013). The information fusion of driving state of ICV is a typical centralized information fusion structure, and the evaluation of driving state is the fusion and inference system of imprecise and uncertain knowledge.

Immune genetic algorithm (IGA) is a multidisciplinary optimization algorithm which combines the advantages of immune theory and basic genetic algorithm. IGA not only retains the advantages of immune algorithm, but also improves the diversity and convergence speed of antibody in immune algorithm. Therefore, IGA is widely used to solve practical engineering problems. Tan et al. used IGA to optimize the transmission system parameters and control parameters of hybrid electric vehicles (Tan et al., 2015). Li et al. proposed a multi-objective evolutionary algorithm based on IGA to realize the multi-objective optimization design of HEV (Li et al., 2018). Wang et al. Proposed an IGA-optimized dual fuzzy control strategy for plug-in hybrid electric vehicle (Wang et al., 2016). You et al. embedded artificial immune genetic algorithm (AIGA) in NMC-SMPIM to perform structural reliability analysis (You & Guo, 2012). Huang et al. used Taguchi genetic algorithm to adjust the hybrid swarm intelligence of artificial immune system and its field programmable gate array implementation (Huang et al., 2016). Boonyopakorn et al. proposed a hybrid IGA based on mathematical function and applied it to Hybrid-VAVET protocol (Boonyopakorn & Meesad, 2016). It can be seen that IGA has been widely used by experts and scholars in various fields such as automobile. In this paper, the immune algorithm of artificial intelligence is applied to complete the information fusion and evaluation of the driving state of ICV.

The purpose of this paper is to monitor the ICV on the road and judge the driving state of each vehicle. In this paper, an environment perception system based on vision, radar, and positioning for intelligent vehicle is developed, and a V2X platform is built. Through the system, vehicle bus, and other sensors, relevant data in the driving process of intelligent vehicle are obtained in real time and transmitted to the monitoring platform. At the same time, an immune algorithm model is established on the monitoring platform to evaluate the driving state of the driving vehicle, and when found in unsafe state, it gives early warning in time.

This paper is divided into seven parts. In Sect. 2, we established the infrastructure of intelligent connected vehicle multi-source vehicle road collaborative information acquisition and monitoring system, the function of each part of the system is introduced. In Sect. 3, an immune algorithm model for ICV vehicle condition monitoring is proposed. In Sect. 4, we show the experimental results. The conclusion is given in Sect. 5.

2 Multi-source vehicle road collaborative information collection and monitoring system of ICV

ICV implements intelligent algorithms to realize the environment perception of the driving vehicle through the on-board camera, lidar, millimeter wave radar, satellite positioning and other technologies. Some state information parameters of the vehicle itself in the process of driving can be obtained through the on-board bus system and various other functional sensors on the vehicle. The V2X technology of ICV enables real-time communication between vehicles and vehicles, vehicles and people, vehicles and roads, and vehicles and remote monitoring platform. Therefore, through these technologies, all the information on the intelligent vehicle can be conveniently transmitted to the relevant monitoring platform to monitor the vehicle, and the driving state of the vehicle can be comprehensively judged, then the driving state of the monitored vehicle can be timely conveyed to the relevant cars, people and roads, etc. This paper has developed a monitoring and information collection system for ICV driving on the road. The system work is shown in Fig. 1.

Fig. 1
figure 1

The driving condition monitoring and safety assessment system structure

2.1 Information acquired by vehicle environment awareness system

Vehicle environment sensing system equipment includes camera, laser sensor, lidar, high-precision positioning system, etc.

The DSP chip TM320SDM6437 is applied as the main chip of image processing. The image processing technology is applied to design the judgment method of lane departure. In addition, the lane detection method based on deep learning is designed. After the fusion of the two, the information of lane departure is obtained by on-board camera, and the number of lane departure per unit time is calculated. It is sent to the monitoring platform through on-board computer and OBU of V2X device.

Driving safety distance model is applied to obtain the distance of the vehicle ahead by using the single-line laser sensor as distance measuring sensor. The SLAM map is built by applying multi-line laser radar, then obstacles in front of the driving vehicle are identified, the distance information of the vehicle ahead is obtained, and the identification system of vehicle and pedestrian in front based on machine learning is established, then the vehicle and pedestrian are recognized in the video image collected by the camera and the distance between the vehicle and the identified previous target is calculated. The above information is integrated to obtain the accurate distance between the vehicle and the front and side vehicles in front, and the distance information is sent to the monitoring platform through the on-board computer and the V2X device OBU.

According to classic car theory, the safe driving distance s0 is calculated as follows:

$${s}_{0}=\frac{{v}_{0}}{3.6}\left({t}_{1}+\frac{{t}_{2}}{2}\right)+\frac{{{v}_{0}}^{2}}{25.92*{a}_{\mathrm{max}}}$$
(1)

where \(t_{1}\) = 1.2 s, \(t_{2}\) = 0.5 s, the maximum braking deceleration \(a_{\max } = 7\,{\text{m}}/{\text{s}}^{2}\) (Zhi-sheng, 2010), and v0 is the current vehicle speed.

The distance between the vehicle and the obstacles in front with the safe distance is compared. When the driving distance is close to or less than the safe distance, it is more dangerous. Based on this, we can judge whether the current driving distance of the vehicle is safe or not and obtain the information about whether the driving distance is safe or not.

The high-precision positioning system is applied, and the high-precision integrated navigation and positioning equipment based on the integration of differential GPS (Global Positioning System) and IMU (inertial measurement unit) is adopted. The integrated navigation and positioning system based on MEMS technology includes RTK Positioning Equipment, 4G receiver, and inertial navigation unit, and its positioning accuracy can reach centimeter level. Based on this, accurate positioning information is obtained and sent to the monitoring platform through on-board computer and OBU of V2X device to complete accurate warning information service for driving vehicles.

2.2 Information collection based on CAN bus

Through the CAN bus of the vehicle, the related information of the vehicle bus is obtained, such as vehicle speed, battery temperature, driving motor temperature, voltage, etc. Through the on-board computer and OBU of V2X device sent the information collected based on CAN bus to the monitoring platform and consider whether the information which real-time access is normal or not, according to the threshold range of these information.

2.3 V2X roadside equipment to obtain information

The equipment installed on the roadside, radar and vedio fused as all-in-one machine, detects the traffic flow information of the number of vehicles on the road in each frame of image, obtains information on the maximum number of times that vehicles on the monitored road deviate from the lane line, and obtains the tire temperature, road conditions, monitoring road weather, and other information through the roadside sensor device. It is sent to the monitoring platform through the V2X equipment RSU to complete the accurate warning information service of the driving vehicle.

2.4 Other relevant information

The information such as vehicle acceleration and yaw rate is obtained by other sensors on the vehicle and sent to the monitoring platform. All the obtained information about vehicle driving is sent to the monitoring platform through V2X equipment. An immune algorithm evaluation model is established on the monitoring platform to monitor and evaluate the driving state. Then the evaluation results are sent to the on-board computer for early warning through the monitoring platform and V2X equipment.

3 Immune model structure for vehicle state monitoring

The biological immune system is a huge and complex system. It involves many cell molecules and adopts many mechanisms. It is the most important system for maintaining biological immunity and resisting the invasion of external bacteria and viruses. B cells are antibody-forming cells. The specific immunoglobulin (antibody) is produced under stimulation. When there is an invading antigen, the immune system will produce the corresponding antigen and combine with the antibody to destroy the antigen. The immune system has the ability to recognize and memory and can respond quickly to the same antigen.

In this paper, using immune algorithm, according to the characteristics of the driving state of the ICV, the structure of the immune evaluation model of the vehicle driving state is designed. The model structure is shown in Fig. 2.

Fig. 2
figure 2

Vehicle driving state immune evaluation model

The working process of the immune evaluation model is as follows. The autologous library is a typical car driving state evaluation knowledge base established by the user based on the characteristics of the monitored road traffic and road vehicles. The autologous library is used as the system's known antigen to establish the system's B cell group. The known antigens act on B cells, learn to produce antibodies, and generate detectors corresponding to each antibody. The non-autologous library is the real-time state of the vehicle during driving. When a certain real-time state of the non-autologous library acts on the detector after uploading, the corresponding antibodies can be stimulated to complete the classification and get a judgment on the state.

The general learning process of B cells and antibodies is shown in Fig. 3.

Fig. 3
figure 3

Learning process of B cells and antibodies

The autologous library of typical driving state evaluation data is used as a known antigen. When the antigen invades the body, the corresponding B cell is activated. At this time, the B cell multiplies and transforms into plasma cells. The plasma cells produce a large number of antibodies corresponding to the antigen. Selection, crossover, mutation and other learning cause the immune system to clone high-affinity antibodies and expand the size of the population to maintain the diversity of the population. The optimal individual is preserved in the form of immune memory, and new antibodies corresponding to the antigen are produced.

When the unknown antigen formed in the real-time driving state is generated, the related antibodies are activated. According to the probability of activating the antibody, the one with the highest probability is selected as the conclusion, and the current state of the vehicle is evaluated.

4 State space representation of immune model system for ICV driving state diagnosis

The state space of immune model for diagnosis of driving state of ICV is composed of information parameters reflecting the driving state of the vehicle, which can describe the interaction between antibody and antigen. The state of the system can be expressed by eigenvector, and the corresponding state space is established for each state in the process of solving.

4.1 Autogenous library and non-autogenous input

Autogenous library are composed of typical vehicle driving state data established by users according to the traffic conditions of monitored road sections and the characteristics of road driving vehicles. As a known antigen, a group of vehicle driving state data establishes a one-dimensional vector set. The following is the \(i-{\text{th}}\) vehicle driving state, and \(j\) is the number of vehicle state parameters.

$$code\left[i\right]=\left\{{c}_{i1},{c}_{i2},\ldots ,{c}_{ij}\right\}$$
(2)

Because there are many vehicle state parameters collected, due to the limitation of space, this paper takes several of them as examples to illustrate the principle of the algorithm. Let's set:

\({c}_{1}\): speed, \({c}_{2}\): acceleration, \({c}_{3}\): battery temperature, \({c}_{4}\): distance from vehicle in front, and \({c}_{5}\): vehicle deviation times.

Here, the parameter of the number of lane departures is the number of times the vehicle deviates from the lane per minute.

According to the example:

$$code\left[i\right]=\left\{{c}_{i1},{c}_{i2},{c}_{i3},{c}_{i4},{c}_{i5}\right\}$$
(3)

A set of n-dimensional autologous library vectors, i = 1 ~ n, j = 1 ~ 5, is constructed from \(\mathrm{n}\) groups of vehicles driving state data.

$$code\left[i\right]\left[j\right]=\left[\begin{array}{cc}\begin{array}{ccc}{c}_{11}& {c}_{12}& {c}_{13}\\ {c}_{21}& {c}_{22}& {c}_{23}\\ \vdots & \vdots & \vdots \end{array}& \begin{array}{cc}\cdots & {c}_{1j}\\ \cdots & {c}_{2j}\\ \vdots & \vdots \end{array}\\ \begin{array}{ccc}{c}_{i1}& {c}_{i2}& {c}_{i3}\end{array}& \begin{array}{cc}\cdots & {c}_{ij}\end{array}\end{array}\right]$$
(4)

Non-autogenous input acts as any state of the vehicle during driving and takes this data as an unknown antigen.

$$uncode\left[i\right]=\left\{{u}_{i1},{u}_{i2},\ldots ,{u}_{ij}\right\}$$
(5)

Here, \(i\) represents the \(i{\text{-th}}\) group data serial number of the non-autologous library, and \(j\) is the number of parameters. Like the autogenous library, this paper uses several of these parameters as examples to illustrate the principle of the algorithm, thus j = 1 ~ 5.

$$uncode\left[i\right]=\left\{{u}_{i1},{u}_{i2},{u}_{i3},{u}_{i4},{u}_{i5}\right\}$$
(6)

\(n\) sets of vehicles driving state data constitute an \(n\)-dimensional non-autologous library vector set: \(i=1\sim n, j=1\sim 5\).

$$uncode\left[i\right]\left[j\right]=\left[\begin{array}{cc}\begin{array}{ccc}{u}_{11}& {u}_{12}& {u}_{13}\\ {u}_{12}& {u}_{22}& {u}_{23}\\ \vdots & \vdots & \vdots \end{array}& \begin{array}{cc}\cdots & {u}_{1j}\\ \cdots & {u}_{2j}\\ \vdots & \vdots \end{array}\\ \begin{array}{ccc}{u}_{i1}& {u}_{i2}& {u}_{i3}\end{array}& \begin{array}{cc}\cdots & {u}_{ij}\end{array}\end{array}\right]$$
(7)

4.2 B cell

When the antigen invades the body, the B cells are activated to recognize the specific antigen, at that time the B cells multiply.

$$B\left[m\right][n]=\left\{{b}_{m1}, {b}_{m2},\ldots , {b}_{mn}\right\}$$
(8)

B[m][n] is the B cell state space matrix. Let the initial population size generated randomly be k, and the binary coding number of each gene be c-length. Where bmn is a vector column, the length of the vector column is the size k of the population, thus m = 0 ~ k, and the size of n is the product of the number of chromosome segments (the number of vehicle state data) in the antigen and the binary coding number c-length of each gene segment.

After selection, crossover, and mutation learning, new B cells were generated as follows:

$$newB\left[m\right][n]=\left\{n{b}_{m1},n{b}_{m2},\ldots ,n{b}_{mn}\right\}$$
(9)

newB[m][n] is the new B cell state space matrix, the meaning of subscript m and n are the same as before.

4.3 Antibody

Each B cell is set to produce a specific antibody (Gene Coding), which is produced by the proliferation and differentiation of B cells into plasma cells after recognizing antigens. Each B cell produces only one specific antibody.

During the learning process, the entire population is removed with low fitness, leaving behind a high degree of fitness. The antibody of \(i{\text{-th}}\) vehicle state generated after each iteration is as follows:

$$result\left[i\right]=\left[\begin{array}{cc}\begin{array}{ccc}{r}_{i11}& {r}_{i12}& {r}_{i13}\\ {r}_{i21}& {r}_{i22}& {r}_{i23}\\ \vdots & \vdots & \vdots \end{array}& \begin{array}{cc}\cdots & {r}_{i1k}\\ \cdots & {r}_{i2k}\\ \vdots & \vdots \end{array}\\ \begin{array}{ccc}{r}_{ij1}& {r}_{ij2}& {r}_{ij3}\end{array}& \begin{array}{cc}\cdots & {r}_{ijk}\end{array}\end{array}\right]$$
(10)

Here, k is the population size, j is the number of vehicle state parameters, and the binary coding bit of each gene is defined as c-length.

4.4 Detector

After iteration, the corresponding detector for each vehicle state is as follows:

$$x\left[i\right]=\left[\begin{array}{cc}\begin{array}{ccc}{x}_{i11}& {x}_{i12}& {x}_{i13}\\ {x}_{i21}& {x}_{i22}& {x}_{i23}\\ \vdots & \vdots & \vdots \end{array}& \begin{array}{cc}\cdots & {x}_{i1k}\\ \cdots & {x}_{i2k}\\ \vdots & \vdots \end{array}\\ \begin{array}{ccc}{x}_{ij1}& {x}_{ij2}& {x}_{ij3}\end{array}& \begin{array}{cc}\cdots & {x}_{ijk}\end{array}\end{array}\right]$$
(11)

where: i represents the driving state of the \(i{\text{-th}}\) typical vehicle, j is the number of vehicle status parameters, and k is the size of the population.

5 The evaluation process of the immune algorithm on the driving state of the vehicle

The process of the immune algorithm evaluating the driving state of the vehicle is the process of generating B cells from the autologous library, training to generate the antibody detector, and then judging the non-autologous library by the monitor.

The algorithm consists of two parts. The first part is that, according to the traffic characteristics and vehicle driving characteristics of the judging section, the user establishes typical vehicle driving state data as the antigen input, randomly generates and multiplies the B cell population, and generates antibody during the learning process. The affinity between the antibody and the antigen is calculated, and the antibody is screened according to the affinity. The antibody with higher affinity to the antigen is stored in the memory bank, and at the same time, the antibody with lower affinity to the antigen is inhibited. Then crossover and mutation operations are performed to generate next-generation antibodies, which can increase the affinity while ensuring the diversity of the population. After a certain number of iterations, the affinity between the antibody and the antigen gradually converges. When it is less than the set threshold, the iteration stops and the final antibody and detector are generated.

The second part is to use the current real-time driving state of the vehicle as the non-autologous input and the non-autologous input as the unknown antigen to be sent to the trained detector. The corresponding antibody is excited by calculating the distance from the detector, and the distance less than the threshold is screened out. The probability of each typical vehicle driving state corresponding to the detector is calculated, and the highest probability is the judgment result of the current vehicle driving state. When the vehicle is running, its state variables are continuously changing. In order to ensure the time consistency of each parameter, the state parameters of the vehicle are collected at regular intervals to form a series of discrete parameter groups. The vehicle state parameter group at each moment is sent to the detector to evaluate the safety level of the vehicle driving state in real time and at the same time send a warning signal to the driver.

The process of the algorithm is shown in Fig. 4.

Fig. 4
figure 4

Evaluation process of vehicle driving state based on immune algorithm

5.1 Initialize the autologous library and non-autologous library

First, the user establishes a typical vehicle driving state based on the traffic conditions of the monitored road section, such as whether the road section is often congested, what are the maximum and minimum speed limits, how many times the vehicle deviates from the lane line in the monitored road section per unit time, and whether there are more long and steep downgradel, etc., input typical vehicle state parameters as autologous input, and initialize the memory bank \(code\left[i\right]\left[j\right]\).

The subscript i represents the \(i{\text{-th}}\) typical vehicle state, and the subscript j represents the vehicle parameter corresponding to this state.

Due to the large number of states and parameters, and limited by space, a few examples are selected to illustrate the algorithm process. The vehicle state evaluation is divided into "safe, safer, unsafe, dangerous", and the corresponding parameters are selected as "vehicle speed, acceleration, temperature, and front distance of the vehicle and the number of lane departures", in the code library, i = 0 ~ 3, j = 0 ~ 4.

The non-autologous library is any state parameter in the real-time driving process of the vehicle. A row of data in \(uncode\left[i\right]\left[j\right]\) is used as the non-autologous input to evaluate its driving state. The size of the subscript i is based on the real-time nature of the collected data. The subscript j is the number of parameters. According to the parameters illustrated in the example, j = 0 ~ 4, which respectively represent "vehicle speed, acceleration, temperature, distance to the vehicle in front, and the number of lane departures".

5.2 Production of B cells and initial antibodies

According to the typical vehicle driving state parameters established before as the antigen, set a certain state parameter as the vector \(code\left[i\right][j]=\left\{{c}_{i1},{c}_{i2},\ldots ,{c}_{ij}\right\}\), and a new B cell is created around the antigen, \({B}_{i}=\left\{{x}_{1},{x}_{2},\ldots ,{x}_{j}\right\}\).

B cells evolve into plasma cells through reproduction, and then produce N antibodies. Assuming that the size of each reproduced individual is k, the number of antibodies is as follows:

$$N=j*k$$
(12)

In this paper, the number of parameters is 5, and the number of individuals is 20, and so the number of antibodies is 100.

The initial antibody result[i] can be generated from two sources. If the problem is retained in the memory bank, the memory bank will be taken, and the insufficient part will be randomly generated. If the memory bank is empty, all will be generated randomly. This article is all randomly generated.

5.3 Calculate affinity

Affinity represents the matching principle of antibody and antigen, that is, recognition strength. The affinity is calculated according to the distance between the antibody and the center of the B cell to which it belongs. The general affinity calculation formula is as follows:

$$({A}_{g}{)}_{k}=\frac{1}{1+{t}_{k}}$$
(13)

where \({t}_{k}\) is the binding strength of the antigen to the antibody, and the general mathematical algorithm for calculating the binding strength \({t}_{k}\) is as follows:

Hamming distance:

$$d = \sum\nolimits_{i = 1}^{L} {\delta \left\{ {_{\delta = 0,else}^{{\delta = 1,x_{i} \ne y_{i} }} } \right.}$$
(14)

Euclidean distance:

$$d = \sqrt {\sum {_{i = 1}^{L} (x_{i} - y_{i} )^{2} } }$$
(15)

Manhattan distance:

$$d = \sqrt {\sum {_{i = 1}^{L} {|}x_{i} - y_{i} {|}} }$$
(16)

The Euclidean distance is used in this paper.

5.4 Memory bank renewal, the inhibition, and promotion of antibodies

After calculating the affinity antibodies with high affinity for storage are selected and the memory bank is updated. Therefore, antibodies with high affinity are obviously promoted and have a greater probability of being passed to the next generation, while those with low affinity will be suppressed.

5.5 Genetic manipulation

Since antibodies with high affinity are promoted, low affinity will be inhibited, which will easily lead to single evolution of the population, leading to a local optimum. Therefore, it is necessary to introduce new strategies into the algorithm to ensure the diversity of the population. The function of genetic operation in this paper is to apply crossover and mutation to produce the next generation of antibodies to ensure ethnic diversity and to evolve in a direction of good fitness.

5.6 Detector generation

After cross-mutation, the population is sorted according to fitness, the low fitness individuals are removed, the high fitness is left, the memory bank is updated, as it is iteratively continued until the maximum fitness individual in the population reaches the threshold.

In this paper, the fitness is the distance-related value between the population antibody and the autologous library antigen in the evolution. The closer the distance, the better the fitness. Therefore, when the distance-related value is less than the set threshold, the evolution can be stopped, and then the vehicle state monitor generates, and so on, all the monitors related to the state of the vehicle group i can be generated.

5.7 Judgment on any state of the vehicle's driving process

After the monitor is generated, the monitor can be used to judge the driving state of any vehicle, assuming that a total of n monitors are generated.

Using any state \(uncode\left[i\right][j]=\left\{{u}_{i1},{u}_{i2},\ldots ,{u}_{ij}\right\}\) in the real-time driving process of the vehicle as a non-autologous input, the Euclidean distance D between the unknown antigen and n monitors is calculated.

$$D=\left\{{d}_{1},{d}_{2},\ldots ,{d}_{i}\right\}\, i=1\sim n$$
(17)

In this paper, there are four evaluations of “Safe, Less safe, Unsafe, Dangerous”, then \(n\) = 4, \({d}_{i}\) is the distance between the unknown antigen parameter and the \(i\)-th monitor.

Since the number of individuals is \(k\), let \(j=1\sim k\), then:

$$\begin{array}{*{20}l} {d_{1} = \{ d_{{11}} ,d_{{12}} ,\Lambda \,d_{{1j}} \} } \hfill \\ {d_{2} = \{ d_{{21}} ,d_{{22}} ,\Lambda \,d_{{2j}} \} } \hfill \\ {\quad \quad \quad \;\;\,{\text{M}}} \hfill \\ {\quad \quad \quad \;\;\,{\text{M}}} \hfill \\ {d_{i} = \{ d_{{i1}} ,d_{{i2}} ,\Lambda \,d_{{ij}} \} } \hfill \\ \end{array} {\text{ }}$$
(18)

The number of individuals k produced in this paper is 20, i = 1 ~ n, n = 4.

Setting a threshold Q of distance and calculating the cumulative sum \(M\) of the distance which \({d}_{ij}< m\) in each distance \({d}_{i}\), thus obtaining the probability that the antibody belongs to the monitor:

$$Pi=\frac{M}{{d}_{i1}+{d}_{i2}+\cdots +{d}_{ij}}$$
(19)

The category of the known antigen to which the unknown antigen belongs is determined based on the maximum value of the probability, thereby evaluating the driving state of the vehicle.

6 Experimental results and data analysis

In order to verify the data collection of ICV vehicle–road collaboration and vehicle driving state and also verify the evaluation results of the immune algorithm model of vehicle driving state data fusion, verification tests are done on some road sections. The experimental equipment is shown in Fig. 5. The experimental vehicle is a modern vehicle. The vehicle is equipped with intelligent equipments such as vision system, laser ranging and environmental perception system, high-precision positioning system, industrial computer, etc. to collect vehicle state parameters, and the data are sent through the C-V2X device OBU to the monitoring platform, while the roadside is equipped with cameras, radar, and vedio fused as all-in-one machine for traffic flow monitoring. In addition, there are equipments such as fire, weather, and vehicle hub temperature sensing. The data are sent to the monitoring platform through the RSU.

Fig. 5
figure 5

Experimental site and partial experimental equipment

Because there are many types of data collected, due to space limitations, this article uses vehicle speed, acceleration, battery temperature, distance between the vehicle, and the vehicle in front and the number of lane departures as examples and lists some data collected by the platform for explanation. Here, the data of "vehicle speed", "acceleration", "battery temperature", and "distance to the vehicle ahead" are collected data at a certain time t, and the "number of deviations" is the sum of the times that the vehicle deviate from the lane within one minute before the time t.

The maximum speed limit of the monitored road section is \(70\,{\text{km}}/{\text{h}}\), the maximum number of times the monitored vehicle deviates from the lane line is 5 times per minute, and the temperature range of the power battery is optimal: 25–40 °C (safe), better: 40–50 ℃ (safer), poorer 50–60 ℃ (unsafe), and worst: above 60 ℃ (dangerous) (Wang, 2020; Zhang, 2020). The traffic flow of the monitored section is less, and the distance of the vehicle ahead can be judged as safe according to the safe distance. The typical data is selected as the autologous library, and the known autologous library is set as follows (Table 1):

Table 1 Autologous library (known antigen)

The 4 sets of data 1, 2, 3, and 4, respectively, represent the driving state of the vehicle as "safe, safer, unsafe, and dangerous".

Taking the data obtained from the real-time vehicle monitoring platform as the non-autologous input of the unknown antigen, this article lists 50 groups from the experimental data to illustrate, as shown in Fig. 6.

Fig. 6
figure 6

Input of unknown antigen non-autologous

The abscissa in the figure is the number of real-time vehicle states, and the ordinate is the parameter corresponding to the real-time state of the vehicle.

Let the number of individual populations k be 20 and the number of gene binary coded digits c-length be 4. The initial antibody populations are randomly generated. After selection, crossover, mutation, and the average fitness of the population changes from 100 iterations is shown in Fig. 7.

Fig. 7
figure 7

Mean change of total fitness of the population

Because fitness is the distance-related value between population antibodies and autologous library antigens in evolution, the closer the distance, the better the fitness, and the smaller the value. It can be seen from the figure that the fitness value continues to decrease as the number of iterations increases. Convergence is reached.

Using the generated monitor to calculate the probability that each set of data belongs to the known antigen in the autologous library on 50 sets of data (the driving state in Fig. 8), the state corresponding to the maximum probability is the evaluation result of this set of data, and the evaluation result obtained is shown in Fig. 8.

Fig. 8
figure 8

Evaluation results

10 sets of typical data from the figure are selected to analyze the judgment results, and the 10 sets of data are entered into the unknown antigen as shown in Table 2.

Table 2 Enter unknown antigen

The results of the evaluation of the output of the 10 sets of data monitors in Table 2 are shown in Table 3. The data in the table are the probability that the unknown antigen belongs to a known antigen.

Table 3 Monitor output

It can be seen from the table that the data 1 has a low speed and a large distance, which is a safe driving state. The data 6 is a less safe state because of the small distance. The data 4 has the same probability of two adjacent states. When this happens, we assume that it is between a less safe and a safer state (so there are cases where the state is at 1.5 and 2.5). The data 5 is unsafe due to the large acceleration and the number of vehicle deviation times. The data 9 is high because of the high speed and many vehicle deviation times, so it is a dangerous state.

In the output data, there is also a case where the non-adjacent data has the same highest probability. For this case, it is judged as a state with low security, and the data is recorded for further verification.

7 Conclusion

In this paper, aiming at the problem of state monitoring of autonomous vehicles driving on the road, and in view of the characteristics of the driving state of IVC, the data are collected in real time through vehicle equipment and roadside equipment, then sent to the monitoring platform through V2X equipment, and the monitoring platform is designed as a vehicle driving state monitoring system based on an immune algorithm developed. The typical data established by the user based on the traffic characteristics of the monitored road section and the driving characteristics of the vehicle are used as the autologous library, and any real-time driving state data are used as the non-autologous library to evaluate the vehicle driving state. The evaluation of the vehicle driving state by the verification immune algorithm is basically the actual driving state of the vehicle. The model calculation has good real-time performance and meets the requirement that the warning time is less than 1 s. Compared with the method of safety judgment and warning based on single parameter threshold in other studies, the comprehensive driving state of vehicles in this study can be judged to give early warning prompt to situations with potential unsafe factors earlier. The reliability of the conclusion found in the application is also closely related to the integrity of the autologous library, the selection of the initial population, the number of iterations, and the selection of the threshold.

Further work to be done is to improve the accuracy of the equipment, do experiments in more scenarios to obtain more raw data, cooperate with the monitoring section management department to obtain more section traffic characteristics, and improve the accuracy and completeness of the data samples of the autologous library. In addition, the stability of data obtained by real-time driving vehicles also has an impact on the results. To complete the monitoring and analysis of many vehicles driving on the road, a big data processing platform should be developed on the monitoring platform to complete the processing and analysis of massive data. It should undergo more verification and improvement and be combined with other intelligent algorithms such as fuzzy and deep learning, which can greatly increase the reliability of the conclusion.