A road traffic accident spatial clustering optimization method, system, device and medium
Patent Information
- Application Number
- CN202611486971.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-23
- Publication Date
- 2026-10-27
AI Technical Summary
[0003]现有道路事故离散空间聚类技术仅能生成少量初始组合,易受初始化状态与交换邻域限制,易陷入局部最优;且多采用均匀变异机制,搜索方向性不足,常规非支配更新规则下,同一中心数量下仅保留聚类代价最低的单解,难以留存质量接近但空间结构不同的优质组合,限制了算法的全局搜索潜力,导致整体搜索质量与运行效率难以兼顾
[0009]为实现上述目的,本发明实施例的第四方面提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机可执行指令,所述计算机可执行指令用于使计算机执行上述的一种道路交通事故空间聚类优化方法。
Smart Images

Figure CN122986558A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the interdisciplinary field of intelligent transportation and spatial data mining, and in particular to a method, system, device and medium for spatial clustering optimization of road traffic accidents. Background Technology
[0002] Spatial clustering analysis of road traffic accidents is a crucial foundational task in intelligent traffic management and traffic safety planning. With the development of road traffic monitoring, accident registration, and urban governance informatization, traffic management departments have accumulated a vast amount of records containing accident occurrence times, spatial coordinates, road conditions, and accident attributes. Spatial summarization of these numerous accident locations provides data support for identifying high-incidence accident areas, determining patrol priorities, analyzing emergency response coverage, and planning the deployment of traffic safety resources. This type of analysis typically falls under unsupervised clustering tasks and requires that the representative output locations be traceable back to actual accident records, rather than continuous mean centers.
[0003] Existing discrete spatial clustering techniques for road accidents can only generate a small number of initial combinations, are easily limited by the initial state and the exchange of neighborhoods, and are prone to getting trapped in local optima. Moreover, most of them adopt uniform mutation mechanisms, which lack search directionality. Under conventional non-dominated update rules, only the single solution with the lowest clustering cost is retained for the same number of centers, making it difficult to retain high-quality combinations with similar quality but different spatial structures. This limits the global search potential of the algorithm, making it difficult to balance the overall search quality and running efficiency. Summary of the Invention
[0004] The main objective of this application is to propose a spatial clustering optimization method, system, device, and storage medium for road traffic accidents, which can retain multiple high-quality candidate solutions through dual screening of quality and diversity, thereby improving the global search quality and diversity of discrete representative locations in the accident space.
[0005] A first aspect of this application provides a spatial clustering optimization method for road traffic accidents, the method comprising: Spatial coordinate information is extracted from each accident record in the historical traffic accident record data to construct a candidate location set, wherein the spatial coordinates of each traffic accident location in the candidate location set are different from each other; From the candidate location set, traffic accident locations are extracted to form multiple initial center combinations, and each initial center combination contains a different number of traffic accident locations; Sub-files are created for the different numbers of traffic accident locations, so that the multiple initial centers are combined and stored in the corresponding number of traffic accident locations in the sub-files. Based on each of the sub-files, multiple rounds of iterative search are performed until the number of iterations reaches a preset maximum number of iterations, at which point the iteration terminates. Target center combinations are determined from the sub-files corresponding to a preset number of targets, and discrete representative positions for the preset number of targets are obtained based on these target center combinations. These discrete representative positions are used to characterize representative positions of areas with high incidence of traffic accidents. The multiple rounds of iterative search include various search strategy stages, each with a different operator selection probability distribution. In each iteration of the multi-round iterative search, the following operations are performed: Based on the operator selection probability distribution and parent source probability corresponding to the current search strategy stage, parent center combinations are selected from each of the sub-files, and operations are performed on the parent center combinations to generate child center combinations. Calculate the cluster quality evaluation value of the offspring center combination; The sub-files corresponding to the number of traffic accident locations contained in the sub-center combination are subjected to quality screening and diversity screening to obtain the screening results; Update the sub-files corresponding to the number of traffic accident locations contained in the offspring center combination based on the filtering results.
[0006] The first aspect of this application provides a spatial clustering optimization method for road traffic accidents. This method extracts spatial coordinate information from each accident record in historical traffic accident data to construct a candidate location set. Traffic accident locations are extracted from the candidate location set to form multiple initial center combinations, each containing a different number of traffic accident locations. Sub-files are created for each different number of traffic accident locations, storing the multiple initial center combinations within the corresponding number of traffic accident locations. Multiple rounds of iterative search are performed based on each sub-file until the number of iterations reaches a preset maximum number of iterations, at which point the iteration terminates. Target center combinations are determined from the sub-files corresponding to a preset target number of locations, thereby obtaining a preset target number of discrete representative locations. This method can retain multiple high-quality candidate solutions through dual screening of quality and diversity, improving the global search quality and diversity of discrete representative locations in the accident space.
[0007] To achieve the above objectives, a second aspect of the present invention provides a spatial clustering optimization system for road traffic accidents, the system comprising: The extraction module is used to extract spatial coordinate information from each accident record in the historical traffic accident record data to construct a candidate location set, wherein the spatial coordinates of each traffic accident location in the candidate location set are different from each other; An extraction module is used to extract traffic accident locations from the candidate location set to form multiple initial center combinations, each of the initial center combinations containing a different number of traffic accident locations. A construction module is used to create sub-files for the different numbers of traffic accident locations, so as to combine and store the multiple initial centers into the corresponding number of traffic accident locations in the sub-files. The optimization module is used to perform multiple rounds of iterative search based on each of the sub-files until the number of iterations reaches a preset maximum number of iterations, and then terminates the iteration. It determines the target center combination from the sub-files corresponding to the preset number of targets, and obtains the discrete representative positions of the preset number of targets based on the target center combination. The discrete representative positions are used to characterize the representative positions of areas with high incidence of traffic accidents. The multiple rounds of iterative search are set with multiple search strategy stages, and the operator selection probability distributions corresponding to each search strategy stage are different. In each iteration of the multi-round iterative search, the following operations are performed: Based on the operator selection probability distribution and parent source probability corresponding to the current search strategy stage, parent center combinations are selected from each of the sub-files, and operations are performed on the parent center combinations to generate child center combinations. Calculate the cluster quality evaluation value of the offspring center combination; The sub-files corresponding to the number of traffic accident locations contained in the sub-center combination are subjected to quality screening and diversity screening to obtain the screening results; Update the sub-files corresponding to the number of traffic accident locations contained in the offspring center combination based on the filtering results.
[0008] To achieve the above objectives, a third aspect of the present invention provides an electronic device, comprising: at least one processor and a memory for communicatively connecting to the at least one processor; the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to execute the above-described spatial clustering optimization method for road traffic accidents.
[0009] To achieve the above objectives, a fourth aspect of the present invention provides a computer-readable storage medium storing computer-executable instructions for causing a computer to execute the above-described spatial clustering optimization method for road traffic accidents.
[0010] It is understood that the beneficial effects of the second to fourth aspects compared with the related technologies are the same as the beneficial effects of the first aspect compared with the related technologies. Please refer to the relevant description in the first aspect above, which will not be repeated here. Attached Figure Description
[0011] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which: Figure 1 This is a flowchart illustrating a spatial clustering optimization method for road traffic accidents provided in an embodiment of this application; Figure 2 This is a schematic diagram of the structure of a spatial clustering optimization system for road traffic accidents provided in an embodiment of this application; Figure 3 This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0012] The embodiments of this application are described in detail below. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application.
[0013] In the description of this application, the use of terms such as "first," "second," etc., is for the purpose of distinguishing technical features only and should not be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated or the order of the technical features indicated.
[0014] In the description of this application, it should be understood that the orientation descriptions, such as up, down, etc., are based on the orientation or positional relationship shown in the accompanying drawings, and are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this application.
[0015] In the description of this application, it should be noted that, unless otherwise explicitly defined, terms such as "setup," "installation," and "connection" should be interpreted broadly, and those skilled in the art can reasonably determine the specific meaning of the above terms in this application in conjunction with the specific content of the technical solution.
[0016] Spatial clustering analysis of road traffic accidents is a crucial foundational task in intelligent traffic management and traffic safety planning. With the development of road traffic monitoring, accident registration, and urban governance informatization, traffic management departments have accumulated a vast amount of records containing accident occurrence times, spatial coordinates, road conditions, and accident attributes. Spatial summarization of these numerous accident locations provides data support for identifying high-incidence accident areas, determining patrol priorities, analyzing emergency response coverage, and planning the deployment of traffic safety resources. This type of analysis typically falls under unsupervised clustering tasks and requires that the representative output locations be traceable back to actual accident records, rather than continuous mean centers.
[0017] Existing discrete spatial clustering techniques for road accidents can only generate a small number of initial combinations, are easily limited by the initial state and the exchange of neighborhoods, and are prone to getting trapped in local optima. Moreover, most of them adopt uniform mutation mechanisms, which lack search directionality. Under conventional non-dominated update rules, only the single solution with the lowest clustering cost is retained for the same number of centers, making it difficult to retain high-quality combinations with similar quality but different spatial structures. This limits the global search potential of the algorithm, making it difficult to balance the overall search quality and running efficiency.
[0018] Based on this, embodiments of this application provide a method, system, electronic device, and medium for optimizing spatial clustering of road traffic accidents, aiming to retain multiple high-quality candidate solutions through dual screening of quality and diversity, thereby improving the global search quality and diversity of discrete representative locations in the accident space.
[0019] The road traffic accident spatial clustering optimization method, system, electronic device and medium provided in the embodiments of this application are specifically described through the following embodiments. First, the road traffic accident spatial clustering optimization method in the embodiments of this application is described.
[0020] The embodiments of this application can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence (AI) refers to the theories, methods, technologies, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.
[0021] Foundational technologies for artificial intelligence generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies mainly encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.
[0022] The spatial clustering optimization method for road traffic accidents provided in this application relates to the interdisciplinary field of intelligent transportation and spatial data mining. This method can be applied to a terminal, a server, or software running on either a terminal or a server. In some embodiments, the terminal can be a smartphone, tablet, laptop, desktop computer, etc.; the server can be configured as an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application implementing the spatial clustering optimization method for road traffic accidents, but is not limited to the above forms.
[0023] This application can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0024] It should be noted that in all specific embodiments of this application, when processing data related to user identity or characteristics, such as user information, user behavior data, user historical data, and user location information, user permission or consent is obtained first. Furthermore, the collection, use, and processing of this data comply with relevant laws, regulations, and standards. In addition, when embodiments of this application require access to sensitive personal information of users, separate permission or consent from the user is obtained through pop-ups or redirection to confirmation pages. Only after obtaining the user's separate permission or consent is the necessary user-related data required for the proper functioning of these embodiments acquired.
[0025] Therefore, referring to Figure 1This application provides a spatial clustering optimization method for road traffic accidents. This method is applied to electronic devices, which can be servers, mobile terminals, etc., without specific limitations. The method includes the following steps S110 to S140.
[0026] Step S110: Extract spatial coordinate information from each accident record in the historical traffic accident record data to construct a candidate location set. The spatial coordinates of each traffic accident location in the candidate location set are different from each other.
[0027] In this step, the aforementioned historical traffic accident record data can be a collection of accident records accumulated by traffic management departments during the accident registration process, containing information on the location of the accidents. Specifically, each accident record in the historical traffic accident record data must at least include a spatial coordinate field of the accident location, and may also include attribute fields such as the accident time, accident severity, accident type, road conditions, and weather conditions. For example, the historical traffic accident record data could be a traffic accident registration form accumulated by a city's traffic management department over the past five years. Each record in this form includes fields such as accident number, accident date, longitude and latitude of the accident location, accident severity level, and accident type.
[0028] The aforementioned spatial coordinate information can be information used to characterize the coordinates of the accident location in a spatial coordinate system. Specifically, the spatial coordinate information can be two-dimensional planar coordinates or latitude and longitude coordinates. For example, the spatial coordinate information can be the abscissa and ordinate of the accident location in a national geodetic coordinate system, or it can be the longitude and latitude of the accident location.
[0029] The aforementioned candidate location set can be a set of locations consisting of the accident locations corresponding to each accident record in historical traffic accident record data. Specifically, the spatial coordinates of each accident location in the candidate location set are different; that is, there are no two accident locations in the candidate location set with exactly the same spatial coordinates. For example, for historical traffic accident record data containing 30,000 accident records, if there are records with the same coordinates at the same location, these records are merged into one accident location. The spatial coordinates of each accident location in the resulting candidate location set are different, but when calculating SSE, each accident record at the same location is still included in the calculation.
[0030] The specific implementation of this step may include: First, reading historical traffic accident record data and extracting the spatial coordinate information of each accident record; then, preprocessing the extracted spatial coordinate information, including deleting records with missing or non-limited coordinates, and deleting records with duplicate accident identifiers; finally, merging records at the same location according to two-dimensional coordinate values to form a candidate location set with distinct coordinates that are associated with at least one accident record. For example, for historical traffic accident record data in latitude and longitude coordinate format, the latitude and longitude coordinates are first converted to a unified plane projection coordinate system, then records with missing or non-limited coordinates are deleted, and finally records at the same location are merged according to two-dimensional coordinate values to form a candidate location set.
[0031] Step S120: From the candidate location set, traffic accident locations are extracted to form multiple initial center combinations, each initial center combination containing a different number of traffic accident locations.
[0032] In this step, the initial center combination can be a set of center locations selected from the candidate location set, used as the starting point for the iterative search. Specifically, each traffic accident location in the initial center combination is a location from the candidate location set, and the spatial coordinates of each traffic accident location are distinct. For example, the initial center combination could be a set containing five traffic accident locations, all of which are from the candidate location set and have distinct spatial coordinates.
[0033] The aforementioned multiple initial center combinations can have different numbers of centers. Specifically, each initial center combination corresponds to a different number of centers, so that sub-files can be created for different numbers of centers. For example, multiple initial center combinations with two, three, four, or even a preset sampling limit can be generated, with each initial center combination corresponding to one number of centers.
[0034] The specific implementation of this step may include: using a distance-guided squared probability sampling method to sequentially select several traffic accident locations from the candidate location set to form an ordered initial center sequence; then, sequentially extracting multiple sequence prefixes from the ordered initial center sequence, each sequence prefix containing a different number of traffic accident locations; finally, forming initial center combinations based on each sequence prefix.
[0035] Step S130: Create sub-files for different numbers of traffic accident locations, so as to store multiple initial centers in the corresponding number of traffic accident locations in the sub-files.
[0036] In this step, the aforementioned sub-file can be a data structure used to store candidate center combinations for a given number of centers. Specifically, each sub-file corresponds to one number of centers and is used to store candidate center combinations with high quality and different center compositions for that number of centers. For example, for the case of five centers, a corresponding sub-file is created to store candidate center combinations with five centers.
[0037] The sub-files corresponding to the aforementioned number of traffic accident locations can be sub-files that match the number of traffic accident locations contained in the initial center combination. Specifically, when the number of traffic accident locations contained in the initial center combination matches the number of centers corresponding to the sub-file, the initial center combination is stored in that sub-file. For example, for an initial center combination containing five traffic accident locations, it is stored in the sub-file corresponding to the number of centers being five.
[0038] The specific implementation of this step may include: First, determining the center number search interval, with a lower bound of two and an upper bound of a preset sampling upper limit; then, creating a sub-file for each center number within the center number search interval; finally, storing each initial center combination into its corresponding sub-file according to its center number. For example, if the preset sampling upper limit is fifty, then sub-files are created for center numbers from two to fifty, resulting in a total of forty-nine sub-files. The initial center combination with a center number of two is stored in the sub-file corresponding to the center number of two, the initial center combination with a center number of three is stored in the sub-file corresponding to the center number of three, and so on.
[0039] It should be noted that the capacity of each sub-file can be set according to actual application needs, and this application embodiment does not impose specific limitations on this. For example, the capacity of each sub-file can be set to ten, that is, each sub-file can store a maximum of ten candidate center combinations.
[0040] Step S140: Perform multiple rounds of iterative search based on each sub-file until the number of iterations reaches the preset maximum number of iterations, then terminate the iteration. Determine the target center combination from the sub-files corresponding to the preset number of targets, and obtain the discrete representative positions of the preset number of targets based on the target center combination. The discrete representative positions are used to characterize the representative positions of areas with high incidence of traffic accidents. Multiple search strategy stages are set in the multiple rounds of iterative search, and the operator selection probability distributions corresponding to each search strategy stage are different.
[0041] In this step, the aforementioned multi-round iterative search can be a search process that repeatedly generates offspring center combinations based on the candidate center combinations stored in the sub-file and updates the sub-file. Specifically, each iteration in the multi-round iterative search includes operations such as offspring generation, quality evaluation, and sub-file updating, gradually improving the quality of candidate center combinations in the sub-file through multiple iterations. For example, the multi-round iterative search may include one thousand iterations, in which parent center combinations are selected from the sub-file and offspring center combinations are generated in each iteration, and then the sub-file is updated based on the quality and diversity of the offspring center combinations.
[0042] The aforementioned preset maximum number of iterations can be a pre-defined maximum number of iterations in a multi-round iterative search. Specifically, the iterative search terminates when the number of iterations reaches the preset maximum number of iterations. For example, the preset maximum number of iterations can be set to one thousand, and the iterative search terminates when the number of iterations reaches one thousand.
[0043] The aforementioned number of preset targets can be a pre-defined number of centers used to determine the combination of target centers. Specifically, the number of preset targets can be determined according to the spatial granularity requirements of the accident analysis task. For example, for city-level traffic accident analysis, the number of preset targets can be set to twenty; for regional-level traffic accident analysis, the number of preset targets can be set to fifty.
[0044] The aforementioned target center combination can be the candidate center combination with the best clustering quality among the sub-files corresponding to the preset number of targets. Specifically, the candidate center combination with the lowest clustering quality evaluation value is selected as the target center combination from the sub-files corresponding to the preset number of targets. For example, for the case where the preset number of targets is twenty, the candidate center combination with the lowest clustering quality evaluation value is selected as the target center combination from the sub-files with twenty centers.
[0045] The aforementioned discrete representative locations can be the locations of various traffic accidents within the target center combination, used to characterize representative locations of high-incidence traffic accident areas. Specifically, discrete representative locations have a correspondence with actual accident records, rather than continuous mean centers obtained through coordinate averaging. For example, a discrete representative location could be the actual location of an accident at a high-incidence intersection, associated with at least one original accident record, facilitating traffic management departments to formulate targeted management measures based on the actual accident records at that location.
[0046] The aforementioned search strategy stages can be defined according to the search orientation within a multi-round iterative search. Specifically, the search strategy stages can include an exploration stage, an exploitation stage, and an escape stage, with different operator selection probability distributions corresponding to different search strategy stages. For example, in the exploration stage, mutation operators have a higher selection probability to perform a breadth search in the solution space; in the exploitation stage, crossover operators and equal-cardinality single-exchange mutations have a higher selection probability to perform a depth search near existing high-quality solutions; and in the escape stage, heavy-tailed multi-exchange mutations have a higher selection probability to escape local optima.
[0047] The aforementioned operator selection probability distribution can be used to determine the probability of each child generation operator being selected in the current search strategy phase. Specifically, the operator selection probability distribution includes the selection probabilities of four types of child generation operators: grouped normalized independent position mutation, equal cardinality single exchange mutation, heavy-tailed multiple exchange mutation, and disordered center set crossover. For example, in the exploration phase, the selection probabilities of grouped normalized independent position mutation, equal cardinality single exchange mutation, heavy-tailed multiple exchange mutation, and disordered center set crossover can be set to 0.35, 0.25, 0.25, and 0.15, respectively.
[0048] In each iteration of the multi-round iterative search, the following operations are performed: Based on the operator selection probability distribution and parent source probability corresponding to the current search strategy stage, parent center combinations are selected from each sub-file to operate on the parent center combinations and generate child center combinations. Calculate the cluster quality evaluation value of the offspring center combination; The sub-files corresponding to the number of traffic accident locations contained in the sub-center combination are subjected to quality screening and diversity screening to obtain the screening results; Update the sub-files corresponding to the number of traffic accident locations contained in the offspring center combination based on the screening results.
[0049] In this step, the aforementioned parent center combination can be a candidate center combination selected from the sub-files to generate the child center combination. Specifically, each traffic accident location in the parent center combination is a location within the candidate location set, and the spatial coordinates of each traffic accident location are distinct. For example, the parent center combination can be a candidate center combination selected from a sub-file with twenty centers according to the parent source probability, containing twenty traffic accident locations.
[0050] The aforementioned offspring center combination can be a new candidate center combination generated by operating on the parent center combination based on the offspring generation operator. Specifically, each traffic accident location in the offspring center combination is a location within the candidate location set, and the grouping normalization independent position mutation allows for variations in the number of centers. Under the equal cardinality single exchange, heavy-tailed multiple exchange, and unordered center set crossover operators, the number of traffic accident locations in the offspring center combination is the same as that in the parent center combination. For example, the offspring center combination can be a new candidate center combination generated by performing an equal cardinality single exchange mutation on the parent center combination. This combination contains the same number of traffic accident locations as the parent center combination, but one of the traffic accident locations is replaced with a new location.
[0051] The clustering quality evaluation value mentioned above can be an indicator used to measure the clustering quality of candidate center combinations. Specifically, the clustering quality evaluation value can be calculated based on the sum of the squared Euclidean distances from each accident location to its nearest center location; the lower the clustering quality evaluation value, the higher the clustering quality.
[0052] The formula for calculating the cluster quality evaluation value is as follows: ; in, This represents the cluster quality score (SSE) of the center combination on the complete evaluation dataset. Indicates the first The location of the accident record Indicates the first Candidate positions, To fully evaluate the total number of accident records in the dataset; This is the binary selection vector corresponding to the candidate position set; For binary selection vectors, the first Bit, For candidate position index. When When the value is 1, it indicates that the first... Candidate positions Selected as the center; when When the value is 0, it indicates that the first... None of the candidate positions were selected as the center; This serves as an index for incident records. During the search process, the database is divided into quality-diversity sub-files based on the number of centers. Upon termination, the individual with the lowest SSE (Score-Earnings Result) and the highest number of centers in the sub-file is selected as the output. Candidate solutions with fewer or more centers than the target value will not replace the target result.
[0053] The aforementioned quality screening can be based on cluster quality evaluation values to select offspring center combinations. Specifically, quality screening is used to determine whether the clustering quality of the offspring center combination is comparable to the quality of candidate center combinations already stored in the sub-archive. For example, a quality tolerance of 1.05 can be set; if the clustering quality evaluation value of the offspring center combination does not exceed 1.05 times the optimal clustering quality evaluation value in the sub-archive, then the offspring center combination passes the quality screening.
[0054] The aforementioned diversity screening can be based on differences in center composition when selecting offspring center combinations. Specifically, diversity screening is used to determine whether the differences in center composition between the offspring center combination and the candidate center combinations already stored in the sub-file are sufficiently large. For example, a Dessian dissimilarity threshold of 0.5 can be set. If the Dessian dissimilarity between the offspring center combination and all the candidate center combinations already stored in the sub-file is greater than or equal to 0.5, then the offspring center combination passes the diversity screening.
[0055] The above screening results can be a joint judgment of quality screening and diversity screening. Specifically, the screening results include two scenarios: pass and fail. When the offspring center combination passes both quality screening and diversity screening, the screening result is pass; otherwise, the screening result is fail. For example, if the clustering quality evaluation value of the offspring center combination does not exceed 1.05 times the optimal clustering quality evaluation value in the sub-archive, and the Descein dissimilarity between the offspring center combination and all stored candidate center combinations in the sub-archive is greater than or equal to 0.5, then the screening result is pass.
[0056] The specific implementation of this step may include: First, based on the operator selection probability distribution corresponding to the current search strategy stage, determining the offspring generation operator from grouped normalized independent position mutation, equal cardinality single crossover mutation, heavy-tailed multiple crossover mutation, and disordered center set crossover; then, based on the parent generation source probability corresponding to the current search strategy stage, selecting parent generation center combinations from the sub-files corresponding to the preset target number or all sub-files; next, using the offspring generation operator to operate on the parent generation center combinations to generate offspring center combinations; then, calculating the clustering quality evaluation value of the offspring center combinations; next, performing quality screening and diversity screening on the sub-files corresponding to the number of traffic accident locations contained in the offspring center combinations and obtaining screening results; finally, updating the sub-files corresponding to the number of traffic accident locations contained in the offspring center combinations based on the screening results.
[0057] It should be noted that the specific methods for updating sub-files based on the screening results may include: when the screening result is passed and the sub-file is not full, the offspring center combination is directly stored in the sub-file; when the screening result is passed and the sub-file is full, the candidate center combination with the lowest overall ranking in the sub-file is removed from the sub-file and the offspring center combination is stored in the sub-file; when the screening result is not passed, the sub-file is not updated.
[0058] The specific implementation of this step may include: after the termination of multiple rounds of iterative search, selecting the candidate center combination with the lowest clustering quality evaluation value from the sub-files corresponding to the preset number of targets as the target center combination; then, using each traffic accident location in the target center combination as a discrete representative location. For example, for the case where the preset number of targets is twenty, the candidate center combination with the lowest clustering quality evaluation value is selected from the sub-files with twenty centers as the target center combination. This combination contains twenty accident locations selected from the accident data rows, which are the discrete representative locations of the road traffic accident spatial clustering.
[0059] In this embodiment, by constructing a set of candidate locations with distinct coordinates and establishing sub-files according to the number of centers, multiple high-quality candidate solutions with different center compositions are retained under the same number of centers, overcoming the limitation of only retaining the single solution with the lowest clustering cost under the conventional non-dominated update rule for the same number of centers; by setting multiple search strategy stages in multiple rounds of iterative search, with different operator selection probability distributions corresponding to each search strategy stage, the search process can adopt different search orientations at different stages, thereby performing breadth search in the exploration stage, depth search in the utilization stage, and escaping local optima in the escape stage; by embedding distance guidance information to select new centers during the offspring generation process, the search directionality is improved, overcoming the problem of insufficient search directionality in the uniform mutation mechanism; by jointly updating the sub-files through quality screening and diversity screening, it is ensured that the candidate center combinations stored in the sub-files have both high clustering quality and good center composition diversity. In this way, the search quality of discrete representative location combinations can be improved, the overall search quality and operational efficiency of road traffic accident spatial clustering can be enhanced, and the technical problems of existing road accident discrete spatial clustering technology, such as only generating a small number of initial combinations, being prone to getting trapped in local optima, lacking search directionality, and being unable to retain high-quality combinations with similar quality but different spatial structures, can be solved.
[0060] In step S120 above, multiple initial center combinations are formed by extracting traffic accident locations from the candidate location set. Each initial center combination contains a different number of traffic accident locations. This includes steps S201 to S203, as follows: Step S201: A distance-guided squared probability sampling method is used on the candidate position set to form an ordered initialization center sequence. The first center in the ordered initialization center sequence is uniformly selected from the candidate position set. The selection probability of each unselected candidate position in the subsequent candidate position set is proportional to the least square Euclidean distance from each unselected candidate position to the current selected center set, until the number of centers in the ordered initialization center sequence reaches the preset sampling limit.
[0061] In this step, the distance-guided quadratic probability sampling method described above can be a sampling method that selects positions from the candidate position set according to the distance-guided principle. Specifically, the distance-guided quadratic probability sampling method is... The core idea of the sampling method is that the first center is uniformly selected from the set of candidate positions, and the selection probability of each subsequent unselected candidate position is proportional to the least square Euclidean distance to the set of currently selected centers, so that the selected positions are as spatially dispersed as possible.
[0062] For example, for a candidate position set P, firstly, a position is uniformly selected from it as the first position of the sequence. Then, for each remaining unselected candidate position in the candidate position set P, the least square Euclidean distance from it to the current selected center set is calculated. This distance is used as the weight of the selection probability of the unselected candidate position. The unselected candidate positions are sampled according to this weight, and a position is selected to be added to the sequence. This process is repeated until the sequence length reaches the preset sampling limit.
[0063] The aforementioned ordered initialization center sequence can be a sequence of accident locations selected from the accident data rows, arranged in the order of selection. Specifically, the order in which the locations are arranged in the ordered initialization center sequence reflects the order in which they were selected; the earlier selected locations are more spatially dispersed, while the later selected locations are relatively concentrated in space.
[0064] The aforementioned first center can be the first selected position in an ordered initialization center sequence. Specifically, the first center is selected uniformly from the candidate position set, meaning that each position in the candidate position set has an equal probability of being selected as the first center. For example, for a candidate position set containing N positions, the first center is selected uniformly from these N positions, and the probability of each position being selected as the first center is one in N.
[0065] The aforementioned unselected candidate positions can be positions in the candidate position set that have not yet been selected into the ordered initialization center sequence. Specifically, each time a new position is selected, the unselected candidate positions are the remaining positions in the candidate position set after removing the selected center set. For example, if the candidate position set contains N positions and the selected center set contains j positions, then the unselected candidate positions are N minus j positions.
[0066] The aforementioned set of currently selected centers can be the set of all positions that have already been selected in the ordered initialization center sequence. Specifically, the set of currently selected centers gradually expands as the sequence extends.
[0067] The aforementioned minimum squared Euclidean distance can be the minimum of the squared Euclidean distances between the unselected candidate position and each position in the current selected center set. Specifically, for an unselected candidate position q and the current selected center set S, the minimum squared Euclidean distance between the unselected candidate position q and the current selected center set S is the minimum of the squared Euclidean distances between q and each position in S.
[0068] The aforementioned selection probability being proportional to the least square Euclidean distance can be determined by normalizing the least square Euclidean distance of an unselected candidate location to the currently selected center set. Specifically, for each unselected candidate location, its selection probability is its least square Euclidean distance divided by the sum of the least square Euclidean distances of all unselected candidate locations.
[0069] The aforementioned preset sampling upper limit can be the maximum length of the pre-defined ordered initialization center sequence. Specifically, the preset sampling upper limit can be determined based on the upper bound of the center number search interval.
[0070] Step S202: Sequentially extract multiple sequence prefixes from the ordered initialization center sequence. Each sequence prefix contains a different number of traffic accident locations, and the different numbers contain a preset target number.
[0071] In this step, the aforementioned sequence prefix can be a subsequence formed by taking several consecutive positions starting from the first position in the ordered initialization center sequence. Specifically, for an ordered initialization center sequence L of length m equal to p1, p2, ..., pm, its k-th sequence prefix is p1, p2, ..., pk, which is the subsequence formed by the first k positions in the sequence.
[0072] The aforementioned different numbers, including the preset target number, can be at least one of the numbers of traffic accident locations contained in the sequence prefix equal to the preset target number. Specifically, by truncating sequence prefixes of different lengths, multiple initial center combinations with a center number ranging from two to a preset sampling upper limit can be formed. The initial center combination with a center number equal to the preset target number is used to determine subsequent target center combinations. For example, if the preset target number is twenty, then the truncated sequence prefix will contain a sequence prefix with a center number of twenty. The initial center combination corresponding to this sequence prefix will be stored in a sub-file with a center number of twenty for use in determining subsequent target center combinations.
[0073] Step S203: Initial center combinations are formed based on each sequence prefix.
[0074] In this step, forming initial center combinations based on each sequence prefix can be achieved by using each traffic accident location in each sequence prefix as an initial center combination. Specifically, the traffic accident locations included in the sequence prefix are the center locations in the initial center combinations.
[0075] In this embodiment, an ordered initial center sequence is generated by using a distance-guided squared probability sampling method. The different lengths of the sequence prefix are used as initial center combinations with different numbers of centers. This makes the center positions in the initial center combination as spatially dispersed as possible, thereby providing a high-quality initial solution for subsequent iterative searches. This helps to accelerate search convergence and improve the final clustering quality.
[0076] In step S140 above, based on the operator selection probability distribution and parent source probability corresponding to the current search strategy stage, parent center combinations are selected from each sub-file to operate on the parent center combinations and generate child center combinations, including steps S301 to S303, as follows: Step S301: Based on the operator selection probability distribution corresponding to the current search strategy stage, determine the offspring generation operator from grouping normalized independent position mutation, equal cardinality single exchange mutation, heavy-tailed multiple exchange mutation, and disordered center set crossover.
[0077] In this step, the aforementioned grouped normalized independent position mutation can be a mutation operator that groups the center positions in the parent center combination and performs independent replacements. Specifically, the grouped normalized independent position mutation divides the candidate positions in the parent center combination into a selected center group and a non-selected candidate position group, and independently flips the positions in the two groups according to the removal probability and the selection probability, respectively, to generate the child center combination.
[0078] For example, firstly, the parent is selected from the quality-diversity sub-files corresponding to the number of target centers according to the parent selection probability corresponding to the current search stage. In other cases, the parent is selected from the existing individuals in all quality-diversity sub-files. Then, a child generation operator is selected from grouping normalization independent mutation, equal cardinality single exchange mutation, heavy-tailed multiple exchange mutation, and disordered center set crossover according to the operator selection probability corresponding to the current search stage.
[0079] Let the parent set be The set of unselected candidate position indices is Unselected candidate positions The least square Euclidean distance to the parent set is denoted as The sum of the distances to all unselected candidate positions is denoted as . ;when When the value is greater than 0, the mixed selection probability of the unselected candidate positions is calculated according to the following formula: ; in, Distance-guided weights, and When the sum of the distances to all unselected candidate positions is 0, select uniformly from the unselected candidate positions. Each time offspring are generated, one of the following three types of mutation operators and one type of crossover operator is selected; the four types of operators generate offspring according to their own rules, and whenever a new center is involved, the above-mentioned mixed selection probability is used within the corresponding operator.
[0080] The aforementioned cardinality-based single-exchange mutation can be a mutation operator that performs a single position exchange on the parent center combination. Specifically, the cardinality-based single-exchange mutation randomly removes one center from the selected centers of the parent center combination and selects a new center from the unselected candidate positions according to a mixed selection probability to generate the child center combination. For example, for a parent center combination containing k center positions, a center position is randomly removed to obtain the first removal result, and then a new center is selected from the unselected candidate positions according to a mixed selection probability to add to the first removal result, resulting in the first selection result, which is the child center combination.
[0081] The aforementioned heavy-tailed multiple-exchange mutation can be a mutation operator that performs multiple position swaps on the parent center combination. Specifically, the heavy-tailed multiple-exchange mutation randomly and non-repeatingly removes several centers from the selected centers of the parent center combination, and non-repeatingly selects the same number of new centers from the unselected candidate positions according to a mixed selection probability. The number of swaps follows a heavy-tailed distribution to generate the offspring center combination.
[0082] The aforementioned unordered center set crossover can be an operator that crosses two center combinations to generate offspring center combinations. Specifically, the unordered center set crossover selects another center combination from the sub-files to which the parent center combination belongs, whose Dessian dissimilarity with the parent center combination meets a preset condition. The centers commonly contained in both the parent center combination and the other center combination are used as the initial center set of the offspring. Then, centers are added one by one from the union of the two according to the mixed selection probability to generate offspring center combinations.
[0083] The aforementioned offspring generation operators can be operators used to operate on parent center combinations to generate offspring center combinations. Specifically, offspring generation operators include four types: grouping normalization independent position mutation, equal cardinality single exchange mutation, heavy-tailed multiple exchange mutation, and unordered center set crossover. For example, in each iteration, based on the operator selection probability distribution corresponding to the current search strategy stage, one of the above four offspring generation operators is determined as the offspring generation operator for this iteration.
[0084] Step S302: Based on the parent source probability corresponding to the current search strategy stage, select the parent center combination from the sub-files corresponding to the preset number of targets or all sub-files.
[0085] In this step, the aforementioned parent source probability can be used to determine the probability of selecting the parent center combination from which sub-files. Specifically, the parent source probability can include the probability of selecting from the sub-files corresponding to the preset target number and the probability of selecting from all sub-files.
[0086] The above-mentioned selection of parent center combinations from sub-files corresponding to the preset number of targets can be achieved by selecting parent center combinations only from sub-files whose center count equals the preset number of targets. Specifically, this selection method facilitates a concentrated search of sub-files corresponding to the preset number of targets, accelerating the determination of target center combinations.
[0087] The above-mentioned selection of parent center combinations from all sub-files can be interpreted as selecting parent center combinations from all sub-files. Specifically, this selection method facilitates information exchange between different numbers of centers, enhancing the diversity of the overall search.
[0088] Step S303: Use the offspring generation operator to operate on the parent center combination to generate the offspring center combination; wherein, when the operation of the offspring generation operator involves selecting a new center from the unselected traffic accident locations, the new center is determined according to the mixed selection probability. The mixed selection probability includes a uniform base term and a distance guide term. The distance guide term is determined based on the proportion of the least square Euclidean distance from the unselected traffic accident location to the current parent center set to the sum of the corresponding distances of all unselected traffic accident locations.
[0089] In this step, the unselected traffic accident locations can be any locations in the candidate location set that are not in the parent generation center combination. Specifically, the unselected traffic accident locations are the unselected candidate locations, which are the remaining locations in the candidate location set after removing the center locations from the parent generation center combination.
[0090] The new center mentioned above can be a position selected from the unselected traffic accident locations into the child center combination during the child generation operator operation. Specifically, the new center is used to replace the center positions removed from the parent center combination to keep the number of centers in the child center combination unchanged.
[0091] The aforementioned mixed selection probability can be used to determine which location to select as the new center from the unselected traffic accident locations. Specifically, the mixed selection probability is weighted by a uniform base term and a distance-guided term, which ensures that it can evenly select locations from the unselected traffic accident locations, while also favoring locations that are farther away from the current parent center set to improve diversity.
[0092] The aforementioned uniform base term can be a term that ensures that each location among the unselected traffic accident locations has an equal probability of being selected. Specifically, the uniform base term can be set as the reciprocal of the number of unselected traffic accident locations.
[0093] The aforementioned distance guide term can be a term that gives a higher probability of selecting unselected traffic accident locations that are farther away from the current parent center set. Specifically, the distance guide term is determined based on the proportion of the least square Euclidean distance from the unselected traffic accident location to the current parent center set to the sum of the distances corresponding to all unselected traffic accident locations.
[0094] The aforementioned current parent center set can be the set composed of the positions of each center in the parent center combination. Specifically, the current parent center set changes as the child generation operator operates. When a center is removed from the parent center combination, the current parent center set shrinks accordingly; when a new center is selected from the unselected traffic accident locations, the current parent center set expands accordingly.
[0095] In this embodiment, the offspring generation operator is determined from a variety of offspring generation operators according to the operator selection probability distribution corresponding to the current search strategy stage. The parent center combination is selected from the sub-files corresponding to the preset number of targets or all sub-files according to the parent source probability. At the same time, the new center is determined according to the mixed selection probability during the new center selection process. This allows the offspring generation process to select appropriate operators according to the needs of the current search stage, and to improve the directionality of new center selection through distance guidance, thereby improving search efficiency while ensuring search diversity.
[0096] In step S303 above, the offspring generation operator is used to operate on the parent generation center combination to generate the offspring center combination. When the offspring generation operator is a grouped normalized independent position variation, steps S401 to S404 are included, as follows: Step S401: When the offspring generation operator is a grouped normalized independent position mutation, the candidate position set corresponding to the parent center combination is divided into the selected center group and the unselected candidate position group.
[0097] In this step, the selected center group can be a set of center locations currently included in the parent center group. Specifically, each center location in the selected center group is an accident location selected from the accident data row, and the spatial coordinates of each center location are different.
[0098] The aforementioned unselected candidate position group can be a set consisting of positions in the candidate position set that are not in the parent center combination. Specifically, each position in the unselected candidate position group is a position in the candidate position set and does not overlap with any position in the selected center group.
[0099] Step S402: Set an equal removal probability for each selected center in the selected center group, and set an admission probability for each unselected candidate position in the unselected candidate position group according to the mixed admission probability, wherein the sum of the removal probabilities of all selected centers is equal to the sum of the admission probabilities of all unselected candidate positions.
[0100] In this step, the aforementioned removal probability can be the probability that each selected center in the selected center group is removed. Specifically, the removal probability of each selected center in the selected center group is equal, that is, the probability that each selected center is removed is the same.
[0101] The aforementioned selection probability can be the probability that each unselected candidate position in the unselected candidate position group is selected into the offspring center combination. Specifically, the selection probability of each unselected candidate position in the unselected candidate position group is determined according to the mixed selection probability, so that unselected candidate positions that are farther away from the current parent center set have a higher selection probability.
[0102] The sum of the removal probabilities of all selected centers being equal to the sum of the selection probabilities of all unselected candidate positions can be expressed as the sum of the removal probabilities of each selected center in the selected center group being equal to the sum of the selection probabilities of each unselected candidate position in the unselected candidate position group. Specifically, this equality ensures that the number of centers removed in the grouped normalized independent metamorphisms is, in a desired sense, equal to the number of new centers selected, thereby maintaining the number of centers in the offspring center combination in a desired sense the same as that in the parent center combination.
[0103] Step S403: Based on the removal probability of each selected center in the selected center group and the selection probability of each unselected candidate position in the unselected candidate position group, each bit of the binary selection vector corresponding to the parent center combination is randomly flipped independently to obtain the flipped binary selection vector; where a value of one in the binary selection vector indicates that the corresponding candidate position is selected as the center, and a value of zero in the binary selection vector indicates that the corresponding candidate position is not selected as the center.
[0104] In this step, the aforementioned binary selection vector can be a binary vector used to characterize whether each position in the candidate position set is selected as the center. Specifically, the length of the binary selection vector is equal to the number of positions in the candidate position set, and the th position in the binary selection vector... When the value of 1 is taken, it indicates that the first position in the candidate position set... The nth position is selected as the center, and a value of zero indicates that the nth position in the candidate position set is selected. One position was not selected as the center.
[0105] The aforementioned random flipping can be an operation that flips each bit in the binary selection vector according to probability. Specifically, for a bit in the binary selection vector that takes the value of one, a random number is generated according to the removal probability of its corresponding selected center. If the random number is less than the removal probability, the bit is flipped to zero; otherwise, it remains one. For a bit in the binary selection vector that takes the value of zero, a random number is generated according to the selection probability of its corresponding unselected candidate position. If the random number is less than the selection probability, the bit is flipped to one; otherwise, it remains zero.
[0106] The aforementioned flipped binary selection vector can be a new binary selection vector obtained by random flipping. Specifically, the flipped binary selection vector is used to characterize the selection state of each center position in the offspring center combination. For example, the candidate position corresponding to the bit with a value of one in the flipped binary selection vector is the center position in the offspring center combination.
[0107] Step S404: Based on the flipped binary selection vector, construct the offspring center combination.
[0108] In this step, the above-mentioned construction of the offspring center combination based on the flipped binary selection vector can be achieved by constructing the offspring center combination based on the candidate positions corresponding to the bits with a value of one in the flipped binary selection vector. Specifically, the candidate positions corresponding to the bits with a value of one in the flipped binary selection vector are the center positions in the offspring center combination.
[0109] In this embodiment, the candidate position set corresponding to the parent center combination is divided into a selected center group and an unselected candidate position group. An equal removal probability is set for each selected center in the selected center group, and an admission probability is set for each unselected candidate position in the unselected candidate position group according to a mixed admission probability. The sum of the removal probabilities of all selected centers is equal to the sum of the admission probabilities of all unselected candidate positions. Then, each bit in the binary selection vector is randomly flipped independently, so that the offspring center combination retains some selected centers and introduces new positions that are far away from the existing center positions, thereby improving the diversity of the center composition while keeping the expected number of centers unchanged.
[0110] In step S303 above, the offspring generation operator is used to operate on the parent generation center combination to generate the offspring center combination. When the offspring generation operator is an equal-cardinality single-crossover mutation, steps S501 to S503 are included, as follows: Step S501: In the case that the offspring generation operator is an equal cardinality single exchange mutation, a center is randomly removed from the selected center of the parent center combination to obtain the first removal result.
[0111] In this step, the selected centers can be the locations of all centers currently included in the parent center combination. Specifically, the selected centers refer to the locations of all centers in the selected center group.
[0112] The aforementioned random removal of a center can be achieved by selecting a center from the selected centers in the parent center combination with equal probability for removal. Specifically, each selected center has an equal probability of being removed.
[0113] The first removal result can be the set of center positions remaining after removing one center from the parent center combination. Specifically, the first removal result includes all center positions in the parent center combination except for the removed center, and the number of center positions in the first removal result is one less than that in the parent center combination.
[0114] Step S502: Based on the mixed selection probability, select a center from the unselected candidate positions of the parent center combination to obtain the first selection result.
[0115] In this step, the aforementioned unselected candidate positions can be any position in the candidate position set that is not in the parent center combination. Specifically, unselected candidate positions refer to any position in the unselected candidate position group.
[0116] The above-mentioned selection of a center based on the mixed selection probability can be achieved by selecting a position from the unselected candidate positions as the new center according to the mixed selection probability. Specifically, the mixed selection probability is composed of a uniform basic term and a distance guiding term, which makes the unselected candidate positions that are far away from the current parent center set have a higher probability of being selected.
[0117] The first selection result can be the set of positions obtained by adding a new center to the first removal result. Specifically, the first selection result includes all the center positions in the first removal result and a new center selected from the unselected candidate positions, and the number of positions in the first selection result is the same as the parent center combination.
[0118] Step S503: Based on the first removal result and the first selection result, generate a child center combination with the same number of centers as the parent center combination.
[0119] In this step, the offspring center combination with the same number of centers as the parent center combination can have the number of centers equal to the number of centers in the parent center combination. Specifically, since the number of centers removed and the number of new centers selected in the cardinality-based single exchange mutation are both one, the number of centers in the offspring center combination remains consistent with that in the parent center combination.
[0120] In this embodiment, by randomly removing a center from the selected centers of the parent center combination and selecting a new center from the unselected candidate positions according to the mixed selection probability, the child center combination undergoes local changes while maintaining the same number of centers. This allows for a fine search near existing high-quality solutions, which is beneficial for improving clustering quality during the utilization phase.
[0121] In step S303 above, the offspring generation operator is used to operate on the parent central combination to generate the offspring central combination. When the offspring generation operator is a heavy-tailed multiple crossover mutation, steps S601 to S605 are included, as follows: Step S601: When the offspring generation operator is a heavy-tailed multi-exchange mutation, determine the upper limit of the exchangeable size based on the number of selected centers, the number of unselected candidate positions, and the preset maximum exchange size of the parent center combination.
[0122] In this step, the number of selected centers can be the number of center locations currently included in the parent center combination. Specifically, the number of selected centers is equal to the number of traffic accident locations included in the parent center combination.
[0123] The number of unselected candidate positions can be the number of positions in the candidate position set that are not in the parent center combination. Specifically, the number of unselected candidate positions is equal to the size of the candidate position set minus the number of centers in the parent center combination.
[0124] The aforementioned preset maximum exchange size can be an upper bound on the maximum number of positions that can be removed and selected in a single exchange. Specifically, the preset maximum exchange size can be set according to actual application requirements.
[0125] The aforementioned maximum swap size can be the maximum number of locations that can actually be removed and selected in a single swap. Specifically, the maximum swap size is the minimum value among the number of selected centers, the number of unselected candidate locations, and the preset maximum swap size.
[0126] Step S602: If the upper limit of the exchangeable size is greater than or equal to two, an integer is drawn from the integer range of two to the upper limit of the exchangeable size as the exchange size for this time.
[0127] In this step, the upper limit of the commutative size being greater than or equal to two can mean that the upper limit of the commutative size is not less than two. Specifically, when the upper limit of the commutative size is less than two, heavy-tailed multi-crossover mutation cannot be performed, and in this case, other offspring generation operators can be switched to.
[0128] The above-mentioned selection of an integer from two to the upper limit of the commutative size can be achieved by selecting an integer from two, three, up to the upper limit of the commutative size according to a heavy-tailed distribution. Specifically, the heavy-tailed distribution makes the probability of smaller commutative sizes appearing higher, and the probability of larger commutative sizes appearing lower but not zero.
[0129] The aforementioned size of this exchange can be considered as the number of positions actually removed and selected in this heavy-tailed multiple exchange mutation. Specifically, the size of this exchange follows a heavy-tailed distribution, making smaller exchange sizes more likely to occur, while larger exchange sizes have a lower but not zero probability of occurring.
[0130] Step S603: Randomly and without repetition remove the current number of centers from the selected centers of the parent center combination to obtain the second removal result.
[0131] In this step, the aforementioned random and non-repeating removal can be achieved by selecting centers of the current swap size from the selected centers in the parent center combination with equal probability, and ensuring that each removed center is distinct. Specifically, each selected center has an equal probability of being removed, and the same center is not selected repeatedly during this removal process.
[0132] The second removal result can be the set of center positions remaining after removing the number of centers of the current exchange size from the parent center combination. Specifically, the second removal result includes all center positions in the parent center combination except for the removed centers, and the number of center positions in the second removal result is less than the number of centers of the current exchange size in the parent center combination.
[0133] Step S604: Based on the mixed selection probability, select new centers of the current exchange scale from the unselected candidate positions of the parent center combination without repetition, and obtain the second selection result.
[0134] In this step, the aforementioned non-repeating selection can be achieved by selecting positions of the current exchange scale as new centers from the unselected candidate positions according to the mixed selection probability, and each selected new center is different from the others. Specifically, the mixed selection probability is weighted by a uniform base term and a distance-guided term, so that unselected candidate positions that are farther away from the current parent center set have a higher probability of being selected.
[0135] The second selection result can be the set of positions obtained by adding the number of new centers selected in this exchange to the second removal result. Specifically, the second selection result includes all the center positions in the second removal result and the number of new centers selected from the unselected candidate positions in this exchange, and the number of positions in the second selection result is the same as the parent center combination.
[0136] Step S605: Based on the second removal result and the second selection result, generate a child center combination with the same number of centers as the parent center combination.
[0137] In this step, the offspring center combination with the same number of centers as the parent center combination can have the number of centers in the offspring center combination equal to the number of centers in the parent center combination. Specifically, since the number of centers removed and the number of new centers selected in the heavy-tailed multiple crossover mutation are both the size of this crossover, the number of centers in the offspring center combination remains consistent with that in the parent center combination.
[0138] It should be noted that the heavy-tailed distribution means that the size of this exchange is more likely to be smaller and less likely to be larger, thus performing a local search in most cases and a large-scale jump search in a few cases.
[0139] In this embodiment, the upper limit of the exchangeable size is determined based on the number of selected centers, the number of unselected candidate positions, and the preset maximum exchange size of the parent center combination. When the upper limit of the exchangeable size is greater than or equal to two, the exchange size is extracted from the integer range of two to the upper limit of the exchangeable size, and multi-position exchange is performed on the parent center combination. This makes the child center combination undergo local changes in most cases to perform fine search, and large-scale changes in a few cases to escape the local optimum, thereby effectively improving the global search capability in the escape phase.
[0140] In step S303 above, the offspring generation operator is used to operate on the parent center combination to generate the offspring center combination. When the offspring generation operator is an intersection of unordered center sets, steps S701 to S703 are included, as follows: Step S701: When the offspring generation operator is an unordered set of centers, select another center combination from the sub-files to which the parent center combination belongs, whose Dessian dissimilarity with the parent center combination satisfies a preset condition. The preset condition includes that the Dessian dissimilarity is the maximum value in the sub-files to which the parent center combination belongs.
[0141] In this step, the sub-files belonging to the aforementioned parent center combination can be sub-files corresponding to the number of traffic accident locations contained in the parent center combination. Specifically, when the number of traffic accident locations contained in the parent center combination is the same as the number of centers corresponding to the sub-file, then the sub-file belongs to the parent center combination.
[0142] The Dess dissimilarity mentioned above can be used as an indicator to measure the degree of difference in the central composition between two central combinations. Specifically, the Dess dissimilarity is calculated based on the amount of shared central positions between the two central combinations; the fewer shared central positions, the greater the Dess dissimilarity.
[0143] The aforementioned preset conditions can be used to determine whether another center combination is suitable for cross-interaction with the parent center combination. Specifically, the preset conditions include the Des dissimilarity being the maximum value among the sub-files of the parent center combination, that is, selecting another center combination with the greatest difference in center composition from the parent center combination for cross-interaction.
[0144] The other center combination mentioned above can be the candidate center combination with the greatest Dessian dissimilarity to the parent center combination in the sub-files to which the parent center combination belongs. Specifically, the other center combination has the greatest difference in center composition from the parent center combination, thus enabling a larger search jump when they intersect.
[0145] In this step, when the offspring generation operator is an unordered set of centers crossing, another center combination with a Dessian dissimilarity that satisfies a preset condition is selected from the sub-files to which the parent center combination belongs. The preset condition includes that the Dessian dissimilarity is the maximum value in the sub-files to which the parent center combination belongs. If there is no available second parent in the sub-files with the same number of centers, the actual implementation will revert to an equal cardinality single exchange mutation, and will not stop the current round of offspring generation.
[0146] Step S702: The centers jointly contained in the parent center combination and another center combination are used as the initial center set of the offspring.
[0147] In this step, the commonly included center can be a center position that is included in both the parent center combination and another center combination. Specifically, the commonly included center is the intersection of the parent center combination and another center combination.
[0148] The aforementioned initial set of offspring centers can be a set consisting of centers jointly contained by a combination of parent centers and another combination of centers. Specifically, each center position in the initial set of offspring centers simultaneously belongs to both a combination of parent centers and another combination of centers.
[0149] Step S703: From the union of the parent center combination and another center combination, and from the centers that have not yet been selected into the initial center set of the offspring, supplement the centers one by one according to the mixed selection probability, until the number of centers contained in the offspring center combination reaches the number of centers contained in the parent center combination.
[0150] In this step, the union of the aforementioned parent center combination and another center combination can be the union of each center position in the parent center combination and each center position in the other center combination. Specifically, each center position in the union belongs to either the parent center combination or the other center combination.
[0151] The centers that have not yet been selected into the initial set of offspring centers can be the remaining center positions after removing the initial set of offspring centers from the union of the parent center combination and another center combination. Specifically, centers that have not yet been selected into the initial set of offspring centers are the center positions in the union that do not belong to the initial set of offspring centers.
[0152] The aforementioned method of supplementing centers one by one according to the mixed selection probability can be described as selecting centers one by one from the centers that have not yet been selected into the initial set of offspring centers and adding them to the offspring center combination according to the mixed selection probability. Specifically, the mixed selection probability is composed of a weighted average of a uniform base term and a distance-guided term, so that offspring centers that are far away from the current set of parent centers have a higher probability of being selected.
[0153] It should be noted that when the number of centers not yet selected into the initial set of offspring centers in the union of the parent center combination and another center combination is insufficient to make the number of centers in the offspring center combination reach the number of centers in the parent center combination, a corresponding number of positions can be supplemented from the candidate position set according to the mixed selection probability.
[0154] In this embodiment, another center combination with the greatest dissimilarity to the parent center combination is selected from the sub-files to which the parent center combination belongs. The centers commonly contained by the parent center combination and the other center combination are used as the initial set of the offspring centers. Then, centers are added one by one from the union of the two centers according to the mixed selection probability. This allows the offspring center combination to inherit the center composition information of the two center combinations, thereby achieving information exchange between different search areas while maintaining the number of centers. This is beneficial for accelerating search convergence during the utilization phase.
[0155] It should be noted that the above multi-round iterative search sets up multiple search strategy stages, and the operator selection probability distribution corresponding to each search strategy stage is different. Specifically, the search strategy stages may include an exploration stage, an exploitation stage, and an escape stage, which are executed alternately or in a preset order.
[0156] For example, in the above multi-round iterative search, the first 1 / 4 of the maximum number of iterations is in the exploration phase; then the default utilization phase; when the historical best target SSE is not improved for a continuous period and reaches a threshold, it enters the escape phase; when the escape is improved, it returns to the utilization phase, or when the continuous lack of improvement during the escape period reaches a certain number of durations, it returns to the utilization phase.
[0157] During the exploration phase, the operator selection probability distribution focuses on mutation operators to enable a breadth-of-field search in the solution space. Specifically, the selection probabilities of grouped normalized independent position mutation, equal cardinality single exchange mutation, heavy-tailed multiple exchange mutation, and unordered center set crossover in the exploration phase can be set to 0.35, 0.25, 0.25, and 0.15, respectively, resulting in a total selection probability of 0.85 for mutation operators and 0.15 for crossover operators. For example, during the exploration phase, since the number and quality of candidate center combinations in the subfiles are relatively small, a higher selection probability for mutation operators can generate more diverse sub-center combinations in the solution space, thereby quickly filling the subfiles.
[0158] During the utilization phase, the operator selection probability distribution focuses on crossover operators and equal-cardinality single-exchange mutations to perform a deep search near existing high-quality solutions. Specifically, the selection probabilities of grouped normalized independent position mutations, equal-cardinality single-exchange mutations, heavy-tailed multi-exchange mutations, and unordered center set crossovers in the utilization phase can be set to 0.15, 0.35, 0.15, and 0.35, respectively, making the total selection probability of crossover operators and equal-cardinality single-exchange mutations 0.70. For example, in the utilization phase, multiple high-quality candidate center combinations are already stored in the sub-file. A higher selection probability for crossover operators allows for information exchange among these high-quality solutions, thereby accelerating search convergence.
[0159] During the escape phase, the operator selection probability distribution focuses on heavy-tailed multiple-exchange mutations to escape the current search region. Specifically, the selection probabilities of grouped normalized independent mutations, equal-cardinality single-exchange mutations, heavy-tailed multiple-exchange mutations, and unordered center set crossovers in the escape phase can be set to 0.20, 0.15, 0.50, and 0.15, respectively, making the selection probability of heavy-tailed multiple-exchange mutations 0.50. For example, in the escape phase, when the sub-files have not been updated in multiple consecutive iterations, a higher selection probability of heavy-tailed multiple-exchange mutations can generate a combination of sub-centers that differs significantly from the current search region, thereby escaping the local optimum.
[0160] In this embodiment, by dividing the multi-round iterative search into an exploration phase, an exploitation phase, and an escape phase, and setting different operator selection probability distributions for different phases, the search process can adaptively adjust the search strategy according to the current search state. This allows for a breadth search in the early stages of the search to quickly fill subfiles, a depth search in the middle stages to improve clustering quality, and a jump search in the later stages to escape local optima, effectively improving the overall search quality and operating efficiency.
[0161] It should be noted that the specific implementation methods of the above-mentioned quality screening and diversity screening can be further refined.
[0162] In terms of quality screening, selection can be based on the tolerance of cluster quality evaluation values. Specifically, for a child center combination, the ratio between its cluster quality evaluation value and the optimal cluster quality evaluation value of the candidate center combinations already stored in the sub-file is calculated. If this ratio does not exceed a preset quality tolerance, the child center combination passes the quality screening. For example, the quality tolerance can be set to 1.05, meaning that if the cluster quality evaluation value of the child center combination does not exceed 1.05 times the optimal cluster quality evaluation value in the sub-file, then the child center combination is considered to be of comparable quality to the candidate center combinations already stored in the sub-file and passes the quality screening.
[0163] For diversity screening, it can be based on Dessian dissimilarity. Specifically, for offspring center combinations that pass quality screening, the Dessian dissimilarity between them and each candidate center combination already stored in the sub-file is calculated. If the Dessian dissimilarity between the offspring center combination and all stored candidate center combinations in the sub-file is greater than or equal to a preset diversity threshold, then the offspring center combination passes diversity screening. For example, the diversity threshold can be set to 0.5, meaning that if the Dessian dissimilarity between the offspring center combination and any stored candidate center combination in the sub-file is less than 0.5, then the center compositions of the two are considered too similar, and the offspring center combination does not pass diversity screening.
[0164] Regarding sub-file updates, when a child center combination passes quality and diversity screening and the sub-file is full, a stored candidate center combination can be removed from the sub-file according to a preset replacement strategy. Specifically, the replacement strategy can be based on a comprehensive evaluation of the candidate center combination's clustering quality assessment value and its contribution to center composition diversity, removing the candidate center combination with the lowest overall ranking from the sub-file. For example, the clustering quality assessment value ranking and diversity contribution ranking of each stored candidate center combination in the sub-file can be calculated, removing the candidate center combination with the largest sum of the two rankings from the sub-file, and storing the child center combination in the sub-file.
[0165] In this embodiment, the sub-files are updated by combining quality screening and diversity screening to ensure that the candidate center combinations stored in the sub-files have both high clustering quality and good center composition diversity. This allows the sub-files to retain high-quality combinations with similar quality but different spatial structures, providing a diverse source of parent generations for subsequent offspring generation.
[0166] It should be noted that the clustering quality evaluation value of the above-mentioned calculation of the offspring center combination can be obtained by using a cached, precise evaluation method to improve computational efficiency.
[0167] Specifically, for the parts of the child center combination that have not changed compared to the parent center combination, the allocation costs already calculated during the evaluation of the parent center combination can be reused, and the allocation costs only need to be recalculated for the parts of the center combination that have changed. For example, when the child center combination replaces only one center position in the parent center combination, it is only necessary to recalculate the new allocation costs for the accident positions originally allocated to the replaced center position, while the allocation costs for the remaining accident positions remain unchanged.
[0168] Furthermore, a cache table can be maintained to record the squared Euclidean distance from each incident location to each center location. During subsequent evaluations, if the distance from the same incident location to the same center location needs to be calculated, it can be directly read from the cache table, avoiding duplicate calculations. For example, for each incident location in the candidate location set, the result of the initial calculation of its squared Euclidean distance to a certain center location is stored in the cache table. During subsequent evaluations, if the distance from the same incident location to the same center location needs to be calculated, it can be directly read from the cache table.
[0169] In this embodiment, by employing a cached and precise evaluation method to calculate the clustering quality evaluation value of the offspring center combination, the evaluation process can reuse the calculated results, avoid repeated calculations, and thus significantly improve evaluation efficiency. This is beneficial for performing more rounds of iterative search under limited computing resources.
[0170] To facilitate understanding of the spatial clustering optimization method for road traffic accidents in the embodiments of this application, several application examples of this method are provided below: Application Example 1: Spatial Clustering Analysis of Traffic Accidents Based on the UrbanGB Dataset In this application example, the UrbanGB road accident spatial data published by the UCI Machine Learning Repository is used as historical traffic accident record data. This dataset contains the spatial locations of road traffic accidents recorded over approximately eleven years within a certain country, totaling approximately 360,000 accident records. Each record contains two spatial coordinate fields: longitude and latitude.
[0171] First, the historical traffic accident record data is preprocessed. Specifically, records with duplicate accident signs, missing coordinates, or non-limited coordinates are deleted, and the latitude and longitude coordinates are converted to a unified planar projected coordinate system with a linear unit of kilometers that covers a specific country. After preprocessing, records with the same location are merged according to their two-dimensional coordinate values to form a candidate location set with distinct coordinates that are associated with at least one accident record.
[0172] Then, a distance-guided squared probability sampling method is used to sequentially select several traffic accident locations from the candidate location set to form an ordered initialization center sequence. Specifically, firstly, a location is uniformly selected from the candidate location set as the first center of the sequence. Then, for each remaining unselected candidate location in the candidate location set, the least square Euclidean distance from it to the current selected center set is calculated. This distance is used as the weight of the selection probability of the unselected candidate location. According to this weight, the unselected candidate locations are sampled probabilistically, and a location is selected and added to the sequence. This process is repeated until the sequence length reaches the preset sampling upper limit. The preset sampling upper limit is set as the upper bound Kmax of the center number search interval. In this application example, Kmax is set to fifty. Multiple sequence prefixes of the ordered initialization center sequence are sequentially extracted. Each sequence prefix contains a different number of traffic accident locations, and the different number contains the preset target number. Initial center combinations are formed based on each sequence prefix.
[0173] Next, create sub-files for centers ranging from two to fifty, with each sub-file having a capacity of ten. Store the initial center combinations into their respective sub-files according to their center count.
[0174] Then, multiple rounds of iterative search are performed based on each sub-file until the number of iterations reaches the preset maximum number of iterations, at which point the iteration terminates. The preset maximum number of iterations is set to one thousand. The multi-round iterative search includes three search strategy phases: an exploration phase, a utilization phase, and an escape phase. The operator selection probability distributions differ for each search strategy phase. In the exploration phase, the selection probabilities for grouped normalized independent bit mutation, equal cardinality single exchange mutation, heavy-tailed multiple exchange mutation, and unordered center set crossover are set to 0.35, 0.25, 0.25, and 0.15, respectively. In the utilization phase, the selection probabilities for the above four operators are set to 0.15, 0.35, 0.15, and 0.35, respectively. In the escape phase, the selection probabilities for the above four operators are set to 0.20, 0.15, 0.50, and 0.15, respectively. In each iteration, a child generation operator is determined from the four operators mentioned above based on the operator selection probability distribution corresponding to the current search strategy stage. Parent center combinations are selected from the sub-files corresponding to the preset target number or all sub-files based on the parent source probability corresponding to the current search strategy stage. The child generation operator is then used to operate on the parent center combinations to generate child center combinations. The clustering quality evaluation value of the child center combinations is calculated. The child center combinations are then subjected to quality and diversity screening with the corresponding number of sub-files. The sub-files with the corresponding number of centers are updated based on the screening results. The quality tolerance for quality screening is set to 1.05, and the Dessian dissimilarity threshold for diversity screening is set to 0.5.
[0175] Finally, after multiple rounds of iterative search, target center combinations are determined from the sub-files corresponding to the preset number of targets. These target center combinations then provide discrete representative positions for the preset number of targets. In this application example, the preset number of targets is set to twenty. The candidate center combination with the lowest clustering quality evaluation value is selected from the sub-files with twenty centers as the target center combination. This combination contains twenty accident locations selected from the accident data rows, which are the discrete representative positions for the spatial clustering of road traffic accidents, used to characterize the representative positions of high-incidence areas of traffic accidents.
[0176] In this application example, the above method is used to perform spatial clustering analysis of traffic accidents on the UrbanGB dataset. This method can retain multiple high-quality candidate solutions with different center compositions under the same number of centers, and improve the search directionality through a multi-stage search strategy, thereby obtaining a better combination of discrete representative locations.
[0177] Application Example 2: Spatial Cluster Analysis of Traffic Accidents Based on STATS19 Data for a Certain Region In this application example, the STATS19 collision records for a specific region, published by the Road Safety Open Data of a certain country's Ministry of Transportation, are used as historical traffic accident record data. This dataset contains traffic accident records within a certain region, and each record includes an accident index and the east and north coordinates of the country's grid.
[0178] First, the historical traffic accident record data is preprocessed. Specifically, records with duplicate accident identifiers, missing coordinates, or non-limited coordinates are deleted. Since the dataset is already in a national grid coordinate system with linear units of meters, no coordinate transformation is required. After preprocessing, records with the same address are merged according to their two-dimensional coordinate values to form a candidate location set with distinct coordinates, each associated with at least one accident record.
[0179] Then, a distance-guided squared probability sampling method is used to sequentially select several traffic accident locations from the candidate location set to form an ordered initial center sequence. The preset sampling upper limit is set to the upper bound Kmax of the center number search interval; in this application example, Kmax is set to thirty. Multiple sequence prefixes are sequentially extracted from the ordered initial center sequence. Each sequence prefix contains a different number of traffic accident locations, and each different number contains a preset target number. Initial center combinations are formed based on each sequence prefix.
[0180] Next, create sub-files for centers ranging from two to thirty, with each sub-file having a capacity of ten. Store the initial center combinations into their respective sub-files according to their center count.
[0181] Then, multiple rounds of iterative search are performed based on each sub-file until the number of iterations reaches the preset maximum number of iterations, at which point the iteration terminates. The preset maximum number of iterations is set to 800. Three search strategy phases are set in the multi-round iterative search: exploration phase, exploitation phase, and escape phase. The operator selection probability distribution corresponding to each search strategy phase is the same as in Application Example 1. In each iteration, the offspring generation operator is determined from the above four operators according to the operator selection probability distribution corresponding to the current search strategy phase. Parent center combinations are selected from the sub-files corresponding to the preset target number or all sub-files according to the parent source probability corresponding to the current search strategy phase. The offspring generation operator is used to operate on the parent center combinations to generate offspring center combinations. The clustering quality evaluation value of the offspring center combinations is calculated. The offspring center combinations are then subjected to quality screening and diversity screening with the corresponding number of sub-files. The sub-files with the corresponding number of centers are updated according to the screening results. The quality tolerance for quality screening is set to 1.05, and the Dessian dissimilarity threshold for diversity screening is set to 0.5.
[0182] Finally, after multiple rounds of iterative search, target center combinations are determined from the sub-files corresponding to the preset number of targets. These target center combinations then provide discrete representative locations for the preset number of targets. In this application example, the preset number of targets is set to fifteen. The candidate center combination with the lowest clustering quality evaluation value is selected from the sub-files with fifteen centers as the target center combination. This combination contains fifteen accident locations selected from the accident data rows, which are the discrete representative locations for the spatial clustering of road traffic accidents, used to characterize the representative locations of high-incidence areas of traffic accidents.
[0183] In this application example, cluster analysis of traffic accident data in a certain region using the above method can obtain higher quality discrete representative location combinations in city-level accident analysis tasks, providing data support for traffic management departments to formulate targeted governance measures.
[0184] Application Example 3: Spatial clustering analysis of traffic accidents based on national STATS19 data of a certain country.
[0185] In this application example, the STATS19 collision records released by the Road Safety Open Data of a certain country's Ministry of Transportation are used as historical traffic accident record data. This dataset contains traffic accident records nationwide in the country, and each record includes an accident index and the country's grid coordinates in the east and north directions.
[0186] First, the historical traffic accident record data is preprocessed. Specifically, records with duplicate accident identifiers, missing coordinates, or non-limited coordinates are deleted. Since the dataset is already in a national grid coordinate system with linear units of meters, no coordinate transformation is required. After preprocessing, records with the same address are merged according to their two-dimensional coordinate values to form a candidate location set with distinct coordinates, each associated with at least one accident record.
[0187] Then, a distance-guided squared probability sampling method is used to sequentially select several traffic accident locations from the candidate location set to form an ordered initial center sequence. The preset sampling upper limit is set to the upper bound Kmax of the center number search interval; in this application example, Kmax is set to one hundred. Multiple sequence prefixes are sequentially extracted from the ordered initial center sequence, each sequence prefix containing a different number of traffic accident locations, and each different number contains a preset target number. Initial center combinations are formed based on each sequence prefix.
[0188] Next, create sub-files for centers ranging from two to one hundred, with each sub-file having a capacity of twenty. Store the initial center combinations into their respective sub-files according to their center count.
[0189] Then, multiple rounds of iterative search are performed based on each sub-file until the number of iterations reaches the preset maximum number of iterations, at which point the iteration terminates. The preset maximum number of iterations is set to 1,500. Three search strategy phases are set in the multi-round iterative search: exploration phase, exploitation phase, and escape phase. The operator selection probability distribution corresponding to each search strategy phase is the same as in Application Example 1. In each iteration, the offspring generation operator is determined from the above four operators according to the operator selection probability distribution corresponding to the current search strategy phase. Parent center combinations are selected from the sub-files corresponding to the preset target number or all sub-files according to the parent source probability corresponding to the current search strategy phase. The offspring generation operator is used to operate on the parent center combinations to generate offspring center combinations. The clustering quality evaluation value of the offspring center combinations is calculated. The offspring center combinations are then subjected to quality screening and diversity screening with the corresponding number of sub-files. The sub-files with the corresponding number of centers are updated according to the screening results. The quality tolerance for quality screening is set to 1.05, and the Dessian dissimilarity threshold for diversity screening is set to 0.5.
[0190] Finally, after multiple rounds of iterative searching, target center combinations are determined from the sub-files corresponding to the preset number of targets. These target center combinations then provide discrete representative positions for the preset number of targets. In this application example, the preset number of targets is set to fifty. The candidate center combination with the lowest clustering quality evaluation value is selected from the sub-files with fifty centers as the target center combination. This combination contains fifty accident locations selected from the accident data rows, which are the discrete representative positions for the spatial clustering of road traffic accidents, used to characterize the representative positions of high-incidence areas of traffic accidents.
[0191] In this application example, the above method is used to perform spatial clustering analysis of traffic accidents on the national STATS19 data of a certain country. This can obtain higher quality discrete representative location combinations in large-scale accident analysis tasks at the national level, providing data basis for the deployment of traffic safety resources and emergency response coverage analysis nationwide.
[0192] like Figure 2 As shown in some embodiments of this application, a spatial clustering optimization system for road traffic accidents is provided, the system comprising: The extraction module 210 is used to extract spatial coordinate information from each accident record in the historical traffic accident record data to construct a candidate location set. The spatial coordinates of each traffic accident location in the candidate location set are different from each other. The extraction module 220 is used to extract traffic accident locations from the candidate location set to form multiple initial center combinations, each initial center combination containing a different number of traffic accident locations. Module 230 is used to create sub-files for different numbers of traffic accident locations, so as to combine multiple initial centers and store them into the corresponding number of traffic accident locations in the sub-files. The optimization module 240 is used to perform multiple rounds of iterative search based on each sub-file until the number of iterations reaches the preset maximum number of iterations and then terminates the iteration. It determines the target center combination from the sub-files corresponding to the preset number of targets, and obtains the discrete representative positions of the preset number of targets based on the target center combination. The discrete representative positions are used to characterize the representative positions of areas with high incidence of traffic accidents. Multiple search strategy stages are set in the multiple rounds of iterative search, and the operator selection probability distribution is different for each search strategy stage. In each iteration of the multi-round iterative search, the following operations are performed: Based on the operator selection probability distribution and parent source probability corresponding to the current search strategy stage, parent center combinations are selected from each sub-file to operate on the parent center combinations and generate child center combinations. Calculate the cluster quality evaluation value of the offspring center combination; The sub-files corresponding to the number of traffic accident locations contained in the sub-center combination are subjected to quality screening and diversity screening to obtain the screening results; Update the sub-files corresponding to the number of traffic accident locations contained in the offspring center combination based on the screening results.
[0193] It should be noted that the road traffic accident spatial clustering optimization system provided in this embodiment is based on the same inventive concept as the road traffic accident spatial clustering optimization method described above. Therefore, the relevant content of the road traffic accident spatial clustering optimization method described above also applies to the content of the road traffic accident spatial clustering optimization system, and will not be repeated here.
[0194] This application also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the above-mentioned spatial clustering optimization method for road traffic accidents.
[0195] like Figure 3 , Figure 3 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. The electronic device includes: At least one memory 1600; At least one processor 1700; At least one program; The program is stored in memory, and the processor executes at least one program to implement the above-described spatial clustering optimization method for road traffic accidents as described in this application.
[0196] This electronic device can be any smart terminal, including mobile phones, tablets, personal digital assistants (PDAs), and in-vehicle computers.
[0197] The electronic devices according to embodiments of this application will now be described in detail.
[0198] The processor 1600 can be implemented using a general-purpose central processing unit (CPU), microprocessor, application specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application. The memory 1700 can be implemented as a read-only memory (ROM), static storage device, dynamic storage device, or random access memory (RAM). The memory 1700 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 1700 and is called and executed by the processor 1600 to implement the spatial clustering optimization method for road traffic accidents according to the embodiments of this application.
[0199] The input / output interface 1800 is used to implement information input and output. The communication interface 1900 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.). Bus 2000 transmits information between various components of the device (e.g., processor 1600, memory 1700, input / output interface 1800, and communication interface 1900); The processor 1600, memory 1700, input / output interface 1800 and communication interface 1900 are connected to each other within the device via bus 2000.
[0200] This application embodiment also provides a storage medium, which is a computer-readable storage medium storing computer-executable instructions for causing a computer to execute the above-described spatial clustering optimization method for road traffic accidents.
[0201] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0202] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.
[0203] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.
[0204] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0205] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.
[0206] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any related variations, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0207] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0208] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0209] The units described as separate components may or may not be physically separate. 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 the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0210] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0211] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part 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 multiple instructions to cause an electronic device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0212] The above is a detailed description of the preferred embodiments of this application. However, the embodiments of this application are not limited to the above-described implementation methods. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of the embodiments of this application. All such equivalent modifications or substitutions are included within the scope defined by the claims of the embodiments of this application.
[0213] The embodiments of this application have been described in detail above with reference to the accompanying drawings. However, this application is not limited to the above embodiments. Within the scope of knowledge possessed by those skilled in the art, various changes can be made without departing from the spirit of this application.
Claims
1. A spatial clustering optimization method for road traffic accidents, characterized in that, The method includes: Spatial coordinate information is extracted from each accident record in the historical traffic accident record data to construct a candidate location set, wherein the spatial coordinates of each traffic accident location in the candidate location set are different from each other; From the candidate location set, traffic accident locations are extracted to form multiple initial center combinations, and each initial center combination contains a different number of traffic accident locations; Sub-files are created for the different numbers of traffic accident locations, so that the multiple initial centers are combined and stored in the corresponding number of traffic accident locations in the sub-files. Based on each of the sub-files, multiple rounds of iterative search are performed until the number of iterations reaches a preset maximum number of iterations, at which point the iteration terminates. Target center combinations are determined from the sub-files corresponding to a preset number of targets, and discrete representative positions for the preset number of targets are obtained based on these target center combinations. These discrete representative positions are used to characterize representative positions of areas with high incidence of traffic accidents. The multiple rounds of iterative search include various search strategy stages, each with a different operator selection probability distribution. In each iteration of the multi-round iterative search, the following operations are performed: Based on the operator selection probability distribution and parent source probability corresponding to the current search strategy stage, parent center combinations are selected from each of the sub-files, and operations are performed on the parent center combinations to generate child center combinations. Calculate the cluster quality evaluation value of the offspring center combination; The sub-files corresponding to the number of traffic accident locations contained in the sub-center combination are subjected to quality screening and diversity screening to obtain the screening results; Update the sub-files corresponding to the number of traffic accident locations contained in the offspring center combination based on the filtering results.
2. The spatial clustering optimization method for road traffic accidents according to claim 1, characterized in that, The process involves extracting traffic accident locations from the candidate location set to form multiple initial center combinations, each initial center combination containing a different number of traffic accident locations, including: A distance-guided squared probability sampling method is used on the candidate location set to form an ordered initialization center sequence; wherein, the first center in the ordered initialization center sequence is uniformly selected from the candidate location set, and the selection probability of each unselected candidate location in the subsequent candidate location set is proportional to the least square Euclidean distance from each unselected candidate location to the current selected center set, until the number of centers in the ordered initialization center sequence reaches a preset sampling limit. Sequentially extract multiple sequence prefixes from the ordered initialization center sequence, each sequence prefix containing a different number of traffic accident locations, and the different number includes the preset target number; Initial center combinations are formed based on each of the sequence prefixes.
3. The spatial clustering optimization method for road traffic accidents according to claim 1, characterized in that, The step of selecting parent center combinations from each of the sub-files based on the operator selection probability distribution and parent source probability corresponding to the current search strategy stage, and then operating on the parent center combinations to generate child center combinations, includes: Based on the operator selection probability distribution corresponding to the current search strategy stage, the offspring generation operator is determined from grouping normalized independent position mutation, equal cardinality single exchange mutation, heavy-tailed multiple exchange mutation, and disordered center set crossover. Based on the parent source probability corresponding to the current search strategy stage, select a parent center combination from the sub-files corresponding to the preset number of targets or all sub-files; The offspring generation operator is used to operate on the parent center combination to generate an offspring center combination; wherein, when the operation of the offspring generation operator involves selecting a new center from the unselected traffic accident locations, the new center is determined based on the mixed selection probability, which includes a uniform base term and a distance guide term. The distance guide term is determined based on the proportion of the least square Euclidean distance from the unselected traffic accident location to the current parent center set to the sum of the corresponding distances of all unselected traffic accident locations.
4. The spatial clustering optimization method for road traffic accidents according to claim 3, characterized in that, The step of using the offspring generation operator to operate on the parent center combination to generate offspring center combinations includes: When the offspring generation operator is the grouped normalized independent position variation, the candidate position set corresponding to the parent center combination is divided into the selected center group and the unselected candidate position group. An equal removal probability is set for each selected center in the selected center group, and an entry probability is set for each unselected candidate position in the unselected candidate position group according to the mixed entry probability, wherein the sum of the removal probabilities of all selected centers is equal to the sum of the entry probabilities of all unselected candidate positions. Based on the removal probability of each selected center in the selected center group and the selection probability of each unselected candidate position in the unselected candidate position group, each bit of the binary selection vector corresponding to the parent center combination is independently randomly flipped to obtain the flipped binary selection vector; wherein, a value of one in the binary selection vector indicates that the corresponding candidate position is selected as a center, and a value of zero in the binary selection vector indicates that the corresponding candidate position is not selected as a center; The offspring center combination is formed based on the flipped binary selection vector.
5. The spatial clustering optimization method for road traffic accidents according to claim 3, characterized in that, The step of using the offspring generation operator to operate on the parent center combination to generate offspring center combinations includes: When the offspring generation operator is the same cardinality single exchange mutation, a center is randomly removed from the selected center of the parent center combination to obtain the first removal result; Based on the mixed selection probability, a center is selected from the unselected candidate positions of the parent center combination to obtain the first selection result; Based on the first removal result and the first selection result, a child center combination with the same number of centers as the parent center combination is generated.
6. The spatial clustering optimization method for road traffic accidents according to claim 3, characterized in that, The step of using the offspring generation operator to operate on the parent center combination to generate offspring center combinations includes: When the offspring generation operator is the heavy-tailed multi-exchange mutation, the upper limit of the exchangeable size is determined based on the number of selected centers, the number of unselected candidate positions, and the preset maximum exchange size of the parent center combination. If the upper limit of the exchangeable size is greater than or equal to two, an integer is drawn from the integer range of two to the upper limit of the exchangeable size as the size of this exchange; Randomly and without repetition, remove the number of centers of the current exchange scale from the selected centers of the parent center combination to obtain the second removal result; Based on the mixed selection probability, the number of new centers of the current exchange scale are selected without repetition from the unselected candidate positions of the parent center combination to obtain the second selection result; Based on the second removal result and the second selection result, a child center combination with the same number of centers as the parent center combination is generated.
7. The spatial clustering optimization method for road traffic accidents according to claim 3, characterized in that, The step of using the offspring generation operator to operate on the parent center combination to generate offspring center combinations includes: When the offspring generation operator is the intersection of the unordered center set, another center combination with the Dessian dissimilarity between the parent center combination and the parent center combination is selected from the sub-files to which the parent center combination belongs. The preset condition includes that the Dessian dissimilarity is the maximum value in the sub-files to which the parent center combination belongs. The centers contained in both the parent center combination and the other center combination are used as the initial center set of the offspring. From the union of the parent center combination and the other center combination, centers that have not yet been selected into the initial set of offspring centers are added one by one according to the mixed selection probability, until the number of centers in the offspring center combination reaches the number of centers in the parent center combination.
8. A spatial clustering optimization system for road traffic accidents, characterized in that, The system includes: The extraction module is used to extract spatial coordinate information from each accident record in the historical traffic accident record data to construct a candidate location set, wherein the spatial coordinates of each traffic accident location in the candidate location set are different from each other; An extraction module is used to extract traffic accident locations from the candidate location set to form multiple initial center combinations, each of the initial center combinations containing a different number of traffic accident locations. A construction module is used to create sub-files for the different numbers of traffic accident locations, so as to combine and store the multiple initial centers into the corresponding number of traffic accident locations in the sub-files. The optimization module is used to perform multiple rounds of iterative search based on each of the sub-files until the number of iterations reaches a preset maximum number of iterations, and then terminates the iteration. It determines the target center combination from the sub-files corresponding to the preset number of targets, and obtains the discrete representative positions of the preset number of targets based on the target center combination. The discrete representative positions are used to characterize the representative positions of areas with high incidence of traffic accidents. The multiple rounds of iterative search are set with multiple search strategy stages, and the operator selection probability distributions corresponding to each search strategy stage are different. In each iteration of the multi-round iterative search, the following operations are performed: Based on the operator selection probability distribution and parent source probability corresponding to the current search strategy stage, parent center combinations are selected from each of the sub-files, and operations are performed on the parent center combinations to generate child center combinations. Calculate the cluster quality evaluation value of the offspring center combination; The sub-files corresponding to the number of traffic accident locations contained in the sub-center combination are subjected to quality screening and diversity screening to obtain the screening results; Update the sub-files corresponding to the number of traffic accident locations contained in the offspring center combination based on the filtering results.
9. An electronic device, characterized in that, The method includes at least one processor and a memory for communicatively connecting to the at least one processor; the memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enable the at least one processor to perform a spatial clustering optimization method for road traffic accidents as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions for causing a computer to perform a spatial clustering optimization method for road traffic accidents as described in any one of claims 1 to 7.