Mountain area continuous downhill tunnel section accident early warning method and system

By using non-uniform segmentation and random forest models to accurately identify high-risk areas in continuous downhill tunnel sections in mountainous areas and set up precise early warning signs, the problems of lack of specificity and high cost of existing early warning methods are solved, and efficient and accurate accident warnings are achieved.

CN120636102APending Publication Date: 2025-09-12ZHEJIANG SCI RES INST OF TRANSPORT +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510973779.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-15
Publication Date
2025-09-12

AI Technical Summary

Technical Problem

The existing accident warning methods for continuous downhill tunnel sections in mountainous areas lack specificity, resulting in an overly large warning range or inaccurate location. This may cause driver distraction and warning fatigue, and cannot effectively reduce accident risks. It is costly and ineffective.

Method used

By obtaining digital road section information, combining cosine similarity and exponentially weighted Euclidean distance for non-uniform segmentation, a random forest model is established to screen dangerous sub-sections, and early warning signs are set up. The number of segments is adjusted using the first and second coverage rates to accurately identify and cover high-risk areas.

Benefits of technology

It improves the accuracy and efficiency of accident warnings, reduces invalid warnings, avoids resource waste and warning fatigue, and significantly improves traffic safety and management efficiency in continuous downhill tunnel sections in mountainous areas.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120636102A_ABST
    Figure CN120636102A_ABST
Patent Text Reader

Abstract

The invention provides a mountain area continuous downhill tunnel road section accident early warning method and system, and relates to the technical field of traffic control, and the method comprises the steps: obtaining the digital road section information of a mountain area continuous downhill tunnel road section; performing non-uniform segmentation on the digital road section information by combining cosine similarity and an exponential weighted Euclidean distance to obtain a plurality of sub-road sections; acquiring historical traffic accident data; establishing a random forest model in combination with a chaos theory and a particle swarm optimization algorithm; screening dangerous sub-road sections by using the model; judging whether the dangerous sub-road sections comprise a target traffic accident road section or not, if so, outputting the dangerous sub-road sections, otherwise, increasing the number of the preset sub-road sections by taking the first coverage rate and the second coverage rate of the traffic accident road section as guidance, and returning to re-segmentation; and setting an early warning identifier at each dangerous sub-road section so as to carry out safety early warning and safety guidance on the vehicle entering each dangerous sub-road section. Excessive reminding is avoided while the dangerous road section reminding coverage rate is ensured, and the early warning effect is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of traffic control, and in particular to a method and system for early warning accidents on a continuous downhill tunnel section in a mountainous area. Background Art

[0002] Mountainous downhill tunnel sections refer to downhill sections of roads located in mountainous areas that contain multiple tunnels or long stretches of continuous tunnels. These sections are characterized by high gradients, long distances, numerous curves, and complex traffic conditions. Furthermore, the fluctuating light conditions and limited air circulation within the tunnels make drivers prone to misjudgment, brake failure, or fatigue. Furthermore, the frequency of sudden accidents and their knock-on effects on subsequent vehicles significantly increase traffic safety risks. Accident warning systems monitor road conditions and traffic dynamics in real time and issue advance warnings, helping drivers take timely action to reduce accidents and ensure safety and efficiency on mountain roads.

[0003] However, existing accident warning methods often employ indiscriminate or subjective decision-making regarding the placement of warning signs across the entire road section. This lack of specificity can result in overly large warning areas or inaccurate placement, distracting drivers from important warning information and even leading to warning fatigue. Furthermore, subjective decisions can overlook the distribution of actual danger points, failing to effectively reduce accident risk. This leads to high costs and poor warning effectiveness, hindering safety maintenance on these roads. Summary of the Invention

[0004] To address the technical issues of existing accident warning methods, which often employ indiscriminate or subjective decision-making regarding the placement of warning signs across the entire road section, resulting in a lack of specificity and potentially overly large warning ranges or inaccurate placement, distracting drivers from important warning information and even leading to warning fatigue. Furthermore, subjective decisions may overlook the distribution of actual danger points, failing to effectively reduce accident risks, resulting in high costs and poor warning effectiveness, hindering the safety maintenance of such sections. The present invention provides a method and system for accident warning on mountainous sections with continuous downhill tunnels.

[0005] The technical solutions provided by the embodiments of the present invention are as follows: First aspect An embodiment of the present invention provides a method for early warning of accidents in a continuous downhill tunnel section in a mountainous area, comprising: S1: Obtain digital road section information of continuous downhill tunnel sections in mountainous areas; S2: With the constraint that the number of sub-segments is less than the preset number of sub-segments, the digital road segment information is non-uniformly segmented using cosine similarity and exponentially weighted Euclidean distance to obtain multiple digitized sub-segments, where the road segment features include road segment type, road segment slope, road segment curvature, road segment width, and road segment length; S3: Acquire historical traffic accident data, wherein the historical traffic accident data includes accident section characteristics of the sub-sections to which the traffic accident section belongs and the number of traffic accidents corresponding to the traffic accident section; S4: Based on historical traffic accident data, a random forest model is established to describe the correlation between the number of traffic accidents and the characteristics of accident sections by combining chaos theory and particle swarm optimization algorithm; S5: Use the random forest model to screen dangerous sub-sections from each sub-section; S6: Determine whether the dangerous sub-section includes a target traffic accident section with a traffic accident number greater than a preset traffic accident number. If so, proceed to step S8; otherwise, proceed to step S7.

[0006] S7: Increasing the number of preset sub-segments based on the first coverage rate and the second coverage rate of the traffic accident section, and returning to step S2, wherein the first coverage rate is the ratio of the number of target traffic accident sections located in the dangerous sub-segment to the total number of target traffic accident sections, and the second coverage rate is the ratio of the length of the target traffic accident section located in the dangerous sub-segment to the length of the dangerous sub-segment to which it belongs; S8: Set up warning signs at each dangerous sub-section to provide safety warnings and safety guidance to vehicles entering each dangerous sub-section.

[0007] Second aspect An embodiment of the present invention provides an accident warning system for a continuous downhill tunnel section in a mountainous area, comprising: processor; A memory stores computer-readable instructions, which, when executed by a processor, implement the accident warning method for a continuous downhill tunnel section in a mountainous area as described in the first aspect.

[0008] The third aspect An embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, the method for early warning of accidents in a continuous downhill tunnel section in a mountainous area according to the first aspect is implemented.

[0009] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least: In this invention, the number of sub-segments is constrained to be less than a preset number. Based on segment characteristics, the digital segment information is non-uniformly segmented using a combination of cosine similarity and exponentially weighted Euclidean distance. This accurately captures the differences in segment characteristics, dynamically adapts to complex road conditions, and focuses on high-risk areas, thereby improving the accuracy of dangerous segment identification and providing a more reliable foundation for subsequent accident warnings. This also reduces invalid warnings and improves warning efficiency. Historical traffic accident data is then collected and, combined with chaos theory and a particle swarm optimization algorithm, a random forest model is developed to describe the correlation between the number of traffic accidents in this historical traffic accident data and the characteristics of the accident segments. This model dynamically groups historical traffic data, optimizes model hyperparameters, and accurately captures the complex nonlinear relationship between the number of accidents and segment characteristics. Through efficient global search and adaptive learning, the ability to identify dangerous segments and the accuracy of accident warnings are significantly improved. The random forest model is then used to screen dangerous sub-segments from the sub-segments derived from the uneven segmentation. Finally, the effectiveness of the uneven segmentation is measured using the first coverage ratio (the ratio of the number of target accident sections located in a dangerous sub-segment to the total number of target accident sections) and the second coverage ratio (the ratio of the length of the target accident section located in a dangerous sub-segment to the length of the corresponding dangerous sub-segment). The number of segments (the number of pre-set sub-segments) is adjusted until a satisfactory coverage ratio is achieved, effectively predicting dangerous sub-segments. This ensures accurate identification and coverage of dangerous sub-segments, effectively reducing missed and false alarms. The placement of warning signs is also optimized to avoid excessive warnings and resource waste, significantly improving the accuracy and efficiency of accident warnings for continuous downhill tunnel sections in mountainous areas. The placement of warning signs is also minimized, avoiding the cost increases and warning fatigue caused by incorrect or subjective placement of warning signs. This results in more accurate warning sign placement, better warning effectiveness, and better traffic safety. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0011] Figure 1 A schematic flow chart of an accident warning method for a continuous downhill tunnel section in a mountainous area provided by an embodiment of the present invention; Figure 2 A schematic structural diagram of an accident warning system for a continuous downhill tunnel section in a mountainous area provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0012] The technical solution of the present invention is described below in conjunction with the accompanying drawings.

[0013] In the embodiments of the present invention, words such as "exemplarily" and "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as an "exemplary" in the present invention should not be interpreted as being preferred or advantageous over other embodiments or designs. Rather, the use of the word "exemplary" is intended to present concepts in a concrete manner. Furthermore, in the embodiments of the present invention, "and / or" can mean both or either of the two.

[0014] In order to make the technical problems, technical solutions and advantages to be solved by the present invention clearer, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.

[0015] Reference Manual Figure 1 , which shows a flow chart of an accident warning method for a continuous downhill tunnel section in a mountainous area provided by an embodiment of the present invention.

[0016] An embodiment of the present invention provides a method for early warning accidents in mountainous areas with continuous downhill tunnel sections. This method can be implemented by an early warning device for mountainous areas with continuous downhill tunnel sections, which can be a terminal or a server. The process flow of the early warning method for mountainous areas with continuous downhill tunnel sections may include the following steps: S1: Obtain digital road section information of continuous downhill tunnel sections in mountainous areas.

[0017] Digital road segment information refers to digitally represented road characteristic data, including geometric characteristics such as road segment type, slope, curvature, width, and length, as well as geographic location, traffic flow, and environmental conditions. This information is used to accurately analyze and model road characteristics. By collecting geometric, geographic, and traffic characteristic data for road segments, it provides the foundational data for subsequent segmentation and hazardous section analysis, ensuring that the model accurately identifies road segment characteristics and dynamically adapts to complex road conditions.

[0018] S2: With the constraint that the number of sub-segments is less than the preset number of sub-segments, the digital road segment information is non-uniformly segmented based on the road segment characteristics, combining cosine similarity and exponentially weighted Euclidean distance to obtain multiple digitized sub-segments.

[0019] Among them, the road section characteristics include road section category, road section slope, road section curvature, road section width and road section length.

[0020] Among them, cosine similarity is a metric that measures the directional similarity between two vectors and is primarily used to determine whether the vectors have consistent directions in high-dimensional space. Exponentially weighted Euclidean distance adds exponential decay weighting to the classic Euclidean distance, emphasizing amplitude differences between features while suppressing the impact of small differences. Cosine similarity captures the directional consistency of road segment features, while exponentially weighted Euclidean distance measures amplitude differences. Under preset constraints, digital road segment information is non-uniformly segmented to accurately identify sub-segments with significant feature changes. This not only measures the directional and amplitude differences of road segment features, but also accurately identifies feature change points through non-uniform segmentation, effectively focusing on high-risk areas and laying a data foundation for subsequent screening of dangerous sections. It also avoids invalid segmentation and improves the efficiency and reliability of segmentation.

[0021] It should be noted that those skilled in the art can set the magnitude of the preset road section feature differentiation according to actual needs, and the present invention does not limit this.

[0022] In a possible implementation, the road segment categories include a straight road segment, a tunnel road segment, a turning road segment, a tunnel entrance road segment, and a tunnel exit road segment.

[0023] It should be noted that by classifying different types of road sections, it is helpful to accurately capture the road geometric characteristics and their corresponding risk characteristics, and provide more refined basic data support for subsequent dangerous road section identification and warning layout.

[0024] In a possible implementation, S2 specifically includes: S201: Divide the digital road section information into a plurality of initial sub-road sections, wherein the total number of the initial sub-road sections is greater than the number of preset sub-road sections.

[0025] It should be noted that those skilled in the art can set the number of preset sub-sections according to actual needs, and the present invention does not limit this.

[0026] Specifically, by dividing digital road segment information into multiple initial sub-segments, ensuring that the number of sub-segments exceeds the preset number, sufficient initial accuracy is provided for subsequent non-uniform segmentation and dangerous section identification. Furthermore, by appropriately setting the preset number of sub-segments, the system avoids overcrowding of warning signs due to excessive segmentation, thereby reducing driver distraction and warning fatigue, and improving driving safety and warning efficiency.

[0027] S202: Collecting the segment features of each initial sub-segment from the digital segment information, and combining the segment features of each initial sub-segment into a segment feature vector.

[0028] The expression of the road segment feature vector is: ; in, Indicates the k The feature vectors of the initial sub-segments, 、 、 、 and Respectively represent k The quantitative value of the road segment category, the average road segment slope, the average road segment curvature, the average road segment width and the average road segment length of the initial sub-segments.

[0029] S203: Calculating the segment feature similarity between adjacent initial sub-segments based on the segment feature vectors of the initial sub-segments.

[0030] The calculation method of the similarity of the road segment characteristics between each adjacent initial sub-segment is as follows: ; in, Indicates the k +1 feature vector of the initial sub-segment, express and The similarity of road segment features between express and The cosine similarity between and Respectively represent k The initial sub-segment and k +1 initial sub-segment u eigenvalues, , n Indicates the total number of road segment features, express and The exponentially weighted Euclidean distance between and Represent the cosine similarity weight and exponentially weighted Euclidean distance weight, respectively. express and The Euclidean distance between e Represents a natural constant.

[0031] Optionally, the cosine similarity weight and the exponentially weighted Euclidean distance weight may be 0.5 and 0.5, or 0.4 and 0.6, respectively.

[0032] The Euclidean distance calculates the magnitude differences between feature vectors, and the exponential function attenuates these distance differences, ensuring that small differences do not significantly affect the results. Combining cosine similarity with exponentially weighted Euclidean distance to calculate segment feature similarity simultaneously measures both the directional consistency and magnitude differences of feature vectors in adjacent segments. This accurately captures changes in directional features while appropriately weighting magnitude differences to avoid overly impacting minor changes. This allows for a comprehensive assessment of changes in segment characteristics and improves the refinement and accuracy of segmentation.

[0033] S204: With the constraint that the number of sub-segments is less than the preset number of sub-segments, the initial sub-segments whose segment feature similarity is greater than the preset segment feature similarity are merged, and the merged initial sub-segments are output as digitized sub-segments; otherwise, the total number of initial sub-segments is increased, and the process returns to step S201.

[0034] It should be noted that by combining the characteristics of cosine similarity and exponentially weighted Euclidean distance, a comprehensive measure of the characteristic similarity between adjacent sub-segments can be achieved. Cosine similarity reflects the directional consistency of vectors and is suitable for evaluating the balance of weights between different characteristics, while exponentially weighted Euclidean distance emphasizes differences in characteristic magnitudes, enhancing sensitivity to absolute differences in characteristic values. Furthermore, by using weight parameters to flexibly adjust the importance of directional and magnitude differences, this calculation method can accurately capture significant change points while appropriately suppressing excessively small changes during refined segmentation, resulting in high adaptability and robustness.

[0035] S3: Obtain historical traffic accident data.

[0036] The historical traffic accident data includes the accident section characteristics of the sub-section to which the traffic accident section belongs and the number of traffic accidents corresponding to the traffic accident section.

[0037] The accident section feature is the section feature of the sub-section to which the traffic accident section belongs.

[0038] Understandably, collecting historical traffic accident data includes the characteristics of the road sections where accidents occurred (such as slope and curvature) and the corresponding number of accidents. This step, by recording the characteristics of the accident sections in detail, provides real and accurate data support for subsequent model building. This allows for in-depth exploration of the correlation between accident patterns and road section characteristics, establishing a priori knowledge foundation for the precise screening of dangerous sub-sections.

[0039] S4: Based on historical traffic accident data, a random forest model is established to describe the correlation between the number of traffic accidents and the characteristics of accident sections by combining chaos theory and particle swarm optimization algorithm.

[0040] Chaos theory, a theory that studies the behavior of nonlinear dynamic systems, emphasizes the sensitivity and complexity of systems to initial conditions. In data analysis, chaos theory can generate chaotic sequences with pseudo-random and dynamic distribution characteristics, which can be used to optimize grouping and increase the diversity of data distribution. Particle swarm optimization, an optimization algorithm based on swarm intelligence, simulates the behavior of flocks of birds or schools of fish to find the optimal solution to a problem. Random forest, an ensemble learning algorithm based on decision trees, achieves classification or regression by constructing multiple decision trees and incorporating a voting mechanism. Chaos theory is used to generate pseudo-random grouped data, ensuring coverage of road sections with different characteristics and improving sample diversity. Particle swarm optimization is combined with the algorithm to rapidly optimize random forest hyperparameters, significantly improving the model's predictive accuracy and efficiency. The random forest model deeply explores the complex nonlinear relationship between traffic accident counts and road section characteristics, providing strong data support for the precise identification of dangerous subsections and the scientific placement of warning signs.

[0041] In a possible implementation, S4 specifically includes: S401: Initialize the random forest model and random forest model hyperparameters, where the random forest model hyperparameters include the number of decision trees, the depth of the decision tree, and the minimum number of samples for leaf nodes.

[0042] S402: Grouping the historical traffic accident data in combination with chaos theory to obtain multiple groups of sample data whose number of groups is equal to the number of decision trees.

[0043] It should be noted that traditional random grouping, based on bootstrap sampling (with replacement), may result in some samples being selected multiple times and others not being selected at all. This high degree of randomness in sampling and a lack of control over data grouping can easily lead to uneven sample characteristics within certain groups. Furthermore, random grouping is uncontrollable and cannot guarantee a uniform data distribution within each tree. For example, samples from certain important categories may be excessively repeated across multiple groups or completely omitted. Chaotic sequences generated by chaos theory, on the other hand, exhibit favorable distributional characteristics and pseudo-randomness in high-dimensional data. They can dynamically partition data, ensuring more uniform and diverse data grouping. Because chaotic sequences are highly sensitive to initial conditions, the data grouping within each decision tree exhibits varying randomness, resulting in greater variability in the training data for each tree. This ensures more independent and diverse training data for each tree, reducing inter-tree correlation. This enhances the ensemble effect of random forests and improves the generalization of the model. Dynamic grouping optimizes grouping based on the distribution of data features, ensuring that each group covers a wider range of feature distributions.

[0044] In summary, the pseudo-random sequence generated by the chaotic map can dynamically adjust the grouping rules, ensuring that the training data for each tree more evenly covers the feature space, thereby increasing model diversity and robustness. Compared to traditional random grouping, which is prone to imbalanced feature distribution or over-extraction of some samples, chaos theory grouping can better balance the sample distribution and prevent certain features or samples from being overlooked. Furthermore, this grouping method is more adaptable to data distribution, can capture high-dimensional nonlinear features, reduce the risk of overfitting, and improve the generalization and interpretability of the random forest on test data, thereby significantly enhancing the overall predictive performance of the model.

[0045] In a possible implementation, S402 specifically includes: S4021: Normalize the characteristics of each accident section of each historical traffic accident data.

[0046] The normalization formula is as follows: ; in, Indicates the i The first of the historical traffic accident data j The characteristic value of the accident section feature, and Respectively represent the first j The minimum and maximum values ​​of the accident section characteristics, express Normalized eigenvalues.

[0047] Specifically, j =5, that is, the accident section characteristics include section type, section slope, section curvature, section width and section length.

[0048] S4022: Performing chaotic mapping on the normalized characteristic values ​​of each accident road section in each historical traffic accident data to generate a chaotic sequence including the normalized characteristic values ​​of each accident road section in each historical traffic accident data.

[0049] The mapping formula is as follows: ; in, and Respectively In the v The mapping iteration and v +1 state value of the mapping iteration, r Represents the chaotic map control parameter that determines the degree of chaos.

[0050] when rWhen it is >3.5, the system enters a chaotic state, showing highly sensitive initial condition dependence and complex dynamic behavior.

[0051] S4023: Taking the average of the normalized characteristic values ​​of each accident section to obtain the comprehensive chaotic state of the historical traffic accident data, that is, the comprehensive state value.

[0052] The calculation method of the comprehensive status value is as follows: ; in, Indicates the i Historical traffic accident data k The comprehensive state value obtained after the mapping iteration.

[0053] S4024: Divide each historical traffic accident data into groups of sample data according to the comprehensive state value, and obtain multiple groups of sample data with the same number of groups as the number of decision trees.

[0054] The specific division method is: ; in, Indicates the g Group sample data, g Indicates the group number of the sample data, Represents the number of sample data groups, where the number of sample data groups is equal to the total number of decision trees.

[0055] Specifically, by normalizing the various features of historical traffic accident data and unifying the data scale, chaotic mapping is applied to generate dynamic chaotic sequences. The sensitivity to initial conditions and complex dynamic behaviors are used to calculate the comprehensive state value. Based on the comprehensive state value, the sample data groups are dynamically divided to match the number of decision trees, ensuring that each group of samples is evenly distributed and more diverse, thereby improving the training effect and prediction ability of the random forest model and enhancing the accuracy and robustness of dangerous road section identification.

[0056] Optionally, the chaotic mapping control parameters are optimized in combination with information entropy, and the optimization process is specifically as follows: Obtain the comprehensive state value under different chaotic map control parameters.

[0057] Calculate the information entropy of each comprehensive state value: ; in, express The probability of occurrence, K represents the maximum number of mapping iterations, and log represents the logarithmic function.

[0058] Take the chaotic mapping control parameters under the maximum information entropy: ; in, represents the optimized chaotic mapping control parameters.

[0059] Based on the optimized chaotic map control parameters, the historical traffic accident data are regrouped to obtain multiple groups of sample data whose number of groups is equal to the number of decision trees.

[0060] Among them, the chaos map control parameter is a key parameter in the chaotic system, which is used to determine the behavior and output characteristics of the chaos map. In the chaos map formula, the range of the control parameter value directly affects whether the system is in a stable state, a periodic state, or enters a chaotic state. By optimizing this parameter, the data grouping rules can be dynamically adjusted to enhance the model's predictive ability and robustness. It can be understood that by adjusting the chaos map control parameter, calculating the information entropy of the comprehensive state value under different parameters, and selecting the optimal chaos map control parameter with the maximum information entropy as the optimization goal, the generated chaotic sequence is ensured to have a higher distribution randomness and diversity. In turn, the historical traffic accident data is regrouped to make the sample data group evenly distributed and diversified in characteristics, improving the training effect and generalization ability of the random forest model, and enhancing the accuracy and robustness of dangerous road section identification.

[0061] S403: Input each group of sample data into different decision trees, output the predicted value of the number of traffic accidents, and train the random forest model.

[0062] The calculation method of the predicted number of traffic accidents is as follows: ; in, represents the predicted value of the number of traffic accidents by the random forest model, Represents sample data based on input x In the random forest model under l The predicted value of the number of traffic accidents based on the decision tree, N Indicates the number of decision trees in the random forest model.

[0063] It should be noted that those skilled in the art can set the preset number of iterations according to actual needs, and the present invention does not limit this.

[0064] S404: Taking the accuracy of the traffic accident number prediction value as the fitness function, the random forest model hyperparameters are optimized using the particle swarm optimization algorithm.

[0065] In a possible implementation, S404 specifically includes: S4041: Initialize the number of particles, particle positions, and particle velocities, where each particle represents a set of random forest model hyperparameters.

[0066] S4042: Determine the accuracy of the predicted value of the number of traffic accidents at each particle position, that is, the fitness function value.

[0067] The calculation method of the fitness function value is as follows: ; in, Represents particles q location, Represents particles q The particle position is The fitness function value when l Indicates the number of samples with correct predictions of the number of traffic accidents. L Indicates the total number of sample data.

[0068] S4043: Determine the individual optimal particle position and the global optimal particle position based on the fitness function value.

[0069] The calculation method of individual optimal particle position and global optimal particle position is as follows: ; in, and They represent the individual optimal particle position and the global optimal particle position respectively, and max means taking the maximum value.

[0070] S4044: combining the individual optimal particle position and the global optimal particle position, updating the position and velocity of each particle until the number of iterations is greater than the preset number of iterations.

[0071] The update method is as follows: ; in, t Indicates the number of iterations. and Represent particles q In the number of iterations t and the number of iterations t Particle velocity at +1, and Represent particles q In the number of iterations t and the number of iterations t The particle position at +1, Represents t The associated dynamic inertia weight, and denote the maximum inertia weight and the minimum inertia weight, respectively. and They represent the learning factors that control the speed at which particles approach the individual optimal particle position and the global optimal particle position, respectively. and Both indicate that they are in the interval A random number, Indicates the t The standard deviation of the particle swarm of iterations, Q represents the total number of particles, Indicates the t The mean position of particles in the particle swarm at iterations.

[0072] The size of the inertia weight determines whether particles prefer a global search (wider range) or a local search (more precise). An appropriate inertia weight value helps the particle swarm quickly explore in the early stages and focus on the current optimal solution in the later stages, thereby accelerating convergence. The dynamic inertia weight setting allows for a higher inertia weight when the swarm is highly diverse (larger standard deviation), facilitating global search. When the swarm is converging (smaller standard deviation), the inertia weight is lowered, allowing the swarm to focus on local search.

[0073] The minimum inertia weight represents the lowest inertia of a particle during the convergence phase and is used for local exploration, with a range of 0.4-0.5. The maximum inertia weight represents the highest inertia of a particle during the initial phase and is used for global exploration, with a range of 0.8-0.9. This ensures that the particle swarm fully explores the search space in the early stages and converges accurately in the later stages, improving the algorithm's global optimization and local exploration capabilities.

[0074] It should be noted that those skilled in the art can set the preset number of iterations according to actual needs, and the present invention does not limit this.

[0075] S4046: Output the global optimal particle position corresponding to the maximum fitness function in the preset number of iterations, and complete the optimization of the random forest model hyperparameters.

[0076] It should be noted that the particle swarm optimization algorithm dynamically adjusts the hyperparameters of the random forest model. After initializing the particle swarm, the individual and global optimal positions are determined based on the fitness function value of each particle position. Dynamic inertia weights are used to adjust particle positions and velocities, balancing global search with local exploitation. Through multiple iterations, the particle position corresponding to the maximum fitness is found, ultimately optimizing the random forest parameter configuration, significantly improving the model's prediction accuracy and generalization ability.

[0077] S405: Outputting the hyperparameters of the random forest model with the largest fitness function value as the optimal hyperparameters of the random forest model to obtain a random forest model.

[0078] Specifically, this process dynamically groups historical traffic accident data using chaos theory to ensure diverse and uniform data distribution, significantly improving the independence of decision tree training and the generalization capabilities of random forests. Subsequently, a particle swarm optimization algorithm is used to globally optimize the random forest's hyperparameters (such as the number and depth of decision trees), significantly improving the model's accuracy and robustness in predicting accident counts. This provides efficient and reliable support for identifying dangerous road sections and placing warning signs.

[0079] S5: Use the random forest model to screen dangerous sub-sections from each sub-section.

[0080] It should be noted that by using the random forest model to screen dangerous sub-sections from sub-sections, it can not only accurately identify known high-risk sections, but also infer potential dangerous sections based on the prior knowledge learned by the model, significantly improving the comprehensiveness and accuracy of accident warnings, and providing effective support for improving the operational safety of continuous downhill tunnel sections in mountainous areas.

[0081] In a possible implementation, S5 specifically includes: S501: Input the segment features of each sub-segment into the random forest model.

[0082] S502: Output the predicted number of traffic accidents for each sub-road section.

[0083] S503: Outputting a sub-road section whose traffic accident number prediction value is greater than a preset traffic accident number prediction value as a dangerous sub-road section.

[0084] It can be understood that by inputting the characteristics of each sub-section into the random forest model, using the model to predict the number of traffic accidents in each sub-section, and screening the sub-sections with accident number prediction values ​​exceeding the preset threshold as dangerous sub-sections, it is possible to accurately identify high-risk sections, provide a scientific basis for the subsequent layout of accident warning signs, and effectively avoid the increase in costs and warning fatigue caused by subjective decision-making on warning layout points or indiscriminate layout of warning points.

[0085] S6: Determine whether the dangerous sub-section includes a target traffic accident section with a traffic accident number greater than a preset traffic accident number. If so, proceed to step S8; otherwise, proceed to step S7.

[0086] As can be understood, the screened dangerous sub-sections are evaluated to determine whether there are any target accident sections where the number of traffic accidents exceeds a preset threshold. If the conditions are met, a warning flag is directly set (step S8). Otherwise, the process returns to step S7 to optimize the segmentation rules, thereby dynamically adjusting the analysis process to ensure the accuracy of dangerous section identification and the reliability of the warning effect.

[0087] It should be noted that those skilled in the art can set the preset number of traffic accidents according to actual needs, and the present invention does not limit this.

[0088] S7: Based on the first coverage rate and the second coverage rate of the traffic accident section, increase the number of preset sub-sections and return to step S2.

[0089] Among them, the first coverage rate is the ratio of the number of target traffic accident sections located in dangerous sub-sections to the total number of target traffic accident sections, and the second coverage rate is the ratio of the section length between the target traffic accident section located in the dangerous sub-section and the dangerous sub-section to which it belongs.

[0090] It's important to note that the two metrics (first coverage and second coverage) used in the dangerous sub-section screening results determine whether the current segmentation rules need optimization. If the coverage is insufficient (e.g., missing high-risk sections or excessive dispersion), optimizing the segmentation by increasing the number of pre-defined sub-sections (refining the segmentation) can improve the accuracy of dangerous sub-section identification and warning effectiveness.

[0091] In one possible implementation, the first coverage ratio is the ratio of the number of target traffic accident sections located in the dangerous sub-section to the total number of target traffic accident sections. The second coverage ratio is the ratio of the length of the target traffic accident section located in the dangerous sub-section to the length of the dangerous sub-section to which it belongs.

[0092] The calculation method of the first coverage rate and the second coverage rate is as follows: ; in, R 1 and R 2 represents the first coverage and the second coverage respectively, Indicates the number of target traffic accident sections located in dangerous sub-sections, Indicates the total number of target traffic accident sections, Indicates the length of the target traffic accident section located in the dangerous sub-section, Indicates the length of the dangerous sub-section.

[0093] In S7, the number of preset sub-segments is increased based on the first coverage rate and the second coverage rate of the traffic accident segment, specifically including: S701: Determine a loss function related to a first coverage ratio and a second coverage ratio.

[0094] The loss function is calculated as follows: ; in, represents the loss function, and Represent the first coverage weight and the second coverage weight respectively.

[0095] S702: Calculate the gradient of the loss function relative to the total number of sub-segments.

[0096] The calculation method of the loss function gradient is as follows: ; in, represents the gradient of the loss function, represents the partial derivative, S Indicates the total number of sub-segments.

[0097] Specifically, by calculating the gradient of the loss function relative to the total number of sub-segments, we can quantify the sensitivity of coverage deviation to the adjustment of the number of segments, and guide the optimization direction and adjustment amplitude.

[0098] S703: Calculate the increment of the number of preset sub-segments according to the gradient of the loss function.

[0099] The calculation method for the increment of the number of preset sub-sections is as follows: ; in, Indicates the increment of the preset sub-section quantity. Indicates rounding down. represents the initial learning rate, Indicates the number of times the preset sub-section quantity is adjusted T The associated adaptive learning rate, Represents a constant that prevents the denominator from being 0. Represents T The associated loss function gradient sum of squares, Indicates the i Adjust the loss function gradient of the preset number of sub-segments.

[0100] It's important to note that by using gradient calculation to pre-set the number of sub-segments, insufficient coverage can be dynamically detected. Combined with an adaptive learning rate, this ensures that the adjustment step size is automatically optimized with the number of iterations. This method not only prevents model oscillation or slow convergence caused by overly large or small adjustments, but also leverages historical adjustment information to improve accuracy. This allows for precise adjustment of the number of sub-segments, enhancing the reliability of dangerous section identification and the efficiency of segmented optimization.

[0101] S704: Increase the number of preset sub-road sections according to the increment of the number of preset sub-road sections.

[0102] Specifically, dynamic adjustments are guided by a combined loss function of the first and second coverage rates, enabling adaptive optimization of segmentation accuracy and balancing the conflict between the number of sub-segments and coverage accuracy. Using a gradient descent method combined with an adaptive learning rate, the number of segments is rapidly increased when coverage is insufficient and slowed down when coverage is excessive. This improves the accuracy of identifying dangerous sections while avoiding resource waste caused by overly detailed segmentation. Ultimately, this enables efficient and reliable early warning sign placement and optimizes warning effectiveness.

[0103] S8: Set up warning signs at each dangerous sub-section to provide safety warnings and safety guidance to vehicles entering each dangerous sub-section.

[0104] Warning signs can include information boards, wired broadcasts, speed limit signs, traffic lights, lane indicators, etc. Warning signs are placed at both ends of the dangerous sub-section and can be randomly placed at locations in the middle of the dangerous sub-section to remind vehicles entering the area from different ends of the dangerous sub-section to reduce speed and pay attention to road conditions.

[0105] In practical application, digital road segment information is first acquired to collect data on road segment geometry and traffic characteristics, laying the foundation for subsequent analysis. Then, the road segments are non-uniformly segmented using cosine similarity and exponentially weighted Euclidean distance to accurately identify feature change points and focus on high-risk areas. Historical traffic accident data is then collected to correlate road segment characteristics with accident counts, providing prior knowledge for the model. In S4, a random forest model is constructed using chaos theory and particle swarm optimization to deeply explore traffic accident patterns and improve model prediction accuracy. In S5, the model is used to screen dangerous sub-segments, not only identifying known high-risk sections but also predicting potential hazardous areas. Dynamically determining whether the accident frequency of a dangerous sub-segment exceeds a threshold determines whether to adjust the segmentation rules or directly set warning signs. Coverage-based segment optimization ensures accurate and effective warnings while avoiding resource waste and excessive alerts. The overall solution achieves precise identification of dangerous sections, dynamic segment optimization, and efficient setting of warning signs, significantly improving traffic safety and management efficiency on complex mountainous roads.

[0106] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least: In this invention, the number of sub-segments is constrained to be less than a preset number. Based on segment characteristics, the digital segment information is non-uniformly segmented using a combination of cosine similarity and exponentially weighted Euclidean distance. This accurately captures the differences in segment characteristics, dynamically adapts to complex road conditions, and focuses on high-risk areas, thereby improving the accuracy of dangerous segment identification and providing a more reliable foundation for subsequent accident warnings. This also reduces invalid warnings and improves warning efficiency. Historical traffic accident data is then collected and, combined with chaos theory and a particle swarm optimization algorithm, a random forest model is developed to describe the correlation between the number of traffic accidents in this historical traffic accident data and the characteristics of the accident segments. This model dynamically groups historical traffic data, optimizes model hyperparameters, and accurately captures the complex nonlinear relationship between the number of accidents and segment characteristics. Through efficient global search and adaptive learning, the ability to identify dangerous segments and the accuracy of accident warnings are significantly improved. The random forest model is then used to screen dangerous sub-segments from the sub-segments derived from the uneven segmentation. Finally, the effectiveness of the uneven segmentation is measured using the first coverage ratio (the ratio of the number of target accident sections located in a dangerous sub-segment to the total number of target accident sections) and the second coverage ratio (the ratio of the length of the target accident section located in a dangerous sub-segment to the length of the corresponding dangerous sub-segment). The number of segments (the number of pre-set sub-segments) is adjusted until a satisfactory coverage ratio is achieved, effectively predicting dangerous sub-segments. This ensures accurate identification and coverage of dangerous sub-segments, effectively reducing missed and false alarms. The placement of warning signs is also optimized to avoid excessive warnings and resource waste, significantly improving the accuracy and efficiency of accident warnings for continuous downhill tunnel sections in mountainous areas. The placement of warning signs is also minimized, avoiding the cost increases and warning fatigue caused by incorrect or subjective placement of warning signs. This results in more accurate warning sign placement, better warning effectiveness, and better traffic safety.

[0107] Reference Manual Figure 2 , which shows a structural schematic diagram of an accident warning system for a continuous downhill tunnel section in a mountainous area provided by the present invention.

[0108] The present invention further provides a mountainous continuous downhill tunnel section accident warning system 20, which is applied to the above-mentioned mountainous continuous downhill tunnel section accident warning method, comprising: Processor 201.

[0109] The memory 202 stores computer-readable instructions. When the computer-readable instructions are executed by the processor 201, the accident warning method for a continuous downhill tunnel section in a mountainous area as in the method embodiment is implemented.

[0110] The accident warning system 20 for a continuous downhill tunnel section in a mountainous area provided by the present invention can execute the above-mentioned accident warning method for a continuous downhill tunnel section in a mountainous area and achieve the same or similar technical effects. To avoid repetition, the present invention will not elaborate on it.

[0111] It should be understood that the processor in the embodiments of the present invention may be a central processing unit (CPU), but may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc.

[0112] It should also be understood that the memory in the embodiments of the present invention may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory may be random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus RAM (DR RAM).

[0113] The above embodiments can be implemented in whole or in part via software, hardware (e.g., circuits), firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product comprises one or more computer instructions or computer programs. When loaded or executed on a computer, the processes or functions described in accordance with the embodiments of the present invention are fully or partially performed. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired means (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium accessible by a computer or a data storage device such as a server or data center that contains a collection of one or more available media. The available medium can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media. The semiconductor media can be a solid-state drive.

[0114] It should be understood that the term "and / or" as used herein simply describes a relationship between associated objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A alone, A and B together, or B alone. A and B can be singular or plural. Furthermore, the character " / " as used herein generally indicates an "or" relationship between the associated objects, but it may also indicate an "and / or" relationship. For specific understanding, please refer to the context.

[0115] In this disclosure, "at least one" means one or more, and "plurality" means two or more. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, "at least one of a, b, or c" can mean: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or plural.

[0116] It should be understood that in various embodiments of the present invention, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0117] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present invention.

[0118] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described equipment, devices and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0119] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interface, indirect coupling or communication connection of the device or unit, which can be electrical, mechanical or other forms.

[0120] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0121] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0122] If the functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or the portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage media include various media that can store program code, such as USB flash drives, mobile hard drives, read-only memories (ROM), random access memories (RAM), magnetic disks, or optical disks.

[0123] An embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, the accident warning method for a continuous downhill tunnel section in a mountainous area as described in the method embodiment is implemented.

[0124] The computer-readable storage medium provided by the present invention can implement the steps and effects of the accident warning method for a continuous downhill tunnel section in a mountainous area of ​​the above-mentioned method embodiment. To avoid repetition, the present invention will not elaborate on them.

[0125] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any modifications or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present invention should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.

[0126] There are a few points to note: (1) The drawings of the embodiments of the present invention only relate to the structures related to the embodiments of the present invention. Other structures may refer to conventional designs.

[0127] (2) For the sake of clarity, the thickness of layers or regions in the drawings used to describe the embodiments of the present invention are exaggerated or reduced, that is, these drawings are not drawn to scale. It is understood that when an element such as a layer, film, region, or substrate is referred to as being "on" or "under" another element, the element may be "directly on" or "under" the other element or intervening elements may be present.

[0128] (3) In the absence of conflict, the embodiments of the present invention and the features therein may be combined with each other to form new embodiments.

[0129] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. The protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. A method for early warning of accidents in a continuous downhill tunnel section in a mountainous area, characterized in that: include: S1: Acquire digital road section information of the continuous downhill tunnel section in the mountainous area; S2: With the number of sub-segments being less than a preset number of sub-segments as a constraint, the digital road segment information is non-uniformly segmented based on road segment features, in combination with cosine similarity and exponentially weighted Euclidean distance, to obtain a plurality of digitized sub-segments, wherein the road segment features include road segment type, road segment slope, road segment curvature, road segment width, and road segment length; S3: Acquire historical traffic accident data, wherein the historical traffic accident data includes accident section characteristics of the sub-section to which the traffic accident section belongs and the number of traffic accidents corresponding to the traffic accident section; S4: Based on the historical traffic accident data, a random forest model is established in combination with chaos theory and particle swarm optimization algorithm to describe the correlation between the number of traffic accidents and the characteristics of the accident road section; S5: using the random forest model to screen dangerous sub-sections from each of the sub-sections; S6: Determine whether the dangerous sub-section includes a target traffic accident section with a traffic accident number greater than a preset traffic accident number. If so, proceed to step S8; otherwise, proceed to step S7; S7: Increasing the number of the preset sub-segments based on the first coverage rate and the second coverage rate of the traffic accident section, and returning to step S2, wherein the first coverage rate is the ratio of the number of target traffic accident sections located in the dangerous sub-segment to the total number of target traffic accident sections, and the second coverage rate is the ratio of the length of the target traffic accident section located in the dangerous sub-segment to the length of the dangerous sub-segment to which it belongs; S8: Setting a warning sign at each of the dangerous sub-sections to provide safety warnings and safety guidance to vehicles entering each of the dangerous sub-sections.

2. The accident warning method for a continuous downhill tunnel section in a mountainous area according to claim 1 is characterized in that: The road section categories include straight road sections, tunnel road sections, turning road sections, tunnel entrance road sections and tunnel exit road sections.

3. The accident warning method for a continuous downhill tunnel section in a mountainous area according to claim 2 is characterized in that: The S2 specifically includes: S201: Divide the digital road section information into a plurality of initial sub-road sections, wherein the total number of the initial sub-road sections is greater than the number of the preset sub-road sections; S202: collecting the segment features of each of the initial sub-segments from the digital segment information, and composing the segment features of each initial sub-segment into a segment feature vector; S203: Calculating the similarity of the segment features between adjacent initial sub-segments based on the segment feature vectors of the initial sub-segments; S204: With the constraint that the number of sub-segments is less than the preset number of sub-segments, the initial sub-segments whose segment feature similarity is greater than the preset segment feature similarity are merged, and the merged initial sub-segments are output as digitized sub-segments; otherwise, the total number of the initial sub-segments is increased, and the process returns to step S201.

4. The accident warning method for a continuous downhill tunnel section in a mountainous area according to claim 1 is characterized in that: The S4 specifically includes: S401: Initializing a random forest model and random forest model hyperparameters, wherein the random forest model hyperparameters include the number of decision trees, the depth of the decision tree, and the minimum number of leaf node samples; S402: Grouping the historical traffic accident data in combination with the chaos theory to obtain multiple groups of sample data, the number of which is equal to the number of decision trees; S403: Inputting each group of sample data into different decision trees, outputting a predicted value of the number of traffic accidents, and training the random forest model; S404: Optimizing the hyperparameters of the random forest model using the particle swarm optimization algorithm with the accuracy of the traffic accident number prediction value as the fitness function; S405: Outputting the hyperparameters of the random forest model with the largest fitness function value as the optimal hyperparameters of the random forest model to obtain the random forest model.

5. The accident warning method for a continuous downhill tunnel section in a mountainous area according to claim 4 is characterized in that: The S402 specifically includes: S4021: Normalizing the characteristics of each accident section of each historical traffic accident data; S4022: performing chaotic mapping on the normalized characteristic values ​​of each accident road section in each historical traffic accident data to generate a chaotic sequence including the normalized characteristic values ​​of each accident road section in each historical traffic accident data; S4023: averaging the normalized characteristic values ​​of each accident section to obtain a comprehensive chaotic state of the corresponding historical traffic accident data, i.e., a comprehensive state value; S4024: Divide each historical traffic accident data into each group of sample data according to the comprehensive state value, and obtain multiple groups of sample data whose number is equal to the number of decision trees.

6. The accident warning method for a continuous downhill tunnel section in a mountainous area according to claim 4 is characterized in that: The S404 specifically includes: S4041: Initialize the number of particles, particle positions, and particle velocities, where each particle represents a set of random forest model hyperparameters; S4042: Determine the accuracy of the predicted value of the number of traffic accidents at each particle position, that is, the fitness function value; S4043: Determine the individual optimal particle position and the global optimal particle position based on the fitness function value; S4044: combining the individual optimal particle position and the global optimal particle position, updating the position and velocity of each particle until the number of iterations exceeds a preset number of iterations; S4046: Output the global optimal particle position corresponding to the maximum fitness function value in the preset number of iterations, and complete the optimization of the random forest model hyperparameters.

7. The accident warning method for a continuous downhill tunnel section in a mountainous area according to claim 1 is characterized in that: The S5 specifically includes: S501: Inputting the road section features of each of the sub-road sections into the random forest model; S502: Outputting the predicted number of traffic accidents for each sub-road segment; S503: Outputting the sub-road section for which the predicted number of traffic accidents is greater than the preset predicted number of traffic accidents as the dangerous sub-road section.

8. The accident warning method for a continuous downhill tunnel section in a mountainous area according to claim 1 is characterized in that: The first coverage rate is the ratio of the number of target traffic accident sections located in the dangerous sub-section to the total number of target traffic accident sections; the second coverage rate is the ratio of the length of the target traffic accident section located in the dangerous sub-section to the length of the dangerous sub-section to which it belongs; Increasing the number of the preset sub-segments based on the first coverage rate and the second coverage rate of the traffic accident section in S7 specifically includes: S701: Determine a loss function related to the first coverage ratio and the second coverage ratio; S702: Calculating the loss function gradient of the loss function relative to the total number of sub-segments; S703: Calculating the increment of the number of preset sub-segments according to the gradient of the loss function; S704: Increase the number of the preset sub-road sections according to the increment of the number of the preset sub-road sections.

9. An accident warning system for a continuous downhill tunnel section in a mountainous area, characterized in that: include: processor; A memory storing computer-readable instructions, wherein the computer-readable instructions, when executed by the processor, implement the accident warning method for a continuous downhill tunnel section in a mountainous area according to any one of claims 1 to 8.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the accident warning method for a continuous downhill tunnel section in a mountainous area as claimed in any one of claims 1 to 8 is implemented.