A method for matching sudden event cases based on hierarchical feature encoding and weight self-optimization
By employing a hierarchical feature encoding and genetic algorithm-based weight optimization method, the problem of similarity calculation for heterogeneous features in highway emergencies was solved, achieving efficient and robust case matching and meeting the timeliness requirements of emergency response.
Patent Information
- Application Number
- CN202611283234.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-24
- Publication Date
- 2026-11-10
AI Technical Summary
In highway emergencies, existing technologies fail to effectively distinguish between categorical and text list features in heterogeneous feature similarity calculation methods. This leads to the dilution of core signals by sparse dimensions, and the weight setting relies on human experience, making it difficult to guarantee the robustness and generalization ability of the matching model in variable scenarios.
A hierarchical feature encoding method is adopted to encode categorical and text list features separately and calculate similarity independently in different metric spaces. A genetic algorithm is used to perform weight self-optimization to generate the globally optimal weight configuration and realize comprehensive similarity calculation.
By decoupling heterogeneous feature computation, the dilution of sparse features is prevented, thereby improving the robustness of matching and the timeliness of emergency response, ensuring the clarity of decision-making basis and the self-evolution capability of the model.
Smart Images

Figure CN123068533A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of intelligent traffic management and emergency decision-making technology, and particularly relates to a case similarity matching method for highway emergencies. Specifically, it is a case matching method that decodes the categorical features and text list features of the case in layers, calculates the similarity independently in different metric spaces, and uses a genetic algorithm to jointly and adaptively optimize the fusion weight and the embedded weight of the features. Background Technology
[0002] Highway emergencies are characterized by their suddenness and complex evolution, requiring management departments to determine response measures and allocate emergency resources within a very short timeframe. Case-based reasoning (CBR) is an efficient decision-making method that simulates the reuse of human experience. Its core lies in retrieving historical cases from a historical case database that are most similar to the current event situation, thereby reusing or adjusting the response plan based on those cases.
[0003] The accuracy of case matching directly determines the recommendation quality of the CBR system. The features of highway emergencies exhibit significant heterogeneity: one type consists of categorical features with limited values and extremely high information density, such as event type, weather conditions, and casualties; the other type consists of text list features with extremely high dimensions but extremely sparse values, such as lists of response measures and required resources. Traditional similarity methods typically concatenate the two types of features indiscriminately into a long vector and then uniformly calculate the cosine similarity. The large number of sparse dimensions severely dilutes the matching signal of the categorical features, causing cases with "completely different event types but some overlapping measures" to be abnormally ranked, resulting in serious mismatches. Furthermore, the importance of different features in similarity determination varies, and this difference may change under different event scenarios. Currently, weight setting largely relies on manual completion based on expert experience, which is not only inefficient but also difficult to guarantee optimal performance across the global case library, limiting the robustness and generalization ability of the matching model in variable scenarios.
[0004] Therefore, there is an urgent need for a case matching method that can decouple heterogeneous features, independently measure similarity in different granularity spaces, and automatically learn the optimal feature weights based on case data. Summary of the Invention
[0005] To address the aforementioned problems, this invention proposes a method for matching sudden event cases based on hierarchical feature encoding and weight self-optimization.
[0006] The specific process of a sudden event case matching method based on hierarchical feature encoding and weight self-optimization is as follows:
[0007] Step 1: Construct a multi-dimensional heterogeneous historical case library, and divide the case features in the historical case library into categorical feature groups and text list feature groups;
[0008] Step 2: Encode the categorical feature groups and the text list feature groups separately to generate independent matching representations;
[0009] Step 3: Based on independent matching representations, calculate category similarity and text set similarity in multi-granularity spaces respectively;
[0010] Step 4: Perform a weighted fusion of category similarity and text set similarity to obtain a comprehensive similarity score;
[0011] Step 5: Use a genetic algorithm to jointly and adaptively optimize the fusion weights and embedded weights in the comprehensive similarity to obtain the globally optimal weight configuration;
[0012] Step Six: For new emergencies, based on the globally optimal weight configuration, execute steps two through four to calculate the comprehensive similarity with all cases in the case library, and return the results in descending order. Most similar case.
[0013] The beneficial effects of this invention are as follows:
[0014] This invention presents a case matching method for sudden events based on hierarchical feature encoding and self-optimized weights. By completely decoupling categorical features and text list features and independently calculating similarity in different metric spaces, it effectively prevents the dilution of core scenario matching signals by high-dimensional sparse features, and the retrieval results strictly follow the cognitive logic of "scenario similarity priority." A genetic algorithm is used to jointly optimize the fusion weights and embedded weights, replacing manual experience-based assignment. This allows the weight configuration to adapt to the data distribution of the case library and the true importance relationship between event features, significantly improving the robustness of matching in rare scenarios. The hierarchical structure ensures that each component in the comprehensive similarity has a clear physical meaning, allowing decision-makers to clearly trace the matching basis, facilitating human-machine trust and subsequent adjustments as needed. The text list features use set intersection and union operations, eliminating the need for high-dimensional vector dot products. Combined with offline optimized weights, matching new events with hundreds of cases can be completed in milliseconds, meeting the stringent time requirements of emergency response to sudden events. The genetic algorithm optimization process can be performed concurrently with incremental updates to the case library, allowing the matching model to self-evolve its performance as the system runs, without requiring manual parameter retuning. Attached Figure Description
[0015] Figure 1 A flowchart illustrating the hierarchical feature encoding and weighted self-optimizing case matching method provided in this embodiment of the invention;
[0016] Figure 2 A schematic diagram illustrating the construction of one-hot encoding concatenation and embedded weight vectors for categorical features;
[0017] Figure 3 A schematic diagram illustrating the calculation of the Jaccard coefficient for text list-type features;
[0018] Figure 4 This is a schematic diagram of multi-granularity similarity weighted fusion and comprehensive similarity ranking.
[0019] Figure 5 This is a flowchart illustrating the adaptive optimization of the weight vector using a genetic algorithm. Detailed Implementation
[0020] Specific Implementation Method 1: The specific process of this implementation method for matching sudden event cases based on hierarchical feature encoding and weight self-optimization is as follows:
[0021] Step 1: Construct a multi-dimensional heterogeneous historical case library, and divide the case features in the historical case library into categorical feature groups and text list feature groups;
[0022] Step 2: Encode the categorical feature groups and the text list feature groups separately to generate independent matching representations;
[0023] Step 3: Based on independent matching representations, calculate category similarity and text set similarity in multi-granularity spaces respectively;
[0024] Step 4: Perform a weighted fusion of category similarity and text set similarity to obtain a comprehensive similarity score;
[0025] Step 5: Use a genetic algorithm to jointly and adaptively optimize the fusion weights and embedded weights in the comprehensive similarity to obtain the globally optimal weight configuration;
[0026] Step Six: For new emergencies, execute steps two through four based on the globally optimal weight configuration. At this point, the query events in steps three and four are the new emergencies. Calculate the comprehensive similarity with all cases in the case library and return them in descending order. ( The most similar cases are used as candidate pools for subsequent scheme fusion.
[0027] Specific Implementation Method Two: This implementation method differs from Specific Implementation Method One in that step one involves constructing a multidimensional heterogeneous case library, defining the case features in the case library in a hierarchical manner, and obtaining categorical feature groups and text list feature groups.
[0028] The specific process is as follows:
[0029] Collect historical records of emergency response on highways to create a case database;
[0030] Each case includes ten feature fields: event type, weather conditions, casualties, response level, triggering condition keywords, set of response measures, set of required resources, set of responsible agencies, set of road sections, and text description of the contingency plan;
[0031] The first five fields of event type (single-value categorical), weather conditions (single-value categorical), casualty situation (single-value categorical), response level (single-value categorical), and trigger condition keywords (multi-value derived) are divided into categorical feature groups;
[0032] The event types include 16 categories, namely: high traffic volume, snow and ice disasters, severe snowstorms, severe rainstorms, severe weather, dense fog, road icing, geological disasters, landslides, slope collapses, road subsidence, bridge structural damage, tunnel fires, major traffic accidents, multi-vehicle pile-up, and hazardous chemical leaks.
[0033] The weather includes 7 types: snow, heavy rain, rain, fog, sunny, low temperature, and overcast.
[0034] Casualties are categorized into three types: none, possibly, and present.
[0035] There are four response levels: Level response Level response Level response Level response;
[0036] The triggering conditions include 18 keywords, namely blizzard, road icing, fog, continuous rainfall, strong wind, earthquake, landslide, mudslide, high temperature, low temperature, insufficient visibility, water accumulation, rockfall, landslide, bridge icing, tunnel smoke, crosswind, and blowing sand.
[0037] The four fields—the set of disposal measures, the set of required resources, the set of responsible agencies, and the set of road sections—are divided into text list-type feature groups.
[0038] The set of response measures includes 34 types, namely traffic control, de-icing and snow removal, demolition and rescue, road closure notices, medical treatment, increased monitoring, road condition patrols, personnel evacuation, on-site reconnaissance, professional dilution, intensive firefighting, fire fighting, information reporting, drainage and flood control, slope patrol, fog lights on full operation, personnel escape and evacuation, positive pressure ventilation, on-site evidence collection, obstacle removal and road restoration, speed limit warnings, anti-skid treatment, structural flaw detection, temporary hydraulic jacking, steel support reinforcement, structural assessment, tank transfer, environmental monitoring, decontamination and verification, dynamic monitoring, rockfall removal, slope toe support reinforcement, emergency dredging, and personnel search and rescue.
[0039] The required resource set includes 30 items: variable message signs, electronic displays, mobile SMS platforms, traffic cones, signs, snowplows, de-icing agents, anti-skid sand, machinery and equipment, de-icing chemicals, toxic gas detectors, empty liquid ammonia tankers, environmental emergency monitoring vehicles, positive pressure breathing apparatus, slope synthetic aperture radar, high-precision total station, tracked large excavators, heavy-duty dump trucks, drones, roadblock facilities, heavy-duty clearing trailers, ultrasonic detectors, 3D laser scanners, hydraulic synchronous lifting jacks, ambulances, medical teams, truck cranes, tunnel-specific smoke extraction fire trucks, heavy-duty foam fire trucks, and high-pressure water jet fire trucks.
[0040] The responsible agencies include 15 entities: the Provincial Department of Transportation, the Expressway Traffic Police Detachment, the Road Administration Brigade, the Special Service Brigade of the Fire and Rescue Detachment, the Health Commission, the Road Clearing and Rescue Traffic Maintenance Sub-center, the Road Section Network Monitoring Center, the Maintenance Department, the Geotechnical Engineering Expert Group, the Facility Repair Team, the Service Area and Civil Affairs Department, the Provincial Emergency Command Center, the Ecological Environment Department, the Natural Resources Department, and the Highway Survey and Design Institute.
[0041] The road section collection includes 8 types: expressway, first-class highway, important road section, bridge deck, ramp, service area, low-lying road section, and slope.
[0042] The text description field of the contingency plan can participate in the subsequent deep semantic matching module, but is not included in the hierarchical feature matching framework described in this invention.
[0043] The other steps and parameters are the same as in Specific Implementation Method 1.
[0044] Specific Implementation Method 3: This implementation method differs from Specific Implementation Method 1 or 2 in that step 2 involves encoding the category-type feature group and the text list-type feature group separately to generate independent matching representations;
[0045] The specific process is as follows:
[0046] Step Two One
[0047] One-hot encoding is performed on the four single-value category fields of event type, weather conditions, casualties and response level in the categorical feature group according to their value space.
[0048] The specific process is as follows:
[0049] There are 16 event types, and an encoding mapping table is created with indices 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, and 15.
[0050] There are 7 types of weather; an encoding mapping table with indices 0, 1, 2, 3, 4, 5, and 6 is established.
[0051] There are three types of injuries and fatalities; an encoding mapping table with indices 0, 1, and 2 is established.
[0052] There are four response levels, and an encoding mapping table with indices 0, 1, 2, and 3 is established.
[0053] For each case, the four fields of event type, weather conditions, casualties, and response level are converted into one-hot vectors according to the coding mapping table; represented as:
[0054] The event type one-hot vector has a length of 16, with the index position corresponding to the value being 1 and the rest being 0;
[0055] The length of the weather heat vector is 7, and the index position corresponding to the value is 1, while the rest are 0;
[0056] The length of the casualty hot vector is 3, and the index position corresponding to the value is 1, while the rest are 0;
[0057] The length of the response level one-hot vector is 4, with the index position corresponding to the value being 1 and the rest being 0;
[0058] Step Two Two
[0059] By concatenating the one-hot vectors of the four fields—event type, weather conditions, casualties, and response level—in order, we obtain... Dense class vectors; specifically:
[0060] By concatenating the four one-hot vectors in sequence, we obtain... Dense class vectors;
[0061] Steps two and three
[0062] The trigger condition keyword field is based on a pre-compiled fixed keyword vocabulary (vocabulary size is...). Multi-Hot Encoding is performed; specifically:
[0063] A glossary of 18 key environmental terms was compiled and standardized by experts in the field, including: blizzard, road icing, fog, continuous rainfall, strong wind, earthquake, landslide, mudslide, high temperature, low temperature, low visibility, water accumulation, rockfall, landslide, bridge icing, tunnel smoke, crosswind, and blowing sand.
[0064] Each case study is queried across 18 dimensions corresponding to the thesaurus. If the thesaurus contains the keywords corresponding to the case study, the corresponding dimension is marked as 1; otherwise, it is marked as 0, forming a... Multidimensional heat vector;
[0065] For example, if the Condition-keywords of the case are {road icing, blizzard}, then the “road icing” and “blizzard” dimensions are marked as 1, and the other 16 dimensions are marked as 0;
[0066] Step Two Four
[0067] Will Dense class vectors and Multidimensional heat vector concatenation yields 3D category feature vector ;
[0068] Step Two Five
[0069] To achieve a controllable difference in importance between features within a category feature group and other features in similarity calculation, a feature vector similar to the category feature vector is constructed. Same dimension Embedded weight vector ;
[0070] The specific process is as follows:
[0071] Class feature vector of Each dimension is divided into five paragraphs based on its corresponding feature field:
[0072] Event type segment The adjustable weight of the event type segment is: Set the initial adjustable weight of the event type segment to [value]. ; Dimensions are 1 to 16.
[0073] Weather section The adjustable weight of the weather segment is: Set the initial adjustable weight of the weather segment to [value]. ; Dimensions are 17 to 23.
[0074] Casualty Section The adjustable weight of the injury / death segment is: The initial adjustable weight of the casualty segment is set to [value]. ; Dimensions are 24 to 26.
[0075] Response level range The adjustable weights of the response level segments are: Set the initial adjustable weight of the response level segment to [value]. ; Dimensions are 27 to 30.
[0076] Conditional keyword segment Dimension, adjustable weights are The initial adjustable weight of the conditional keywords is set to [value]. ; Dimensions are 31 to 48.
[0077] Five weights , , , , Constructing an embedded weight vector ;
[0078]
[0079] Step 26
[0080] Text list-type feature encoding is performed on the four fields of disposal measures set, required resources set, responsible agency set, and road section set in the text list-type feature group to obtain the disposal measures set, required resources set, responsible agency set, and road section set after text list-type feature encoding;
[0081] The specific process is as follows:
[0082] The set of disposal measures is not vectorized, but only retained as a mathematical set;
[0083] The required resource set is not vectorized, but only retained as a mathematical set;
[0084] The set of responsible agencies is not vectorized, but is retained only as a mathematical set;
[0085] The set of road segments is not vectorized; it is retained only as a mathematical set.
[0086] For example, the set of measures for handling Case A ={Traffic control, de-icing and snow removal, anti-skid treatment}, resource collection ={snowplow, de-icing agent, cones} etc., provide direct input for subsequent Jaccard coefficient calculation.
[0087] For each case, each text list field is stored as a collection of 1, 2, 3, or 4 text items, denoted as . ,in ;
[0088] The aforementioned "several text items" refers to one, two, three, or four of the following: the set of disposal measures, the set of required resources, the set of responsible agencies, and the set of road sections.
[0089] A collection of disposal measures; For the required resource set; For the collection of responsible agencies; This is a set of road sections.
[0090] This encoding method fundamentally avoids the generation of ultra-high-dimensional sparse vectors, providing a direct data foundation for subsequent Jaccard coefficient calculation in the set metric space.
[0091] Other steps and parameters are the same as in specific implementation method one or two.
[0092] Specific Implementation Method Four: This implementation method differs from one of the specific implementation methods one to three in that, in step three, based on independent matching representations, category similarity and text set similarity are calculated separately in multi-granularity spaces;
[0093] The specific process is as follows:
[0094] Step 31
[0095] For query events With the first case in the case library Historical Cases Calculate events With the Historical Cases The category similarity in the category feature space, where the category similarity is the first similarity;
[0096] The query event in step three is an event in the case library, the first event in the case library. Historical Cases These are events in the case library other than query events;
[0097] The query event in step six is a new query event, which is an event that does not exist in the case library;
[0098] The specific process is as follows:
[0099] Step 3.11: Query Event of 3D category feature vector and the first in the case library Historical Cases of 3D category feature vector Each with the embedded weight vector Perform element-wise multiplication (Hadamard product) to obtain the weighted eigenvectors;
[0100] Step 3.12: Calculate the cosine similarity between the two weighted vectors; the mathematical expression is:
[0101]
[0102] In the formula:
[0103] To query events With the first case in the case library Historical Cases First similarity in the category feature space;
[0104] To query events of 3D category feature vector (composed of one-hot and multi-hot encodings);
[0105] For the first case in the case library Historical Cases of 3D category feature vector;
[0106] for dimensional embedded weight vector, Importance coefficients for each element corresponding to different category sub-features;
[0107] The symbol for element-wise multiplication of vectors; This is the vector dot product operator; The L2 norm operator for vectors;
[0108] Step 3.2
[0109] Calculate query events using Jaccard coefficients With the first case in the case library Historical Cases In the text list field The text set similarity is calculated using the second similarity metric.
[0110] The specific process is as follows:
[0111] Calculate query events using Jaccard coefficients With the case library Historical Cases In the set of disposal measures Second similarity ;
[0112] Calculate query events using Jaccard coefficients With the case library Historical Cases In the required resource set Second similarity ;
[0113] Calculate query events using Jaccard coefficients With the case library Historical Cases In the group of responsible agencies Second similarity ;
[0114] Calculate query events using Jaccard coefficients With the case library Historical Cases Collection in road sections Second similarity ;
[0115] The Jaccard coefficient is a classic metric for measuring the similarity between two finite sets. It is defined as the ratio of the number of elements in the intersection of the two sets to the number of elements in the union of the two sets.
[0116] Calculate query events using Jaccard coefficients With the case library Historical Cases In each field Second similarity The calculation method is as follows:
[0117]
[0118] In the formula: ;
[0119] To query events Fields extracted The collection of text items (query events) Input to the Natural Language Processing (NLP) information extraction module; output the query event from the Natural Language Processing (NLP) information extraction module. Fields extracted (a collection of text items);
[0120] For the first case in the case library Historical Cases Fields extracted The collection of text items (the first in the case library) Historical Cases Input to the Natural Language Processing (NLP) information extraction module; output from the Natural Language Processing (NLP) information extraction module. Historical Cases Fields extracted (a collection of text items);
[0121] For set The potential, i.e., the set The number of elements in the middle;
[0122] For set The potential, i.e., the set The number of elements in the middle;
[0123] The intersection operator; This is the union operator;
[0124] The other steps and parameters are the same as those in one of the specific implementation methods one to three.
[0125] Specific Implementation Method Five: This implementation method differs from one of the specific implementation methods one to four in that step four involves weighted fusion of category similarity and text set similarity to obtain a comprehensive similarity.
[0126] The specific process is as follows:
[0127] Step 41: Set the weights of the categorical feature groups as follows. The weights of the set of treatment measures are set as follows: Set the weight of the required resource set as follows: The weight of the set of responsible agencies is set as follows: The weights of the road segment set are set as follows: ;
[0128] Weight , , , , The following normalization constraints must be satisfied:
[0129]
[0130]
[0131] Step 42: Based on weights , , , , For the first similarity Second similarity , , , Perform weighted fusion to obtain the query events. With the case library Historical Cases Overall similarity ;
[0132] The calculation formula is:
[0133] .
[0134] The other steps and parameters are the same as those in one of the specific implementation methods one to four.
[0135] Specific Implementation Method Six: This implementation method differs from one of the specific implementation methods one to five in that step five, in which a genetic algorithm is used to jointly and adaptively optimize the weights to obtain the globally optimal weight configuration;
[0136] Weights include the weights of categorical feature groups. Weight of the set of disposal measures Weight of the required resource set Weight of the set of responsible agencies The weight of the road segment set is Adjustable weights for event type segments Adjustable weights for weather segments Adjustable weights for injury / death segments Adjustable weights for response level segments and conditional keyword segments ;
[0137] The specific process is as follows:
[0138] The process includes four stages: chromosome encoding and decoding, fitness function design, genetic operation iteration, and optimal weight output.
[0139] Step 51: Let the number of iterations be... ;
[0140] Step 52: Chromosome Encoding and Decoding;
[0141] Step 53: Generate the initial population;
[0142] Step 54: Construct the fitness function;
[0143] Step 55: Determine if the termination condition is met;
[0144] When the termination condition is met, the genetic algorithm stops iterating and outputs the individual with the highest fitness in the population during the last iteration. As the globally optimal weight configuration:
[0145] When the termination condition is not met, let the number of iterations... Continue with steps five and six until the termination condition is met;
[0146] The termination condition is either condition 1 or condition 2;
[0147] Condition 1 is continuous (In this embodiment, the following is taken) The increase in the optimal fitness value is less than the preset threshold. (This embodiment takes) This indicates that the search has converged sufficiently;
[0148] Condition 2 is to reach the preset maximum algebra. (This embodiment takes) This forces the iteration to terminate.
[0149] The individual with the highest fitness for:
[0150] .
[0151] The optimal weight is persistently stored and synchronously updated to the similarity calculation module of the online inference engine to complete the weight self-optimization process.
[0152] Step 56: Generate a new generation of population through selection, crossover, and mutation, and add the elite retention process to the new generation of population in step 54.
[0153] The other steps and parameters are the same as those in one of the specific implementation methods one to five.
[0154] Specific Implementation Method Seven: This implementation method differs from Specific Implementation Methods One to Six in that: step five two, chromosome encoding and decoding;
[0155] The specific process is as follows:
[0156] When encoding chromosomes, the fusion weights to be optimized , , , , and embedded weights , , , , Individuals composed of real chromosomes in sequence , is represented as:
[0157]
[0158] In the formula:
[0159] This represents a chromosome individual in the genetic algorithm, containing a total of 10 gene loci;
[0160] Decoding chromosomes requires imposing constraints to ensure the validity of parameters. The process is as follows:
[0161] For individuals with real chromosomes The first 5 fusion weights are subject to nonnegativity and normalization constraints. , ;
[0162] For individuals with real chromosomes The last 5 embedded weights Apply interval constraints, meaning each weight is located at a preset lower bound. and the Upper Realm In one embodiment of the present invention, L=0.5 and U=5.0 are set to avoid the corresponding sub-features from becoming completely ineffective due to the weights approaching 0, while reserving a weight advantage space of several times for the key features.
[0163] The other steps and parameters are the same as those in one of the specific implementation methods one to six.
[0164] Specific Implementation Method Eight: This implementation method differs from Specific Implementation Methods One through Seven in that: Step Five Three, generating the initial population, is as follows:
[0165] Preset population size (In this embodiment, we take) );
[0166] For each chromosome of an individual in the population, first in Within the interval, the first 5 gene loci are uniformly randomly sampled, and then L1 norm normalization is performed on the randomly sampled first 5 gene loci (i.e., each value is divided by the sum of the five values) to ensure that the sum of the five values is 1; for the last 5 gene loci... Uniform random sampling is performed within the interval;
[0167] Repeat the above process Next, generated by The initial population consisted of individuals with 10 chromosomes.
[0168] The other steps and parameters are the same as those in any of the specific implementation methods one to seven.
[0169] Specific Implementation Method Nine: This implementation method differs from Specific Implementation Methods One through Eight in that: Step Five Four, constructing the fitness function, specifically involves the following process:
[0170] Step 541: Extract a subset of cases from the historical case library in Step 1 (the complete historical case library used in Steps 1 to 4 consists of 58 cases; this validation set only appears in Step 5, meaning a subset of events from the case library is used to verify the model's effectiveness). Construct the validation set. The validation set contains One event ( The test set contains the number of events, which is the number of validation samples extracted from the historical case library to verify the quality of the weight configuration and the standard answers with annotations. Each event has been labeled with a corresponding ideal matching case by domain experts in advance (this ideal matching case is a "standard response" to the validation set event, just like a label "stuck" on the validation event).
[0171] Step 542: For each event in the validation set , Use the current weight configuration Perform steps two, three, and four to calculate each event in the validation set. The overall similarity is calculated with the remaining historical cases in the case library after removing the validation set (that is, the retrieval case library mentioned in the example). At this time, the query events in steps three and four are the events in the validation set, and the comparison objects are the historical cases in the retrieval case library; and they are arranged in descending order of similarity from high to low.
[0172] Step 543: In the ranking results, rank the historical cases corresponding to the highest similarity values (i.e., the cases marked as ideal matches). The ranking of historical cases corresponding to the second highest similarity value And so on;
[0173] Step 544, based on Ranking of events Calculate the fitness function; expressed as:
[0174]
[0175] In the formula: The fitness value is the weight combination Θ. To verify the total number of events in the set;
[0176] For the first The ranking position of correct cases in the similarity ranking under each verification event.
[0177] The other steps and parameters are the same as those in one of the specific implementation methods one to eight.
[0178] Specific Implementation Method Ten: This implementation method differs from Specific Implementation Methods One through Nine in that: in step five and six, generating a new generation population through selection, crossover, and mutation, and then adding elite retention to the generated new generation population in step five and four; the process is as follows:
[0179] Step 561: Generate a new generation of population through selection, crossover, and mutation;
[0180] The process is as follows:
[0181] Selection operation: A tournament selection strategy is adopted;
[0182] The tournament selection strategy is to randomly select from the current population each time. Individual (in this embodiment, we take) ),Compare For each individual, select the individual with the highest fitness value as the parent; repeat this process until a parent is selected. A sufficient number of parent individuals;
[0183] The advantage of tournament betting over roulette betting is that the pressure of choosing is controllable (through adjustments). The value is independent of the sign of the fitness function and scaling transformation;
[0184] Crossover operation: Perform simulated binary crossover (SBX) on two paired parent individuals to obtain offspring genotypes; the specific process is as follows:
[0185] SBX is a crossover operator widely used in real-number encoded genetic algorithms, capable of simulating the search behavior of binary-coded crossover in the real-number space.
[0186] For two parent individuals and In each gene locus Above, with the set crossover probability (This embodiment takes) ) Decide whether to perform crossover;
[0187] If crossover is not performed, the offspring gene locus values directly inherit the corresponding gene locus values from the parent, that is:
[0188]
[0189] In the formula: , For offspring 1 and offspring 2 respectively in the 1st and 2nd generations Values at each gene locus;
[0190] , Parent individuals and parental individuals In the Values at each gene locus;
[0191] If crossover is performed, the offspring genotype values are generated by the following formula:
[0192]
[0193]
[0194] In the formula: , For offspring 1 and offspring 2 respectively in the 1st and 2nd generations Values at each gene locus;
[0195] , Parent individuals and parental individuals In the Values at each gene locus;
[0196] Let [the number of] propagation factors be uniformly random numbers in the range [0,1). After transformation, the transformation formula is:
[0197]
[0198] in, This is a distribution parameter that controls the degree of similarity between offspring and parents. The larger the offspring, the more concentrated they are near their parents. In this invention, we take... This ensures that the offspring produced by crossover have a higher probability of inheriting the superior genes of their parents, while retaining a certain degree of exploratory ability.
[0199] Mutation operation: For each progeny locus value obtained from the crossover operation, a set mutation probability is applied. (This embodiment takes) Independently decide whether to perform mutation;
[0200] If no mutation is performed, the offspring genotype values obtained by the crossover operation remain unchanged;
[0201] If mutation is performed, a Gaussian distribution is superimposed on the progeny loci values obtained from the crossover operation. Random perturbations;
[0202] in, For the standard deviation parameter, this embodiment takes... Mutation operations introduce new genetic material into a population, which is a key mechanism for maintaining population diversity and preventing premature convergence.
[0203] Step 562
[0204] The new generation population generated in step 561 through selection, crossover, and mutation is repaired to obtain the repaired new generation population.
[0205] The specific process is as follows:
[0206] Repair strategy: Crossover and mutation operations may violate the legality constraints of chromosomes, therefore repair processing is required after each genetic operation;
[0207] Each real chromosome individual in the new generation population generated in step 561 through selection, crossover, and mutation. Divide each of the first 5 fusion weights by the sum of the first 5 fusion weights, so that the sum of the first 5 fusion weights after normalization equals 1;
[0208] like If a normalized value of one of the first 5 fusion weights is negative, the corresponding fusion weight will be reset to zero and then normalized again.
[0209] If the sum of the first 5 normalized fusion weights is zero, then reset to a uniform distribution (that is, set the values of the five fusion weights to an equal value, which is 0.2).
[0210] For each real chromosome individual in the new generation population generated through selection, crossover, and mutation in step 561. If any of the last 5 embedded weights exceeds a preset boundary... If the reflection still exceeds the preset boundary, then the boundary value is taken.
[0211] The boundary reflection repair strategy process is as follows:
[0212] If one of the last 5 embedded weights is greater than Then set the embedded weight value to Subtract the excess amount;
[0213] If the value of any of the last 5 embedded weights is less than Then set the embedded weight value to Add the insufficient amount;
[0214] Steps 5 and 63
[0215] Elite preservation strategy: To prevent the loss of optimal solutions discovered during evolution due to the randomness of crossover and mutation, after each generation iteration, the best-fit solution in the current population is selected. Individual (in this embodiment, we take) The individuals are directly copied into step five and four, without participating in crossover and mutation operations. (In each generation of the genetic algorithm, selection, crossover, and mutation generate a new batch of individuals; then, the best-performing individuals are taken from the original batch and moved over without modification. These five best-performing individuals are simply copied and placed into the next generation; they do not pair up or change themselves. Therefore, they "do not participate in crossover and mutation.") The elite preservation strategy ensures the monotonically convergent nature of the algorithm, and the optimal fitness value does not decrease with each generation.
[0216] The other steps and parameters are the same as those in any of the specific implementation methods one to nine.
[0217] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be described in further detail below with reference to the accompanying drawings and specific embodiments. The specific embodiments described herein are for illustrative purposes only and do not constitute a limitation thereof.
[0218] As attached Figure 1 As shown, this method comprises six main steps: S1 Case library construction and feature layering → S2 Layered encoding → S3 Multi-granularity similarity calculation → S4 Similarity fusion and ranking → S5 Genetic algorithm weight self-optimization → S6 Retrieval output based on optimized weights. S5 is the offline training phase, while S1-S4 and S6 are the online inference phases.
[0219] Offline training phase (step S5): This phase is executed before system deployment or after a significant incremental update to the case library. It takes the historical case library and expert-annotated validation set as input and uses a genetic algorithm to adjust the fusion weights. , , , , and embedded weights , , , , Perform joint optimization and output the optimal weight configuration. It is then persistently stored. This stage can be repeated periodically or on demand to achieve continuous evolution of the weights.
[0220] Online Inference Phase (Steps 1-6): Real-time response to requests for handling new emergencies. This involves sequentially loading the case library and defining feature hierarchies, extracting new event features and hierarchical encoding, multi-granularity similarity calculation, weighted fusion and ranking of comprehensive similarities, and outputting Top-K similar cases. This phase uses the optimal weights generated during the offline training phase. .
[0221] Step 1: Build a case library and perform feature stratification.
[0222] A case library for training and testing was constructed by extracting cases from known highway emergency plans and historical response records. The case library built in this embodiment contains 58 cases, covering 16 event types, including snowstorms, multi-vehicle pileups, tunnel fires, hazardous chemical leaks, and landslides. Each case has been validated by domain experts and contains ten fields, as shown in Table 1.
[0223]
[0224] Based on the mathematical representation properties and matching semantics of the fields, the following layering is performed:
[0225] The categorical feature group (5 fields) consists of single-value categorical fields: Event-type (16 possible values), weather (7 possible values), casualty (3 possible values), and Response-level (4 possible values), while Condition-keywords (18-dimensional keyword list) is a multi-value derived field. These five fields collectively depict the "contextual profile" of the event and are the core criterion for determining whether two events belong to the same handling scenario.
[0226] The text list feature group (4 fields): actions, resources, orgs, and road-section are all collections of text items of variable length. These four fields together depict the "handling profile" of the event, providing auxiliary matching information at the solution level.
[0227] Long text field (1 field): Plan-text is a full description of the plan, which can be used with pre-trained language models such as BERT to extract semantic similarity. This part is not covered by the hierarchical framework described in this invention, but can be added to the fusion framework as an independent similarity component as needed.
[0228] Step 2: Hierarchical feature encoding.
[0229] First, determine the value space and encoding dictionary for each single-value category field. In this embodiment:
[0230] Event types: 16 types, indexed. The encoding mapping table;
[0231] Weather: 7 types (snow, heavy rain, rain, fog, sunny, low temperature, cloudy), indexed. The encoding mapping table;
[0232] Casualty: 3 types (none, possible, present), create an index The encoding mapping table;
[0233] Response level: 4 types Level response Level response Level response Level response), create index The encoding mapping table.
[0234] For each case, convert the above four fields into one-hot vectors according to the encoding mapping table:
[0235] Event type one-hot vector: length 16, the index position corresponding to the value is 1, and the rest are 0;
[0236] Weather hot vector: length 7, the index of the value is 1, and the rest are 0;
[0237] Casualty hot vector: length 3, the index position corresponding to the value is 1, and the rest are 0;
[0238] Response level one-hot vector: length 4, the index position corresponding to the value is 1, and the rest are 0.
[0239] By concatenating the four one-hot vectors in sequence, we obtain... A dense class vector of dimensions.
[0240] Regarding condition-keywords, a thesaurus of 18 key environmental terms was compiled and standardized by domain experts. These include: blizzard, icy roads, fog, continuous rainfall, strong winds, earthquake, landslide, mudslide, high temperature, low temperature, low visibility, water accumulation, rockfall, landslide, bridge icing, tunnel smoke, crosswind, and blowing sand. For each case, in the 18 dimensions corresponding to the thesaurus, if the trigger condition determines that the condition contains the keyword, that dimension is marked as 1; otherwise, it is marked as 0, forming a... Multidimensional heat vector. For example, if the Condition-keywords of the case are {road icing, blizzard}, then the “road icing” and “blizzard” dimensions are labeled with 1, and the other 16 dimensions are 0.
[0241] By concatenating the 30-dimensional dense vector with the 18-dimensional multi-heat vector, we obtain... Dimensional categorical feature vectors.
[0242] To differentiate the importance of different sub-features, an embedded weight vector of 48 dimensions is constructed. Its construction method is to fill segments according to feature sub-segments:
[0243] Event type segment (the first) Dimension): Fill in the coefficient uniformly. The initial value is set to 3.0;
[0244] Weather segment (number) Dimension): Fill in the coefficient uniformly. The initial value is set to 2.0;
[0245] Casualty Section (Number) Dimension): Fill in the coefficient uniformly. The initial value is set to 2.0;
[0246] Response level segment (number) Dimension): Fill in the coefficient uniformly. The initial value is set to 1.0;
[0247] Conditional keyword segment (the first) Dimension): Fill in the coefficient uniformly. The initial value is set to 1.0.
[0248] Right now These five coefficients will participate in evolution as independent gene loci during genetic algorithm optimization.
[0249] Text list-based feature encoding: The four text list fields are not vectorized, but only retained as mathematical sets. For example, the set of disposal measures in Case A. Resource collection This provides direct input for subsequent Jaccard coefficient calculations.
[0250] Step 3: Calculate the similarity at multiple granularities.
[0251] First similarity: For new events and Case Studies , and its category feature vector and respectively with After obtaining the weighted vector through element-wise multiplication, the cosine similarity is calculated. Since all dimensions are non-negative, this value lies in... Intervals. Weights amplify the matching signals on key fields. For example, when event types are different, even if the remaining fields highly overlap, the weighted numerator will be significantly reduced due to the large weight dimension being 0.
[0252] Second similarity: The Jaccard coefficient is calculated for each of the four text list fields. The Jaccard coefficient is not sensitive to the size of the set. Even if the new event only extracts 2 measures while the case contains 8 measures, as long as these 2 measures are included, the coefficient is still 0.25, which does not over-penalize like vector cosine.
[0253] Step 4: Combine similarity fusion and ranking.
[0254] Set fusion weights , , , , The initial stage was set up based on expert experience. , , , , This ensures that category features dominate the contribution to overall similarity. The matching results are obtained by calculating the overall similarity of all cases in the case library and then sorting them in descending order.
[0255] Step 5: Weight joint self-optimization based on genetic algorithm.
[0256] To free weight allocation from manual intervention, a genetic algorithm is introduced to jointly optimize the fused weights and embedded weights.
[0257] Chromosome encoding and population initialization. Chromosome encoding arranges 10 parameters to be optimized on a real number of chromosomes: During decoding, the first 5 fusion weights are non-negative and sum to 1, while the last 5 embedded coefficients are located at... The population size is set to 50.
[0258] Fitness assessment. From 58 cases, 15 cases were selected as the validation set using stratified sampling. (Covering 12 of the 16 event types to ensure representativeness of the type distribution), the remaining 43 entries serve as the search case library. For each verification event, a full database search and ranking are performed using the current weight, and the ranking of correct cases is recorded. The MRR is calculated as the fitness value of the individual.
[0259] Genetic operation parameter settings.
[0260] Options: Tournament Selection, Tournament Size ;
[0261] Crossover: Simulated binary crossover (SBX), crossover probability Distribution parameters ;
[0262] Mutation: Gaussian mutation, mutation probability Standard deviation ;
[0263] Elite retention: Five best individuals are retained in each generation;
[0264] Termination condition: MRR improvement is less than 20 consecutive generations. Or it can reach the maximum number of generations, 100.
[0265] Optimization process and convergence analysis
[0266] In the initial population (generation 0), due to randomized weight initialization, the average fitness rate (MRR) of each individual is approximately 0.67, and the optimal individual's MRR is 0.79. As the genetic iteration progresses, both the average fitness and the optimal fitness of the population exhibit a monotonically increasing trend. The convergence speed is relatively fast within the first 20 generations, with the MRR rapidly increasing from 0.79 to approximately 0.91. Afterward, it enters a fine-grained search phase, and the algorithm converges around the 60th generation when the termination condition is met.
[0267] The optimal individual is finally output by the genetic algorithm. for: , , , , ; , , , , .
[0268] Step Six: Online matching and application based on optimized weights.
[0269] After a new event occurs, the system triggers an online reasoning process. First, the natural language processing module extracts information from the text description of the new event, obtaining structured features: event type identification, weather extraction, casualty assessment, response level judgment, trigger keyword recognition, response measure extraction, and resource requirement extraction. Then, the extracted features are encoded according to step S2, and optimal weights are applied. Following steps three and four, calculate the overall similarity with all cases in the case library, and output the top 3 cases and their similarity breakdown details in descending order.
[0270] Taking the actual event "Due to continuous heavy snow, the bridge surface at K850 on the G2 Beijing-Shanghai Expressway became icy, resulting in an 8-vehicle rear-end collision, with people trapped inside the vehicles. The temperature was -5°C and visibility was less than 50 meters" as an example, the system output:
[0271] Top 1: Case Study (Ice and Snow Disaster - Multi-vehicle Collision on Bridge), Overall Similarity 0.85. Breakdown: Category Similarity 0.92 (Event types are completely identical, triggering conditions "road icing" and "blizzard" are both hit), Measures Jaccard 0.57 (both include traffic control, de-icing and snow removal, demolition and rescue), Resources Jaccard 0.45, Institutions Jaccard 0.52, Segment Jaccard 0.68.
[0272] Top 2: Case Study (Snowstorm Disaster - Chain Collision on a Long Downhill Slope), Overall Similarity 0.73. Breakdown: Category Similarity 0.80 (Same event type, but different casualties and road sections), Measures Jaccard 0.50, Resources Jaccard 0.38, Institutions Jaccard 0.44, Section Jaccard 0.25.
[0273] Top 3: Case Studies (Fog - Multi-vehicle collision), Overall similarity 0.61. Category similarity 0.55 (different event types, fog and snow, but the casualties and severity are the same), Measures Jaccard 0.48, Resources Jaccard 0.35, Institutions Jaccard 0.40, Sections Jaccard 0.30.
[0274] The results show that the Top 1 case is highly consistent with the current event scenario, and its handling plan can serve as a core reference; the Top 2 case provides a reference plan for similar events but on different road sections; although the Top 3 case has some overlap in measures and resources, its ranking is reasonable and placed lower because the category similarity is effectively suppressed, reflecting the matching logic of "prioritizing similar scenarios".
[0275] This invention may have other embodiments. Without departing from the spirit and essence of this invention, those skilled in the art can make various corresponding changes and modifications according to this invention, but these corresponding changes and modifications should all fall within the protection scope of the appended claims.
Claims
1. A method for matching sudden event cases based on hierarchical feature encoding and weight self-optimization, characterized in that: The specific process of the method is as follows: Step 1: Construct a multi-dimensional heterogeneous historical case library, and divide the case features in the historical case library into categorical feature groups and text list feature groups; Step 2: Encode the categorical feature groups and the text list feature groups separately to generate independent matching representations; Step 3: Based on independent matching representations, calculate category similarity and text set similarity in multi-granularity spaces respectively; Step 4: Perform a weighted fusion of category similarity and text set similarity to obtain a comprehensive similarity score; Step 5: Use a genetic algorithm to jointly and adaptively optimize the fusion weights and embedded weights in the comprehensive similarity to obtain the globally optimal weight configuration; Step Six: For new emergencies, based on the globally optimal weight configuration, execute steps two through four to calculate the comprehensive similarity with all cases in the case library, and return the results in descending order. Most similar case.
2. The method for matching sudden event cases based on hierarchical feature encoding and weight self-optimization as described in claim 1, characterized in that: Step 1 involves constructing a multidimensional heterogeneous case library and defining the case features in the case library hierarchically to obtain categorical feature groups and text list feature groups. The specific process is as follows: Collect historical records of emergency response on highways to create a case database; Each case includes ten feature fields: event type, weather conditions, casualties, response level, triggering condition keywords, set of response measures, set of required resources, set of responsible agencies, set of road sections, and text description of the contingency plan; The first five fields of keywords—event type, weather conditions, casualties, response level, and triggering conditions—are divided into categorical feature groups. The event types include 16 categories, namely: high traffic volume, snow and ice disasters, severe snowstorms, severe rainstorms, severe weather, dense fog, road icing, geological disasters, landslides, slope collapses, road subsidence, bridge structural damage, tunnel fires, major traffic accidents, multi-vehicle pile-up, and hazardous chemical leaks. The weather includes 7 types: snow, heavy rain, rain, fog, sunny, low temperature, and overcast. Casualties are categorized into three types: none, possibly, and present. There are four response levels: Level response Level response Level response Level 1 response; The triggering conditions include 18 keywords, namely blizzard, road icing, fog, continuous rainfall, strong wind, earthquake, landslide, mudslide, high temperature, low temperature, insufficient visibility, water accumulation, rockfall, landslide, bridge icing, tunnel smoke, crosswind, and blowing sand. The four fields—the set of disposal measures, the set of required resources, the set of responsible agencies, and the set of road sections—are divided into text list-type feature groups. The set of response measures includes 34 types, namely traffic control, de-icing and snow removal, demolition and rescue, road closure notices, medical treatment, increased monitoring, road condition patrols, personnel evacuation, on-site reconnaissance, professional dilution, intensive firefighting, fire fighting, information reporting, drainage and flood control, slope patrol, fog lights on full operation, personnel escape and evacuation, positive pressure ventilation, on-site evidence collection, obstacle removal and road restoration, speed limit warnings, anti-skid treatment, structural flaw detection, temporary hydraulic jacking, steel support reinforcement, structural assessment, tank transfer, environmental monitoring, decontamination and verification, dynamic monitoring, rockfall removal, slope toe support reinforcement, emergency dredging, and personnel search and rescue. The required resource set includes 30 items: variable message signs, electronic displays, mobile SMS platforms, traffic cones, signs, snowplows, de-icing agents, anti-skid sand, machinery and equipment, de-icing chemicals, toxic gas detectors, empty liquid ammonia tankers, environmental emergency monitoring vehicles, positive pressure breathing apparatus, slope synthetic aperture radar, high-precision total station, tracked large excavators, heavy-duty dump trucks, drones, roadblock facilities, heavy-duty clearing trailers, ultrasonic detectors, 3D laser scanners, hydraulic synchronous lifting jacks, ambulances, medical teams, truck cranes, tunnel-specific smoke extraction fire trucks, heavy-duty foam fire trucks, and high-pressure water jet fire trucks. The responsible agencies include 15 entities: the Provincial Department of Transportation, the Expressway Traffic Police Detachment, the Road Administration Brigade, the Special Service Brigade of the Fire and Rescue Detachment, the Health Commission, the Road Clearing and Rescue Traffic Maintenance Sub-center, the Road Section Network Monitoring Center, the Maintenance Department, the Geotechnical Engineering Expert Group, the Facility Repair Team, the Service Area and Civil Affairs Department, the Provincial Emergency Command Center, the Ecological Environment Department, the Natural Resources Department, and the Highway Survey and Design Institute. The road section set includes 8 types: expressway, first-class highway, important road section, bridge, ramp, service area, low-lying road section, and slope.
3. The method for matching sudden event cases based on hierarchical feature encoding and weight self-optimization according to claim 2, characterized in that: Step two involves encoding the categorical feature groups and the text list feature groups separately to generate independent matching representations; the specific process is as follows: Step Two One One-hot encoding is performed on the four single-value category fields of event type, weather conditions, casualties, and response level in the categorical feature group according to their value space. The specific process is as follows: There are 16 event types, and an encoding mapping table is created with indexes 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, and 15. There are 7 types of weather, and an encoding mapping table is created with indices 0, 1, 2, 3, 4, 5, and 6. There are three types of injuries and fatalities; an encoding mapping table with indices 0, 1, and 2 is established. There are four response levels, and an encoding mapping table with indices 0, 1, 2, and 3 is established. For each case, the four fields of event type, weather conditions, casualties, and response level are converted into one-hot vectors according to the coding mapping table; represented as: The event type one-hot vector has a length of 16, with the index position corresponding to the value being 1 and the rest being 0; The length of the weather-specific heat vector is 7, and the index position corresponding to the value is 1, while the rest are 0. The length of the casualty hot vector is 3, and the index position corresponding to the value is 1, while the rest are 0; The response level one-hot vector has a length of 4, with the index position corresponding to the value being 1 and the rest being 0; Step Two Two By concatenating the one-hot vectors of the four fields—event type, weather conditions, casualties, and response level—in order, we obtain... Dense class vectors; specifically: By concatenating the four one-hot vectors in sequence, we obtain... Dense class vectors; Steps two and three The trigger condition keyword field is multi-hot encoded based on a pre-summarized fixed keyword list; Specifically: A glossary of 18 key environmental terms was compiled and standardized by experts in the field, including: blizzard, road icing, fog, continuous rainfall, strong wind, earthquake, landslide, mudslide, high temperature, low temperature, low visibility, water accumulation, rockfall, landslide, bridge icing, tunnel smoke, crosswind, and blowing sand. Each case study is queried across 18 dimensions corresponding to the thesaurus. If the thesaurus contains the keywords corresponding to the case study, the corresponding dimension is marked as 1; otherwise, it is marked as 0, thus forming a... Multidimensional heat vector; Step Two Four Will Dense class vectors and Multidimensional heat vector concatenation yields 3D category feature vector ; Step Two Five Construct a feature vector of category Same dimension Embedded weight vector ; The specific process is as follows: Class feature vector of Each dimension is divided into five paragraphs based on its corresponding feature field: Event type segment The adjustable weight of the event type segment is: Set the initial adjustable weight of the event type segment to [value]. ; Dimensions are 1 to 16. Weather section The adjustable weight of the weather segment is: Set the initial adjustable weight of the weather segment to [value]. ; Dimensions are 17 to 23. Casualty Section The adjustable weight of the injury / death segment is: The initial adjustable weight of the casualty segment is set to... ; Dimensions are 24 to 26. Response level range The adjustable weights of the response level segments are: Set the initial adjustable weight of the response level segment to [value]. ; Dimensions are 27 to 30. Conditional keyword segment Dimension, adjustable weights are The initial adjustable weight of the conditional keywords is set to [value]. ; Dimensions are 31 to 48. Five weights , , , , Constructing an embedded weight vector ; Step 26 Text list-type feature encoding is performed on the four fields of disposal measures set, required resources set, responsible agency set, and road section set in the text list-type feature group to obtain the disposal measures set, required resources set, responsible agency set, and road section set after text list-type feature encoding; The specific process is as follows: The set of disposal measures is not vectorized, but only retained as a mathematical set; The required resource set is not vectorized, but only retained as a mathematical set; The set of responsible agencies is not vectorized, but is retained only as a mathematical set; The set of road segments is not vectorized; it is retained only as a mathematical set. For each case, each text list field is stored as a collection of 1, 2, 3, or 4 text items, denoted as . ,in ; The aforementioned "several text items" refers to one, two, three, or four of the following: the set of disposal measures, the set of required resources, the set of responsible agencies, and the set of road sections. A collection of disposal measures; For the required resource set; For the collection of responsible agencies; This is a set of road sections.
4. The method for matching sudden event cases based on hierarchical feature encoding and weight self-optimization according to claim 3, characterized in that: Step three involves calculating category similarity and text set similarity in a multi-granularity space based on independent matching representations. The specific process is as follows: Step 31 For query events With the first case in the case library Historical Cases Calculate events With the Historical Cases The category similarity in the category feature space, where the category similarity is the first similarity; The specific process is as follows: Step 3.11: Query Event of 3D category feature vector and the first in the case library Historical Cases of 3D category feature vector Each with the embedded weight vector Perform element-wise multiplication to obtain the weighted eigenvectors; Step 3.12: Calculate the cosine similarity between the two weighted vectors; the mathematical expression is: In the formula: To query events With the first case in the case library Historical Cases First similarity in the category feature space; To query events of 3D category feature vector; For the first case in the case library Historical Cases of 3D category feature vector; for Dimensionally embedded weight vector; The symbol for element-wise multiplication of vectors; This is the vector dot product operator; The L2 norm operator for vectors; Step 3.2 Calculate query events using Jaccard coefficients With the first case in the case library Historical Cases In the text list field The text set similarity is calculated using the second similarity metric. The specific process is as follows: Calculate query events using Jaccard coefficients With the case library Historical Cases In the set of disposal measures Second similarity ; Calculate query events using Jaccard coefficients With the case library Historical Cases In the required resource set Second similarity ; Calculate query events using Jaccard coefficients With the case library Historical Cases In the group of responsible agencies Second similarity ; Calculate query events using Jaccard coefficients With the case library Historical Cases Collection in road sections Second similarity ; Calculate query events using Jaccard coefficients With the case library Historical Cases In each field Second similarity The calculation method is as follows: In the formula: ; To query events Fields extracted A collection of text items; For the first case in the case library Historical Cases Fields extracted A collection of text items; For set The potential, i.e., the set The number of elements in the middle; For set The potential, i.e., the set The number of elements in the middle; The intersection operator; This is the union operator.
5. The method for matching sudden event cases based on hierarchical feature encoding and weight self-optimization according to claim 4, characterized in that: Step four involves weighted fusion of category similarity and text set similarity to obtain a comprehensive similarity score. The specific process is as follows: Step 41: Set the weights of the categorical feature groups as follows. The weights of the set of treatment measures are set as follows: Set the weight of the required resource set as follows: The weight of the set of responsible agencies is set as follows: The weights of the road segment set are set as follows: ; Weight , , , , The following normalization constraints must be satisfied: Step 42: Based on weights , , , , For the first similarity Second similarity , , , Perform weighted fusion to obtain the query events. With the case library Historical Cases Overall similarity ; The calculation formula is: 。 6. The method for matching sudden event cases based on hierarchical feature encoding and weight self-optimization according to claim 5, characterized in that: Step five involves using a genetic algorithm to perform joint adaptive optimization of the weights to obtain the globally optimal weight configuration. Weights include the weights of categorical feature groups. Weight of the set of disposal measures Weight of the required resource set Weight of the set of responsible agencies The weight of the road segment set is Adjustable weights for event type segments Adjustable weights for weather segments Adjustable weights for injury / death segments Adjustable weights for response level segments and conditional keyword segments ; The specific process is as follows: Step 51: Let the number of iterations be... ; Step 52: Chromosome Encoding and Decoding; Step 53: Generate the initial population; Step 54: Construct the fitness function; Step 55: Determine if the termination condition is met; When the termination condition is met, the genetic algorithm stops iterating and outputs the individual with the highest fitness in the population during the last iteration. As the globally optimal weight configuration: When the termination condition is not met, let the number of iterations... Continue with steps five and six until the termination condition is met; The termination condition is either condition 1 or condition 2; Condition 1 is continuous The increase in the optimal fitness value is less than a preset threshold. This indicates that the search has converged sufficiently. Condition 2 is to reach the preset maximum algebra. Force termination of the iteration; The individual with the highest fitness for: ; Step 56: Generate a new generation of population through selection, crossover, and mutation, and add the elite retention process to the new generation of population in step 54.
7. The method for matching sudden event cases based on hierarchical feature encoding and weight self-optimization according to claim 6, characterized in that: Step 5.2, Chromosome Encoding and Decoding; The specific process is as follows: When encoding chromosomes, the fusion weights to be optimized , , , , and embedded weights , , , , Individuals composed of real chromosomes in sequence , is represented as: In the formula: This represents a chromosome individual in the genetic algorithm, containing a total of 10 gene loci; Decoding chromosomes requires imposing constraints to ensure the validity of parameters. The process is as follows: For individuals with real chromosomes The first 5 fusion weights are subject to nonnegativity and normalization constraints. , ; For individuals with real chromosomes The last 5 embedded weights Apply interval constraints, meaning each weight is located at a preset lower bound. and the Upper Realm between.
8. The method for matching sudden event cases based on hierarchical feature encoding and weight self-optimization according to claim 7, characterized in that: Step five, section three, involves generating the initial population; the process is as follows: Preset population size ; For each individual with a chromosome in the population, first in Within the interval, the first 5 gene loci are uniformly randomly sampled, and then L1 norm normalization is performed on the randomly sampled first 5 gene loci to ensure that the sum of the five is 1; for the last 5 gene loci... Uniform random sampling is performed within the interval; Repeat the above process Next, generated by The initial population consisted of individuals with 10 chromosomes.
9. The method for matching sudden event cases based on hierarchical feature encoding and weight self-optimization according to claim 8, characterized in that: Step five, fourth, involves constructing the fitness function; the specific process is as follows: Step 541: Extract a portion of cases from the historical case library in Step 1 to construct a validation set. The validation set contains Each event has been pre-labeled with an ideal matching case by domain experts; Step 542: For each event in the validation set , Use the current weight configuration Perform steps two, three, and four to calculate each event in the validation set. The overall similarity with the remaining historical cases in the case library after removing the validation set is calculated and sorted in descending order of similarity. Step 543: In the ranking results, rank the historical cases corresponding to the highest similarity values. The ranking of historical cases corresponding to the second highest similarity value And so on; Step 544, based on Ranking of events Calculate the fitness function; expressed as: In the formula: The fitness value is the weight combination Θ. To verify the total number of events in the set; For the first The ranking position of correct cases in the similarity ranking under each verification event.
10. The method for matching sudden event cases based on hierarchical feature encoding and weight self-optimization according to claim 9, characterized in that: Steps five and six involve generating a new generation of population through selection, crossover, and mutation, and then performing elite retention on the generated new generation population, which is then added to step five and four. The process is as follows: Step 561: Generate a new generation of population through selection, crossover, and mutation; the specific process is as follows: Selection operation: A tournament selection strategy is adopted; The tournament selection strategy is to randomly select from the current population each time. Individuals, comparison For each individual, select the individual with the highest fitness value as the parent; repeat this process until a parent is selected. One parent generation individual; Crossover operation: Perform simulated binary crossover on two paired parent individuals to obtain offspring genotypes; the specific process is as follows: For two parent individuals and In each gene locus Above, with the set crossover probability Decide whether to perform crossover; If crossover is not performed, the offspring genotype values directly inherit the corresponding genotype values from the parent, that is: In the formula: , For offspring 1 and offspring 2 respectively in the 1st and 2nd generations Values at each gene locus; , Parent individuals and parental individuals In the Values at each gene locus; If crossover is performed, the offspring genotype values are generated by the following formula: In the formula: , For offspring 1 and offspring 2 respectively in the 1st and 2nd generations Values at each gene locus; , Parent individuals and parental individuals In the Values at each gene locus; Let [the number of] propagation factors be uniformly random numbers in the range [0,1). After transformation, the transformation formula is: in, These are the distribution parameters; Mutation operation: For each progeny locus value obtained from the crossover operation, a set mutation probability is applied. Independently decide whether to implement mutations; If no mutation is performed, the offspring genotype values obtained by the crossover operation remain unchanged; If mutation is performed, a Gaussian distribution is superimposed on the progeny loci values obtained from the crossover operation. Random perturbations; in, The standard deviation parameter; Step 562 The new generation population generated in step 561 through selection, crossover, and mutation is repaired to obtain the repaired new generation population. The specific process is as follows: Each real chromosome individual in the new generation population generated in step 561 through selection, crossover, and mutation. Divide each of the first 5 fusion weights by the sum of the first 5 fusion weights, so that the sum of the first 5 fusion weights after normalization equals 1; like If a normalized value of one of the first 5 fusion weights is negative, the corresponding fusion weight will be reset to zero and then normalized again. If the sum of the first 5 normalized fusion weights is zero, then reset to a uniform distribution; For each real chromosome individual in the new generation population generated through selection, crossover, and mutation in step 561. If any of the last 5 embedded weights exceeds a preset boundary... If the reflection still exceeds the preset boundary, then the boundary value is taken. The boundary reflection repair strategy process is as follows: If one of the last 5 embedded weights is greater than Then set the embedded weight value to Subtract the excess amount; If the value of any of the last 5 embedded weights is less than Then set the embedded weight value to Add the insufficient amount; Steps 5 and 63 The most fit among the current population Each individual copy directly into step five four, without participating in crossover or mutation operations.
