Continuous accident space-time interval prediction method and device and storage medium

Through the Stacking integrated model, the identification of traffic accidents is combined with static and dynamic methods, and the time and space separation between the secondary accident and the primary accident is predicted, which solves the problem of low prediction efficiency in the existing technology and improves the accuracy and efficiency of traffic management.

CN119049264APending Publication Date: 2024-11-29CENT SOUTH UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310621975.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-05-29
Publication Date
2024-11-29

AI Technical Summary

Technical Problem

The prior art is difficult to accurately predict the time and space separation between the secondary accident and the primary accident, resulting in low efficiency of traffic management measures and increasing the risk of traffic accidents.

Method used

The Stacking integrated model is adopted, combining static space-time fixed threshold and dynamic speed profile diagram methods to identify the initial and secondary accident sets, and train them through RF, GBDT, XGBoost and LR models to predict the time-space interval category.

Benefits of technology

Accurate prediction of the spatial separation between the secondary accident and the primary accident has been achieved, helping to formulate effective traffic management measures, reduce traffic accidents, and improve traffic operation efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119049264A_ABST
    Figure CN119049264A_ABST
Patent Text Reader

Abstract

The invention provides a continuous accident space-time interval prediction method and device and a storage medium, and the method comprises the steps: carrying out the recognition of an obtained historical traffic accident set, and obtaining a primary accident set and a secondary accident set; the historical traffic accidents at least comprise positions and time; according to a preset accident space-time interval classification rule, determining an accident space-time interval category between each primary accident and each corresponding secondary accident based on the position and the time; based on the accident space-time interval category between the primary accident and each corresponding secondary accident, training the Stacking integration model to obtain a trained Stacking integration model; and inputting a to-be-predicted target primary accident into the trained Stacking integration model to obtain a target accident space-time interval category between the target primary accident output by the trained Stacking integration model and the corresponding target secondary accident. Therefore, the time-space interval type of the continuous accident can be accurately and quickly identified.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of traffic technology, and in particular to a method, device and storage medium for predicting the spatiotemporal interval of continuous accidents. Background Art

[0002] Road traffic accidents pose a threat to normal traffic operation and safety, and cause serious property damage and casualties. According to statistics from the World Health Organization, about 1.3 million people die in road traffic accidents each year, and 20 to 50 million people suffer non-fatal injuries, many of whom become disabled. In addition, road traffic accidents cost most countries 3% of their GDP. The bad traffic conditions that occur after a traffic accident are prone to secondary accidents. Secondary accidents are accidents that occur within the scope of the first accident. Secondary accidents and first accidents are called continuous accidents. Secondary accidents will aggravate the deterioration of traffic conditions and cause additional personal injuries. Studies have shown that the harm caused by secondary accidents is more serious than that of primary accidents. Faced with such huge negative consequences, the study of secondary accidents has gradually become a hot issue.

[0003] In the past few decades, many scholars have conducted extensive research on secondary accidents, but they mainly focus on the identification of secondary accidents and the modeling and prediction of their occurrence risks. Although the time and space interval between secondary accidents and primary accidents can also be used to assist traffic management, how to predict the time and space interval between secondary accidents and primary accidents has been under research.

[0004] The preceding description is intended to provide general background information and does not necessarily constitute prior art. Summary of the invention

[0005] In response to the above technical problems, the present application provides a method, device and storage medium for predicting the time and space intervals between consecutive accidents, which can accurately and quickly identify the time and space interval category between secondary accidents and initial accidents, help to formulate effective traffic management measures, reduce traffic accidents and improve traffic operation efficiency.

[0006] To achieve the above object, the technical solution of the present invention is achieved as follows:

[0007] In a first aspect, an embodiment of the present invention provides a method for predicting the spatiotemporal interval of continuous accidents, the method comprising:

[0008] Identify the acquired historical traffic accident set to obtain a primary accident set and a secondary accident set; the historical traffic accident includes at least a location and a time, the primary accident set includes at least one primary accident, and the secondary accident set includes at least one secondary accident corresponding to each primary accident;

[0009] According to a preset time-space interval classification rule, the time-space interval category between each primary accident and each corresponding secondary accident is determined based on location and time;

[0010] Based on the initial accident set, the secondary accident set and the time-space interval category between each initial accident and each corresponding secondary accident, the Stacking ensemble model is trained to obtain a trained Stacking ensemble model; the Stacking ensemble model includes at least two basic estimators of the first layer and a combiner of the second layer;

[0011] The target first accident to be predicted is input into the trained Stacking ensemble model to obtain the target space-time interval category between the target first accident and the corresponding target second accident output by the trained Stacking ensemble model.

[0012] In one implementation, the step of identifying the acquired historical traffic accident set to obtain the primary accident set and the secondary accident set includes:

[0013] According to the location and time of each historical traffic accident in the historical traffic accident set, the historical traffic accidents are selected based on preset location conditions and preset time conditions to determine a candidate primary accident set and a candidate secondary accident set;

[0014] The method based on the speed profile map is used to filter the candidate primary accident set and the candidate secondary accident set to determine the primary accident set and the secondary accident set.

[0015] In one embodiment, the selecting of historical traffic accidents based on the location and time of each historical traffic accident in the historical traffic accident set and the preset location condition and the preset time condition to determine the candidate primary accident set and the candidate secondary accident set includes:

[0016] Determine the first historical traffic accident from the historical traffic accident set, where the first historical traffic accident is any historical traffic accident;

[0017] For any second historical traffic accident in the historical traffic accident set that is different from the first historical traffic accident, detect whether the location of the second historical traffic accident is upstream of the first historical traffic accident, whether the distance interval is less than or equal to the preset distance threshold, and whether the time interval is less than or equal to the preset time threshold. If so, add the first historical traffic accident to the candidate primary accident set, and add the second historical traffic accident to the candidate secondary accident set.

[0018] In one embodiment, the method based on the speed profile map filters the candidate primary accident set and the candidate secondary accident set to determine the primary accident set and the secondary accident set, including:

[0019] Determine a target candidate primary accident from the candidate primary accident set, where the target candidate primary accident is any candidate primary accident and does not belong to the candidate secondary accident set;

[0020] According to the target position and target time of the target candidate first accident, a speed profile of the target candidate first accident is obtained; the speed profile of the target candidate first accident is obtained by sampling the average speed of vehicles collected within a preset distance upstream and downstream of the target position based on a preset time interval, with a time point at a preset time length before the target time as a sampling start point and a time point at a preset time length after the target time as a sampling end point;

[0021] Obtain the historical average speed, which is the average speed corresponding to each sampling point in the year of the target time, with the time point at the preset time length before the target time as the sampling start point and the time point at the preset time length after the target time as the sampling end point. After sampling the average speed of vehicles collected within the preset distance upstream and downstream of the target location based on the preset time interval, the average speed is obtained;

[0022] Subtract the historical average speed from the speed profile of the target candidate first accident to determine the impact area of ​​the target candidate first accident;

[0023] Detect whether the location of the target candidate secondary accident is within the influence area of ​​the target candidate primary accident. If so, add the target candidate primary accident to the primary accident set, and add the target candidate secondary accident to the secondary accident set; wherein the target candidate secondary accident is any candidate secondary accident in the candidate secondary accident set that corresponds to the target candidate primary accident.

[0024] In one embodiment, the first layer of the Stacking ensemble model includes an RF model, a GBDT model, and an XGBoost model, and the second layer includes an LR model;

[0025] The Stacking integration model is trained based on the initial accident set, the secondary accident set, and the time-space interval category between each initial accident and each corresponding secondary accident to obtain the trained Stacking integration model, including:

[0026] The data set consisting of the initial accident set, the secondary accident set, and the time-space interval categories between each initial accident and each corresponding secondary accident is divided into a training set and a test set;

[0027] Based on the training set, the RF model, the GBDT model and the XGBoost model are respectively constructed, and the RF model, the GBDT model and the XGBoost model are tuned based on the test set, and the first prediction probability of the RF model, the GBDT model and the XGBoost model for the training set and the second prediction probability for the test set are obtained respectively; wherein the first prediction probability and the second prediction probability are used to indicate the probability of belonging to which type of space-time interval category;

[0028] The LR model is constructed based on the first predicted probability and the space-time interval category corresponding to the training set, and the LR model is optimized based on the second predicted probability and the space-time interval category corresponding to the test set.

[0029] In a second aspect, an embodiment of the present invention provides a device for predicting the spatiotemporal interval of continuous accidents, the device comprising:

[0030] An identification module is used to identify the acquired historical traffic accident set to obtain a primary accident set and a secondary accident set; the historical traffic accident includes at least a location and a time, the primary accident set includes at least one primary accident, and the secondary accident set includes at least one secondary accident corresponding to each primary accident;

[0031] A classification module, for determining the time-space interval category between each primary accident and each corresponding secondary accident based on location and time according to a preset time-space interval classification rule;

[0032] A processing module, used for training the Stacking ensemble model based on the primary accident set, the secondary accident set and the time-space interval category between each primary accident and each corresponding secondary accident, to obtain a trained Stacking ensemble model; the Stacking ensemble model includes at least two basic estimators of the first layer and a combiner of the second layer;

[0033] The prediction module is used to input the target initial accident to be predicted into the trained Stacking integration model to obtain the target space-time interval category between the target initial accident and the corresponding target secondary accident output by the trained Stacking integration model.

[0034] In one embodiment, the identification module is specifically used to:

[0035] According to the location and time of each historical traffic accident in the historical traffic accident set, the historical traffic accidents are selected based on preset location conditions and preset time conditions to determine a candidate primary accident set and a candidate secondary accident set;

[0036] The method based on the speed profile map is used to filter the candidate primary accident set and the candidate secondary accident set to determine the primary accident set and the secondary accident set.

[0037] In one embodiment, the identification module is specifically used to:

[0038] Determine the first historical traffic accident from the historical traffic accident set, where the first historical traffic accident is any historical traffic accident;

[0039] For any second historical traffic accident in the historical traffic accident set that is different from the first historical traffic accident, detect whether the location of the second historical traffic accident is upstream of the first historical traffic accident, whether the distance interval is less than or equal to the preset distance threshold, and whether the time interval is less than or equal to the preset time threshold. If so, add the first historical traffic accident to the candidate primary accident set, and add the second historical traffic accident to the candidate secondary accident set.

[0040] In one embodiment, the identification module is specifically used to:

[0041] Determine a target candidate primary accident from the candidate primary accident set, where the target candidate primary accident is any candidate primary accident and does not belong to the candidate secondary accident set;

[0042] According to the target position and target time of the target candidate first accident, a speed profile of the target candidate first accident is obtained; the speed profile of the target candidate first accident is obtained by sampling the average speed of vehicles collected within a preset distance upstream and downstream of the target position based on a preset time interval, with a time point at a preset time length before the target time as a sampling start point and a time point at a preset time length after the target time as a sampling end point;

[0043] Obtain the historical average speed, which is the average speed corresponding to each sampling point in the year of the target time, with the time point at the preset time length before the target time as the sampling start point and the time point at the preset time length after the target time as the sampling end point. After sampling the average speed of vehicles collected within the preset distance upstream and downstream of the target location based on the preset time interval, the average speed is obtained;

[0044] Subtract the historical average speed from the speed profile of the target candidate first accident to determine the impact area of ​​the target candidate first accident;

[0045] Detect whether the location of the target candidate secondary accident is within the influence area of ​​the target candidate primary accident. If so, add the target candidate primary accident to the primary accident set, and add the target candidate secondary accident to the secondary accident set; wherein the target candidate secondary accident is any candidate secondary accident in the candidate secondary accident set that corresponds to the target candidate primary accident.

[0046] In one embodiment, the first layer of the Stacking integrated model includes an RF model, a GBDT model, and an XGBoost model, and the second layer includes an LR model; the processing module is specifically used to:

[0047] The data set consisting of the initial accident set, the secondary accident set, and the time-space interval categories between each initial accident and each corresponding secondary accident is divided into a training set and a test set;

[0048] Based on the training set, the RF model, the GBDT model and the XGBoost model are respectively constructed, and the RF model, the GBDT model and the XGBoost model are tuned based on the test set, and the first prediction probability of the RF model, the GBDT model and the XGBoost model for the training set and the second prediction probability for the test set are obtained respectively; wherein the first prediction probability and the second prediction probability are used to indicate the probability of belonging to which type of space-time interval category;

[0049] The LR model is constructed based on the first predicted probability and the space-time interval category corresponding to the training set, and the LR model is optimized based on the second predicted probability and the space-time interval category corresponding to the test set.

[0050] The present application also provides a device for predicting the temporal and spatial intervals of continuous accidents, comprising: a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the steps of the above method are implemented.

[0051] The present application also provides a storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.

[0052] As described above, the prediction method of the time-space interval of continuous accidents of the present application includes the steps of: identifying the acquired historical traffic accident set to obtain the primary accident set and the secondary accident set; the historical traffic accident includes at least the location and time, the primary accident set includes at least one primary accident, and the secondary accident set includes at least one secondary accident corresponding to each primary accident; according to the preset time-space interval classification rule, the time-space interval category between each primary accident and each corresponding secondary accident is determined based on the location and time; based on the primary accident set, the secondary accident set and the time-space interval category between each primary accident and each corresponding secondary accident, the Stacking integration model is trained to obtain the trained Stacking integration model; the Stacking integration model includes at least two basic estimators of the first layer and the combiner of the second layer; the target primary accident to be predicted is input into the trained Stacking integration model to obtain the target time-space interval category between the target primary accident and the corresponding target secondary accident output by the trained Stacking integration model. Based on the above technical solution, the time-space interval between the secondary accident and the primary accident can be accurately and quickly predicted, which is helpful to formulate effective traffic management measures in a timely manner, reduce traffic accidents, and improve traffic operation efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] The drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application. In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments are briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor.

[0054] Figure 1 It is a flow chart of a method for predicting the spatiotemporal interval of continuous accidents provided by an embodiment of the present invention;

[0055] Figure 2 is a schematic diagram of the distribution of time-space interval categories in an embodiment of the present invention;

[0056] Figure 3 It is a schematic diagram of the structure of a device for predicting continuous accident time-space intervals provided by an embodiment of the present invention.

[0057] The realization of the purpose, functional features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. The above-mentioned drawings have shown clear embodiments of this application, which will be described in more detail later. These drawings and textual descriptions are not intended to limit the scope of the concept of this application in any way, but to illustrate the concept of this application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0058] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0059] It should be noted that, in this article, the terms "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element. In addition, components, features, and elements with the same name in different embodiments of the present application may have the same meaning or different meanings, and their specific meanings need to be determined by their explanation in the specific embodiment or further combined with the context of the specific embodiment.

[0060] See also Figure 1 , a method for predicting the spatiotemporal interval of continuous accidents provided by an embodiment of the present invention, the method can be applied to the case of identifying the spatiotemporal interval categories of continuous accidents, the method can be executed by a device for predicting the spatiotemporal interval of continuous accidents provided by an embodiment of the present invention, the device can be implemented in software and / or hardware, in specific applications, the device can be a terminal such as a desktop computer, a laptop computer, a smart phone, a personal digital assistant, a tablet computer, etc. The method for predicting the spatiotemporal interval of continuous accidents includes the following steps:

[0061] Step S101, identify the acquired historical traffic accident set to obtain a primary accident set and a secondary accident set; the historical traffic accident includes at least a location and a time, the primary accident set includes at least one primary accident, and the secondary accident set includes at least one secondary accident corresponding to each primary accident.

[0062] Optionally, the historical traffic accident set may be a set of historical traffic accidents that occurred on highways or urban roads within a certain period of time. For example, the historical traffic accident set may include historical traffic accidents that occurred on a certain highway in the past two years. For each historical traffic accident, at least the location where the traffic accident occurred (hereinafter referred to as location) and the time of occurrence (hereinafter referred to as time) need to be included. Of course, the type of accident vehicle, weather and other information may also be included. Among them, the location where the traffic accident occurred can be specifically determined in combination with the road where the traffic accident occurred, such as 10 km from north to south on the A to B highway, etc. The time when the traffic accident occurred can be a certain year, month, day, hour, and minute, etc.

[0063] Optionally, since there is a correlation between the primary accident and the corresponding secondary accident, such as close location and time, the primary accident set and the secondary accident set can be obtained by identifying the acquired historical traffic accident set. In this embodiment, the secondary accident is identified by combining the static spatiotemporal fixed threshold method and the dynamic speed profile method, so as to quickly and accurately identify the secondary accident from a large number of accidents. Among them, the candidate primary accident set and the candidate secondary accident set are first determined from the historical traffic accident set by the spatiotemporal fixed threshold method, and then the primary accident set and the secondary accident set are determined from the candidate primary accident set and the candidate secondary accident set by the speed profile method.

[0064] In one implementation, the step of identifying the acquired historical traffic accident set to obtain the primary accident set and the secondary accident set includes:

[0065] According to the location and time of each historical traffic accident in the historical traffic accident set, the historical traffic accidents are selected based on preset location conditions and preset time conditions to determine a candidate primary accident set and a candidate secondary accident set;

[0066] The method based on the speed profile map is used to filter the candidate primary accident set and the candidate secondary accident set to determine the primary accident set and the secondary accident set.

[0067] Among them, the preset location condition and the preset time condition can be set according to actual needs. For example, the preset location condition can be set as a distance interval less than or equal to a preset distance threshold, and the preset time condition can be set as a time interval less than or equal to a preset time threshold, etc. For any two historical traffic accidents in the historical traffic accident set, it can be determined whether one of them is a candidate for the first accident and whether the other is a candidate for the second accident based on the preset location condition and the preset time condition. Since the candidate first accident and candidate second accident determined by the static time-space fixed threshold method may not be accurate enough, it is necessary to combine the dynamic speed profile method for filtering to accurately obtain the first accident set and the second accident set.

[0068] In this way, the method based on static spatiotemporal fixed threshold is easy to implement and can quickly obtain recognition results, while the method based on dynamic speed profile has the characteristics of high recognition accuracy but long time consumption. By combining the static spatiotemporal fixed threshold method with the dynamic speed profile method to identify secondary accidents, it is possible to quickly and accurately identify secondary accidents from a large number of accidents.

[0069] In one embodiment, the selecting of historical traffic accidents based on the location and time of each historical traffic accident in the historical traffic accident set and the preset location condition and the preset time condition to determine the candidate primary accident set and the candidate secondary accident set includes:

[0070] Determine the first historical traffic accident from the historical traffic accident set, where the first historical traffic accident is any historical traffic accident;

[0071] For any second historical traffic accident in the historical traffic accident set that is different from the first historical traffic accident, detect whether the second historical traffic accident is located upstream of the first historical traffic accident based on location and time, whether the distance interval is less than or equal to the preset distance threshold, and whether the time interval is less than or equal to the preset time threshold. If so, add the first historical traffic accident to the candidate primary accident set, and add the second historical traffic accident to the candidate secondary accident set.

[0072] Specifically, first, any historical traffic accident can be selected from the historical traffic accident set as the first historical traffic accident; then, the first historical traffic accident is compared with the remaining historical traffic accidents in the historical traffic accident set one by one, that is, the first historical traffic accident is compared with each second historical traffic accident in the historical traffic accident set, so as to detect whether the second historical traffic accident is located upstream of the first historical traffic accident, whether the distance interval is less than or equal to the preset distance threshold, and whether the time interval is less than or equal to the preset time threshold according to the positions and times corresponding to the first historical traffic accident and the second historical traffic accident respectively; if the position of the second historical traffic accident is located upstream of the position of the first historical traffic accident, the distance interval is less than or equal to the preset distance threshold, and the time interval is less than or equal to the preset time threshold, then the first historical traffic accident is added to the candidate primary accident set, and the second historical traffic accident is added to the candidate secondary accident set as the candidate secondary accident corresponding to the first historical traffic accident, and this operation is repeated until each historical traffic accident in the historical traffic accident set has been processed as the first historical traffic accident.

[0073] It should be noted that the second historical traffic accident being located upstream of the first historical traffic accident means that the location of the second historical traffic accident is the location that the vehicle corresponding to the first historical traffic accident passed before the traffic accident occurred. The distance interval between the first historical traffic accident and the second historical traffic accident can be obtained based on the location of the first historical traffic accident and the location of the second historical traffic accident, and the time interval between the first historical traffic accident and the second historical traffic accident can be obtained based on the time of the first historical traffic accident and the time of the second historical traffic accident, which will not be repeated here.

[0074] That is to say, the process of identifying secondary accidents based on the static time-space fixed threshold method can be summarized as follows: for any accident i, compare accident i with other accidents j. If the time-space relationship between the two meets the predefined time-space threshold, and j occurs upstream of i, then j is identified as a candidate secondary accident of i. Taking the historical traffic accident set as a highway accident set as an example, the method of identifying secondary accidents based on the static time-space fixed threshold method may include the following steps:

[0075] Step S201: Collect and clean highway accident data to obtain a highway accident set.

[0076] Step S202: extract accident i from the highway accident set.

[0077] Here, the highway accident set may include / accidents, and may be marked as accidents i=1, 2, 3...I in sequence.

[0078] Step S203: Take accident j from the highway accident set, where j is not equal to i.

[0079] Step S204, determine whether accident j is located upstream of accident i, if so, execute step S205, otherwise execute step S207.

[0080] Step S205: Determine t j -t i ≤T threshold and|d j -d i |≤D threshold Is it established? If so, execute step S206; otherwise, execute step S207.

[0081] Here, t j represents the time when accident j occurs, i i represents the time when accident i occurred, d j represents the location where accident j occurred, d i represents the location where accident i occurs, T threshold represents the time threshold, D threshold Indicates the distance threshold.

[0082] Step S206: store accident i into a candidate primary accident set, and store accident j into a candidate secondary accident set.

[0083] Step S207, determine whether j is equal to or greater than J, if so, execute step S208, otherwise execute step S210.

[0084] Here, J represents the total number of accidents in the highway accident set except accident i.

[0085] Step S208, determine whether i is equal to or greater than I, if so, execute step S209, otherwise execute step S211.

[0086] Step S209, end.

[0087] Step S210, control j=j+1.

[0088] Step S211, control i=i+1.

[0089] Among them, the method based on the speed profile map is used to filter the candidate primary accident set and the candidate secondary accident set in order to accurately extract the primary accident and the secondary accident corresponding to the primary accident to obtain the primary accident set and the secondary accident set.

[0090] In one embodiment, the method based on the speed profile map filters the candidate primary accident set and the candidate secondary accident set to determine the primary accident set and the secondary accident set, including:

[0091] Determine a target candidate primary accident from the candidate primary accident set, where the target candidate primary accident is any candidate primary accident and does not belong to the candidate secondary accident set;

[0092] According to the target position and target time of the target candidate's first accident, the speed profile of the target candidate's first accident is obtained; the speed profile of the target candidate's first accident is obtained by sampling the average speed of vehicles collected within a preset distance upstream and downstream of the target position based on a preset time interval, with the time point at a preset time length before the target time as the sampling start point and the time point at a preset time length after the target time as the sampling end point:

[0093] Obtain the historical average speed, which is the average speed corresponding to each sampling point in the year of the target time, with the time point at the preset time length before the target time as the sampling start point and the time point at the preset time length after the target time as the sampling end point. After sampling the average speed of vehicles collected within the preset distance upstream and downstream of the target location based on the preset time interval, the average speed is obtained;

[0094] Subtract the historical average speed from the speed profile of the target candidate first accident to determine the impact area of ​​the target candidate first accident:

[0095] Detect whether the location of the target candidate secondary accident is within the influence area of ​​the target candidate primary accident. If so, add the target candidate primary accident to the primary accident set, and add the target candidate secondary accident to the secondary accident set; wherein the target candidate secondary accident is any candidate secondary accident in the candidate secondary accident set that corresponds to the target candidate primary accident.

[0096] Specifically, first, any candidate primary accident that does not belong to the candidate secondary accident set can be selected from the candidate primary accident set as the target candidate primary accident; then, taking the time point at a preset time length before the target time of the target candidate primary accident as the sampling start point, and taking the time point at a preset time length after the target time as the sampling end point, based on the preset time interval, the average speed of vehicles collected within a preset distance upstream and downstream of the target position of the target candidate primary accident is sampled to obtain a speed profile of the target candidate primary accident; then, within the year of the target time, taking the time point at a preset time length before the target time as the sampling start point, and taking the time point at a preset time length after the target time as the sampling end point, based on the preset time interval, the average speed of vehicles collected within a preset distance upstream and downstream of the target position The average speed of vehicles collected within a preset distance of the tour is sampled, and the average speed corresponding to each sampling point is taken as the historical average speed; then, the historical average speed is subtracted from the speed profile of the target candidate primary accident to determine the impact area of ​​the target candidate primary accident; then, each candidate secondary accident corresponding to the target candidate primary accident in the candidate secondary accident set, that is, the target candidate secondary accident, is detected to detect whether the location of the target candidate secondary accident is located in the impact area of ​​the target candidate primary accident. If so, the target candidate primary accident is added to the primary accident set, and the target candidate secondary accident is added to the secondary accident set. This operation is repeated until each candidate primary accident in the candidate primary accident set has been processed as the target candidate primary accident.

[0097] It should be noted that the preset duration, preset distance and preset time interval can be set according to actual needs, for example, the preset duration can be set to 6 hours, the preset distance can be set to 10 kilometers, the preset time interval can be set to 5 minutes, etc. A plurality of speed detection devices can be set within the preset distance upstream and downstream of the target position, and the average speed of all vehicles passing the position where the speed detection device is located at each time point can be obtained through each speed detection device.

[0098] That is to say, the principle of identifying secondary accidents based on the dynamic speed profile method is to divide the road into grid units and obtain the speed of the grid unit to determine whether the grid is affected by the accident. The speed profile method determines the affected time and space range through the following formula, that is,

[0099]

[0100] Among them, V (t,L) represents the velocity of the Lth grid at the tth time interval, Indicates the reference speed of the Lth grid at the tth time interval (usually the historical average speed). If the grid is affected, it means that the grid is affected, otherwise it means that it is not affected.

[0101] The method for identifying secondary accidents based on a dynamic speed profile may include the following steps:

[0102] Step S301: select accident k from the candidate primary accident set, and select accident k′ from the candidate secondary accident set.

[0103] Step S302: Obtain the speed V of accident k every 5 minutes acci , generate the speed contour map of accident k.

[0104] The speed data is extracted from speed detectors within 10 km upstream and 10 km downstream of the accident k, and the time range is 6 hours before and 6 hours after the accident k. In order to eliminate the impact of frequent congestion, the traffic speed should be compared with the accident location in the same time range and distance range under normal traffic conditions.

[0105] Step S303: Obtain the historical average speed V in the time and space range corresponding to the accident k norm .

[0106] Specifically, the speed data of every 5 minutes in the same time window and the same distance range as in step S302 under normal traffic conditions are extracted. In order to ensure the representativeness of normal speed, the data of one year with a date range of the year when the accident k occurred is selected to obtain the historical average speed.

[0107] Step S304: Control V acci -V norm , obtain the speed contour map of accident k that eliminates frequent congestion.

[0108] Here, in order to eliminate the potential impact of frequent congestion, the speed data V at each time and place in step S302 is used. acci Subtract the historical average speed V in step S303 norm When the speed difference is less than 0, the grid is considered to be affected by the accident, and a new speed contour map is obtained.

[0109] Step S305 , based on the speed profile of accident k, determine whether accident k′ is a secondary accident of accident k, if so, execute step S306 , otherwise execute step S307 .

[0110] Here, based on the speed profile of accident k, it can be determined whether the candidate secondary accident, ie, accident k', falls within the influence area of ​​accident k. If so, step S306 is executed, otherwise, step S307 is executed.

[0111] Step S306: store accident k into the primary accident set, and store accident k' into the secondary accident set.

[0112] Step S307, determine whether k is equal to or greater than K, if so, execute step S308, otherwise execute step S309.

[0113] Here, K represents the number of candidate first accidents in the candidate first accident set.

[0114] Step S308, end.

[0115] Step S309, control k=k+1.

[0116] Step S102: According to a preset time-space interval classification rule, the time-space interval category between each primary accident and each corresponding secondary accident is determined based on location and time.

[0117] Among them, the preset space-time interval classification rules can be determined based on the analysis of historical traffic accident data. In this embodiment, the space-time interval categories are divided according to the ratio of the distance interval to the time interval between the first accident and the corresponding second accident. The ratio reveals the characteristics between the location and time of the secondary collision, that is, the time interval and distance interval are converted into classification characteristics, and the space-time interval categories between the first accident and the corresponding second accident are divided into five categories. Specifically, the ratio r ranges used in this embodiment are: r>4, r∈(2,4], r∈(0.5,2], r∈(0.25,0.5] and r∈(0,0.25], and the corresponding space-time interval categories are: ultra-short time interval category, short time interval-long distance interval category, long time interval-long distance interval category, long time interval-short distance interval category and ultra-short distance interval category.

[0118] See also Figure 2 , is a schematic diagram of the distribution of each time-space interval category with time interval as the horizontal axis and distance interval as the vertical axis.

[0119] (1) Ultra-short time interval class: This class is defined as r>4. Figure 2 As shown in the first circle on the left, a very short time interval is an important feature of this type, indicating that the second accident occurred within a short period of time after the first accident.

[0120] (2) Short time interval-long distance interval class: This class is obtained by using the ratio range (2,4]. It has similar but less significant characteristics to the ultra-short time interval class, in which the short feature of the time interval is weakened.

[0121] (3) Long time interval-long distance interval class: divided by the ratio range (0.50, 2], long time intervals and long distance intervals may appear in this class at the same time.

[0122] (4) Long time interval-short distance interval category: The ratio range of this category is (0.25, 0.50). Long time intervals and short distance intervals appear together in this category, and the characteristics of these two categories show opposite characteristics to a certain extent compared with the short time interval-long distance interval category.

[0123] (5) Ultra-short distance interval class: The ratio range of this class is [0, 0.25]. The ultra-long distance interval is the most important feature, which means that the secondary accident occurs at a closer location. This class shows the opposite properties to the ultra-short time interval class.

[0124] Step S103, based on the set of primary accidents, the set of secondary accidents, and the time-space interval categories between each primary accident and each corresponding secondary accident, the Stacking integration model is trained to obtain a trained Stacking integration model; the Stacking integration model includes at least two basic estimators of the first layer and a combiner of the second layer.

[0125] Among them, the Stacking model is a hierarchical structure, which usually consists of two layers. The first layer is used to extract features from the original data set, and the second layer is used to synthesize the training results of the first layer to obtain the final prediction results. Specifically, the first layer includes several complex and advanced basic estimator models, which need to meet two requirements: high diversity and high accuracy. The number and type of basic estimators can be set according to actual needs. In this embodiment, random forest (RF), gradient boosting decision tree (GBDT) and extreme gradient boosting method (XGBoost) are selected as the basic estimators of the first layer. Among them, these three methods are universal and robust by combining multiple learners, but their driving principles are completely different. In short, the RF model averages the predictions of several independent learners and reduces the variance in this way. In contrast, in GBDT and XGBoost models, the basic learners are established in sequence, and as their number increases, the deviation of the prediction will gradually decrease. GBDT and XGBoost differ in basic estimators, loss functions, complexity control, etc. As for the second layer, a simple model is generally used to prevent overfitting. The Logistic Regression method (LR) is widely recognized for its simple structure, good fitting effect, and strong noise resistance. In addition, it can also adjust L2 regularization to prevent overfitting. Therefore, the LR model is selected as the combiner of the second layer in this embodiment.

[0126] In one embodiment, the Stacking integration model is trained based on the primary accident set, the secondary accident set, and the time-space interval category between each primary accident and each corresponding secondary accident to obtain the trained Stacking integration model, including:

[0127] The data set consisting of the initial accident set, the secondary accident set, and the time-space interval categories between each initial accident and each corresponding secondary accident is divided into a training set and a test set;

[0128] Based on the training set, the RF model, the GBDT model and the XGBoost model are respectively constructed, and the RF model, the GBDT model and the XGBoost model are tuned based on the test set, and the first prediction probability of the RF model, the GBDT model and the XGBoost model for the training set and the second prediction probability for the test set are obtained respectively; wherein the first prediction probability and the second prediction probability are used to indicate the probability of belonging to which type of space-time interval category;

[0129] The LR model is constructed based on the first predicted probability and the space-time interval category corresponding to the training set, and the LR model is optimized based on the second predicted probability and the space-time interval category corresponding to the test set.

[0130] Among them, for each primary accident in the primary accident set, each secondary accident corresponding to the primary accident is determined from the secondary accident set, and the primary accident, any secondary accident corresponding to the primary accident, and the time-space interval category between the primary accident and the corresponding secondary accident are taken as a data sample, and the time-space interval category between the primary accident and the corresponding secondary accident is the sample label of the data sample. It should be noted that since a primary accident may correspond to multiple secondary accidents, a primary accident may correspond to multiple data samples, and the secondary accidents in each data sample are different.

[0131] Among them, the data set includes multiple data samples, and the data set can be divided into a training set and a test set in a random manner and according to a preset ratio. For example, assuming that the data set includes 300 data samples, the data set can be divided in a ratio of 2:1 between the training set and the test set, so that 200 data samples are randomly divided into the training set as training samples, and the remaining 100 data samples are divided into the test set as test samples.

[0132] Among them, when constructing the RF model, GBDT model and XGBoost model based on the training set, the first accident and the secondary accident corresponding to the first accident in the training sample are used as input variables, and the time-space interval category between the first accident and the corresponding secondary accident in the training sample is used as the output variable, so as to construct the model based on the input variables and the output variables, respectively, so as to construct the RF model, GBDT model and XGBoost model. Then, when the RF model, GBDT model and XGBoost model are tuned based on the test set, the prediction results generated by the constructed RF model, GBDT model and XGBoost model based on the input variables of the test sample are compared with the output variables of the test sample, so as to adjust the model parameters of the above models according to the comparison results and continue training. Here, the first prediction probability of the training set and the second prediction probability of the test set of the RF model, GBDT model and XGBoost model respectively refer to the first prediction probability of the training set and the second prediction probability of the test set of the RF model, GBDT model and XGBoost model after model tuning.

[0133] Among them, when constructing the LR model based on the first predicted probability and the space-time interval category corresponding to the training set, the vector composed of the first predicted probability of the training set by the RF model, GBDT model and XGBoost model is used as the input variable of the LR model, and the space-time interval category corresponding to the training set is used as the output variable of the LR model to construct the LR model. When the LR model is tuned based on the second predicted probability and the space-time interval category corresponding to the test set, the vector composed of the second predicted probability of the test set by the RF model, GBDT model and XGBoost model is used as the input variable of the LR model, and the corresponding prediction results are compared with the space-time interval category corresponding to the test set, and the model parameters of the LR model are adjusted accordingly according to the comparison results and the training continues. Among them, the first predicted probability and the second predicted probability are used to indicate the probability of belonging to which space-time interval category.

[0134] In simple terms, the training process of the Stacking model is as follows: the training data set (also called training sample set) and the test data set (also called test sample set) separated from the original data set are sent to the RF model, GBDT model and XGBoost model of the first layer; after the RF model, GBDT model and XGBoost model train the training data set, the prediction probabilities of the above models for the training sample set are output respectively [P 1 , P 2 , P 3 ] and the predicted probability of the test sample set [T 1 , T 2 , T 3 ]; then, [P1 , P 2 , P 3 ] and [T 1 , T 2 , T 3 ] is combined with sample labels to train and test the LR model respectively, that is, the training set of the LR model input is [P 1 , P 2 , P 3 ], the test set of LR model input is [T 1 , T 2 , T 3 ], the sample labels of the training set and test set input to the LR model are the labels of the original training data set and test data set. Finally, the final result of the Stacking model is based on the test result of the LR model.

[0135] Step S104: input the target initial accident to be predicted into the trained Stacking integration model to obtain the target space-time interval category between the target initial accident and the corresponding target secondary accident output by the trained Stacking integration model.

[0136] Here, when it is necessary to know the time-space interval category between any first accident and the corresponding second accident, the target first accident to be predicted is input into the trained Stacking integration model to obtain the target time-space interval category between the target first accident and the corresponding target second accident output by the trained Stacking integration model, thereby realizing the prediction of the time-space interval. Among them, the target first accident input into the trained Stacking integration model may include relevant features of the target first accident, such as time, location, accident severity, parameters of vehicles involved in the accident, weather, etc.

[0137] In summary, the method for predicting the time-space interval between consecutive accidents provided in the above embodiments can accurately and quickly predict the time-space interval between a secondary accident and a primary accident, which helps to formulate effective traffic management measures in a timely manner, reduce traffic accidents, and improve traffic operation efficiency.

[0138] The above examples are only reference examples. In order to avoid redundancy, they are not listed one by one here. In actual development or application, they can be flexibly combined according to actual needs, but any combination belongs to the technical solution of this application and is covered within the scope of protection of this application.

[0139] Based on the same inventive concept as the above embodiments, see Figure 3 , which shows the composition of a prediction device for continuous accident time-space interval provided by an embodiment of the present invention, which may include:

[0140] An identification module is used to identify the acquired historical traffic accident set to obtain a primary accident set and a secondary accident set; the historical traffic accident includes at least a location and a time, the primary accident set includes at least one primary accident, and the secondary accident set includes at least one secondary accident corresponding to each primary accident;

[0141] A classification module, for determining the time-space interval category between each primary accident and each corresponding secondary accident based on location and time according to a preset time-space interval classification rule;

[0142] A processing module, used for training the Stacking ensemble model based on the primary accident set, the secondary accident set and the time-space interval category between each primary accident and each corresponding secondary accident, to obtain a trained Stacking ensemble model; the Stacking ensemble model includes at least two basic estimators of the first layer and a combiner of the second layer;

[0143] The prediction module is used to input the target initial accident to be predicted into the trained Stacking integration model to obtain the target space-time interval category between the target initial accident and the corresponding target secondary accident output by the trained Stacking integration model.

[0144] In summary, the device for predicting the time-space interval between consecutive accidents provided in the above embodiments can accurately and quickly predict the time-space interval between a secondary accident and a primary accident, which helps to formulate effective traffic management measures in a timely manner, reduce traffic accidents, and improve traffic operation efficiency.

[0145] for Figure 3 In the technical solution shown, in a possible implementation manner, the identification module is specifically used to:

[0146] According to the location and time of each historical traffic accident in the historical traffic accident set, the historical traffic accidents are selected based on preset location conditions and preset time conditions to determine a candidate primary accident set and a candidate secondary accident set;

[0147] The method based on the speed profile map is used to filter the candidate primary accident set and the candidate secondary accident set to determine the primary accident set and the secondary accident set.

[0148] for Figure 3 In the technical solution shown, in a possible implementation manner, the identification module is specifically used to:

[0149] Determine the first historical traffic accident from the historical traffic accident set, where the first historical traffic accident is any historical traffic accident;

[0150] For any second historical traffic accident in the historical traffic accident set that is different from the first historical traffic accident, detect whether the location of the second historical traffic accident is upstream of the first historical traffic accident, whether the distance interval is less than or equal to the preset distance threshold, and whether the time interval is less than or equal to the preset time threshold. If so, add the first historical traffic accident to the candidate primary accident set, and add the second historical traffic accident to the candidate secondary accident set.

[0151] for Figure 3 In the technical solution shown, in a possible implementation manner, the identification module is specifically used to:

[0152] Determine a target candidate primary accident from the candidate primary accident set, where the target candidate primary accident is any candidate primary accident and does not belong to the candidate secondary accident set;

[0153] According to the target position and target time of the target candidate first accident, a speed profile of the target candidate first accident is obtained; the speed profile of the target candidate first accident is obtained by sampling the average speed of vehicles collected within a preset distance upstream and downstream of the target position based on a preset time interval, with a time point at a preset time length before the target time as a sampling start point and a time point at a preset time length after the target time as a sampling end point;

[0154] Obtain the historical average speed, which is the average speed corresponding to each sampling point in the year of the target time, with the time point at the preset time length before the target time as the sampling start point and the time point at the preset time length after the target time as the sampling end point. After sampling the average speed of vehicles collected within the preset distance upstream and downstream of the target location based on the preset time interval, the average speed is obtained;

[0155] Subtract the historical average speed from the speed profile of the target candidate first accident to determine the impact area of ​​the target candidate first accident;

[0156] Detect whether the location of the target candidate secondary accident is within the influence area of ​​the target candidate primary accident. If so, add the target candidate primary accident to the primary accident set, and add the target candidate secondary accident to the secondary accident set; wherein the target candidate secondary accident is any candidate secondary accident in the candidate secondary accident set that corresponds to the target candidate primary accident.

[0157] for Figure 3 In the technical solution shown in the figure, in a possible implementation, the first layer of the Stacking integrated model includes the RF model, the GBDT model and the XGBoost model, and the second layer includes the LR model; the processing module is specifically used for:

[0158] The data set consisting of the initial accident set, the secondary accident set, and the time-space interval categories between each initial accident and each corresponding secondary accident is divided into a training set and a test set;

[0159] Based on the training set, the RF model, the GBDT model and the XGBoost model are respectively constructed, and the RF model, the GBDT model and the XGBoost model are tuned based on the test set, and the first prediction probability of the RF model, the GBDT model and the XGBoost model for the training set and the second prediction probability for the test set are obtained respectively; wherein the first prediction probability and the second prediction probability are used to indicate the probability of belonging to which type of space-time interval category;

[0160] The LR model is constructed based on the first predicted probability and the space-time interval category corresponding to the training set, and the LR model is optimized based on the second predicted probability and the space-time interval category corresponding to the test set.

[0161] It should be noted that: the prediction device for the spatiotemporal interval of continuous accidents provided in the above embodiment only uses the division of the above program modules as an example to illustrate when implementing the prediction method for the spatiotemporal interval of continuous accidents. In actual applications, the above processing can be assigned to different program modules as needed, that is, the internal structure of the vehicle identification device is divided into different program modules to complete all or part of the processing described above. In addition, the prediction device for the spatiotemporal interval of continuous accidents provided in the above embodiment and the corresponding prediction method for the spatiotemporal interval of continuous accidents belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.

[0162] An embodiment of the present application also provides a device for predicting the temporal and spatial intervals of continuous accidents, comprising: a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the steps of the above method are implemented.

[0163] An embodiment of the present application further provides a storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.

[0164] In the embodiments of the device and storage medium for predicting the spatiotemporal interval of continuous accidents provided in the present application, all technical features of any of the above-mentioned embodiments of the method for predicting the spatiotemporal interval of continuous accidents may be included, and the expanded and explained contents of the specification are basically the same as those of the embodiments of the above-mentioned methods, and will not be repeated here.

[0165] The embodiment of the present application further provides a computer program product, which includes a computer program code. When the computer program code runs on a computer, the computer executes the methods in the above various possible implementation modes.

[0166] An embodiment of the present application also provides a chip, including a memory and a processor, the memory is used to store a computer program, and the processor is used to call and run the computer program from the memory, so that a device equipped with the chip executes the methods in various possible implementation modes as described above.

[0167] It is understood that the above scenarios are only examples and do not constitute a limitation on the application scenarios of the technical solutions provided in the embodiments of the present application. The technical solutions of the present application can also be applied to other scenarios. For example, it is known to those skilled in the art that with the evolution of the system architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0168] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0169] The steps in the method of the embodiment of the present application can be adjusted in order, combined and deleted according to actual needs.

[0170] The units in the device of the embodiment of the present application can be merged, divided and deleted according to actual needs.

[0171] In the present application, the same or similar terminology concepts, technical solutions and / or application scenario descriptions are generally described in detail only the first time they appear. When they appear again later, they are generally not repeated for the sake of brevity. When understanding the technical solutions and other contents of the present application, for the same or similar terminology concepts, technical solutions and / or application scenario descriptions that are not described in detail later, reference can be made to the previous related detailed descriptions.

[0172] In the present application, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0173] The various technical features of the technical solution of the present application can be arbitrarily combined. In order to make the description concise, not all possible combinations of the various technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of the present application.

[0174] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as above, and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, a controlled terminal, or a network device, etc.) to execute the method of each embodiment of the present application.

[0175] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loading and executing computer program instructions on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. Computer instructions can be stored in a storage medium, or transmitted from one storage medium to another storage medium. For example, computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integration. Available media can be magnetic media, (e.g., floppy disk, storage disk, tape), optical media (e.g., DVD), or semiconductor media (e.g., solid-state storage disk Solid State Disk (SSD)), etc.

[0176] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A method for predicting the time interval of continuous accidents, characterized in that: The method comprises: Identify the acquired historical traffic accident set to obtain a primary accident set and a secondary accident set; the historical traffic accident includes at least a location and a time, the primary accident set includes at least one primary accident, and the secondary accident set includes at least one secondary accident corresponding to each primary accident; According to a preset time-space interval classification rule, the time-space interval category between each primary accident and each corresponding secondary accident is determined based on location and time; Based on the initial accident set, the secondary accident set and the time-space interval category between each initial accident and each corresponding secondary accident, the Stacking ensemble model is trained to obtain a trained Stacking ensemble model; the Stacking ensemble model includes at least two basic estimators of the first layer and a combiner of the second layer; The target first accident to be predicted is input into the trained Stacking ensemble model to obtain the target space-time interval category between the target first accident and the corresponding target second accident output by the trained Stacking ensemble model.

2. The method according to claim 1, characterized in that The step of identifying the acquired historical traffic accident set to obtain the primary accident set and the secondary accident set includes: According to the location and time of each historical traffic accident in the historical traffic accident set, the historical traffic accidents are selected based on preset location conditions and preset time conditions to determine a candidate primary accident set and a candidate secondary accident set; The method based on the speed profile map is used to filter the candidate primary accident set and the candidate secondary accident set to determine the primary accident set and the secondary accident set.

3. The method according to claim 2, characterized in that The selecting of historical traffic accidents based on the location and time of each historical traffic accident in the historical traffic accident set and the preset location condition and the preset time condition to determine the candidate primary accident set and the candidate secondary accident set includes: Determine the first historical traffic accident from the historical traffic accident set, where the first historical traffic accident is any historical traffic accident; For any second historical traffic accident in the historical traffic accident set that is different from the first historical traffic accident, detect whether the second historical traffic accident is located upstream of the first historical traffic accident based on location and time, whether the distance interval is less than or equal to the preset distance threshold, and whether the time interval is less than or equal to the preset time threshold. If so, add the first historical traffic accident to the candidate primary accident set, and add the second historical traffic accident to the candidate secondary accident set.

4. The method according to claim 2, characterized in that The method based on the speed profile map filters the candidate primary accident set and the candidate secondary accident set to determine the primary accident set and the secondary accident set, including: Determine a target candidate primary accident from the candidate primary accident set, where the target candidate primary accident is any candidate primary accident and does not belong to the candidate secondary accident set; According to the target position and target time of the target candidate first accident, a speed profile of the target candidate first accident is obtained; the speed profile of the target candidate first accident is obtained by sampling the average speed of vehicles collected within a preset distance upstream and downstream of the target position based on a preset time interval, with a time point at a preset time length before the target time as a sampling start point and a time point at a preset time length after the target time as a sampling end point; Obtain the historical average speed, which is the average speed corresponding to each sampling point in the year of the target time, with the time point at the preset time length before the target time as the sampling start point and the time point at the preset time length after the target time as the sampling end point. After sampling the average speed of vehicles collected within the preset distance upstream and downstream of the target location based on the preset time interval, the average speed is obtained; Subtract the historical average speed from the speed profile of the target candidate first accident to determine the impact area of ​​the target candidate first accident; Detect whether the location of the target candidate secondary accident is within the influence area of ​​the target candidate primary accident. If so, add the target candidate primary accident to the primary accident set, and add the target candidate secondary accident to the secondary accident set; wherein the target candidate secondary accident is any candidate secondary accident in the candidate secondary accident set that corresponds to the target candidate primary accident.

5. The method according to claim 1, characterized in that The first layer of the Stacking ensemble model includes the RF model, GBDT model, and XGBoost model, and the second layer includes the LR model; The Stacking integration model is trained based on the initial accident set, the secondary accident set, and the time-space interval category between each initial accident and each corresponding secondary accident to obtain the trained Stacking integration model, including: The data set consisting of the initial accident set, the secondary accident set, and the time-space interval categories between each initial accident and each corresponding secondary accident is divided into a training set and a test set; Based on the training set, the RF model, the GBDT model and the XGBoost model are respectively constructed, and the RF model, the GBDT model and the XGBoost model are tuned based on the test set, and the first prediction probability of the RF model, the GBDT model and the XGBoost model for the training set and the second prediction probability for the test set are obtained respectively; wherein the first prediction probability and the second prediction probability are used to indicate the probability of belonging to which type of space-time interval category; The LR model is constructed based on the first predicted probability and the space-time interval category corresponding to the training set, and the LR model is optimized based on the second predicted probability and the space-time interval category corresponding to the test set.

6. A device for predicting the time interval of continuous accidents, characterized in that: The device comprises: An identification module is used to identify the acquired historical traffic accident set to obtain a primary accident set and a secondary accident set; the historical traffic accident includes at least a location and a time, the primary accident set includes at least one primary accident, and the secondary accident set includes at least one secondary accident corresponding to each primary accident; A classification module, for determining the time-space interval category between each primary accident and each corresponding secondary accident based on location and time according to a preset time-space interval classification rule; A processing module, used for training the Stacking ensemble model based on the primary accident set, the secondary accident set and the time-space interval category between each primary accident and each corresponding secondary accident, to obtain a trained Stacking ensemble model; the Stacking ensemble model includes at least two basic estimators of the first layer and a combiner of the second layer; The prediction module is used to input the target initial accident to be predicted into the trained Stacking integration model to obtain the target space-time interval category between the target initial accident and the corresponding target secondary accident output by the trained Stacking integration model.

7. The device according to claim 6, characterized in that The identification module is specifically used for: According to the location and time of each historical traffic accident in the historical traffic accident set, the historical traffic accidents are selected based on preset location conditions and preset time conditions to determine a candidate primary accident set and a candidate secondary accident set; The method based on the speed profile map is used to filter the candidate primary accident set and the candidate secondary accident set to determine the primary accident set and the secondary accident set.

8. The device according to claim 6, characterized in that The first layer of the Stacking ensemble model includes the RF model, the GBDT model and the XGBoost model, and the second layer includes the LR model; the processing module is specifically used for: The data set consisting of the initial accident set, the secondary accident set, and the time-space interval categories between each initial accident and each corresponding secondary accident is divided into a training set and a test set; Based on the training set, the RF model, the GBDT model and the XGBoost model are respectively constructed, and the RF model, the GBDT model and the XGBoost model are tuned based on the test set, and the first prediction probability of the RF model, the GBDT model and the XGBoost model for the training set and the second prediction probability for the test set are obtained respectively; wherein the first prediction probability and the second prediction probability are used to indicate the probability of belonging to which type of space-time interval category; The LR model is constructed based on the first predicted probability and the space-time interval category corresponding to the training set, and the LR model is optimized based on the second predicted probability and the space-time interval category corresponding to the test set.

9. A device for predicting the time interval of continuous accidents, characterized in that: include: A memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the steps of the method for predicting the continuous accident time-space interval as described in any one of claims 1 to 5 are implemented.

10. A storage medium, characterized in that: The storage medium stores a computer program, which, when executed by a processor, implements the steps of the method for predicting the spatiotemporal interval of continuous accidents as claimed in any one of claims 1 to 5.